]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
#2696 BBTK Bug New Normal - BoxChange BoxExecute not responding at the second actio...
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index c74b2e9e1cf4a53a87ab398660813ffadc5d580a..6fb1fb83a9c749dfce3cc545269c3f0773ad71bf 100644 (file)
@@ -1,32 +1,39 @@
-/*=========================================================================                                                                               
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/06/08 14:50:02 $
-  Version:   $Revision: 1.48 $
+  Date:      $Date: 2012/11/16 08:49:01 $
+  Version:   $Revision: 1.56 $
 =========================================================================*/
 
-/* ---------------------------------------------------------------------
-
-* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
-* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
-*
-*  This software is governed by the CeCILL-B license under French law and 
-*  abiding by the rules of distribution of free software. You can  use, 
-*  modify and/ or redistribute the software under the terms of the CeCILL-B 
-*  license as circulated by CEA, CNRS and INRIA at the following URL 
-*  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
-*  or in the file LICENSE.txt.
-*
-*  As a counterpart to the access to the source code and  rights to copy,
-*  modify and redistribute granted by the license, users are provided only
-*  with a limited warranty  and the software's author,  the holder of the
-*  economic rights,  and the successive licensors  have only  limited
-*  liability. 
-*
-*  The fact that you are presently reading this means that you have had
-*  knowledge of the CeCILL-B license and that you accept its terms.
-* ------------------------------------------------------------------------ */                                                                         
+
 
 /**
  *  \file 
@@ -48,8 +55,6 @@
 
 namespace bbtk
 {
-
-
   static bool bbmgSomeBoxExecuting = false;
   static bool bbmgFreezeExecution = false;
   static std::set<BlackBox::WeakPointer> bbmgExecutionList;
@@ -111,9 +116,14 @@ namespace bbtk
     bbmExecuting(false),
     bbmName(name),
     bbmBoxProcessMode("Pipeline"),
+       bbLetRecursiveExecuteManualMode(false),
     bbmParent()
     
   {
+         //JCP 02-11-09
+        // bbmBoxProcessMode = "Pipeline";     
+//std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+//               <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
     bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox(\""
                     <<name<<"\")"<<std::endl);
     bbtkBlackBoxDebugMessage("object",4,"<== BlackBox::BlackBox(\""
@@ -133,9 +143,14 @@ namespace bbtk
     bbmExecuting(false),
     bbmName(name), 
     bbmBoxProcessMode(from.bbmBoxProcessMode),
+       bbLetRecursiveExecuteManualMode(false),
     bbmParent()
     
   {
+         //JCP 02-11-09
+         //bbmBoxProcessMode = from.bbmBoxProcessMode;
+         //std::cout<<"JCP BlackBox::BlackBox(const std::string &name) name=" <<name
+               //  <<"bbmBoxProcessMode="<<bbmBoxProcessMode<<std::endl;
     bbtkBlackBoxDebugMessage("object",4,"==> BlackBox::BlackBox("
                     <<from.bbGetFullName()<<",\""
                     <<name<<"\")"<<std::endl);
@@ -273,7 +288,6 @@ namespace bbtk
        bbGetOutputConnectorMap()[o->second->GetName()] 
          = new BlackBoxOutputConnector(GetThisPointer<BlackBox>());
       }
-
   }
   //=========================================================================
 
@@ -300,8 +314,7 @@ namespace bbtk
        delete (o->second);
       }                                                                        
    
-    bbtkDebugDecTab("kernel",8);  
-
+    bbtkDebugDecTab("kernel",8);
   }
   //=========================================================================
 
@@ -337,7 +350,6 @@ namespace bbtk
       }
 
     bbtkDebugDecTab("kernel",9);
-
   }
   //=========================================================================
 
@@ -350,7 +362,7 @@ namespace bbtk
 #ifdef USE_WXWIDGETS
             || Wx::IsSomeWindowAlive() 
 #endif
-            ); 
+            );
   }
   //=========================================================================
 
@@ -362,44 +374,57 @@ namespace bbtk
     const std::string& p = bbmBoxProcessMode;
     if ( (p == "0") ||
         (p == "P") || (p == "p") ||
-        (p == "Pipeline") || (p == "pipeline") ) return Pipeline;
+        (p == "Pipeline") || (p == "pipeline") ) return bbPipeline;
     if ( (p == "1") ||
         (p == "A") || (p == "a") ||
-        (p == "Always") || (p == "always") ) return Always;
+        (p == "Always") || (p == "always") ) return bbAlways;
     if ( (p == "2") ||
         (p == "R") || (p == "r") ||
-        (p == "Reactive") || (p == "reactive") ) return Reactive;
+        (p == "Reactive") || (p == "reactive") ) 
+               return bbReactive;
     /*
     if ( (p == "3") ||
         (p == "F") || (p == "f") ||
         (p == "Flash") || (p == "flash") ) return Flash;
     */
