From 4587841469935cb1a28754558dece0ee77aa20a6 Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 17 Dec 2015 16:19:27 +0300 Subject: [PATCH] Error message correction for the following case, found by squish: Create parameter a, Create construction Input 'a', 'Enter' Input 'b', 'Enter' -> strange text in Property Panel tool tip. --- src/ModelAPI/ModelAPI_Tools.cpp | 16 +++++++++++++++- src/ModuleBase/ModuleBase_IModule.cpp | 14 -------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ModelAPI/ModelAPI_Tools.cpp b/src/ModelAPI/ModelAPI_Tools.cpp index 9023cb2d2..442549557 100755 --- a/src/ModelAPI/ModelAPI_Tools.cpp +++ b/src/ModelAPI/ModelAPI_Tools.cpp @@ -22,6 +22,20 @@ std::shared_ptr shape(const ResultPtr& theResult) return theResult->shape(); } +const char* toString(ModelAPI_ExecState theExecState) +{ +#define TO_STRING(__NAME__) case __NAME__: return #__NAME__; + switch (theExecState) { + TO_STRING(ModelAPI_StateDone) + TO_STRING(ModelAPI_StateMustBeUpdated) + TO_STRING(ModelAPI_StateExecFailed) + TO_STRING(ModelAPI_StateInvalidArgument) + TO_STRING(ModelAPI_StateNothing) + default: return "Unknown ExecState."; + } +#undef TO_STRING +} + std::string getFeatureError(const FeaturePtr& theFeature) { std::string anError; @@ -39,7 +53,7 @@ std::string getFeatureError(const FeaturePtr& theFeature) bool isDone = ( theFeature->data()->execState() == ModelAPI_StateDone || theFeature->data()->execState() == ModelAPI_StateMustBeUpdated ); if (!isDone) - anError = theFeature->data()->execState(); + anError = toString(theFeature->data()->execState()); } return anError; diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 343f3a086..35d09d0de 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -66,20 +66,6 @@ void ModuleBase_IModule::sendOperation(ModuleBase_Operation* theOperation) Events_Loop::loop()->send(aMessage); } -const char* toString(ModelAPI_ExecState theExecState) -{ -#define TO_STRING(__NAME__) case __NAME__: return #__NAME__; - switch (theExecState) { - TO_STRING(ModelAPI_StateDone) - TO_STRING(ModelAPI_StateMustBeUpdated) - TO_STRING(ModelAPI_StateExecFailed) - TO_STRING(ModelAPI_StateInvalidArgument) - TO_STRING(ModelAPI_StateNothing) - default: return "Unknown ExecState."; - } -#undef TO_STRING -} - QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature) { return ModelAPI_Tools::getFeatureError(theFeature).c_str(); -- 2.39.2