}
}
+void SALOME_Parameter::Update()
+{
+ myNotebook->SetToUpdate( _this() );
+ myNotebook->Update();
+}
+
void SALOME_Parameter::SetExpression( const char* theExpr )
{
if( myIsAnonymous )
else
{
InternalSetExpression( theExpr );
- myIsCalculable = true;
- myNotebook->SetToUpdate( _this() );
+ Update();
}
}
{
myResult = theValue;
myIsCalculable = false;
- myNotebook->SetToUpdate( _this() );
+ Update();
}
}
{
myResult = (int)theValue;
myIsCalculable = false;
- myNotebook->SetToUpdate( _this() );
+ Update();
}
}
{
myResult = theValue;
myIsCalculable = false;
- myNotebook->SetToUpdate( _this() );
+ Update();
}
}
{
myResult = theValue;
myIsCalculable = false;
- myNotebook->SetToUpdate( _this() );
+ Update();
}
}
void SALOME_Parameter::InternalSetExpression( const std::string& theExpr )
{
- myExpr.setExpression( theExpr );
- AnalyzeError();
+ std::string anOldExpr = myExpr.expression();
+ bool anOldCalc = myIsCalculable;
+ try
+ {
+ myExpr.setExpression( theExpr );
+ myIsCalculable = true;
+ AnalyzeError();
+ }
+ catch( SALOME::ExpressionError anError )
+ {
+ myExpr.setExpression( anOldExpr );
+ myIsCalculable = anOldCalc;
+ throw anError;
+ }
}
void SALOME_Parameter::AnalyzeError()
{
+ if( !myIsCalculable )
+ return;
+
std::string aMsg;
SALOME_EvalExprError anError = myExpr.parser()->error();
bool isCalcError = true;