Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:14 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2008/04/21 12:43:05 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
<<(caller?caller->GetFullName():"0")<<") ["
<<bbGetFullName()<<"]"<<std::endl);
- if (bbGetExecuting())
- {
- bbtkWarning(bbGetFullName()<<" : Cyclic execution stopped");
- return UPTODATE;
- }
- bbSetExecuting(true);
-
bbtkDebugMessage("Process",5,"Initial Status = "<<bbGetStatus()
<<std::endl);
bbtkDebugMessage("Process",5,"BoxProcessMode = "
<<bbGetInputBoxProcessMode()<<std::endl);
- /*
- if ( bbGetStatus() == UPDATING )
- {
- bbtkMessage("Warning",1,"!! WARNING !! Cyclic pipeline execution (bbBackwardUpdate ["<<bbGetFullName()<<"] reentered). This may indicate an error in pipeline conception"<<std::endl);
- // return UPTODATE;
- bbSetStatus(MODIFIED);
- }
- */
if ( ( bbGetStatus() == MODIFIED ) ||
( bbBoxProcessModeIsAlways() ) )
bool wasExecuting = bbGlobalGetSomeBoxExecuting();
bbGlobalSetSomeBoxExecuting(true);
- // bbSetStatus(UPDATING);
-
// Updates its inputs
IOStatus s = bbUpdateInputs();
<<bbGetFullName()<<"]"<<std::endl);
bbtkDebugDecTab("Process",1);
- bbSetExecuting(false);
return bbGetStatus();
Program: bbtk
Module: $RCSfile: bbtkBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/18 12:59:15 $
-Version: $Revision: 1.10 $
+Date: $Date: 2008/04/21 12:43:05 $
+Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
: bbmName(name),
bbmStatus(MODIFIED),
bbmBoxProcessMode("Pipeline"),
- bbmParent(),
- bbmExecuting(false)
+ bbmParent()
+
{
bbtkDebugMessage("object",4,"==> BlackBox::BlackBox(\""
<<name<<"\")"<<std::endl);
: bbmName(name),
bbmStatus(from.bbmStatus),
bbmBoxProcessMode(from.bbmBoxProcessMode),
- bbmParent(),
- bbmExecuting(false)
+ bbmParent()
+
{
bbtkDebugMessage("object",4,"==> BlackBox::BlackBox("
<<from.bbGetFullName()<<",\""
Program: bbtk
Module: $RCSfile: bbtkBlackBox.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:15 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2008/04/21 12:43:05 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See doc/license.txt or
virtual void bbCopyIOValues(BlackBox& from);
//==================================================================
- bool bbGetExecuting() const { return bbmExecuting; }
- void bbSetExecuting(bool b) { bbmExecuting = b; }
-
// Black box objects have a special deleter
// which must take care of releasing the descriptor
// **AFTER** the box is deleted
BlackBox::WeakPointer bbmParent;
//==================================================================
- //==================================================================
- // Am I executing (to test pipeline cycles) ?
- bool bbmExecuting;
- //==================================================================
//==================================================================
// ATTRIBUTES
Program: bbtk
Module: $RCSfile: bbtkComplexBlackBox.cxx,v $
Language: C++
-Date: $Date: 2008/04/21 11:41:56 $
-Version: $Revision: 1.11 $
+Date: $Date: 2008/04/21 12:43:05 $
+Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bbtkInternalError("ComplexBlackBox::bbBackwardUpdate called with caller=0");
}
- if (bbGetExecuting())
- {
- bbtkWarning(bbGetFullName()<<" : Cyclic execution stopped");
- return UPTODATE;
- }
- bbSetExecuting(true);
IOStatus s = UPTODATE;
const BlackBoxDescriptor::OutputDescriptorMapType& omap
}
bbtkDebugDecTab("Process",1);
- bbSetExecuting(false);
-
return s;
- // return UPTODATE;
}
//==================================================================
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
"=> 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);
}
"<= WxBlackBox::bbBackwardUpdate() ["
<<bbGetFullName()<<"]"<<std::endl);
- bbSetExecuting(false);
}
//=========================================================================
Program: bbtk
Module: $RCSfile: bbtkWxBlackBox.h,v $
Language: C++
- Date: $Date: 2008/04/18 12:59:16 $
- Version: $Revision: 1.11 $
+ Date: $Date: 2008/04/21 12:43:05 $
+ Version: $Revision: 1.12 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// Main processing method of the box. Overloaded to handle windows inclusion : if the output Widget is connected then the execution is transfered to the box to which it is connected (the container window must be created and displayed - this box will be also executed by the normal pipeline recursion mechanism)
virtual void bbExecute(bool force = false);
+
+ /// Is set to true before transfering update to parent
+ /// in order to not re-transfer a second time...
+ bool bbmUpdateTransferedToParent;
+
+ bool bbGetUpdateTransferedToParent() const { return bbmUpdateTransferedToParent; }
+ void bbSetUpdateTransferedToParent(bool b)
+ { bbmUpdateTransferedToParent = b; }
+
+
};
//=================================================================