-
-
- //=========================================================================
- /// Main processing method of the box.
- IOStatus AtomicBlackBox::bbBackwardUpdate( Connection* caller )
- {
- bbtkDebugMessageInc("Process",1,
- "=> AtomicBlackBox::bbBackwardUpdate("
- <<(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();
-
- bbtkDebugMessage("Process",6,"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
- if ( ( s == UPTODATE ) &&
- ( ! bbBoxProcessModeIsAlways() ) )
- {
- bbSetStatus(UPTODATE);
- }
- else
- {
- // else it remains MODIFIED
- bbSetStatus(MODIFIED);
- }
-
- // User process
- bbProcess();
-
- // Displays the window (WxBlackbox)
- bbShowWindow(caller);
-
- bbGlobalSetSomeBoxExecuting(wasExecuting);
-
- }
- else
- {
- bbtkDebugMessage("Process",5,"Up-to-date : nothing to do"<<std::endl);
- }
-
- bbtkDebugMessage("Process",5,"Final Status = "
- <<bbGetStatus()<<std::endl);
- bbtkDebugMessage("Process",1,
- "<= AtomicBlackBox::bbBackwardUpdate() ["
- <<bbGetFullName()<<"]"<<std::endl);
- bbtkDebugDecTab("Process",1);
-
- bbSetExecuting(false);