From 018997db10529c9c22420a89e21066a70451c651 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me?= Date: Fri, 13 Nov 2020 16:49:07 +0100 Subject: [PATCH] fixed issue from validation of feature --- src/BuildPlugin/BuildPlugin_Interpolation.cpp | 13 ++++++------- src/BuildPlugin/BuildPlugin_Validators.h | 1 - .../InitializationPlugin_EvalListener.cpp | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) 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; -- 2.39.2