]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
#3403 vtk8itk5wx3-macos
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index e2dae01bcc2cd42401bc53469cb8106bf3c17005..b9f376a45c2a28abd031c0845480c69612860a24 100644 (file)
@@ -55,8 +55,8 @@
 
 namespace bbtk
 {
-  static bool bbmgSomeBoxExecuting = false;
-  static bool bbmgFreezeExecution = false;
+  static bool bbmgSomeBoxExecuting     = false;
+  static bool bbmgFreezeExecution      = false;
   static std::set<BlackBox::WeakPointer> bbmgExecutionList;
 
   //=========================================================================
@@ -93,14 +93,10 @@ namespace bbtk
        if (!pack.expired()) 
          {
            Package::ReleaseBlackBoxDescriptor(pack,desc);
-         }
-       else 
-         {
+         }     else {
            bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : descriptor package expired (was not held by a package and the box was the last instance)"<<std::endl);
          }
-      }
-    else
-      {
+      } else {
        bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""<<name<<"\") : descriptor expired : nothing to do (was not held by a package or the box is a complex black box prototype)"<<std::endl);
       }
     bbtkDebugMessage("object",2,"<## BlackBox::Deleter(\""<<name<<"\")"<<std::endl);
@@ -187,13 +183,11 @@ namespace bbtk
   std::string BlackBox::bbGetNameWithParent() const
   {
     if (bbmParent.lock()) 
-      {
-       return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
-      }
-    else 
-      {
-       return bbmName;
-      }
+       {
+               return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
+       } else {
+               return bbmName;
+    }
   } 
   //=========================================================================
 
@@ -463,17 +457,32 @@ 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() ) )
@@ -481,7 +490,7 @@ namespace bbtk
        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);
@@ -698,12 +707,12 @@ namespace bbtk
                        <<std::endl);
 
     // If already executing : return
-    if (bbGetExecuting()) 
-      {
-       bbtkBlackBoxDebugMessage("process",3,
+       if (bbGetExecuting()) 
+       {
+               bbtkBlackBoxDebugMessage("process",3,
                         " -> already executing : abort"<<std::endl);
-       return; 
-      }
+               return; 
+       }
     
     // If not initialized do it
     bbInitializeProcessing();
@@ -721,8 +730,8 @@ namespace bbtk
          IOStatus s=UPTODATE;
 //       IOStatus s=OUTOFDATE;
 //       IOStatus s=MODIFIED;
-         
-         
+                 
+
          if ( ( bbBoxProcessModeIsManual()==false )  || 
                   ( (bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==true) ) )
          {
@@ -739,7 +748,9 @@ namespace bbtk
                           ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
                         )
                        {
+//  printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
                                this->bbProcess();              
+//  printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
                    } // Manual analysis
                  
 //EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
@@ -750,9 +761,7 @@ namespace bbtk
                  
                  // Update the I/O statuses
                  bbComputePostProcessStatus();
-      }
-    else 
-      {
+      }  else  {
        // Test output status...
        OutputConnectorMapType::iterator o;
        for ( o = bbGetOutputConnectorMap().begin(); 
@@ -764,11 +773,11 @@ namespace bbtk
                            <<"all inputs are Up-to-date but output '"
                            <<o->first<<"' is Out-of-date ???");
              }
-         }
+         } // for
        
         bbtkBlackBoxDebugMessage("process",3," -> Up-to-date : nothing to do"
                         <<std::endl);
-      }
+      } // if
 
     // Shows the window if the black box has one
     this->bbShowWindow(); 
@@ -1468,6 +1477,7 @@ namespace bbtk
                         <<std::endl);     
      
      bbmgGlobalProcessingExecutionList = false;
+
      
    }
   //=========================================================================