From: azakir Date: Tue, 12 Jan 2021 16:36:13 +0000 (+0100) Subject: for MG-adapt TUI X-Git-Tag: V9_7_0a1~18^2~36^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8196d751b1e8edaa53acca65c062e5b897ca69a0;p=modules%2Fsmesh.git for MG-adapt TUI --- diff --git a/idl/MG_ADAPT.idl b/idl/MG_ADAPT.idl index 8f9311e75..8cad0d628 100644 --- a/idl/MG_ADAPT.idl +++ b/idl/MG_ADAPT.idl @@ -124,7 +124,9 @@ module SMESH{ boolean setAll(); string getCommandToRun() ; - long compute(out string errStr); + //long compute(out string errStr); + long compute(); + string getErrMsg(); string getFileName() ; string getExeName(); void copyMgAdaptHypothesisData(in MgAdaptHypothesisData f ) ; diff --git a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx index 56180d043..0025f5751 100644 --- a/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx +++ b/src/SMESHGUI/SMESHGUI_MG_ADAPTDRIVER.cxx @@ -376,7 +376,8 @@ bool SMESHGUI_MG_ADAPTDRIVER::execute() char* errStr; try { - err = getModel()->compute(errStr); + err = getModel()->compute(); + errStr = getModel()->getErrMsg(); std::string msg = err == 0 ? " ok" : std::string("Not ok \n")+CORBA::string_dup(errStr) ; } catch (const std::exception& e) diff --git a/src/SMESH_I/MG_ADAPT_i.cxx b/src/SMESH_I/MG_ADAPT_i.cxx index 6a770c68c..1d41d8079 100644 --- a/src/SMESH_I/MG_ADAPT_i.cxx +++ b/src/SMESH_I/MG_ADAPT_i.cxx @@ -354,13 +354,24 @@ char* MG_ADAPT_i::getCommandToRun() return CORBA::string_dup(myMgAdapt->getCommandToRun().c_str()); } -CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) +//~CORBA::Long MG_ADAPT_i::compute(::CORBA::String_out errStr) +//~{ + //~std::string err(""); + //~CORBA::Long ret = myMgAdapt->compute(err); + //~errStr = err.c_str(); + //~return ret; +//~} +CORBA::Long MG_ADAPT_i::compute() { - std::string err(""); - CORBA::Long ret = myMgAdapt->compute(err); - errStr = err.c_str(); + errStr = ""; + CORBA::Long ret = myMgAdapt->compute(errStr); + //~errStr = err.c_str(); return ret; } +char* MG_ADAPT_i::getErrMsg() +{ + return CORBA::string_dup(errStr.c_str()); +} char* MG_ADAPT_i::getFileName() { return CORBA::string_dup(myMgAdapt->getFileName().c_str()); diff --git a/src/SMESH_I/MG_ADAPT_i.hxx b/src/SMESH_I/MG_ADAPT_i.hxx index 7ff30dce4..07fc78b8f 100644 --- a/src/SMESH_I/MG_ADAPT_i.hxx +++ b/src/SMESH_I/MG_ADAPT_i.hxx @@ -106,7 +106,8 @@ public: bool setAll(); char* getCommandToRun() ; - CORBA::Long compute(::CORBA::String_out errStr); + //~CORBA::Long compute(::CORBA::String_out errStr); + CORBA::Long compute(); char* getFileName(); char* getExeName(); void copyMgAdaptHypothesisData( const SMESH::MgAdaptHypothesisData& data ) ; @@ -127,9 +128,10 @@ public: void copyHypothesisDataToImpl(const SMESH::MgAdaptHypothesisData& from, ::MG_ADAPT::MgAdaptHypothesisData* to) const; //~TOptionValues getOptionValues() const; //~const TOptionValues& getCustomOptionValues() const ; + char* getErrMsg(); private: ::MG_ADAPT::MgAdapt* myMgAdapt; - + std::string errStr; //~CORBA::ORB_ptr _orb; //~ADAPT::ADAPT_Gen_var _gen_i;