From: Anthony GEAY Date: Fri, 19 Feb 2021 16:38:18 +0000 (+0100) Subject: Study is OK X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fec6fef41448cbfbd329bf33b1abc96c4cf4b5b9;p=modules%2Fgui.git Study is OK --- diff --git a/src/Session/Session_NS_wrapper.cxx b/src/Session/Session_NS_wrapper.cxx index e55f9c24c..0c2f25bbe 100644 --- a/src/Session/Session_NS_wrapper.cxx +++ b/src/Session/Session_NS_wrapper.cxx @@ -22,6 +22,8 @@ #include "SALOME_Fake_NamingService.hxx" #include "SALOME_Container_i.hxx" #include "SALOME_Launcher.hxx" +#include "SALOMEDSClient_ClientFactory.hxx" + #include "Session_Session_i.hxx" #include "Session_Promises.hxx" #include "utilities.h" @@ -167,6 +169,33 @@ void OldStyleNS::activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa CommonActivateSession(orb,poa,GUIMutex,GUILauncher,nullptr,argc,argv); } +void OldStyleNS::activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa) +{ + try { + MESSAGE("SALOMEDS thread started"); + // We allocate the objects on the heap. Since these are reference + // counted objects, they will be deleted by the POA when they are no + // longer needed. + + ClientFactory::createStudy(orb,poa); + } + catch(CORBA::SystemException&) { + INFOS( "Caught CORBA::SystemException." ); + } + catch(CORBA::Exception&) { + INFOS( "Caught CORBA::Exception." ); + } + catch(omniORB::fatalException& fe) { + INFOS( "Caught omniORB::fatalException:" ); + INFOS( " file: " << fe.file() ); + INFOS( " line: " << fe.line() ); + INFOS( " mesg: " << fe.errmsg() ); + } + catch(...) { + INFOS( "Caught unknown exception." ); + } +} + Engines_Container_i *NewStyleNS::activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char **argv) { return KERNEL::getContainerSA(); @@ -182,3 +211,8 @@ void NewStyleNS::activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa SALOME_Fake_NamingService *ns=new SALOME_Fake_NamingService; CommonActivateSession(orb,poa,GUIMutex,GUILauncher,ns,argc,argv); } + +void NewStyleNS::activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa) +{ + ClientFactory::createStudyWithoutNS(orb,poa); +} diff --git a/src/Session/Session_NS_wrapper.hxx b/src/Session/Session_NS_wrapper.hxx index 69636394d..a0b34e415 100644 --- a/src/Session/Session_NS_wrapper.hxx +++ b/src/Session/Session_NS_wrapper.hxx @@ -40,6 +40,7 @@ public: Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv); void activateContainerManager(CORBA::ORB_var orb); void activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex *GUIMutex, QWaitCondition *GUILauncher, int argc, char ** argv); + void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa); private: RealNS _NS; }; @@ -58,6 +59,7 @@ public: Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv); void activateContainerManager(CORBA::ORB_var orb); void activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex *GUIMutex, QWaitCondition *GUILauncher, int argc, char ** argv); + void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa); private: RealNS _NS; }; diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 667a35f4e..84eb438fa 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -216,29 +215,7 @@ void Session_ServerThread::ActivateModuleCatalog(int argc, char ** argv) template void Session_ServerThread::ActivateSALOMEDS(int /*argc*/, char** /*argv*/) { - try { - MESSAGE("SALOMEDS thread started"); - // We allocate the objects on the heap. Since these are reference - // counted objects, they will be deleted by the POA when they are no - // longer needed. - - ClientFactory::createStudy(_orb,_root_poa); - } - catch(CORBA::SystemException&) { - INFOS( "Caught CORBA::SystemException." ); - } - catch(CORBA::Exception&) { - INFOS( "Caught CORBA::Exception." ); - } - catch(omniORB::fatalException& fe) { - INFOS( "Caught omniORB::fatalException:" ); - INFOS( " file: " << fe.file() ); - INFOS( " line: " << fe.line() ); - INFOS( " mesg: " << fe.errmsg() ); - } - catch(...) { - INFOS( "Caught unknown exception." ); - } + this->_NS->activateSALOMEDS(this->_orb,this->_root_poa); } template