]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
preparing move of the engine code into GUI.
authorabn <adrien.bruneton@cea.fr>
Thu, 16 Oct 2014 11:31:07 +0000 (13:31 +0200)
committerabn <adrien.bruneton@cea.fr>
Thu, 16 Oct 2014 11:31:07 +0000 (13:31 +0200)
src/PVViewer/PVViewer_EngineWrapper.cxx
src/PVViewer/PVViewer_EngineWrapper.h

index e94214adc151bb3abdbf2242021cb2cbcf12918a..20a1ee5d7f0ad656d77eb4aea044d3cdd2832536 100644 (file)
@@ -41,7 +41,7 @@ PVViewer_EngineWrapper * PVViewer_EngineWrapper::GetInstance()
 //}
 //
 //PVViewer_EngineWrapper::PVViewer_EngineWrapper()
-//// : paravisEngine(NULL)
+//// : pvserverEngine(NULL)
 //{
 //  _component = getApplication()->lcc()->FindOrLoad_Component( "FactoryServer", "PARAVIS" );
 //}
@@ -94,21 +94,20 @@ PVViewer_EngineWrapper * PVViewer_EngineWrapper::GetInstance()
 //}
 
 PVViewer_EngineWrapper::PVViewer_EngineWrapper() :
-    paravisEngine(NULL)
+    pvserverEngine(NULL)
 {
-//  const char * cmd = "import PARAVIS_utils;e=";
   PyLockWrapper lock;
-  const char* code = "import PARAVIS_utils as pa;__enginePARAVIS=pa.getEngine()";
+  const char* code = "import PVSERVER_utils as pa;__enginePVSERVER=pa.getEngine()";
   int ret = PyRun_SimpleString(const_cast<char*>(code));
 
   if (ret == -1)
-    throw SALOME_Exception("Unable to retrieve PARAVIS engine!");
+    throw SALOME_Exception("Unable to retrieve PVSERVER engine!");
 
   // Now get the reference to __engine and save the pointer.
   PyObject* main_module = PyImport_AddModule((char*)"__main__");
   PyObject* global_dict = PyModule_GetDict(main_module);
-  PyObjWrapper tmp(PyDict_GetItemString(global_dict, "__enginePARAVIS"));
-  paravisEngine = tmp;
+  PyObjWrapper tmp(PyDict_GetItemString(global_dict, "__enginePVSERVER"));
+  pvserverEngine = tmp;
 }
 
 
@@ -116,11 +115,11 @@ PVViewer_EngineWrapper::PVViewer_EngineWrapper() :
 bool PVViewer_EngineWrapper::GetGUIConnected()
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(paravisEngine, (char*)("GetGUIConnected"), NULL));
+  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("GetGUIConnected"), NULL));
   if (!obj)
     {
       PyErr_Print();
-      throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+      throw SALOME_Exception("Unable to invoke PVSERVER engine!");
     }
   return PyObject_IsTrue(obj);
 }
@@ -129,24 +128,24 @@ void PVViewer_EngineWrapper::SetGUIConnected(bool isConnected)
 {
   PyLockWrapper lock;
 
-  PyObjWrapper obj(PyObject_CallMethod(paravisEngine, (char*)("SetGUIConnected"),
+  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("SetGUIConnected"),
                                        (char *)"i", (int)isConnected ) );
   if (!obj)
     {
       PyErr_Print();
-      throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+      throw SALOME_Exception("Unable to invoke PVSERVER service!");
     }
 }
 
 std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(paravisEngine, (char*)("FindOrStartPVServer"),
+  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("FindOrStartPVServer"),
                                          (char *)"i", port ) );
   if (!obj)
     {
       PyErr_Print();
-      throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+      throw SALOME_Exception("Unable to invoke PVSERVER service!");
     }
   char * s = PyString_AsString(obj);
 
@@ -156,11 +155,11 @@ std::string PVViewer_EngineWrapper::FindOrStartPVServer(int port)
 void PVViewer_EngineWrapper::PutPythonTraceStringToEngine(const char * str)
 {
   PyLockWrapper lock;
-  PyObjWrapper obj(PyObject_CallMethod(paravisEngine, (char*)("PutPythonTraceStringToEngine"),
+  PyObjWrapper obj(PyObject_CallMethod(pvserverEngine, (char*)("PutPythonTraceStringToEngine"),
                                        (char *)"s",  str) );
   if (!obj)
     {
       PyErr_Print();
-      throw SALOME_Exception("Unable to invoke PARAVIS engine!");
+      throw SALOME_Exception("Unable to invoke PVSERVER service!");
     }
 }
index a14993c047e8221456133eaae3dd6cb0f6c65885..c4a9e74719bd97321133e5f9352fa7a915a7aaeb 100644 (file)
@@ -56,7 +56,7 @@ private:
   static PVViewer_EngineWrapper * instance;
   //Engines::EngineComponent_var _component;
 
-  PyObjWrapper paravisEngine;
+  PyObjWrapper pvserverEngine;
 };
 
 #endif /* PVVIEWERENGINEWRAPPER_H_ */