X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkBlackBox.cxx;h=88cde1317bcb0f968b3d7a1222d71c5054292d06;hb=4d6822024afbbe783cdd620e248184b37d84c540;hp=e2dae01bcc2cd42401bc53469cb8106bf3c17005;hpb=cfad95b6e08e6e53846ffcda7fbc5932065f2c47;p=bbtk.git diff --git a/kernel/src/bbtkBlackBox.cxx b/kernel/src/bbtkBlackBox.cxx index e2dae01..88cde13 100644 --- a/kernel/src/bbtkBlackBox.cxx +++ b/kernel/src/bbtkBlackBox.cxx @@ -55,8 +55,8 @@ namespace bbtk { - static bool bbmgSomeBoxExecuting = false; - static bool bbmgFreezeExecution = false; + static bool bbmgSomeBoxExecuting = false; + static bool bbmgFreezeExecution = false; static std::set bbmgExecutionList; //========================================================================= @@ -93,14 +93,10 @@ namespace bbtk if (!pack.expired()) { Package::ReleaseBlackBoxDescriptor(pack,desc); - } - else - { + } else { bbtkDebugMessage("object",2,"##> BlackBox::Deleter(\""< BlackBox::Deleter(\""<bbGetNameWithParent() + ":" + bbmName; - } - else - { - return bbmName; - } + { + return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName; + } else { + return bbmName; + } } //========================================================================= @@ -463,17 +457,32 @@ namespace bbtk } */ + OutputConnectorMapType::const_iterator o; for ( o = bbGetOutputConnectorMap().begin(); o != bbGetOutputConnectorMap().end(); ++o ) - { - if (o->second->GetStatus()==UPTODATE) + { + + + if (o->first=="BoxChange") + { + o->second->SetStatus(UPTODATE); + } + + + +//EED 24/08/2015 +// EED CASPITAS 2 + if (o->second->GetStatus()==UPTODATE) +// if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==OUTOFDATE)) +// if ((o->second->GetStatus()==UPTODATE) || (o->second->GetStatus()==MODIFIED)) { o->second->SetStatus(OUTOFDATE); o->second->SignalChange(GetThisPointer(),o->first); - } - } + } // if + } // for + if ( ( bbBoxProcessModeIsReactive() || (c==bbGetInputConnectorMap().find("BoxExecute")->second)) && (bbCanReact() ) ) @@ -481,7 +490,7 @@ namespace bbtk bbtkBlackBoxDebugMessage("change",2, "-> Execution triggered by Reactive mode or BoxExecute input change"<() ); - } + } // if bbtkBlackBoxDebugMessage("change",5, "<= BlackBox::bbSetStatusAndPropagate(input)" < already executing : abort"<bbProcess(); + +//printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() ); + +//auto start = std::chrono::high_resolution_clock::now(); + this->bbProcess(); +//auto stop = std::chrono::high_resolution_clock::now(); +//auto duration = duration_cast(stop - start); +//printf("EED BlackBox::bbRecursiveExecute bbProcess time= %ld %s \n", duration.count() , bbGetFullName().c_str() ); + +//printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() ); + } // Manual analysis //EED ups if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false)) //EED ups { //EED ups bbSignalOutputModification(true); //EED ups } - - + // Update the I/O statuses bbComputePostProcessStatus(); - } - else - { + } else { // Test output status... OutputConnectorMapType::iterator o; for ( o = bbGetOutputConnectorMap().begin(); @@ -764,11 +779,11 @@ namespace bbtk <<"all inputs are Up-to-date but output '" <first<<"' is Out-of-date ???"); } - } + } // for bbtkBlackBoxDebugMessage("process",3," -> Up-to-date : nothing to do" <bbShowWindow(); @@ -785,9 +800,6 @@ namespace bbtk } //========================================================================= - - - //========================================================================= IOStatus BlackBox::bbUpdateInputs() @@ -1468,6 +1480,7 @@ namespace bbtk <