-    bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p
+
+         if ( (p == "3") ||
+          (p == "M") || (p == "m") ||
+          (p == "Manual") || (p == "manual") ) return bbManual;
+         
+         bbtkError(bbGetFullName()<<" : BoxProcessMode value '"<<p
              <<"' unknown. Possible values : "
              <<"'0'/'P'/'p'/'Pipeline'/'pipeline' | "
              <<"'1'/'A'/'a'/'Always'/'always' | "
              <<"'2'/'R'/'r'/'Reactive'/'reactive'"
              //      <<"'3'/'F'/'f'/'Flash'/'flash'"
-             <<std::endl);
+             <<"'3'/'M'/'m'/'Manual'/'manual'"
+                 <<std::endl);
   }
   //=========================================================================
   
   //=========================================================================
   bool  BlackBox::bbBoxProcessModeIsReactive() const
   {
-    return (bbGetBoxProcessModeValue() == Reactive);
+    return (bbGetBoxProcessModeValue() == bbReactive);
   }
   //=========================================================================
 
   //=========================================================================
   bool  BlackBox::bbBoxProcessModeIsAlways() const
   {
-    return (bbGetBoxProcessModeValue() == Always);
+    return (bbGetBoxProcessModeValue() == bbAlways);
   }
   //=========================================================================
 
 
-
+       //=========================================================================
+       bool  BlackBox::bbBoxProcessModeIsManual() const
+       {
+               return (bbGetBoxProcessModeValue() == bbManual);
+       }
+       //=========================================================================
+       
 
   //=========================================================================
   void BlackBox::bbAddOutputObserver(const std::string& output, 
@@ -438,25 +463,40 @@ namespace bbtk
       }
     */
 
+
     OutputConnectorMapType::const_iterator o;  
     for ( o = bbGetOutputConnectorMap().begin(); 
          o != bbGetOutputConnectorMap().end(); ++o )                   
-      {                                                                        
-       if (o->second->GetStatus()==UPTODATE) 
+      {
+
+
+       if (o->first=="BoxChange")
+       {
+               o->second->SetStatus(UPTODATE);
+       }
+
+
+
+//EED 24/08/2015
+// EED CASPITAS 2
+       if (o->second->GetStatus()==UPTODATE)
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==OUTOFDATE))
+//     if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==MODIFIED))
          {
            o->second->SetStatus(OUTOFDATE);
            o->second->SignalChange(GetThisPointer<BlackBox>(),o->first); 
-         }
-      }                                                                        
+         } // if
+       } // for                                                        
     
-    if ( ( bbBoxProcessModeIsReactive()  ||
-          (c==bbGetInputConnectorMap().find("BoxExecute")->second))
-        && (bbCanReact() ) )
+
+    if (  ( bbBoxProcessModeIsReactive()
+          || (c==bbGetInputConnectorMap().find("BoxExecute")->second))
+          && (bbCanReact() ) )
       {
        bbtkBlackBoxDebugMessage("change",2,
                         "-> Execution triggered by Reactive mode or BoxExecute input change"<<std::endl);
         bbGlobalAddToExecutionList( GetThisPointer<BlackBox>() );
-      }    
+      } // if
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSetStatusAndPropagate(input)"
                             <<std::endl);
@@ -471,7 +511,7 @@ namespace bbtk
                             "=> BlackBox::bbSignalOutputModification("
                             <<reaction<<")"
                             <<"]"<<std::endl);
