From: Jérôme Date: Fri, 13 Nov 2020 15:49:07 +0000 (+0100) Subject: fixed issue from validation of feature X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c7a214b676f53b119def3325d5931f716ce79640;p=modules%2Fshaper.git fixed issue from validation of feature --- diff --git a/src/BuildPlugin/BuildPlugin_Interpolation.cpp b/src/BuildPlugin/BuildPlugin_Interpolation.cpp index 13506b77e..59e91ca81 100644 --- a/src/BuildPlugin/BuildPlugin_Interpolation.cpp +++ b/src/BuildPlugin/BuildPlugin_Interpolation.cpp @@ -123,8 +123,7 @@ void BuildPlugin_Interpolation::attributeChanged(const std::string& theID) && string(XT_ID())->value() !="" && string(YT_ID())->value() !="" && string(ZT_ID())->value() !="" - && string(CREATION_METHOD_ID())->value() == CREATION_METHOD_ANALYTICAL_ID() - ){ + && string(CREATION_METHOD_ID())->value() == CREATION_METHOD_ANALYTICAL_ID()){ updateCoordinates(); } } @@ -151,8 +150,12 @@ void BuildPlugin_Interpolation::updateCoordinates() } outErrorMessage=""; - evaluate(outErrorMessage); + data()->string(EXPRESSION_ERROR_ID())->setValue(outErrorMessage); + if (!outErrorMessage.empty()){ + setError("Error: Python interpreter "); //+ outErrorMessage ); + return; + } } //================================================================================================= @@ -249,10 +252,6 @@ void BuildPlugin_Interpolation::execute() ||tables(VALUE_ID())->rows()== 0 ) return; - if (!outErrorMessage.empty()){ - setError("Error Python interpreter :" + outErrorMessage, false ); - return; - } bool aWasBlocked = data()->blockSendAttributeUpdated(true); updateCoordinates(); data()->blockSendAttributeUpdated(aWasBlocked, false); diff --git a/src/BuildPlugin/BuildPlugin_Validators.h b/src/BuildPlugin/BuildPlugin_Validators.h index ffb8b0fbb..9b2b5194c 100644 --- a/src/BuildPlugin/BuildPlugin_Validators.h +++ b/src/BuildPlugin/BuildPlugin_Validators.h @@ -154,5 +154,4 @@ class BuildPlugin_ValidatorExpressionInterpolation Events_InfoMessage& theError) const; }; - #endif diff --git a/src/InitializationPlugin/InitializationPlugin_EvalListener.cpp b/src/InitializationPlugin/InitializationPlugin_EvalListener.cpp index 9268004a4..67de035b1 100644 --- a/src/InitializationPlugin/InitializationPlugin_EvalListener.cpp +++ b/src/InitializationPlugin/InitializationPlugin_EvalListener.cpp @@ -139,8 +139,8 @@ void InitializationPlugin_EvalListener::processEvent( anError, aParamsList, anIsFirstTime); + if(!anError.empty()) break; anValueAttr->setValue(aVal,step,1); - if( !anError.empty()) break; anExprAttr = aParam->string(BuildPlugin_Interpolation::YT_ID()); anExp = anExprAttr->isUValue() ? Locale::Convert::toWString(anExprAttr->valueU()) : @@ -152,8 +152,8 @@ void InitializationPlugin_EvalListener::processEvent( anError, aParamsList, anIsFirstTime); + if(!anError.empty()) break; anValueAttr->setValue(aVal,step,2); - if( !anError.empty()) break; anExprAttr = aParam->string(BuildPlugin_Interpolation::ZT_ID()); anExp = anExprAttr->isUValue() ? Locale::Convert::toWString(anExprAttr->valueU()) : @@ -165,7 +165,7 @@ void InitializationPlugin_EvalListener::processEvent( anError, aParamsList, anIsFirstTime); - if( !anError.empty()) break; + if(!anError.empty()) break; anValueAttr->setValue(aVal,step,3); if ( anIsFirstTime ) anIsFirstTime = false;