]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkAtomicBlackBox.cxx
New widget pipeline : progressing ...
[bbtk.git] / kernel / src / bbtkAtomicBlackBox.cxx
index a947d006315da4263a2f615af8fa5691327f93c8..3ee7d62b05d0e98e685e87f7683b04fcbc9c382a 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkAtomicBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/10/17 08:18:12 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2008/11/25 11:17:13 $
+  Version:   $Revision: 1.10 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -92,7 +92,18 @@ namespace bbtk
                        "=> AtomicBlackBox::bbBackwardUpdate("
                        <<(caller?caller->GetFullName():"0")<<") ["
                        <<bbGetFullName()<<"]"<<std::endl);
-    
+
+    // If already executing : return
+    if (bbGetExecuting()) 
+      {
+       bbtkDebugMessage("process",3,
+                        " -> already executing : bailing out"<<std::endl);
+       return bbGetStatus();
+      }
+    bbSetExecuting(true);
+    bool wasExecuting = bbGlobalGetSomeBoxExecuting();
+    bbGlobalSetSomeBoxExecuting(true);
+
     bbtkDebugMessage("process",5,"Initial Status  = "<<bbGetStatus()
                     <<std::endl);
     bbtkDebugMessage("process",5,"BoxProcessMode  = "
@@ -103,15 +114,14 @@ namespace bbtk
         ( bbBoxProcessModeIsAlways() ) )
       {
 
-       bbSetStatus(UPDATING);
-       
-       bool wasExecuting = bbGlobalGetSomeBoxExecuting();
-        bbGlobalSetSomeBoxExecuting(true);
+       //      bbSetStatus(UPDATING);
 
         // Updates its inputs
         IOStatus s = bbUpdateInputs();
     
-        bbtkDebugMessage("process",6,"Inputs post-update status = "<<s<<std::endl);
+        bbtkDebugMessage("process",6,"=> AtomicBlackBox::bbBackwardUpdate("
+                       <<(caller?caller->GetFullName():"0")<<") ["
+                       <<bbGetFullName()<<"] : Inputs post-update status = "<<s<<std::endl);
         // If all inputs are in UPTODATE post-update status 
         // and mProcessMode is not "Always"
         // then the box is now UPTODATE
@@ -134,7 +144,6 @@ namespace bbtk
         // Displays the window (WxBlackbox)
         bbShowWindow(caller);
 
-        bbGlobalSetSomeBoxExecuting(wasExecuting);
 
       }
     else 
@@ -142,12 +151,16 @@ namespace bbtk
         bbtkDebugMessage("process",5,"Up-to-date : nothing to do"<<std::endl);
       }
 
-    bbtkDebugMessage("process",5,"Final Status    = "
-            <<bbGetStatus()<<std::endl);
+    bbtkDebugMessage("process",5,"=> AtomicBlackBox::bbBackwardUpdate("
+                    <<(caller?caller->GetFullName():"0")<<") ["
+                    <<bbGetFullName()<<"] : Final Status    = "
+                    <<bbGetStatus()<<std::endl);
     bbtkDebugMessage("process",3,
             "<= AtomicBlackBox::bbBackwardUpdate() ["
             <<bbGetFullName()<<"]"<<std::endl);
 
+    bbSetExecuting(false);
+    bbGlobalSetSomeBoxExecuting(wasExecuting);
 
     return bbGetStatus();
 
@@ -214,7 +227,7 @@ namespace bbtk
                 Data data, 
                 bool setModified )
   {
-    bbtkDebugMessageInc("Data",7,
+    bbtkDebugMessageInc("data",7,
             "AtomicBlackBox::bbSetInput(\""<<name<<"\",data) ["
             <<bbGetFullName()<<"]"
             <<std::endl);  
@@ -225,7 +238,7 @@ namespace bbtk
             bbSetModifiedStatus();
         }
     
-    bbtkDebugDecTab("Data",7);
+    bbtkDebugDecTab("data",7);
   }
   //=========================================================================
   
@@ -238,7 +251,7 @@ namespace bbtk
                     bool setModified
     )
   {
-    bbtkDebugMessageInc("Data",7,
+    bbtkDebugMessageInc("data",7,
             "AtomicBlackBox::bbBruteForceSetInputPointer(\""
             <<name<<"\",data) ["
             <<bbGetFullName()<<"]"
@@ -252,7 +265,7 @@ namespace bbtk
         bbSetModifiedStatus();
       }
     
-    bbtkDebugDecTab("Data",7);
+    bbtkDebugDecTab("data",7);
   }
   //=========================================================================