-    
+
     OutputConnectorMapType::iterator i;
     for ( i  = bbGetOutputConnectorMap().begin(); 
          i != bbGetOutputConnectorMap().end(); ++i) 
@@ -485,16 +525,17 @@ namespace bbtk
        //        {
            i->second->SignalChange(GetThisPointer<BlackBox>(),i->first); 
            //    }
-      } 
+      } // for
 
     if (reaction) bbGlobalProcessExecutionList();
 
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification()"
                             <<std::endl);
-    
   }  
   //=========================================================================   
+
+
   //=========================================================================  
   void BlackBox::bbSignalOutputModification(const std::string& output,
                                            bool reaction)
@@ -532,7 +573,6 @@ namespace bbtk
                             "<= BlackBox::bbSignalOutputModification("
                             <<output<<")"
                             <<std::endl);
-    
   }  
   //=========================================================================   
   //=========================================================================  
@@ -576,7 +616,6 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("change",5,
                             "<= BlackBox::bbSignalOutputModification(vector of outputs)"
                             <<std::endl);
-
   }  
   //=========================================================================   
 
@@ -616,9 +655,22 @@ namespace bbtk
     // If force is true then update is triggered even if the box is UPTODATE
     //    if (force) bbSetModifiedStatus();
 
+       if ( bbBoxProcessModeIsManual() ) 
+       {
+               bbLetRecursiveExecuteManualMode = true;
+    }
+         
+         
     // Calls the main recursive execution method 
     bbRecursiveExecute(Connection::Pointer());
 
+         
+       if ( bbBoxProcessModeIsManual() ) 
+       {
+               bbLetRecursiveExecuteManualMode = false;
+       }
+         
+         
     bbtkBlackBoxDebugMessage("process",2,
                             "<= BlackBox::bbExecute()"
                             <<std::endl);
@@ -655,6 +707,7 @@ namespace bbtk
   //=========================================================================
   void BlackBox::bbRecursiveExecute( Connection::Pointer caller )
   {
+
     bbtkBlackBoxDebugMessage("process",3,
                        "=> BlackBox::bbRecursiveExecute("
                        <<(caller?caller->GetFullName():"0")<<")"
@@ -679,20 +732,40 @@ namespace bbtk
     this->bbCreateWindow();
     
     // Updates its inputs
-    IOStatus s = bbUpdateInputs();
-    
-    if ( (s != UPTODATE) ||
-        bbBoxProcessModeIsAlways() )
+         
+//       IOStatus s;
+         IOStatus s=UPTODATE;
+//       IOStatus s=OUTOFDATE;
+//       IOStatus s=MODIFIED;
+                 
+
+         if ( ( bbBoxProcessModeIsManual()==false )  || 
+                  ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
+         {
+                 s = bbUpdateInputs();
+         }       
+                 
+    if ( (s != UPTODATE) ||  bbBoxProcessModeIsAlways() )
       {
          // Displays the window (WxBlackbox)
          //    bbShowWindow(caller);
 
          // Actual processing (virtual)
-         this->bbProcess();
-       
-       
-         // Update the I/O statuses
-         bbComputePostProcessStatus();
+                 if ( ( bbBoxProcessModeIsManual()==false )  || 
+                          ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
+                        )
+                       {
+                               this->bbProcess();              
+                   } // Manual analysis
+                 
+//EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
+//EED ups                      {
+//EED ups                        bbSignalOutputModification(true);
+//EED ups                      }
+                 
+                 
+                 // Update the I/O statuses
+                 bbComputePostProcessStatus();
       }
     else 
       {
@@ -724,8 +797,8 @@ namespace bbtk
     bbSetExecuting(false);
     bbGlobalSetSomeBoxExecuting(wasExecuting);
 
-    return; 
 
+    return;
   }
   //=========================================================================
   
@@ -768,9 +841,7 @@ namespace bbtk
     
     bbtkBlackBoxDebugMessage("process",4,
                        "<= BlackBox::bbUpdateInputs()"
-                       <<std::endl);   
-    
-    
+                       <<std::endl);
     return s;
   }
   //=========================================================================
@@ -809,13 +880,24 @@ namespace bbtk
     for ( o = bbGetOutputConnectorMap().begin(); 
          o!= bbGetOutputConnectorMap().end(); ++o) 
       {
-       o->second->SetStatus(new_output_status);
+               
+//EED            if  ( ( bbBoxProcessModeIsManual()==false )  || 
+//EED                      ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) 
+//EED                    )
+//EED            {
+                         o->second->SetStatus(new_output_status);
+//EED            }  else  {
+//EED                    if  (( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false) )  ) 
+//EED                    {
+//EED                            o->second->SetStatus(UPTODATE);
+//EED                    }
+//EED            } // Manual analysis
+                         
       }
 
     bbtkBlackBoxDebugMessage("process",4,
                        "<= BlackBox::bbComputePostProcessStatus()"
-                       <<std::endl);   
-
+                       <<std::endl);
   }
   //==================================================================
 
