]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkWxBlackBox.cxx
*** empty log message ***
[bbtk.git] / kernel / src / bbtkWxBlackBox.cxx
index 2413e4a55aba8e69c9e067adafb05c2db8b156db..b278488f23c0968d458130c1a9ca612ff0b5db39 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxBlackBox.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:16 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2008/04/21 12:43:05 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -540,40 +540,41 @@ namespace bbtk
                        "=> WxBlackBox::bbBackwardUpdate("
                        <<(caller?caller->GetFullName():"0")<<") ["
                        <<bbGetFullName()<<"]"<<std::endl);
-
-    if (bbGetExecuting()) 
-      {
-       bbtkWarning(bbGetFullName()<<" : Cyclic execution stopped");
-       return UPTODATE;
-      }
-    bbSetExecuting(true);
-
     // If the caller is not the connection to the output widget
     // and the output 'Widget' is connected then 
-    // we must execute the parent box
-    bool done = false;
+    // we must execute the parent box 
+    // but only one time 
+    // (this is the role of the flag UpdateTransferedToParent=
     if ( (caller==0) ||
         ((caller!=0)&&(caller->GetBlackBoxFromOutput()!="Widget"))
         )
       {
        BlackBox::OutputConnectorMapType::const_iterator i 
          = bbGetOutputConnectorMap().find("Widget") ;
-       if ( 
-           i->second->GetConnectionVector().size() != 0 ) 
+       if ( i->second->GetConnectionVector().size() != 0 )
+            
          {
            bbtkDebugMessage("Process",2,
-                            "-> Output 'Widget' connected : transfering execution to parent"
+                            "-> Output 'Widget' connected : transfering update order to parent"
                             <<std::endl);
-           
-           i->second->GetConnectionVector().front().lock()
-             ->GetBlackBoxTo()->bbExecute(false);
-           done = true;
+           if ( bbGetUpdateTransferedToParent() )          
+             {
+               bbSetUpdateTransferedToParent(false);
+               bbtkDebugMessage("Process",2,
+                                "   ... already transfered : abort"
+                                <<std::endl);
+             }
+           else 
+             {
+               bbSetUpdateTransferedToParent(true);
+               i->second->GetConnectionVector().front().lock()
+                 ->GetBlackBoxTo()->bbExecute(false);
+             }
          }
       }
     // call 'standard' BlackBox execution method
-    if (!done
+    if (!bbGetUpdateTransferedToParent()
       { 
-       bbSetExecuting(false);
        AtomicBlackBox::bbBackwardUpdate(caller);
       }
     
@@ -581,7 +582,6 @@ namespace bbtk
                        "<= WxBlackBox::bbBackwardUpdate() ["
                        <<bbGetFullName()<<"]"<<std::endl);
     
-    bbSetExecuting(false);
   }
 
   //=========================================================================