]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkBlackBox.cxx
New widget pipeline : progressing ...
[bbtk.git] / kernel / src / bbtkBlackBox.cxx
index 6d134c9ce3faae64d0c348add99e51c91ab78f3e..ddfc3ed9576598ad5b150716c67dbec7ccafe65e 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/11/13 10:37:27 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2008/11/25 11:17:13 $
+  Version:   $Revision: 1.29 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -103,6 +103,7 @@ namespace bbtk
   BlackBox::BlackBox(const std::string &name) 
     : 
     bbmStatus(MODIFIED), 
+    bbmExecuting(false),
     bbmName(name),
     bbmBoxProcessMode("Pipeline"),
     bbmParent()
@@ -123,6 +124,7 @@ namespace bbtk
   BlackBox::BlackBox(BlackBox& from, const std::string &name) 
     :
       bbmStatus(from.bbmStatus), 
+      bbmExecuting(false),
       bbmName(name), 
       bbmBoxProcessMode(from.bbmBoxProcessMode),
       bbmParent()
@@ -155,9 +157,16 @@ namespace bbtk
   void BlackBox::bbExecute(bool force)
   {
     bbtkDebugMessageInc("process",2,
-                       "=> BlackBox::bbExecute() ["
+                       "=> BlackBox::bbExecute("<<(int)force<<") ["
                        <<bbGetFullName()<<"]"<<std::endl);
  
+    // If already executing : return
+    if (bbGetExecuting()) 
+      {
+       bbtkDebugMessage("process",2,
+                        " -> already executing : bailing out"<<std::endl);
+       return;
+      }
 
     // If execution frozen : return
     if (bbGlobalGetFreezeExecution()) 
@@ -334,7 +343,7 @@ namespace bbtk
   /// Copies the input / output values from another box
   void BlackBox::bbCopyIOValues(BlackBox& from)
   {
-    bbtkDebugMessageInc("Kernel",9,
+    bbtkDebugMessageInc("Kernel",1,
                        "BlackBox::bbCopyIOValues("
                        <<from.bbGetFullName()<<") ["
                        <<bbGetFullName()<<"]"<<std::endl);
@@ -346,6 +355,7 @@ namespace bbtk
       {                
        if (! i->second->GetCopyConstruct() ) continue;
        std::string input = i->second->GetName();
+       bbtkDebugMessage("Kernel",2,"* Copying input "<<input<<std::endl);
        this->bbSetInput(input, from.bbGetInput(input) );
       }                                                                        
     // copies the output values
@@ -356,6 +366,7 @@ namespace bbtk
       {                                                        
        if (! o->second->GetCopyConstruct() ) continue;
        std::string output = o->second->GetName();
+       bbtkDebugMessage("Kernel",2,"* Copying output "<<output<<std::endl);
        this->bbSetOutput(output, from.bbGetOutput(output) );
       }