@@ -827,7 +909,6 @@ namespace bbtk
                        <<name<<"\","<<c->GetFullName()<<")"
                        <<std::endl);       
 
-
     InputConnectorMapType::iterator i = bbGetInputConnectorMap().find(name);
     if (i==bbGetInputConnectorMap().end())
       {
@@ -836,12 +917,11 @@ namespace bbtk
     i->second->SetConnection(c);
     // The input *MUST* be set OUTOFDATE to update its input on next execution
     bbSetStatusAndPropagate(i->second,OUTOFDATE);
-    
+
     bbtkBlackBoxDebugMessage("connection",2,
                        "<== BlackBox::bbConnectInput(\""
                        <<name<<"\","<<c->GetFullName()<<")"
-                       <<std::endl);       
-
+                       <<std::endl);
   }
   //=========================================================================
 
@@ -853,7 +933,7 @@ namespace bbtk
                             "==> BlackBox::bbConnectOutput(\""<<name<<"\","
                             <<c->GetFullName()<<")"
                             <<std::endl);       
-    
+
     OutputConnectorMapType::iterator i = bbGetOutputConnectorMap().find(name);
     if (i==bbGetOutputConnectorMap().end())
       {
@@ -864,8 +944,7 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("connection",2,
                             "<== BlackBox::bbConnectOutput(\""<<name<<"\","
                             <<c->GetFullName()<<")"
-                            <<std::endl);       
-
+                            <<std::endl);
   }
   //=========================================================================
 
@@ -877,8 +956,7 @@ namespace bbtk
     bbtkBlackBoxDebugMessage("connection",2,
                     "==> BlackBox::bbDisconnectInput(\""<<name
                     <<"\","<<c->GetFullName()<<")"
-                    <<std::endl);      
-
+                    <<std::endl);
     if (!c) 
       {
 
@@ -1155,8 +1233,8 @@ namespace bbtk
           const BlackBoxOutputDescriptor* id = bbGetDescriptor()->GetOutputDescriptor(ii->first); 
           tempStrTypeName=id->GetTypeName();
           SubsBrackets(tempStrTypeName);
-           std::string Name(ii->first);
-           SubsBrackets(Name);
+          std::string Name(ii->first);
+          SubsBrackets(Name);
           labelStr=labelStr+"<"+ii->first.c_str()+"> " + valueStr + Name.c_str() + "  ["+tempStrTypeName+"]";
        }
        labelStr = labelStr+ "      } }" ;
