From a56db4993bab53bc45a338337142fe59a755f95b Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 25 May 2015 11:44:03 +0300 Subject: [PATCH] Optimization of working with parameters --- src/Model/Model_AttributeDouble.cpp | 2 +- src/Model/Model_Update.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_AttributeDouble.cpp b/src/Model/Model_AttributeDouble.cpp index 86cbc9e14..29ca7be4e 100644 --- a/src/Model/Model_AttributeDouble.cpp +++ b/src/Model/Model_AttributeDouble.cpp @@ -44,7 +44,7 @@ void Model_AttributeDouble::setText(const std::string& theValue) TCollection_ExtendedString aValue(theValue.c_str()); if (myText->Get() != aValue) { myText->Set(aValue); - //owner()->data()->sendAttributeUpdated(this); ? + owner()->data()->sendAttributeUpdated(this); } } diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 50d73e311..8eae85c93 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -197,6 +197,7 @@ void Model_Update::updateInDoc(std::shared_ptr theDoc) // number of subs can be changed in execution: like fillet for(int a = 0; a < aComposite->numberOfSubs(); a++) { FeaturePtr aSub = aComposite->subFeature(a); + updateArguments(aSub); updateFeature(aSub); alreadyProcessed.insert(aSub); } @@ -257,7 +258,10 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { bool aJustUpdated = false; ModelAPI_ExecState aState = theFeature->data()->execState(); + if (aState == ModelAPI_StateInvalidArgument) // a chance to be corrected + aState = ModelAPI_StateMustBeUpdated; // check the parameters: values can be changed + /* parameters evaluator now does this std::list aDoubles = theFeature->data()->attributes(ModelAPI_AttributeDouble::typeId()); std::list::iterator aDoubleIter = aDoubles.begin(); @@ -276,6 +280,7 @@ void Model_Update::updateArguments(FeaturePtr theFeature) { } } } + */ //if (aState == ModelAPI_StateDone) {// all referenced objects are ready to be used //std::cout<<"Execute feature "<getKind()<validators(); - if (theFeature->isDisabled()) // nothing to do with disabled feature + if (theFeature->isDisabled() || // nothing to do with disabled feature + theFeature->data()->execState() == ModelAPI_StateInvalidArgument) return; bool aJustUpdated = false; -- 2.39.2