Program: bbtk
Module: $RCSfile: bbtkAtomicBlackBox.cxx,v $
Language: C++
- Date: $Date: 2008/11/25 11:17:13 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2008/12/08 12:53:35 $
+ Version: $Revision: 1.11 $
=========================================================================*/
/* ---------------------------------------------------------------------
//=========================================================================
/// Main processing method of the box.
- IOStatus AtomicBlackBox::bbBackwardUpdate( Connection::Pointer caller )
+ void AtomicBlackBox::bbBackwardUpdate( Connection::Pointer caller )
{
bbtkDebugMessageInc("process",3,
"=> AtomicBlackBox::bbBackwardUpdate("
if (bbGetExecuting())
{
bbtkDebugMessage("process",3,
- " -> already executing : bailing out"<<std::endl);
- return bbGetStatus();
+ " -> already executing : returning"<<std::endl);
+ return;
}
+
bbSetExecuting(true);
bool wasExecuting = bbGlobalGetSomeBoxExecuting();
bbGlobalSetSomeBoxExecuting(true);
- bbtkDebugMessage("process",5,"Initial Status = "<<bbGetStatus()
- <<std::endl);
- bbtkDebugMessage("process",5,"BoxProcessMode = "
- <<bbGetInputBoxProcessMode()<<std::endl);
-
-
- if ( ( bbGetStatus() == MODIFIED ) ||
- ( bbBoxProcessModeIsAlways() ) )
- {
-
- // bbSetStatus(UPDATING);
-
- // Updates its inputs
- IOStatus s = bbUpdateInputs();
+ // Updates its inputs
+ IOStatus s = bbUpdateInputs();
- 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
- IOStatus new_status;
- if ( ( s == UPTODATE ) &&
- ( ! bbBoxProcessModeIsAlways() ) )
- {
- new_status = UPTODATE;
- }
- else
- {
- // else it remains MODIFIED
- new_status = MODIFIED;
- }
- bbSetStatus(new_status);
-
- // User process
- bbProcess();
-
- // Displays the window (WxBlackbox)
- bbShowWindow(caller);
-
-
+ if ( (s != UPTODATE) ||
+ bbBoxProcessModeIsAlways() )
+ {
+ // User process
+ bbProcess();
+
+ // Displays the window (WxBlackbox)
+ bbShowWindow(caller);
+
+ // Update the I/O statuses
+ bbComputePostProcessStatus();
}
else
{
- bbtkDebugMessage("process",5,"Up-to-date : nothing to do"<<std::endl);
+ bbtkDebugMessage("process",5," -> Up-to-date : nothing to do"
+ <<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();
+ return; // bbGetStatus();
}
//=========================================================================
//=========================================================================
/// Sets the data of the input called <name>
- void AtomicBlackBox::bbSetInput(
- const std::string &name,
- Data data,
- bool setModified )
+ void AtomicBlackBox::bbSetInput(const std::string &name,
+ Data data,
+ bool setModified )
{
bbtkDebugMessageInc("data",7,
"AtomicBlackBox::bbSetInput(\""<<name<<"\",data) ["
((AtomicBlackBoxInputDescriptor*)bbGetDescriptor()->GetInputDescriptor(name))->GetSetFunctor()->Set(this,data);
if (setModified)
- {
- bbSetModifiedStatus();
- }
+ {
+ bbSetStatusAndPropagate(bbGetInputConnectorMap().find(name)->second,
+ MODIFIED);
+ }
bbtkDebugDecTab("data",7);
}
//=========================================================================
- //=========================================================================
+ //=========================================================================
/// Sets the data of the input called <name>
- void AtomicBlackBox::bbBruteForceSetInputPointer
- (
- const std::string &name,
- void* data,
- bool setModified
- )
+ void AtomicBlackBox::bbBruteForceSetInputPointer(const std::string &name,
+ void* data,
+ bool setModified
+ )
{
bbtkDebugMessageInc("data",7,
"AtomicBlackBox::bbBruteForceSetInputPointer(\""
if (setModified)
{
- bbSetModifiedStatus();
+ bbSetStatusAndPropagate(bbGetInputConnectorMap().find(name)->second,
+ MODIFIED);
}
bbtkDebugDecTab("data",7);