@@ -1216,23 +1294,23 @@ namespace bbtk
      
     if (this->bbGetDescriptor()->GetPackage()) 
       {
-       bbtkBlackBoxMessage("help",1,"Black Box '"<<bbGetName()<<"' <"<<
+            bbtkBlackBoxMessage("help",1,"Black Box '"<<bbGetName()<<"' <"<<
                    this->bbGetDescriptor()->GetPackage()->GetName()
                    <<"::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
       }
     else 
       {
-       bbtkBlackBoxMessage("help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
+            bbtkBlackBoxMessage("help",1,"Black Box <::"<<this->bbGetDescriptor()->GetTypeName()<<">"<<std::endl);
       }
     /*
     if (bbIsUpToDate())
       {
-       bbtkBlackBoxMessage("help",1,"Up-to-date ["<<mMaxInputChangeTime<<","
+            bbtkBlackBoxMessage("help",1,"Up-to-date ["<<mMaxInputChangeTime<<","
                    <<mMinOutputChangeTime<<"]"<<std::endl);
       }
     else 
       {
-       bbtkBlackBoxMessage("help",1,"Out-of-date ["<<mMaxInputChangeTime<<","
+            bbtkBlackBoxMessage("help",1,"Out-of-date ["<<mMaxInputChangeTime<<","
                    <<mMinOutputChangeTime<<"]"<<std::endl);
       }
     */
@@ -1249,47 +1327,49 @@ namespace bbtk
     unsigned int valuelmax = 0;
     //   unsigned int connlmax = 0;
     for ( i = mInputConnectorMap.begin(); i != mInputConnectorMap.end(); ++i ) 
-      {
-       iname.push_back(i->first);
-       if (iname.back().size()>namelmax) namelmax = iname.back().size();
-       ivalue.push_back(bbGetInputAsString(i->first));
-       if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size();
-       std::string s("");
-       Connection* con = i->second->GetConnection();
-       if (con!=0){
-         s = con->GetOriginalBlackBoxFrom()->bbGetName();
-         s += ".";
-         s += con->GetOriginalBlackBoxFromOutput();
-       }  // if con
-       iconn.push_back(s);
-       istatus.push_back(GetIOStatusString(i->second->GetStatus()));
-      }
+    {
+          iname.push_back(i->first);
+          if (iname.back().size()>namelmax) namelmax = iname.back().size();
+          ivalue.push_back(bbGetInputAsString(i->first));
+          if (ivalue.back().size()>valuelmax) valuelmax = ivalue.back().size();
+          std::string s("");
+          Connection* con = i->second->GetConnection();
+          if (con!=0){
+             s = con->GetOriginalBlackBoxFrom()->bbGetName();
+             s += ".";
+             s += con->GetOriginalBlackBoxFromOutput();
+          }  // if con
+          iconn.push_back(s);
+          istatus.push_back(GetIOStatusString(i->second->GetStatus()));
+    }
     OutputConnectorMapType::iterator o;
     std::vector<std::string> oname;
     std::vector<std::string> ovalue;
     std::vector<std::vector<std::string> > oconn;
     std::vector<std::string> ostatus;
     for ( o = mOutputConnectorMap.begin(); o != mOutputConnectorMap.end(); ++o ) 
-      {
-       oname.push_back(o->first);
-       if (oname.back().size()>namelmax) namelmax = oname.back().size();
-       ovalue.push_back(bbGetOutputAsString(o->first));
-       if (ovalue.back().size()>valuelmax) valuelmax = ovalue.back().size();
-       std::vector<std::string> ss;
-       const std::vector<Connection*>& con 
-         = o->second->GetConnectionVector();
-       std::vector<Connection*>::const_iterator c;
-       for (c=con.begin();c!=con.end();++c) 
-         {
-           std::string s;
-           s = (*c)->GetOriginalBlackBoxTo()->bbGetName();
-           s += ".";
-           s += (*c)->GetOriginalBlackBoxToInput();
-           ss.push_back(s);
-       }  // if con
-       oconn.push_back(ss);
-       ostatus.push_back(GetIOStatusString(o->second->GetStatus()));
-      }
+    {
+          oname.push_back(o->first);
+          if (oname.back().size()>namelmax)
+          namelmax = oname.back().size();
+          ovalue.push_back(bbGetOutputAsString(o->first));
+          if (ovalue.back().size()>valuelmax) 
+          valuelmax = ovalue.back().size();
+          std::vector<std::string> ss;
+          const std::vector<Connection*>& con 
+                                   = o->second->GetConnectionVector();
+          std::vector<Connection*>::const_iterator c;
+          for (c=con.begin();c!=con.end();++c) 
+          {
+              std::string s;
+              s = (*c)->GetOriginalBlackBoxTo()->bbGetName();
+              s += ".";
+              s += (*c)->GetOriginalBlackBoxToInput();
+              ss.push_back(s);
+           }  // if con
+           oconn.push_back(ss);
+           ostatus.push_back(GetIOStatusString(o->second->GetStatus()));
+    }
 
     if (iname.size()) 
       bbtkBlackBoxMessage("help",1," * Inputs : "<<std::endl);
@@ -1298,53 +1378,52 @@ namespace bbtk
 
     std::vector<std::string>::iterator i1,i2,i3,i4;
     for (i1=iname.begin(),i2=ivalue.begin(),i3=iconn.begin(),i4=istatus.begin();
-        i1!=iname.end(),i2!=ivalue.end(),i3!=iconn.end(),i4!=istatus.end();
-        ++i1,++i2,++i3,++i4)
-      {
-       std::string name(*i1);
-       name += "'";
-       name.append(1+namelmax-name.size(),' ');
-       std::string value(*i2);
-       value += "'";
-       value.append(1+valuelmax-value.size(),' ');
-       if (i3->size()) 
-         bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value<<" <-- '"
-                     <<*i3<<"'");
-       else 
-         bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value);
-       bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
-      }
+            i1!=iname.end(),i2!=ivalue.end(),i3!=iconn.end(),i4!=istatus.end();
+          ++i1,++i2,++i3,++i4)
+     {
+           std::string name(*i1);
+           name += "'";
+           name.append(1+namelmax-name.size(),' ');
+           std::string value(*i2);
+           value += "'";
+           value.append(1+valuelmax-value.size(),' ');
+           if (i3->size()) 
+             bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value<<" <-- '" <<*i3<<"'");
+           else 
+             bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value);
+           bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
+     }
 
     if (oname.size()) 
