exemple PYHELLO
-
Bonjour,
J'essaie de faire tourner l'example de PYHELLO en suivant le devguide.txt.J'ai rencontré un probleme au niveau du Chargement du composant exemple.
Ceci fonctionne bien :
import PYHELLO_ORB
c=container.load_impl("PYHELLO","PYHELLO"
c.makeBanner("Christian"
Mais la suite avec LifeCycleCORBA pose probleme :
[root@lea salome]# ./runAppli
arret des serveurs SALOME
arret du process 19320 : SALOME_Session_Loader
------------------ process 19320 : SALOME_Session_Loader inexistant
arret du process 19352 : SALOME_Registry_Server
------------------ process 19352 : SALOME_Registry_Server inexistant
arret du process 19370 : SALOMEDS_Server
------------------ process 19370 : SALOMEDS_Server inexistant
arret du process 19360 : SALOME_ModuleCatalog_Server
------------------ process 19360 : SALOME_ModuleCatalog_Server inexistant
arret du process 19343 : SALOME_Logger_Server
------------------ process 19343 : SALOME_Logger_Server inexistant
arret du naming service
omniNames: aucun processus tué
Lancement du Naming Service runNS.sh > /tmp/logs/root/salomeNS.log 2>&1
Searching Naming Service ++ found in 0.2 seconds
Searching /Registry in Naming Service ++++++ found in 3.0 seconds
KERNELCatalog.xml
PYHELLOCatalog.xml
Searching /Kernel/ModulCatalog in Naming Service ++ found in 1.0 seconds
Searching /myStudyManager in Naming Service ++++++++++++++++++++++++++++ found in 14.0 seconds
Searching /Containers/lea/FactoryServer in Naming Service +++++ found in 2.5 seconds
Searching /Containers/lea/FactoryServerPy in Naming Service +++++++ found in 3.5 seconds
Start SALOME, elpased time : 26.0 seconds
Sauvegarde du dictionnaire des process dans , /tmp/root_SALOME_pidict
Pour tuer les process SALOME, executer : python killSalome.py depuis
une console, ou bien killSalome() depuis le present interpreteur,
s'il n'est pas ferm?.
runSalome, avec l'option --killall, commence par tuer les process restants
d'une execution pr?c?dente.
Pour lancer uniquement le GUI, executer startGUI() depuis le present interpreteur,
s'il n'est pas ferm?.
--- registered objects tree in Naming Service ---
Registry.object
Kernel.dir
ModulCatalog.object
Study.dir
myStudyManager.object
Containers.dir
lea.dir
FactoryServer.object
FactoryServerPy.object
Searching /Kernel/Session in Naming Service +++++++++++++ found in 6.5 seconds
Searching /Kernel/ModulCatalog in Naming Service found in 0.0 seconds
Searching /Containers/lea/FactoryServerPy in Naming Service found in 0.0 seconds
>>> import LifeCycleCORBA
----------------------------------------------------------
no user defined launcher, ssh used. (see Launchers.py)
----------------------------------------------------------
>>> lcc = LifeCycleCORBA.LifeCycleCORBA(clt.orb)
- Trace :
LifeCycleCORBA::__init__
- Trace :
[]
- Trace :
/Containers.dir Context already exists
- Trace :
ContainerManager.object not found in Naming Service
Traceback (most recent call last):
File "", line 1, in ?
File "/root/salome/KERNEL_2.2.2/bin/salome/LifeCycleCORBA.py", line 90, in __init__
self._contManager = obj._narrow(Engines.ContainerManager)
AttributeError: 'module' object has no attribute 'ContainerManager'
>>> clt.showNS()
Registry.object
Kernel.dir
ModulCatalog.object
Session.object
Study.dir
myStudyManager.object
Containers.dir
lea.dir
FactoryServer.object
FactoryServerPy.object
>>>
on voit que le service containerManager n'est pas lancé. Est ce normal que le fichier PYHELLO/bin/salome/runSalome ne lance pas ce service ?-
dacquignie wrote:
Bonjour,
J'essaie de faire tourner l'example de PYHELLO en suivant le devguide.txt.J'ai rencontré un probleme au niveau du Chargement du composant exemple.
Le problème que vous rencontrez est normal car runAppli et runSalome.py ne sont plus à jour avec les dernières versions de SALOME de meme que dev_guide.txt.
Pour faire fonctionner l'exemple PYHELLO, il faut plutot utiliser runSalome du module KERNEL.
Rapidement :
- sourcer l'environnement des prerequis : . envprerequis.sh
- mettre les variables KERNEL_ROOT_DIR et PYHELLO_ROOT_DIR dans l'environnement (export KERNEL_ROOT_DIR=....)
- aller dans l'install de KERNEL : cd $KERNEL_ROOT_DIR
- executer ./runSalome -g --modules=PYHELLO
Ca devrait marcher. La suite de l'exemple dans le document doit etre adaptée mais en regardant le source de runSalome.py dans PYHELLO, on doit s'en sortir.
-
Merci,ceci m'a permis de lancer Salome cliquez sur l'icone de Pyhello, creer une nouvelle etude mais lorsque je veux lancer l'IHM de Pyhello, J'ai une erreur.
voici les messages de la console :
[root@lea salome]# cd $KERNEL_ROOT_DIR
[root@lea KERNEL_2.2.2]# cd bin/salome/
[root@lea salome]# ./runSalome -g --module=PYHELLO
Searching for a free port for naming service: 2810 2811 2812 - Ok
source= ['-g', '--module', 'PYHELLO']
opts= {'m': ['PYHELLO'], 'g': []}
args= {u'portkill': 1, 'file': 0, u'killall': 0, 'embedded': [u'registry', u'study', u'moduleCatalog', u'cppContainer'], 'standalone': [u'pyContainer', u'supervContainer'], 'appname': 'salome', 'modules': ['PYHELLO'], u'gui': 1, u'xterm': 0, 'SMESH_plugins': [u'NETGENPlugin', u'GHS3DPlugin'], 'key': [], u'logger': 0, 'interp': 0, 'port': 2812, 'containers': []}
le fichier /tmp/root_2812_SALOME_pidict des process SALOME n'est pas accessible
startSalome {u'portkill': 1, 'file': 0, u'killall': 0, 'embedded': [u'registry', u'study', u'moduleCatalog', u'cppContainer'], 'standalone': [u'pyContainer', u'supervContainer'], 'appname': 'salome', 'modules': ['PYHELLO'], u'gui': 1, u'xterm': 0, 'SMESH_plugins': [u'NETGENPlugin', u'GHS3DPlugin'], 'key': [], u'logger': 0, 'interp': 0, 'port': 2812, 'containers': []}
['SALOME_Session_Loader', 'CPP', 'PY', 'SUPERV', 'GUI']
Lancement du Naming Service runNS.sh > /tmp/logs/root/salomeNS.log 2>&1
Searching Naming Service found in 0.0 seconds
Notify Server to launch
KERNELCatalog.xml
PYHELLOCatalog.xml
KERNELCatalog.xml
PYHELLOCatalog.xml
Searching /Kernel/Session in Naming Service ++This is the end of document
th. 1129073472 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : Registry (object) not found
++th. 1129073472 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : Registry (object) not found
++th. 1129073472 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : Registry (object) not found
++th. 1129073472 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : Registry (object) not found
+th. 1164294144 - Trace ../../../KERNEL_SRC/src/Session/SALOME_Session_Server.cxx [123] : pman->activate()
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[269] : Registry thread started
th. 1206287040 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : Registry (object) not found
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[179] : ModuleCatalog thread started
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[224] : SALOMEDS thread started
th. 1206287040 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [463] : This context was'nt created, it's now done
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[333] : Container thread started
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[345] : factory_poa does not exists, create...
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Container/Container_i.cxx [298] : 1206287040SigIntHandler activated
+th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx [444] : Session thread started
th. 1206287040 - Trace ../../../KERNEL_SRC/src/Session/Session_ServerThread.cxx
[449] : poa->activate_object(mySALOME_Session)
found in 5.0 seconds
Searching /Containers/lea/FactoryServerPy in Naming Service ++- Trace :
['/root/salome/KERNEL_2.2.2/bin/salome/SALOME_ContainerPy.py', 'FactoryServerPy']
- Trace :
SALOME_ContainerPy_i::__init__
- Trace :
/Containers/lea/FactoryServerPy
- Trace :
SALOME_NamingServicePy_i::Register
- Trace :
SALOME_ContainerPy_i::ping
found in 1.0 seconds
Searching /Containers/lea/SuperVisionContainer in Naming Service +th. 1129073472 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] :
Resolve() : SuperVisionContainer (object) not found
'import site' failed; use -v for traceback
th. 1091109280 COMPILED with ../../../KERNEL_SRC/src/Container/SALOME_Container.cxx [66] : g++, Mar 29 2005 at 13:33:05
th. 1091109280 - Trace ../../../KERNEL_SRC/src/Container/Container_i.cxx [298] : 1091109280SigIntHandler activated
found in 0.5 seconds
Start SALOME, elapsed time : 7.8 seconds
additional external python interpreters: 0
Saving of the dictionary of Salome processes in /tmp/root_2812_SALOME_pidict To kill SALOME processes from a console (kill all sessions from all ports):
python killSalome.py
To kill SALOME from the present interpreter, if it is not closed :
killLocalPort() --> kill this session
(use CORBA port from args of runSalome)
givenPortKill(port) --> kill a specific session with given CORBA port
killAllPorts() --> kill all sessions
runSalome, with --killall option, starts with killing
the processes resulting from the previous execution.
--- registered objects tree in Naming Service ---
ContainerManager.object
ChannelFactory.ChannelFactory
EventChannel.EventChannel
Registry.object
Kernel.dir
ModulCatalog.object
Session.object
Study.dir
myStudyManager.object
Containers.dir
lea.dir
FactoryServer.object
FactoryServerPy.object
SuperVisionContainer.object
>>> th. 1090066112 - Trace ../../../KERNEL_SRC/src/Loader/SALOME_Session_Loader.cxx [75] : Corba initialisation, Distant server
th. 1164294144 - Trace ../../../KERNEL_SRC/src/Session/SALOME_Session_Server.cxx [146] : Session activated, Launch IAPP...
th. 1164294144 - Trace ../../../KERNEL_SRC/src/Session/SALOME_Session_Server.cxx [152] : creation QApplication
th. 1164294144 - Trace ../../../KERNEL_SRC/src/Session/SALOME_Session_Server.cxx [157] : creation SALOMEGUI_Application
'import site' failed; use -v for traceback
Xlib: extension "XFree86-DRI" missing on display ":0.0".
th. 1164294144 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : FactoryServer (dir) not found
th. 1164294144 - Trace ../../../KERNEL_SRC/src/Container/Container_i.cxx [186] : Can't load shared library : libPYHELLOEngine.so
th. 1164294144 - Trace ../../../KERNEL_SRC/src/Container/Container_i.cxx [187] : error dlopen: libPYHELLOEngine.so: Ne peut ouvrir le fichier d'objet partagé: Aucun fichier ou répertoire de ce type
th. 1164294144 - Trace ../../../KERNEL_SRC/src/NamingService/SALOME_NamingService.cxx [337] : Resolve() : FactoryServerPy (dir) not found
- Trace :
SALOME_ContainerPy_i::load_impl PYHELLO libPYHELLOEngine.so
- Trace :
SALOME_ContainerPy_i::load_impl :import PYHELLO
comp_i = PYHELLO.PYHELLO(self._orb, self._poa, self._this(), self._containerName, instanceName, interfaceName)
PYHELLO.__init__: FactoryServerPy PYHELLO_inst_1
- Trace :
SALOME_ComponentPy_i::__init__ FactoryServerPy PYHELLO_inst_1 PYHELLO
'import site' failed; use -v for traceback
- Trace :
SALOME_ComponentPy_i Register/Containers/lea/FactoryServerPy/PYHELLO
- Trace :
SALOME_NamingServicePy_i::Register
- Trace :
IOR:010000001a00000049444c3a456e67696e65732f436f6e7461696e65723a312e3000000001000000000000002a000000010100000c0000003139322e3136382e302e3200148434bb0e000000feab7c0c43000010e70000000000
----------------------------------------------------------
no user defined launcher, ssh used. (see Launchers.py)
----------------------------------------------------------
- Trace :
LifeCycleCORBA::__init__
- Trace :
[]
- Trace :
/Containers.dir Context already exists
- Trace :
ContainerManager.object exists but is not a ContainerManager
looking for studyManager ...
studyManager found
getActiveStudy
---in gui
myStudyId 1
Traceback (most recent call last):
File "import_hook.py", line 83, in import_hook
module= original_import(name, globals, locals, fromlist)
File "/root/salome/PYHELLO1/bin/salome/PYHELLOGUI.py", line 17, in ?
pyhello=lifecycle.FindOrLoadComponent("FactoryServerPy", "PYHELLO"
File "/root/salome/KERNEL_2.2.2/bin/salome/LifeCycleCORBA.py", line 261, in FindOrLoadComponent
comp=self.FindComponent(containerName,componentName,listOfMachine)
File "/root/salome/KERNEL_2.2.2/bin/salome/LifeCycleCORBA.py", line 163, in FindComponent
bestMachine=self._contManager.FindBest(machinesOK)
AttributeError: 'NoneType' object has no attribute 'FindBest'
SystemError: null argument to internal routine
AttributeError: setSettings
AttributeError: OnGUIEvent
J'aimerai savoir si la trace suivante est normale :
- Trace :
ContainerManager.object exists but is not a ContainerManager
J'ai l'impression qu'il n'arrive pas à faire le _narrow parce que l'objet n'est pas du type attendu mais pourquoi ?
-
dacquignie wrote:
Merci,ceci m'a permis de lancer Salome cliquez sur l'icone de Pyhello, creer une nouvelle etude mais lorsque je veux lancer l'IHM de Pyhello, J'ai une erreur.
'import site' failed; use -v for traceback
Ce message d'erreur n'est pas bon signe. En général, on l'obtient quand on utilise
deux versions différentes de Python : une pour la construction de Salome et une
pour l'execution.
Pouvez vous verifier que vous utilisez la meme installation de Python
dans les 2 cas ?
-
La version installée sur ma machine est la 2.2.2.
L'installation de salome et la construction de PYHELLO s'est faite avec cette version.
Mais par contre je n'ai pas tout recompilé à l'installation j'ai récuprére les binaires des différents modules qui d'apres ce j'ai compris ont été compilés avec la 2.2.1.
Je viens donc de recommencer l'installation de salome avec python 2.2.1 et continuer la suite ....
Merci pour l'information Aurore-
-
Hi,
this is my experience with PYHELLO. I use Salome 2.2.8 on SUSE 9.1.
1 - convert to csh shell
2 - from the "my_kernel_root_dir" source salome.csh
3 - from the "my_kernel_root_dir" setend KERNEL_ROOT_DIR="my_kernel_root_dir"
4 - from the "my_kernel_root_dir" setend PYHELLO_ROOT_DIR="my_pyhello_root_dir"
5 - from the "my_kernel_root_dir"+/bin/slaome ./runSalome -g --modules=PYHELLO
It seams working
My bests
Edmondo
-
-
-
-
-
-
Powered by
Ploneboard

