From b5b44337d62219656650cf2b21108594bbf9adc3 Mon Sep 17 00:00:00 2001 From: nri Date: Thu, 10 Jul 2003 09:02:49 +0000 Subject: [PATCH] NRI : Merge from V1_2. --- src/Loader/InquireServersQThread.cxx | 95 +++++++++++++++++----------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/src/Loader/InquireServersQThread.cxx b/src/Loader/InquireServersQThread.cxx index 7e8cf6e42..4fa67e651 100644 --- a/src/Loader/InquireServersQThread.cxx +++ b/src/Loader/InquireServersQThread.cxx @@ -215,12 +215,12 @@ InquireServersQThread::InquireServersQThread( InquireServersGUI* r ) QString str = "Loading: "; myMessages[0] = "Checking naming service..."; myMessages[1] = str + "SALOME_Registry_Server" + "..."; - myMessages[2] = str + "SALOME_Container SuperVisionContainer" + "..."; + myMessages[2] = str + "SALOMEDS_Server" + "..."; myMessages[3] = str + "SALOME_ModuleCatalog_Server" + "..."; - myMessages[4] = str + "SALOME_ContainerPy.py FactoryServerPy" + "..."; - myMessages[5] = str + "SALOME_Container FactoryServer" + "..."; - myMessages[6] = str + "SALOMEDS_Server" + "..."; - myMessages[7] = str + "SALOME_Session_Server" + "..."; + myMessages[4] = str + "SALOME_Session_Server" + "..."; + myMessages[5] = ""; + myMessages[6] = ""; + myMessages[7] = ""; r->getArgs( _argc, &_argv); @@ -327,18 +327,18 @@ bool InquireServersQThread::AskServer(int iteration, QString ** errMessage) case 2: //checking - existence of SALOME_Registry_Server case 3: - //checking - existence of SALOME_Container SuperVisionContainer + //checking - existence of SALOMEDS_Server case 4: //checking - existence of SALOME_ModuleCatalog_Server case 5: - //checking - existence of SALOME_ContainerPy.py FactoryServerPy + //checking - existence of SALOME_Session_Server case 6: //checking - existence of SALOME_Container FactoryServer case 7: - //checking - existence of SALOMEDS_Server + //checking - existence of SALOME_ContainerPy.py FactoryServerPy case 8: - //checking - existence of SALOME_Session_Server - + //checking - existence of SALOME_Container SuperVisionContainer + IsPassed = pingServer(iteration, errDescription); if (!IsPassed) @@ -377,20 +377,21 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) } } break; - case 3: - { - string hostname = GetHostname(); - string containerName = "/Containers/"; - containerName += hostname; - containerName += "/SuperVisionContainer"; - - CORBA::Object_var obj = NS.Resolve(containerName.c_str()); - Engines::Container_var SVcontainer = Engines::Container::_narrow(obj) ; - if (!CORBA::is_nil(SVcontainer)) + case 3: + { + CORBA::Object_var obj = NS.Resolve("/myStudyManager"); + SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(obj) ; + if (!CORBA::is_nil(studyManager)) + + + + + { - SVcontainer->ping(); + MESSAGE("/myStudyManager is found"); + studyManager->ping(); result = true; - MESSAGE("SuperVisionContainer container was activated"); + MESSAGE("StudyManager was activated"); return result; } } @@ -409,7 +410,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) } } break; - case 8: + case 5: { CORBA::Object_var obj = NS.Resolve("Kernel/Session"); SALOME::Session_var session = SALOME::Session::_narrow(obj) ; @@ -441,7 +442,7 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) } } break; - case 5: + case 7: { string hostname = GetHostname(); string containerName = "/Containers/"; @@ -459,16 +460,21 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) } } break; - case 7: - { - CORBA::Object_var obj = NS.Resolve("/myStudyManager"); - SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(obj) ; - if (!CORBA::is_nil(studyManager)) + case 8: + { + string hostname = GetHostname(); + string containerName = "/Containers/"; + containerName += hostname; + containerName += "/SuperVisionContainer"; + + CORBA::Object_var obj = NS.Resolve(containerName.c_str()); + Engines::Container_var SVcontainer = Engines::Container::_narrow(obj) ; + if (!CORBA::is_nil(SVcontainer)) { - MESSAGE("/myStudyManager is found"); - studyManager->ping(); + SVcontainer->ping(); + result = true; - MESSAGE("StudyManager was activated"); + MESSAGE("SuperVisionContainer container was activated"); return result; } } @@ -510,22 +516,22 @@ bool InquireServersQThread::pingServer(int iteration, QString& errMessage) case 2: serverName = "SALOME_Registry_Server is not loaded. "; break; - case 7: + case 3: serverName = "SALOMEDS_Server is not loaded. "; break; case 4: serverName = "SALOME_ModuleCatalog_Server is not loaded. "; break; - case 8: + case 5: serverName = "SALOME_Session_Server is not loaded. "; break; case 6: serverName = "SALOME_Container FactoryServer is not loaded. "; break; - case 5: + case 7: serverName = "SALOME_ContainerPy.py FactoryServerPy is not loaded. "; break; - case 3: + case 8: serverName = "SALOME_Container SuperVisionContainer is not loaded. "; break; } @@ -541,6 +547,23 @@ QString findFile( QString filename ) QString dir; char* cenv; + // Try ${SALOME_ROOT_DIR}/share/salome/resources directory + cenv = getenv( "KERNEL_ROOT_DIR" ); + if ( cenv ) { + dir.sprintf( "%s", cenv ); + if ( !dir.isEmpty() ) { + dir = addSlash(dir) ; + dir = dir + "share" ; + dir = addSlash(dir) ; + dir = dir + "salome" ; + dir = addSlash(dir) ; + dir = dir + "resources" ; + dir = addSlash(dir) ; + QFileInfo fileInfo( dir + filename ); + if ( fileInfo.isFile() && fileInfo.exists() ) + return fileInfo.filePath(); + } + } // Try CSF_ResourcesDefaults env.var directory ( or directory list ) cenv = getenv( "CSF_ResourcesDefaults" ); if ( cenv ) { -- 2.39.2