-      bbtkBlackBoxMessage("help",1," * Outputs : "<<std::endl);
+       bbtkBlackBoxMessage("help",1," * Outputs : "<<std::endl);
     else 
-      bbtkBlackBoxMessage("help",1," * No outputs"<<std::endl);
+       bbtkBlackBoxMessage("help",1," * No outputs"<<std::endl);
 
     std::vector<std::vector<std::string> >::iterator i5;
 
     for (i1=oname.begin(),i2=ovalue.begin(),i5=oconn.begin(),i4=ostatus.begin();
-        i1!=oname.end(),i2!=ovalue.end(),i5!=oconn.end(),i4!=ostatus.end();
-        ++i1,++i2,++i4,++i5)
-      {
-       std::string name(*i1);
-       name += "'";
-       name.append(1+namelmax-name.size(),' ');
-       std::string value(*i2);
-       value += "'";
-       value.append(1+valuelmax-value.size(),' ');
-       if (!(*i5).size())
-         bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value);
-       else 
-         {
-           std::string pref = "    '"+name+" = '"+value;
-           for (i3=i5->begin();i3!=i5->end();++i3)
-             {
-               bbtkBlackBoxMessage("help",1,pref<<" --> '"<<*i3<<"'");
-               pref.replace(0,pref.size(),pref.size(),' ');
-             }
-         }
-       bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
-      }
+            i1!=oname.end(),i2!=ovalue.end(),i5!=oconn.end(),i4!=ostatus.end();
+          ++i1,++i2,++i4,++i5)
+    {
+           std::string name(*i1);
+           name += "'";
+           name.append(1+namelmax-name.size(),' ');
+           std::string value(*i2);
+           value += "'";
+           value.append(1+valuelmax-value.size(),' ');
+           if (!(*i5).size())
+             bbtkBlackBoxMessage("help",1,"    '"<<name<<" = '"<<value);
+           else 
+           {
+              std::string pref = "    '"+name+" = '"+value;
+              for (i3=i5->begin();i3!=i5->end();++i3)
+              {
+                     bbtkBlackBoxMessage("help",1,pref<<" --> '"<<*i3<<"'");
+                     pref.replace(0,pref.size(),pref.size(),' ');
+              }
+           }
+           bbtkBlackBoxMessage("help",1," ["<<*i4<<"]"<<std::endl);
+    }
 
    }
   //=========================================================================
@@ -1406,6 +1485,7 @@ namespace bbtk
                         <<std::endl);     
      
      bbmgGlobalProcessingExecutionList = false;
+
      
    }
   //=========================================================================