X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.cxx;h=803e554ce0971f89ed7e21c73dfc2f5741a6fbea;hb=f72d94f32545c8a49d524dba4847174e08a30996;hp=1ff72d10bdb6f49542d099ca5faf82c2fe784240;hpb=554eb3a09fb2700fa281cc46e04642f11cdbad28;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index 1ff72d1..803e554 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkBlackBox.cxx,v $ Language: C++ - Date: $Date: 2008/12/09 13:45:13 $ - Version: $Revision: 1.35 $ + Date: $Date: 2009/02/27 11:20:25 $ + Version: $Revision: 1.39 $ =========================================================================*/ /* --------------------------------------------------------------------- @@ -78,7 +78,7 @@ namespace bbtk b->bbDelete(); - bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""< BlackBox::Deleter(\""< BlackBox::bbExecute("<<(int)force<<") [" - < already executing : bailing out"< FreezeExecution global flag is 'true' : abort execution"<second->GetStatus()==UPTODATE) - { + // std::cout << "Stat = " + //<second->GetStatus()) + // <second->GetStatus()==UPTODATE) + // { i->second->SignalChange(GetThisPointer(),i->first); - } + // } } if (reaction) bbGlobalProcessExecutionList(); @@ -649,8 +620,8 @@ namespace bbtk bbtkError("BlackBox["<second->GetStatus()==UPTODATE) - { + // if (i->second->GetStatus()==UPTODATE) + // { i->second->SignalChange(GetThisPointer(),i->first); // Has to notify the output "BoxChange" also if (output != "BoxChange") @@ -662,7 +633,7 @@ namespace bbtk } } if (reaction) bbGlobalProcessExecutionList(); - } + // } bbtkDebugMessageDec("change",5, "<= BlackBox::bbSignalOutputModification(" @@ -691,23 +662,22 @@ namespace bbtk { bbtkError("BlackBox["<second->GetStatus()==UPTODATE) - { + + // if (i->second->GetStatus()==UPTODATE) + // { i->second->SignalChange(GetThisPointer(),i->first); changed = true; - } + // } } // Has to notify the output "BoxChange" also i = bbGetOutputConnectorMap().find("BoxChange"); if ( changed && (i != bbGetOutputConnectorMap().end())) { - // Already OUTOFDATE : noting to do - if (i->second->GetStatus()==UPTODATE) - { + // if (i->second->GetStatus()==UPTODATE) + // { i->second->SignalChange(GetThisPointer(),i->first); if (reaction) bbGlobalProcessExecutionList(); - } + // } } bbtkDebugMessageDec("change",5, @@ -717,9 +687,128 @@ namespace bbtk } //========================================================================= + + + + + + + //========================================================================= + /// Main processing method of the box. + void BlackBox::bbExecute(bool force) + { + bbtkDebugMessageInc("process",2, + "=> BlackBox::bbExecute("<<(int)force<<") [" + < already executing : abort"< FreezeExecution global flag is 'true' : abort execution"< BlackBox::bbRecursiveExecute(" + <<(caller?caller->GetFullName():"0")<<") [" + < already executing : abort"<bbProcess(); + + + // Update the I/O statuses + bbComputePostProcessStatus(); + } + else + { + // Test output status... + OutputConnectorMapType::iterator o; + for ( o = bbGetOutputConnectorMap().begin(); + o!= bbGetOutputConnectorMap().end(); ++o) + { + if (o->second->GetStatus() != UPTODATE) + { + bbtkWarning("BlackBox::bbRecursiveExecute [" + <first<<"' is Out-of-date ???"); + } + } + + bbtkDebugMessage("process",3," -> Up-to-date : nothing to do" + <second->BackwardUpdate(); + i->second->RecursiveExecute(); IOStatus t = i->second->GetStatus(); if (t > s) s = t; bbtkDebugMessageDec("change",2,