From: ribes Date: Fri, 27 Feb 2009 14:18:24 +0000 (+0000) Subject: - mergefrom V5_1_1a1 X-Git-Tag: new_launcher_alpha_091119~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f6d1d3de4d2758478333d9c95bf81ae87d4a01c;p=modules%2Fkernel.git - mergefrom V5_1_1a1 --- diff --git a/bin/appli_gen.py b/bin/appli_gen.py index c57f4c25d..e6d035518 100644 --- a/bin/appli_gen.py +++ b/bin/appli_gen.py @@ -20,9 +20,9 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -"""Create a virtual Salome installation - -""" +## \file appli_gen.py +# Create a %SALOME application (virtual Salome installation) +# usage="""usage: %prog [options] Typical use is: python appli_gen.py diff --git a/bin/killSalome.py b/bin/killSalome.py index 582152ceb..381f3f710 100755 --- a/bin/killSalome.py +++ b/bin/killSalome.py @@ -20,6 +20,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file killSalome.py +# Stop all %SALOME servers from all sessions by killing them +# + import os, sys, re, signal from killSalomeWithPort import killMyPort, getPiDict diff --git a/bin/killSalomeWithPort.py b/bin/killSalomeWithPort.py index 4403a8bc2..fcdea4ec4 100755 --- a/bin/killSalomeWithPort.py +++ b/bin/killSalomeWithPort.py @@ -20,6 +20,14 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file killSalomeWithPort.py +# Stop all %SALOME servers from given sessions by killing them +# +# The sessions are indicated by their ports on the command line as in : +# +# killSalomeWithPort.py 2811 2815 +# + import os, sys, pickle, signal, commands,glob from launchConfigureParser import verbose import Utils_Identity diff --git a/bin/nameserver.py b/bin/nameserver.py index 329310fba..46986f897 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -95,7 +95,7 @@ class NamingServer(Server): #print "port=", aPort if sys.platform == "win32": #print "start omniNames -start " + aPort + " -logdir " + upath - self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"', ' -errlog', upath+'/omniNameErrors.log'] + self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"', ' -errlog', '\"' + upath+'/omniNameErrors.log' + '\"'] #os.system("start omniNames -start " + aPort + " -logdir " + upath) else: #self.CMD=['omniNames -start ' , aPort , ' -logdir ' , upath , ' &'] diff --git a/bin/orbmodule.py b/bin/orbmodule.py index ae4744432..d9aa08d7a 100755 --- a/bin/orbmodule.py +++ b/bin/orbmodule.py @@ -19,6 +19,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## @package orbmodule +# \brief Module that provides a client for %SALOME +# +# + import sys,os,time import string from nameserver import * @@ -32,6 +37,7 @@ import CosNaming # ----------------------------------------------------------------------------- class client: + """Client for SALOME""" def __init__(self,args=None): #set GIOP message size for bug 10560: impossible to get field values in TUI mode @@ -93,7 +99,7 @@ class client: # -------------------------------------------------------------------------- def showNS(self): - """ Show the content of NS""" + """ Show the content of SALOME naming service """ self.showNScontext(self.rootContext) # -------------------------------------------------------------------------- diff --git a/bin/runSalome.py b/bin/runSalome.py index fe97b68ff..bf9cfc5fe 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -20,6 +20,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## @package runSalome +# \brief Module that provides services to launch SALOME +# +# + import sys, os, string, glob, time, pickle, re import orbmodule import setenv diff --git a/bin/salome_session.py b/bin/salome_session.py index 9c648214d..be227c89f 100644 --- a/bin/salome_session.py +++ b/bin/salome_session.py @@ -19,6 +19,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## @package salome_session +# \brief Module that provides the SalomeSession object that helps to launch +# a SALOME script session +# +# + import os import sys import string @@ -99,6 +105,7 @@ def searchFreePort(): class SalomeSession(object): + """Salome session launcher""" import runSalome import killSalomeWithPort import killSalome diff --git a/bin/salome_utils.py b/bin/salome_utils.py index ab9c0669c..cf22daf17 100644 --- a/bin/salome_utils.py +++ b/bin/salome_utils.py @@ -24,9 +24,10 @@ # Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) # --- # -""" -Set of utility functions used by SALOME python scripts. -""" +## @package salome_utils +# \brief Set of utility functions used by SALOME python scripts. +# +# # # Exported functions diff --git a/bin/showNS.py b/bin/showNS.py index 48783acd8..7f4a0ba01 100755 --- a/bin/showNS.py +++ b/bin/showNS.py @@ -20,6 +20,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file showNS.py +# \brief display the contents of %SALOME naming service +# + import orbmodule clt=orbmodule.client() diff --git a/bin/shutdownSalome.py b/bin/shutdownSalome.py index f4d54ea9c..3746788e9 100755 --- a/bin/shutdownSalome.py +++ b/bin/shutdownSalome.py @@ -20,6 +20,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file shutdownSalome.py +# shutdown all %SALOME servers and naming service +# +# + import time import salome salome.salome_init() diff --git a/bin/waitContainers.py b/bin/waitContainers.py index dd8ba9b3b..ebc94e097 100755 --- a/bin/waitContainers.py +++ b/bin/waitContainers.py @@ -20,6 +20,12 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file waitContainers.py +# \brief command to wait until containers are launched +# +# the container names (in naming service) are passed on the command line as in : +# waitContainers.py FactoryServer + import sys import time import orbmodule diff --git a/bin/waitNS.py b/bin/waitNS.py index 03ea33f23..576df3c79 100755 --- a/bin/waitNS.py +++ b/bin/waitNS.py @@ -20,6 +20,9 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## \file waitNS.py +# \brief command to wait until module catalog server is launched +# import orbmodule clt=orbmodule.client() clt.waitNS("/Kernel/ModulCatalog") diff --git a/configure.ac b/configure.ac index 740153160..844d28f58 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ # ================================================================ #AC_PREREQ(2.59) # -AC_INIT([Salome2 Project], [5.1.0], [paul.rascle@edf.fr], [SalomeKERNEL]) +AC_INIT([Salome2 Project], [5.1.1], [paul.rascle@edf.fr], [SalomeKERNEL]) # AC_CONFIG_AUX_DIR defines an alternative directory where to find the auxiliary # scripts such as config.guess, install-sh, ... @@ -89,8 +89,8 @@ AM_CONDITIONAL(CORBA_GEN, test x$corba_gen = xtrue) # ---- option to build only launcher, resources manager and batch classes AC_ARG_WITH(onlylauncher, --with-onlylauncher, - WITHONLYLAUNCHER="yes",WITHONLYLAUNCHER="no") -AM_CONDITIONAL(WITHONLYLAUNCHER, test x$WITHONLYLAUNCHER = xyes) + [],[with_onlylauncher="no"]) +AM_CONDITIONAL(WITHONLYLAUNCHER, test x$with_onlylauncher = xyes) # ---------------------------------------------------------------------------- @@ -206,7 +206,7 @@ echo CHECK_LIBXML -if test x$WITHONLYLAUNCHER = xno; then +if test x$with_onlylauncher = xno; then echo echo --------------------------------------------- echo testing HDF5 @@ -439,7 +439,7 @@ function check_fatal_error { # -------------------------------------- -if test x$WITHONLYLAUNCHER = xno; then +if test x$with_onlylauncher = xno; then if test x$corba_gen = xtrue; then basic_mandatory_products="cc_ok threads_ok python_ok swig_ok hdf5_ok libxml_ok" else @@ -454,7 +454,7 @@ summary $basic_mandatory_products check_fatal_error $basic_mandatory_products echo -if test x$WITHONLYLAUNCHER = xno; then +if test x$with_onlylauncher = xno; then corba_mandatory_products="omniORB_ok omniORBpy_ok boost_ok" if test x$corba_gen = xtrue; then echo --- CORBA mandatory products - default configuration: @@ -491,7 +491,7 @@ echo --- Html documentation products: only required for doc production summary $htmldoc_products echo -if test x$WITHONLYLAUNCHER = xno; then +if test x$with_onlylauncher = xno; then echo echo "Default ORB : $DEFAULT_ORB" echo @@ -537,9 +537,9 @@ AC_OUTPUT([ \ ./doc/Makefile \ ./doc/salome/Makefile \ ./doc/salome/tui/Makefile \ - ./doc/salome/tui/INPUT/doxyuser:./doc/salome/tui/KERNEL/doxyuser.in \ - ./doc/salome/tui/INPUT/doxydev:./doc/salome/tui/KERNEL/doxydev.in \ - ./doc/salome/tui/INPUT/sources/static/tree.js:./doc/salome/tui/KERNEL/sources/static/tree.js.in \ + ./doc/salome/tui/doxyfile \ + ./doc/salome/gui/Makefile \ + ./doc/salome/gui/doxyfile \ ./idl/Makefile \ ./resources/Makefile \ ./resources/KERNELCatalog.xml \ diff --git a/doc/Makefile.am b/doc/Makefile.am index d8d42009a..8bc7565fa 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -28,31 +28,14 @@ include $(top_srcdir)/salome_adm/unix/make_common_starter.am SUBDIRS = salome -# if RST2HTML_IS_OK -# DOC_FILES = \ -# index.html \ -# UnitTests.html \ -# SALOME_Application.html \ -# INSTALL.html \ -# kernel_resources.html \ -# KERNEL_Services.html -# CSS_FILE = rst.css -# endif - -nodist_doc_DATA = $(DOC_FILES) - -EXTRA_DIST=$(DOC_FILES:%.html=%.txt) $(CSS_FILE) - -# Building html from restructured text files -STYLESHEET=$(CSS_FILE) -RST2HTML=@RST2HTML@ -RSTOPTS=--output-encoding=latin1 --stylesheet=$(STYLESHEET) - -%.html: %.txt - $(RST2HTML) $(RSTOPTS) $< $@ +docs: usr_docs usr_docs: (cd salome && $(MAKE) $(AM_MAKEFLAGS) usr_docs) dev_docs: (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs) + +dist-hook: + cp -Rp $(srcdir)/configuration_examples $(distdir) + rm -rf $(distdir)/configuration_examples/CVS diff --git a/doc/salome/Makefile.am b/doc/salome/Makefile.am index 81cbabb59..4d433e927 100644 --- a/doc/salome/Makefile.am +++ b/doc/salome/Makefile.am @@ -26,38 +26,17 @@ # include $(top_srcdir)/salome_adm/unix/make_common_starter.am -SUBDIRS= tui -SUBDIRSGUI= tui -SUBDIRSTUI= tui +SUBDIRS= tui gui -index_html: - $(INSTALL) -d $(DESTDIR)$(docdir); +docs:usr_docs -usr_docs: index_html - list='$(SUBDIRSGUI)'; for subdir in $$list; do \ - echo "Making usr_docs in $$subdir"; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) usr_docs) \ - done; +usr_docs: + echo "Making usr_docs in gui"; \ + (cd gui && $(MAKE) $(AM_MAKEFLAGS) usr_docs) -dev_docs: index_html - list='$(SUBDIRSTUI)'; for subdir in $$list; do \ - echo "Making dev_docs in $$subdir"; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) dev_docs) \ - done; - - -# VSR: nullify these make targets to avoid 'make distcheck' failure -dvi: -pdf: -ps: - -info_TEXINFOS = Batch.texi - -install-data-local: html usr_docs - cp -rp $(top_builddir)/doc/salome/Batch.html $(DESTDIR)$(docdir) - -uninstall-local: - rm -rf $(DESTDIR)$(docdir)/Batch.html +dev_docs: + echo "Making dev_docs in tui"; \ + (cd tui && $(MAKE) $(AM_MAKEFLAGS) dev_docs) EXTRA_DIST= main.dox install.dox \ kernel_resources.dox kernel_services.dox \ diff --git a/doc/salome/examples/example1 b/doc/salome/examples/example1 new file mode 100644 index 000000000..eae882cae --- /dev/null +++ b/doc/salome/examples/example1 @@ -0,0 +1,45 @@ + +# create AttributeReal +#================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeReal") +if A == None : + raise RuntimeError, "Can't create AttributeReal attribute" +A = A._narrow(SALOMEDS.AttributeReal) +A.SetValue(0.0001) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" + +# save / restore study +#================================= + +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +#file = "/tmp/ggg.hdf" + +print " ------- We will save to", file, "-----------" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file) + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeReal +#================================= + +res,A=father.FindAttribute("AttributeReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeReal" + +A = A._narrow(SALOMEDS.AttributeReal) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" diff --git a/doc/salome/examples/example10 b/doc/salome/examples/example10 new file mode 100644 index 000000000..756e4a3f1 --- /dev/null +++ b/doc/salome/examples/example10 @@ -0,0 +1,50 @@ + +# create AttributeExpandable +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute( batchmode_geompy.father, "AttributeExpandable") +if A == None : + raise RuntimeError, "Can't create AttributeExpandable attribute" +A = A._narrow(SALOMEDS.AttributeExpandable) + +if A == None : + raise RuntimeError, "Can't create AttributeExpandable attribute" + +A.SetExpandable(1) + +if A.IsExpandable() == 0: + "Error: wrong value of AttributeExpandable" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeExpandable +#============================================================ + +res,A=father.FindAttribute("AttributeExpandable") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeExpandable" + +A = A._narrow(SALOMEDS.AttributeExpandable) + +if A == None : + raise RuntimeError, "Can't create AttributeExpandable attribute" + +if A.IsExpandable() == 0: + "Error: wrong value of AttributeExpandable" + diff --git a/doc/salome/examples/example11 b/doc/salome/examples/example11 new file mode 100644 index 000000000..4cfd732fd --- /dev/null +++ b/doc/salome/examples/example11 @@ -0,0 +1,49 @@ + +# create AttributeOpened +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeOpened") +if A == None : + raise RuntimeError, "Can't create AttributeOpened attribute" +A = A._narrow(SALOMEDS.AttributeOpened) + +if A == None : + raise RuntimeError, "Can't create AttributeOpened attribute" + +A.SetOpened(1) + +if A.IsOpened() == 0: + "Error: wrong value of AttributeOpened" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeOpened +#============================================================ + +res,A=father.FindAttribute("AttributeOpened") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeOpened" + +A = A._narrow(SALOMEDS.AttributeOpened) + +if A == None : + raise RuntimeError, "Can't create AttributeOpened attribute" + +if A.IsOpened() == 0: + "Error: wrong value of AttributeOpened" diff --git a/doc/salome/examples/example12 b/doc/salome/examples/example12 new file mode 100644 index 000000000..760587736 --- /dev/null +++ b/doc/salome/examples/example12 @@ -0,0 +1,57 @@ + +#-------------------------------------------------------------------------- +# create AttributeTextColor +#=========================================================== +import SALOMEDS_Attributes_idl +color = SALOMEDS_Attributes_idl._0_SALOMEDS.Color(234,345,231) + +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTextColor") + +if A == None : + raise RuntimeError, "Can't create AttributeTextColor attribute" +A = A._narrow(SALOMEDS.AttributeTextColor) + +if A == None : + raise RuntimeError, "Can't create AttributeTextColor attribute" + +A.SetTextColor(color) + +c = A.TextColor(); + +if c.R != 234 or c.G != 345 or c.B != 231: + print "Error: wrong value of AttributeTextColor" + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeTextColor +#============================================================ + +res,A=father.FindAttribute("AttributeTextColor") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeTextColor" + +A = A._narrow(SALOMEDS.AttributeTextColor) + +if A == None : + raise RuntimeError, "Can't create AttributeTextColor attribute" + +c = A.TextColor(); +if c.R != 234 or c.G != 345 or c.B != 231: + print "Error: wrong value of AttributeTextColor" + diff --git a/doc/salome/examples/example13 b/doc/salome/examples/example13 new file mode 100644 index 000000000..c05aaff52 --- /dev/null +++ b/doc/salome/examples/example13 @@ -0,0 +1,60 @@ + +#-------------------------------------------------------------------------- +# create AttributeTextHighlightColor +#=========================================================== + +import SALOMEDS_Attributes_idl +highlightcolor=SALOMEDS_Attributes_idl._0_SALOMEDS.Color(256,256,256) + +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTextHighlightColor") + +if A == None : + raise RuntimeError, "Can't create AttributeTextHighlightColor attribute" +A = A._narrow(SALOMEDS.AttributeTextHighlightColor) + +if A == None : + raise RuntimeError, "Can't create AttributeTextHighlightColor attribute" + +A.SetTextHighlightColor(highlightcolor) + +c = A.TextHighlightColor(); +if c.R != 256 or c.G != 256 or c.B != 256: + print "Error: wrong value of AttributeTextHighlightColor" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeTextHighlightColor +#============================================================ + +res, A = father.FindAttribute("AttributeTextHighlightColor") +print res, A +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeTextHighlightColor" + +A = A._narrow(SALOMEDS.AttributeTextHighlightColor) + +if A == None : + raise RuntimeError, "Can't create AttributeTextHighlightColor attribute" + +c = A.TextHighlightColor(); + +if c.R != 256 or c.G != 256 or c.B != 256: + print "Error: wrong value of AttributeTextTextHighlightColor" + diff --git a/doc/salome/examples/example14 b/doc/salome/examples/example14 new file mode 100644 index 000000000..a0acf346d --- /dev/null +++ b/doc/salome/examples/example14 @@ -0,0 +1,47 @@ + +#-------------------------------------------------------------------------- +# create AttributePixMap +#=============================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributePixMap") +if A == None : + raise RuntimeError, "Can't create AttributePixMap attribute" +aPixmap = A._narrow(SALOMEDS.AttributePixMap); +aPixmap.SetPixMap( "ICON_OBJBROWSER_Geometry" ); + +if aPixmap.GetPixMap() != "ICON_OBJBROWSER_Geometry": + print "Error: wrong value of AttributePixMap" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributePixMap +#============================================================ + +res,A=father.FindAttribute("AttributePixMap") +if res == 0 or A == None: + raise RuntimeError, "Error: AttributePixMap not found " + +A = A._narrow(SALOMEDS.AttributePixMap) + +if A == None : + raise RuntimeError, "Can't create AttributePixMap attribute" + +if A.GetPixMap() != "ICON_OBJBROWSER_Geometry": + print "Error: wrong value of AttributePixMap" + diff --git a/doc/salome/examples/example15 b/doc/salome/examples/example15 new file mode 100644 index 000000000..42493fe01 --- /dev/null +++ b/doc/salome/examples/example15 @@ -0,0 +1,43 @@ + +# create AttributeLocalID +#================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeLocalID") +if A == None : + raise RuntimeError, "Can't create AttributeLocalID attribute" +A = A._narrow(SALOMEDS.AttributeLocalID) + +A.SetValue(763242882) + +if A.Value() != 763242882: + print "Error: wrong value of AttributeLocalID" + +# save / restore study +#================================= +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeLocalID +#================================= + +res,A=father.FindAttribute("AttributeLocalID") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeLocalID" + +A = A._narrow(SALOMEDS.AttributeLocalID) + +if A.Value() != 763242882: + print "Error: wrong value of AttributeLocalID" + diff --git a/doc/salome/examples/example16 b/doc/salome/examples/example16 new file mode 100644 index 000000000..3be50d9b6 --- /dev/null +++ b/doc/salome/examples/example16 @@ -0,0 +1,151 @@ + +dir= os.getenv("TmpDir") +if dir == None: + dir = "/tmp" + +batchmode_geompy.myBuilder._set_UndoLimit(20) + +# 1st transaction ----------------------------------------- +batchmode_geompy.myBuilder.NewCommand() +# create AttributeSequenceOfInteger +#========================================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeSequenceOfInteger") +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfInteger attribute" +A = A._narrow(SALOMEDS.AttributeSequenceOfInteger) +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfInteger attribute" + +A.Add(100) +A.Add(300) +A.Add(500) +A.Add(400) +A.Add(700) +print "First transaction goes on : HasOpenCommand() = ", batchmode_geompy.myBuilder.HasOpenCommand() +batchmode_geompy.myBuilder.CommitCommand() #-------------- + +# 2nd transaction ------------------------------------------ +batchmode_geompy.myBuilder.NewCommand() +A.Remove(3) +A.ChangeValue(4,500) +batchmode_geompy.myBuilder.CommitCommand() #-------------- + +if batchmode_geompy.myBuilder.GetAvailableUndos() == 0: + raise RuntimeError, "GetAvailableUndos() = 0 but must not !" + +if A.Length() != 4: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 400 or A.Value(4) != 500: + raise RuntimeError, "Wrong value of AttributeSequenceOfInteger" + +file1 = dir + "/test1.hdf" +batchmode_geompy.myStudyManager.SaveAs(file1, batchmode_geompy.myStudy) + +# 1st Undo --------------------------------------- +batchmode_geompy.myBuilder.Undo() +res, A = batchmode_geompy.myBuilder.FindAttribute(batchmode_geompy.father, "AttributeSequenceOfInteger") +if A is None: + raise RuntimeError, "After first 'undo' can't find AttributeSequenceOfInteger" +if A.Length() != 5: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 500 or A.Value(4) != 400 or A.Value(5) != 700: + print A.Value(1), A.Value(2), A.Value(3), A.Value(4), A.Value(5) + raise RuntimeError, "Wrong value of AttributeSequenceOfInteger after the first 'undo'!" +# save +file2 = dir + "/test2.hdf" +batchmode_geompy.myStudyManager.SaveAs(file2, batchmode_geompy.myStudy) +#------------------------------------------------- +# 2nd Undo --------------------------------------- +batchmode_geompy.myBuilder.Undo() +res, attr = batchmode_geompy.myBuilder.FindAttribute(batchmode_geompy.father, "AttributeSequenceOfInteger") +if res !=0 or attr != None : + raise RuntimeError, "After the second 'undo' AttributeSequenceOfInteger exists but must not!" +file3 = dir + "/test3.hdf" +batchmode_geompy.myStudyManager.SaveAs(file3, batchmode_geompy.myStudy) +#------------------------------------------------- + +#make redo twice --------------------------------- +if batchmode_geompy.myBuilder.GetAvailableRedos() == 0: + raise RuntimeError, "GetAvailableRedos() = 0 but must not !" +batchmode_geompy.myBuilder.Redo() +batchmode_geompy.myBuilder.Redo() +res, A = batchmode_geompy.myBuilder.FindAttribute(batchmode_geompy.father, "AttributeSequenceOfInteger") +if res ==0 or A== None : + raise RuntimeError, "AttributeSequenceOfInteger is not found but must be!" +if A.Length() != 4: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 400 or A.Value(4) != 500: + raise RuntimeError, "Wrong value of AttributeSequenceOfInteger" + + +#---------------------------------------------------------------------- +openedStudy=batchmode_geompy.myStudyManager.Open(file1); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSequenceOfInteger +#====================================== + +res,A=father.FindAttribute("AttributeSequenceOfInteger") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeSequenceOfInteger" + +A = A._narrow(SALOMEDS.AttributeSequenceOfInteger) + +if A.Length() != 4: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 400 or A.Value(4) != 500: + print "Wrong value of AttributeSequenceOfInteger" +#---------------------------------------------------------------------- +openedStudy=batchmode_geompy.myStudyManager.Open(file2); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSequenceOfInteger +#====================================== + +res,A=father.FindAttribute("AttributeSequenceOfInteger") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeSequenceOfInteger" + +A = A._narrow(SALOMEDS.AttributeSequenceOfInteger) + +if A.Length() != 5: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 500 or A.Value(4) != 400 or A.Value(5) != 700: + raise RuntimeError, "Wrong value of AttributeSequenceOfInteger after the first 'undo'!" + +#---------------------------------------------------------------------- +openedStudy=batchmode_geompy.myStudyManager.Open(file3); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSequenceOfInteger +#====================================== + +res,A=father.FindAttribute("AttributeSequenceOfInteger") + +if res!=0 or A != None: + raise RuntimeError, " AttributeSequenceOfInteger is found but must not!" + diff --git a/doc/salome/examples/example17 b/doc/salome/examples/example17 new file mode 100644 index 000000000..2c3e6b819 --- /dev/null +++ b/doc/salome/examples/example17 @@ -0,0 +1,154 @@ + +batchmode_geompy.myBuilder._set_UndoLimit(20) + +batchmode_geompy.myBuilder.NewCommand() +child = batchmode_geompy.myBuilder.NewObject(batchmode_geompy.father) +batchmode_geompy.myBuilder.CommitCommand() + +batchmode_geompy.myBuilder.NewCommand() +#========================================================== +# create AttributeSequenceOfReal +#========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeSequenceOfReal") +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfReal attribute" +A = A._narrow(SALOMEDS.AttributeSequenceOfReal) +if A == None : + raise RuntimeError, "_narrow returns None instead of AttributeSequenceOfReal pointer" + +A.Add(0.0293) +A.Add(522) +A.Add(98234) +A.Add(83.287) +batchmode_geompy.myBuilder.CommitCommand() + + +batchmode_geompy.myBuilder.NewCommand() +#========================================================== +# create AttributeInteger +#========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeInteger") +if A == None : + raise RuntimeError, "Can't create AttributeInteger attribute" +A = A._narrow(SALOMEDS.AttributeInteger) +A.SetValue(1000000) + +if A.Value() != 1000000: + raise RuntimeError, "Error : wrong value of AttributeInteger" + +batchmode_geompy.myBuilder.CommitCommand() + +batchmode_geompy.myBuilder.NewCommand() #=================== +# create AttributeName +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) + +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A.SetValue("AttributesTesting") + +if A.Value() != "AttributesTesting": + print "Wrong value of AttributeName" + +batchmode_geompy.myBuilder.CommitCommand() + +batchmode_geompy.myBuilder.NewCommand() #=================== +# create AttributeComment +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeComment") +if A == None : + raise RuntimeError, "Can't create AttributeComment attribute" +A = A._narrow(SALOMEDS.AttributeComment) + +if A == None : + raise RuntimeError, "Can't create AttributeComment attribute" + +A.SetValue("GEOM") + +batchmode_geompy.myBuilder.AbortCommand() + +batchmode_geompy.myBuilder.NewCommand() #=================== +# create AttributePersistentRef +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributePersistentRef") +if A == None : + raise RuntimeError, "Can't create AttributePersistentRef attribute" +A = A._narrow(SALOMEDS.AttributePersistentRef) + +if A == None : + raise RuntimeError, "Can't create AttributePersistentRef attribute" + +A.SetValue("/tmp/test;1") +batchmode_geompy.myBuilder.CommitCommand() + +batchmode_geompy.myBuilder.NewCommand() #=================================== +# create AttributeDrawable +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeDrawable") +if A == None : + raise RuntimeError, "Can't create AttributeDrawable attribute" +A = A._narrow(SALOMEDS.AttributeDrawable) + +if A == None : + raise RuntimeError, "Can't create AttributeDrawable attribute" + +A.SetDrawable(1) + +if A.IsDrawable() == 0: + "Error: wrong value of AttributeDrawable" +batchmode_geompy.myBuilder.CommitCommand() + + + +batchmode_geompy.myBuilder.NewCommand() #=================== +# create AttributeSelectable +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child, "AttributeSelectable") +if A == None : + raise RuntimeError, "Can't create AttributeSelectable attribute" +A = A._narrow(SALOMEDS.AttributeSelectable) + +if A == None : + raise RuntimeError, "Can't create AttributeSelectable attribute" + +A.SetSelectable(1) + +if A.IsSelectable() == 0: + "Error: wrong value of AttributeSelectable" +batchmode_geompy.myBuilder.CommitCommand() + + +batchmode_geompy.myBuilder.NewCommand() #=================== +#=========================================================== +batchmode_geompy.myBuilder.RemoveAttribute(child,"AttributeSelectable") +batchmode_geompy.myBuilder.CommitCommand() + +# Control the attributes +#=========================================================== + +res, A = batchmode_geompy.myBuilder.FindAttribute(child, "AttributeComment") +print "res = ", res +if A != None : + print " AttributeComment was found" +else: + print " AttributeComment is not found. It's correct" + +attributes=[] + +attributes = child.GetAllAttributes() + +length = len(attributes) + +print "Attributes number = ", length +print attributes +for i in range(0, length) : + attr = attributes[i] + if attr is None : + print i,"None item of object attributes list" + +if length != 5 : + raise RuntimeError, "Wrong number of attributes" + diff --git a/doc/salome/examples/example18 b/doc/salome/examples/example18 new file mode 100644 index 000000000..477f8b2b6 --- /dev/null +++ b/doc/salome/examples/example18 @@ -0,0 +1,163 @@ + +child1 = batchmode_geompy.myBuilder.NewObject(batchmode_geompy.father) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child1,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N1") +N1 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child1, "AttributeTreeNode") +if N1 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child2 = batchmode_geompy.myBuilder.NewObject(batchmode_geompy.father) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child2,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N2") +N2 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child2, "AttributeTreeNode") +if N2 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child3 = batchmode_geompy.myBuilder.NewObject(batchmode_geompy.father) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child3,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N3") +N3 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child3, "AttributeTreeNode") +if N3 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + + +child11 = batchmode_geompy.myBuilder.NewObject(child1) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child11,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N11") + +N11 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child11, "AttributeTreeNode") + +if N11 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child111 = batchmode_geompy.myBuilder.NewObject(child11) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child111, "AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N111") + +N111 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child111, "AttributeTreeNode") + +if N111 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + + +child31 = batchmode_geompy.myBuilder.NewObject(child3) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child31,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N31") + +N31 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child31, "AttributeTreeNode") +if N31 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child32 = batchmode_geompy.myBuilder.NewObject(child3) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child32,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N32") + +N32 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child32, "AttributeTreeNode") +if N32 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child321 = batchmode_geompy.myBuilder.NewObject(child32) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child321,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N321") + +N321 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child321, "AttributeTreeNode") +if N321 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child33 = batchmode_geompy.myBuilder.NewObject(child3) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child33,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N33") + +N33 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child33, "AttributeTreeNode") +if N33 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + +child34 = batchmode_geompy.myBuilder.NewObject(child3) +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(child34,"AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) +A.SetValue("N34") + +N34 = batchmode_geompy.myBuilder.FindOrCreateAttribute(child34, "AttributeTreeNode") +if N34 == None : + raise RuntimeError, "Can't create AttributeTreeNode attribute" + + + +#Create links between tree nodes. +# -| root +# --N1 __ +# | N11__ +# | N111 +# --N2 +# | +# --N3__ +# N31 +# N32__ +# N321 +# N33 +# N34 + +N11.SetFather(N1) +N11.Append(N111) +N3.SetPrevious(N1) +N3.Prepend(N2) + +N32.SetFather(N3) +N32.Prepend(N31) +N33.InsertAfter(N32) +N33.Append(N34) +print "------------- ", N1, " ------------- " +print "N1.Label() = ", N1.Label() , "IsRoot() = ", N1.IsRoot(), "Depth() = ", N1.Depth() +print "N11.Label() = ", N11.Label() , "IsRoot() = ", N11.IsRoot(), "Depth() = ", N11.Depth() +print "N111.Label() = ", N111.Label() , "IsRoot() = ", N111.IsRoot(), "Depth() = ", N111.Depth() +print "N2.Label() = ", N2.Label() , "IsRoot() = ", N2.IsRoot(), "Depth() = ", N2.Depth() +print "N3.Label() = ", N3.Label() , "IsRoot() = ", N3.IsRoot(), "Depth() = ", N3.Depth() +print "N31.Label() = ", N31.Label() , "IsRoot() = ", N31.IsRoot(), "Depth() = ", N31.Depth() +print "N32.Label() = ", N32.Label() , "IsRoot() = ", N32.IsRoot(), "Depth() = ", N32.Depth() +print "N321.Label() = ", N321.Label() , "IsRoot() = ", N321.IsRoot(), "Depth() = ", N321.Depth() +print "N33.Label() = ", N33.Label() , "IsRoot() = ", N33.IsRoot(), "Depth() = ", N33.Depth() +print "N34.Label() = ", N34.Label() , "IsRoot() = ", N34.IsRoot(), "Depth() = ", N34.Depth() +print "N1.IsRoot()=", N1.IsRoot() + +print "N1.HasNext() = ",N1.HasNext() +if N1.HasNext(): + print N1.Next().Label() + +print "N32.HasPrevious() = ",N32.HasPrevious() +if N32.HasPrevious(): + print N32.GetPrevious().Label() + +print "N111.HasFirst()=",N111.HasFirst() +print "N111.HasFather()=",N111.HasFather() +if N111.HasFather() : + print "N111.GetFather().Label()=",N111.GetFather().Label() + diff --git a/doc/salome/examples/example19 b/doc/salome/examples/example19 new file mode 100644 index 000000000..4cf37eb34 --- /dev/null +++ b/doc/salome/examples/example19 @@ -0,0 +1,540 @@ + +#====================================================================== +#1. Create Study and add some components to it +#====================================================================== + +#================================= +# create AttributeReal +#================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeReal") +if A == None : + raise RuntimeError, "Can't create AttributeReal attribute" +A = A._narrow(SALOMEDS.AttributeReal) +A.SetValue(0.0001) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" + +# === Geometry ================================================== + +import batchmode_geompy + +#=================================== +# define a box +#=================================== + +box = batchmode_geompy.MakeBox(0., 0., 0., 100., 200., 300.) +idbox = batchmode_geompy.addToStudy(box,"box") + + +geom = batchmode_geompy.geom +import SMESH +import batchmode_smesh +ShapeType = batchmode_smesh.ShapeType + +# ---- add first face of box in study + +subShapeList = batchmode_geompy.SubShapeAll(box,ShapeType["Face"]) +face=subShapeList[0] +name = "box_face" +print name +idface= batchmode_geompy.addToStudyInFather(box,face,name) + +# ---- add shell from box in study + +subShellList= batchmode_geompy.SubShapeAll(box,ShapeType["Shell"]) +shell = subShellList[0] +name = "box_shell" +print name +idshell= batchmode_geompy.addToStudyInFather(box,shell,name) + +# ---- add first edge of face in study + +edgeList = batchmode_geompy.SubShapeAll(face,ShapeType["Edge"]) +edge=edgeList[0]; +name = "face_edge" +print name +idedge= batchmode_geompy.addToStudyInFather(face,edge,name) + +# ---- launch SMESH, init a Mesh with the box + +smesh = batchmode_smesh.smesh +# -- Init -- +shape = batchmode_geompy.IDToObject(idbox) +mesh=smesh.Init(geom, batchmode_geompy.myStudyId, shape) + +orb = batchmode_geompy.orb + +idmesh = batchmode_smesh.AddNewMesh( orb.object_to_string(mesh) ) +batchmode_smesh.SetName(idmesh, "Meshbox"); +batchmode_smesh.SetShape(idbox, idmesh); + +# ---- create Hypothesis + +print "-------------------------- create Hypothesis ----------------------" +print "-------------------------- LocalLength" +hyp1 = smesh.CreateHypothesis("LocalLength", batchmode_geompy.myStudyId ) +hypLen1 = hyp1._narrow(SMESH.SMESH_LocalLength) +hypLen1.SetLength(100) +print hypLen1.GetName() +print hypLen1.GetId() +print hypLen1.GetLength() + +idlength = batchmode_smesh.AddNewHypothesis( orb.object_to_string(hypLen1) ); +batchmode_smesh.SetName(idlength, "Local_Length_100"); + +print "-------------------------- NumberOfSegments" +hyp2 = smesh.CreateHypothesis("NumberOfSegments", batchmode_geompy.myStudyId ) +hypNbSeg1=hyp2._narrow(SMESH.SMESH_NumberOfSegments) +hypNbSeg1.SetNumberOfSegments(7) +print hypNbSeg1.GetName() +print hypNbSeg1.GetId() +print hypNbSeg1.GetNumberOfSegments() + +idseg = batchmode_smesh.AddNewHypothesis( orb.object_to_string(hypNbSeg1) ); +batchmode_smesh.SetName(idseg, "NumberOfSegments_7"); + +print "-------------------------- MaxElementArea" +hyp3 = smesh.CreateHypothesis("MaxElementArea", batchmode_geompy.myStudyId) +hypArea1=hyp3._narrow(SMESH.SMESH_MaxElementArea) +hypArea1.SetMaxElementArea(2500) +print hypArea1.GetName() +print hypArea1.GetId() +print hypArea1.GetMaxElementArea() + +idarea1 = batchmode_smesh.AddNewHypothesis( orb.object_to_string(hypArea1) ); +batchmode_smesh.SetName(idarea1, "MaxElementArea_2500"); + +print "-------------------------- MaxElementArea" +hyp3 = smesh.CreateHypothesis("MaxElementArea", batchmode_geompy.myStudyId) +hypArea2 = hyp3._narrow(SMESH.SMESH_MaxElementArea) +hypArea2.SetMaxElementArea(500) +print hypArea2.GetName() +print hypArea2.GetId() +print hypArea2.GetMaxElementArea() + +idarea2 = batchmode_smesh.AddNewHypothesis( orb.object_to_string(hypArea2) ); +batchmode_smesh.SetName(idarea2, "MaxElementArea_500"); + +print "-------------------------- Regular_1D" +alg1 = smesh.CreateHypothesis("Regular_1D", batchmode_geompy.myStudyId) +algo1 = alg1._narrow(SMESH.SMESH_Algo) +listHyp = algo1.GetCompatibleHypothesis() +for hyp in listHyp: + print hyp +algoReg=alg1._narrow(SMESH.SMESH_Regular_1D) +print algoReg.GetName() +print algoReg.GetId() + +idreg = batchmode_smesh.AddNewAlgorithms( orb.object_to_string(algoReg) ); +batchmode_smesh.SetName(idreg, "Regular_1D"); + +print "-------------------------- MEFISTO_2D" +alg2 = smesh.CreateHypothesis("MEFISTO_2D", batchmode_geompy.myStudyId) +algo2 = alg2._narrow(SMESH.SMESH_Algo) +listHyp=algo2.GetCompatibleHypothesis() +for hyp in listHyp: + print hyp +algoMef=alg2._narrow(SMESH.SMESH_MEFISTO_2D) +print algoMef.GetName() +print algoMef.GetId() + +idmef = batchmode_smesh.AddNewAlgorithms( orb.object_to_string(algoMef) ); +batchmode_smesh.SetName(idmef, "MEFISTO_2D"); + + +# ---- add hypothesis to edge + +print "-------------------------- add hypothesis to edge" +edge = batchmode_geompy.IDToObject(idedge) +submesh = mesh.GetElementsOnShape(edge) +ret = mesh.AddHypothesis(edge,algoReg) +print ret +ret=mesh.AddHypothesis(edge,hypLen1) +print ret + +idsm1 = batchmode_smesh.AddSubMeshOnShape( idmesh, + idedge, + orb.object_to_string(submesh), + ShapeType["Edge"] ) +batchmode_smesh.SetName(idsm1, "SubMeshEdge") +batchmode_smesh.SetAlgorithms( idsm1, idreg ); +batchmode_smesh.SetHypothesis( idsm1, idlength ); + +print "-------------------------- add hypothesis to face" +face=batchmode_geompy.IDToObject(idface) +submesh=mesh.GetElementsOnShape(face) +ret=mesh.AddHypothesis(face,hypArea2) +print ret + +idsm2 = batchmode_smesh.AddSubMeshOnShape( idmesh, + idface, + orb.object_to_string(submesh), + ShapeType["Face"] ) +batchmode_smesh.SetName(idsm2, "SubMeshFace") +batchmode_smesh.SetHypothesis( idsm2, idarea2 ); + +# ---- add hypothesis to box + +print "-------------------------- add hypothesis to box" +box=batchmode_geompy.IDToObject(idbox) +submesh=mesh.GetElementsOnShape(box) +ret=mesh.AddHypothesis(box,algoReg) +print ret +ret=mesh.AddHypothesis(box,hypNbSeg1) +print ret +ret=mesh.AddHypothesis(box,algoMef) +print ret +ret=mesh.AddHypothesis(box,hypArea1) +print ret + +batchmode_smesh.SetAlgorithms( idmesh, idreg ); +batchmode_smesh.SetHypothesis( idmesh, idseg ); +batchmode_smesh.SetAlgorithms( idmesh, idmef ); +batchmode_smesh.SetHypothesis( idmesh, idarea1 ); + +# ---- compute box + +print "-------------------------- compute box" +ret=smesh.Compute(mesh,box) +print ret +log=mesh.GetLog(0); # no erase trace +for linelog in log: + print linelog + + +#======================================================= +# add SuperVision component +#======================================================= + +from batchmode_SuperV import * +import os +dir= os.getenv("SUPERV_ROOT_DIR") +if dir == None: + raise RuntimeError, "SUPERV_ROOT_DIR is not defined" +xmlfile = dir +"/examples/GraphEssai.xml" +print "--------------\n"+xmlfile+"\n--------------\n" + +myGraph = Graph ( xmlfile ) + +# This DataFlow is "valid" : no loop, correct links between Nodes etc... +print myGraph.IsValid() + +# Get Nodes +myGraph.PrintNodes() +Add,Sub,Mul,Div = myGraph.Nodes() + +# Load Datas +Addx = Add.Input("x",3.) +Addy = Add.Input("y",4.5) +Subx = Sub.Input("x",1.5) + +# Get Output Port +Addz = Add.Port('z') +Subz = Sub.Port('z') +Mulz = Mul.Port('z') +Divz = Div.Port('z') + +# This DataFlow is "executable" : all pending Ports are defined with Datas +print myGraph.IsExecutable() + +# Starts only execution of that DataFlow and gets control immediatly +print myGraph.Run() + +# That DataFlow is running ==> 0 (false) +print myGraph.IsDone() + +# Events of execution : +aStatus,aNode,anEvent,aState = myGraph.Event() +while aStatus : + print aNode.Thread(),aNode.SubGraph(),aNode.Name(),anEvent,aState + aStatus,aNode,anEvent,aState = myGraph.Event() +print myGraph.IsDone() + +# Wait for Completion (but it is already done after event loop ...) +print "Done : ",myGraph.DoneW() + +# Get result +print "Result : ",Divz.ToString() + +# Intermediate results : +print "Intermediate Result Add\z : ",Addz.ToString() +print "Intermediate Result Sub\z : ",Subz.ToString() +print "Intermediate Result Mul\z : ",Mulz.ToString() + +print " " +#print "Type : print myGraph.IsDone()" +#print " If execution is finished ==> 1 (true)" +res=myGraph.IsDone() +if res != 1: + raise RuntimeError, "myGraph.Run() is not done" + +print " " +print "Type : print Divz.ToString()" +print " You will get the result" +Divz.ToString() + +print " " +print "Type : myGraph.PrintPorts()" +print " to see input and output values of the graph" +myGraph.PrintPorts() + +print " " +print "Type : Add.PrintPorts()" +Add.PrintPorts() + +print "Type : Sub.PrintPorts()" +Sub.PrintPorts() + +print "Type : Mul.PrintPorts()" +Mul.PrintPorts() + +print "Type : Div.PrintPorts()" +print " to see input and output values of nodes" +Div.PrintPorts() + +# Export will create newsupervisionexample.xml and the corresponding .py file +tmpdir=os.getenv("TmpDir") +if tmpdir is None: + tmpdir="/tmp" +file = tmpdir + "/newsupervisionexample" +print "--------------\n"+file+"\n--------------\n" +myGraph.Export(file) + +ior = batchmode_geompy.orb.object_to_string(myGraph.G) +addStudy(ior) + +GraphName = myGraph.Name() +print "Befor save ", +nodes = myGraph.Nodes() +length_bs = len(nodes) +print "ListOfNodes length = ", length_bs +names=[] +for node in nodes: + names.append(node.Name()) +print names + + +#================================= +# save / restore study +#================================= +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + + +#================================================== +#1. SaveAs +#================================================== +print " ------- We will save to", file, "-----------" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +batchmode_geompy.myStudyManager.Close(batchmode_geompy.myStudy) + +#rename the file and try to reread it again + +os.mkdir(str + "/test_dir") + +#2.================================================== +print " ------- We rename the file as " + str + "/test_dir/test_new.hdf" +os.rename(file, str+"/test_dir/test_new.hdf") + +#================================================== +#3. Open +#================================================== +print " ------- We try to open " + str + "/test_dir/test_new.hdf" + +try: + openedStudy=batchmode_geompy.myStudyManager.Open(str+"/test_dir/test_new.hdf") +except Exception: + raise RuntimeError, "Can't open saved study!" + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "GEOM component is not found! Wrong study is opened." + + +#================================= +# find AttributeReal +#================================= + +res,A=father.FindAttribute("AttributeReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeReal" + +A = A._narrow(SALOMEDS.AttributeReal) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" + +#================================================== +# find box +#================================================== +box = openedStudy.FindObject("box") +if box is None : + raise RuntimeError, "box was not found! Wrong study is opened." + +edge=openedStudy.FindObject("face_edge") +if edge is None : + raise RuntimeError, "face_edge was not found! Wrong study is opened." + + +father = openedStudy.FindComponent("MESH") +if father is None: + raise RuntimeError, "MESH component is not found! Wrong study is opened." + +hp=openedStudy.FindObject("Meshbox") +if hp is None: + raise RuntimeError, "Meshbox object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("Algorithms Definition") +if hp is None: + raise RuntimeError, "Algorithms Definition object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("MEFISTO_2D") +if hp is None: + raise RuntimeError, "MEFISTO_2D object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("Hypothesis Definition") +if hp is None: + raise RuntimeError, "Algoriths Definition was not found! Wrong study is opened." + +#================================================== +# Find Supervisor +#================================================== +father = openedStudy.FindComponent("SUPERV") +if father is None: + raise RuntimeError, "SUPERV component is not found! Wrong study is opened." + +SuperV = lcc.FindOrLoadComponent("SuperVisionContainer","Supervision") +Builder = openedStudy.NewBuilder() +Builder.LoadWith(father, SuperV) +import SALOMEDS + +aChildIterator = openedStudy.NewChildIterator(father) + +#while aChildIterator.More(): +anSObject = aChildIterator.Value() +#print "iterate: ", anSObject.GetID() +res, anAttr=anSObject.FindAttribute("AttributeIOR") +if res : + anAttr=anAttr._narrow(SALOMEDS.AttributeIOR) + ior = anAttr.Value() + Graph=SuperV.getGraph(ior) + ListOfNodes=Graph.Nodes() + length_as= len(ListOfNodes) + print "ListOfNodes length = ", length_as + if length_as != length_bs: + raise RuntimeErrror, "defferent length of nodes after study open" +#aChildIterator.Next() + +Names = [] +for node in ListOfNodes: + Names.append(node.Name()) +names.sort() +Names.sort() +if names != Names : + raise RuntimeError, "List of dataflow nodes after save differs from one befor save operation" + +#================================================== +#4. Save +#================================================== +batchmode_geompy.myStudyManager.Save(openedStudy) +batchmode_geompy.myStudyManager.Close(openedStudy) +#================================================== +#5. Open +#================================================== +try: + openedStudy = batchmode_geompy.myStudyManager.Open(str+"/test_dir/test_new.hdf") +except Exception: + raise RuntimeError, "Can't open saved study!" + + + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +#find AttributeReal +res,A=father.FindAttribute("AttributeReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeReal" + +A = A._narrow(SALOMEDS.AttributeReal) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" +#================================================== +# find box +#================================================== +box = openedStudy.FindObject("box") +if box is None : + raise RuntimeError, "box was not found! Wrong study is opened." + +edge=openedStudy.FindObject("face_edge") +if edge is None : + raise RuntimeError, "face_edge was not found! Wrong study is opened." + + +father = openedStudy.FindComponent("MESH") +if father is None: + raise RuntimeError, "MESH component is not found! Wrong study is opened." + +hp=openedStudy.FindObject("Meshbox") +if hp is None: + raise RuntimeError, "Meshbox object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("Algorithms Definition") +if hp is None: + raise RuntimeError, "Algorithms Definition object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("MEFISTO_2D") +if hp is None: + raise RuntimeError, "MEFISTO_2D object was not found! Wrong study is opened." + +hp = openedStudy.FindObject("Hypothesis Definition") +if hp is None: + raise RuntimeError, "Algoriths Definition was not found! Wrong study is opened." + +#================================================== +# Find Supervisor +#================================================== +father = openedStudy.FindComponent("SUPERV") +if father is None: + raise RuntimeError, "SUPERV component is not found! Wrong study is opened." + +SuperV = lcc.FindOrLoadComponent("SuperVisionContainer","Supervision") +Builder = openedStudy.NewBuilder() +Builder.LoadWith(father, SuperV) +import SALOMEDS + +aChildIterator = openedStudy.NewChildIterator(father) + +#while aChildIterator.More(): +anSObject = aChildIterator.Value() + +res, anAttr=anSObject.FindAttribute("AttributeIOR") +if res : + anAttr=anAttr._narrow(SALOMEDS.AttributeIOR) + ior = anAttr.Value() + Graph=SuperV.getGraph(ior) + ListOfNodes=Graph.Nodes() + length_as= len(ListOfNodes) + print "ListOfNodes length = ", length_as + if length_as != length_bs: + raise RuntimeErrror, "defferent length of nodes after study open" +#aChildIterator.Next() + +Names = [] +for node in ListOfNodes: + Names.append(node.Name()) +names.sort() +Names.sort() +if names != Names : + raise RuntimeError, "List of dataflow nodes after save differs from one befor save operation" + diff --git a/doc/salome/examples/example20 b/doc/salome/examples/example20 new file mode 100644 index 000000000..9326da115 --- /dev/null +++ b/doc/salome/examples/example20 @@ -0,0 +1,152 @@ + +batchmode_geompy.myBuilder._set_UndoLimit(20) + +#-------------------------------------------------------------------------- +# create AttributeReal +#=============================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeReal") +if A == None : + raise RuntimeError, "Can't create AttributeReal attribute" +A = A._narrow(SALOMEDS.AttributeReal) +A.SetValue(0.0001) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" + +# create AttributeStudyProperties +#================================================ +A = batchmode_geompy.myStudy.GetProperties() +if A == None : + raise RuntimeError, "Can't create AttributeStudyProperties attribute" +A = A._narrow(SALOMEDS.AttributeStudyProperties) + +batchmode_geompy.myBuilder.NewCommand(); +print "A.GetUserName()= ", A.GetUserName() +res,mm,hh,dd,mnth,yy=A.GetCreationDate() +print "A.GetCreationDate() = ", mm,hh,dd,mnth,yy +print "A.GetCreationMode() = ", A.GetCreationMode() +print "A.IsModified() = ", A.IsModified() +print "A.IsLocked() = ", A.IsLocked() +if A.IsLocked() == 0 : + A.SetUserName("tester"); print 'A.SetUserName("tester"), A.GetUserName() = ', A.GetUserName() + A.SetCreationDate(11,11,11,11,2002); print 'A.SetCreationDate(11,11,11,11,2002), A.GetCreationDate() =', A.GetCreationDate() + print "A.IsModified() = ", A.IsModified() +A.SetLocked(1) + +#check the transaction result +batchmode_geompy.myBuilder.CommitCommand() +if A.GetUserName() != "tester": + print 'Control after transaction close : A.GetUserName() = ', A.GetUserName() + raise RuntimeError, "Field 'UserName' was not modified but had to!" + +# try to make some changes wrapped by transaction +#================================================ +batchmode_geompy.myBuilder.NewCommand() +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeInteger") + +if A == None : + raise RuntimeError, "Can't create AttributeInteger attribute" +A = A._narrow(SALOMEDS.AttributeInteger) +A.SetValue(1000000) + +exception_was = None +try : batchmode_geompy.myBuilder.CommitCommand() +except Exception: exception_was = 1 + +if exception_was is None: + raise RuntimeError, "Study was locked for changes but CommitCommand did not generate an exception !" + +# save / restore study + +#================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +print " ------- We will save to", file, "-----------" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) + + +#--------------------------------------------------------------------------# +#--------------------------- Open file ------------------------------------# +#--------------------------------------------------------------------------# + +print" -------------- Open " + file + "-------------- " + +openedStudy = batchmode_geompy.myStudyManager.Open(file) +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +#1. find AttributeReal +#================================================ + +res,A=father.FindAttribute("AttributeReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeReal" + +A = A._narrow(SALOMEDS.AttributeReal) +if A.Value() != 0.0001: + raise RuntimeError, "Error : wrong value of AttributeReal" + + +#2. find AttributeStudyProperties +#================================================= +A=openedStudy.GetProperties() +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeStudyProperties" + +A = A._narrow(SALOMEDS.AttributeStudyProperties) +if A.IsLocked() == 0 : + raise RuntimeError, "Error : AttributeStudyProperties must have Locked flag but have no!" + +#get the builder +myBuilder = openedStudy.NewBuilder() + +#3. try to make some changes wrapped by transaction +#================================================== +exception_was = None +try : + myBuilder.NewCommand() + A = myBuilder.FindOrCreateAttribute(father, "AttributeInteger") + + if A == None : + raise RuntimeError, "Can't create AttributeInteger attribute" + A = A._narrow(SALOMEDS.AttributeInteger) + A.SetValue(1000000) + myBuilder.CommitCommand() +except Exception: exception_was = 1 + +if exception_was is None: + raise RuntimeError, "Study was locked for changes but CommitCommand did not generate an exception !" + + +myBuilder.NewCommand() +A=openedStudy.GetProperties() +A = A._narrow(SALOMEDS.AttributeStudyProperties) +A.SetLocked(0) +myBuilder.CommitCommand() + +#4. +myBuilder.NewCommand() +A.SetLocked(0); +print "A.GetUserName()= ", A.GetUserName() +print "A.GetCreationDate() = ", A.GetCreationDate() +print "A.GetCreationMode() = ", A.GetCreationMode() +print "A.IsModified() = ", A.IsModified() +myBuilder.CommitCommand() + +#5. +myBuilder.NewCommand() +A.SetUserName("tester1") +myBuilder.CommitCommand() +print "A.GetUserName()= ", A.GetUserName() + +#remove the document file +os.remove(file) + diff --git a/doc/salome/examples/example21 b/doc/salome/examples/example21 new file mode 100644 index 000000000..33526d956 --- /dev/null +++ b/doc/salome/examples/example21 @@ -0,0 +1,127 @@ + +# create AttributeReal +#======================================================================================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTableOfInteger") +if A == None : + raise RuntimeError, "Can't create AttributeTableOfInteger attribute" +A = A._narrow(SALOMEDS.AttributeTableOfInteger) +a=[1,2] + +b=[3,4] + +# 2x2 +# --- rows --- +A.AddRow(a) +A.AddRow(b) +a=[34,14] +A.SetRow(1,a) + +# 3x3 +# +b=[54,56] +A.AddRow(b) + +# --- columns --- +a=[76,25,12] + +A.AddColumn(a) +a=[836,3425,342] +A.SetColumn(3,a) + +# change attribute values +print "A.GetValue(2,2) = ", A.GetValue(2,2) +print "A.PutValue(2,2,625323)" +A.PutValue(625323,2,2) +print "A.GetValue(2,2) = ", A.GetValue(2,2) + +#set Titles + +A.SetTitle("TEST") + +A.SetRowTitle(1,"FR") +A.SetRowTitle(2,"SR") +A.SetRowTitle(3,"TR") + +A.SetColumnTitle(1,"FC") +A.SetColumnTitle(2,"SC") +A.SetColumnTitle(3,"TC") + + +#check the table +print "Common title : ",A.GetTitle() +print "Rows titles : ", A.GetRowTitles() +rnb = A.GetNbRows() +for i in range(1, rnb): + b=A.GetRow(i) + print b + +cnb = A.GetNbColumns() +print "Columns title : ", A.GetColumnTitles() +for i in range(1, cnb): + b=A.GetColumn(i) + print b + +# set titles +#titles=["11","12","13"] +#A.SetRowTitles(titles) +#titles=["21","22","23"] +#A.SetRowTitles(2,titles) +#titles=["31","32","33"] +#A.SetRowTitles(3,titles) + +#--------------------------------------------------------------------------# +# ----------------------- save the study ----------------------------------# +#--------------------------------------------------------------------------# +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +print " ------- We will save to", file, "-----------" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) + +#--------------------------------------------------------------------------# +#---------------------------- Open file -----------------------------------# +#--------------------------------------------------------------------------# + +print" -------------- Open " + file + "-------------- " + +openedStudy=batchmode_geompy.myStudyManager.Open(file) +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + +# --- check attribute --- + +res,A=father.FindAttribute("AttributeTableOfInteger") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeTableOfInteger" + +A = A._narrow(SALOMEDS.AttributeTableOfInteger) + +#check the table +print "Common title : ",A.GetTitle() +print "Rows titles : ", A.GetRowTitles() +rnb = A.GetNbRows() +for i in range(1, rnb): + b=A.GetRow(i) + print b + +cnb = A.GetNbColumns() +print "Columns title : ", A.GetColumnTitles() +for i in range(1, cnb): + b=A.GetColumn(i) + print b + +titles=["ff","ss","tt"] +A.SetRowTitles(titles) +print "Rows titles : ", A.GetRowTitles() + +titles=["ww","zz","cc"] +A.SetColumnTitles(titles) +print "Column titles : ", A.GetColumnTitles() + diff --git a/doc/salome/examples/example22 b/doc/salome/examples/example22 new file mode 100644 index 000000000..bba273be6 --- /dev/null +++ b/doc/salome/examples/example22 @@ -0,0 +1,128 @@ + +# create AttributeReal +#=============================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeTableOfReal") +if A == None : + raise RuntimeError, "Can't create AttributeTableOfReal attribute" +A = A._narrow(SALOMEDS.AttributeTableOfReal) +a=[1,2] + +b=[3,4] + +# 2x2 +# --- rows --- +A.AddRow(a) +A.AddRow(b) +a=[34,14] +A.SetRow(1,a) + +# 3x3 +# +b=[54,56] +A.AddRow(b) + +# --- columns --- +a=[76,25,12] + +A.AddColumn(a) +a=[836,3425,342] +A.SetColumn(3,a) + +# change attribute values +print "A.GetValue(2,2) = ", A.GetValue(2,2) +print "A.PutValue(2,2,625323)" +A.PutValue(625323,2,2) +print "A.GetValue(2,2) = ", A.GetValue(2,2) + +#set Titles + +A.SetTitle("TEST") + +A.SetRowTitle(1,"FR") +A.SetRowTitle(2,"SR") +A.SetRowTitle(3,"TR") + +A.SetColumnTitle(1,"FC") +A.SetColumnTitle(2,"SC") +A.SetColumnTitle(3,"TC") + + +#check the table +print "Common title : ",A.GetTitle() +print "Rows titles : ", A.GetRowTitles() +rnb = A.GetNbRows() + 1 +for i in range(1, rnb): + b=A.GetRow(i) + print b + +cnb = A.GetNbColumns() + 1 +print "Columns title : ", A.GetColumnTitles() +for i in range(1, cnb): + b=A.GetColumn(i) + print b + +# set titles +#titles=["11","12","13"] +#A.SetRowTitles(titles) +#titles=["21","22","23"] +#A.SetRowTitles(2,titles) +#titles=["31","32","33"] +#A.SetRowTitles(3,titles) + +#--------------------------------------------------------------------------# +#------------------------ save the study ----------------------------------# +#--------------------------------------------------------------------------# +import os +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +print " ------- We will save to", file, "-----------" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) + +#--------------------------------------------------------------------------# +#---------------------------- Open file -----------------------------------# +#--------------------------------------------------------------------------# + +print" -------------- Open " + file + "-------------- " + +openedStudy = batchmode_geompy.myStudyManager.Open(file) +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + +# --- check attribute --- + +res,A=father.FindAttribute("AttributeTableOfReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeTableOfReal" + +A = A._narrow(SALOMEDS.AttributeTableOfReal) + +#check the table +print "Common title : ",A.GetTitle() +print "Rows titles : ", A.GetRowTitles() +rnb = A.GetNbRows() + 1 +for i in range(1, rnb): + b=A.GetRow(i) + print b + +cnb = A.GetNbColumns() + 1 +print "Columns title : ", A.GetColumnTitles() +for i in range(1, cnb): + b=A.GetColumn(i) + print b + +titles=["ff","ss","tt"] +A.SetRowTitles(titles) +print "Rows titles : ", A.GetRowTitles() + +titles=["ww","zz","cc"] +A.SetColumnTitles(titles) +print "Column titles : ", A.GetColumnTitles() + diff --git a/doc/salome/examples/example23 b/doc/salome/examples/example23 new file mode 100644 index 000000000..da60ce0e9 --- /dev/null +++ b/doc/salome/examples/example23 @@ -0,0 +1,30 @@ + +import batchmode_salome +#import SALOMEDS + +aStudy = batchmode_salome.myStudy + +#Add new component 'User data' +aBuilder = aStudy.NewBuilder() +aComponent = aBuilder.NewComponent("User data") +anAttr = aBuilder.FindOrCreateAttribute(aComponent, "AttributeName") +anAttrName = anAttr._narrow(SALOMEDS.AttributeName) +anAttrName.SetValue("User data") + + +#Add a new case 'Case1' to the component 'User data' +aBuilder.AddDirectory("/User data/Case1") + +#Set a study context to '/User data/Case1' +aStudy.SetContext("/User data/Case1") + +#Print the current study context +print aStudy.GetContext() + +#Add a sub directory 'aSubCase' to 'Case1' (under the current context) +aBuilder.AddDirectory("aSubCase") + + +#Add a new case 'Case2' to component 'User data' +aBuilder.AddDirectory("/User data/Case2") + diff --git a/doc/salome/examples/example3 b/doc/salome/examples/example3 new file mode 100644 index 000000000..95e18e8e7 --- /dev/null +++ b/doc/salome/examples/example3 @@ -0,0 +1,60 @@ + +# create AttributeSequenceOfReal +#================================= +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeSequenceOfReal") +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfReal attribute" +A = A._narrow(SALOMEDS.AttributeSequenceOfReal) +if A == None : + raise RuntimeError, "_narrow returns None instead of AttributeSequenceOfReal pointer" + +A.Add(0.0293) +A.Add(625.1e+2) +A.Add(0.928e+100) +A.Add(83.287) + +print "initial values ",A.Value(1), A.Value(2), A.Value(3), A.Value(4) +A.Remove(3) +print "after remove ", A.Value(1), A.Value(2), A.Value(3) +A.ChangeValue(2,76.265) +print "after second item change", A.Value(1), A.Value(2), A.Value(3) + +if A.Length() != 3: + print "Error : wrong length of SequenceOfReal" +if A.Value(1) != 0.0293 or A.Value(2) != 76.265 or A.Value(3) != 83.287: + print "Error : wrong value of AttributeSequenceOfReal" + +# save / restore study +#================================= +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSequenceOfReal +#================================= + +res,A=father.FindAttribute("AttributeSequenceOfReal") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeSequenceOfReal" + +A = A._narrow(SALOMEDS.AttributeSequenceOfReal) + +if A.Length() != 3: + print "Error : wrong length of SequenceOfReal" +if A.Value(1) != 0.0293 or A.Value(2) != 76.265 or A.Value(3) != 83.287: + print "Error : wrong value of AttributeSequenceOfReal" +print "after restoring ", A.Value(1), A.Value(2), A.Value(3) + diff --git a/doc/salome/examples/example4 b/doc/salome/examples/example4 new file mode 100644 index 000000000..2dd1966db --- /dev/null +++ b/doc/salome/examples/example4 @@ -0,0 +1,58 @@ + +# create AttributeSequenceOfInteger +#========================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeSequenceOfInteger") +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfInteger attribute" +A = A._narrow(SALOMEDS.AttributeSequenceOfInteger) +if A == None : + raise RuntimeError, "Can't create AttributeSequenceOfInteger attribute" + +A.Add(100) +A.Add(300) +A.Add(500) +A.Add(400) +A.Add(700) + +A.Remove(3) +A.ChangeValue(4,500) + + +if A.Length() != 4: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 400 or A.Value(4) != 700: + print "Wrong value of AttributeSequenceOfInteger" + + +# save / restore study +#================================= +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSequenceOfInteger +#====================================== + +res,A=father.FindAttribute("AttributeSequenceOfInteger") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeSequenceOfInteger" + +A = A._narrow(SALOMEDS.AttributeSequenceOfInteger) + +if A.Length() != 4: + print "Wrong length of SequenceOfInteger" +if A.Value(1) != 100 or A.Value(2) != 300 or A.Value(3) != 400 or A.Value(4) != 700: + print "Wrong value of AttributeSequenceOfInteger" + diff --git a/doc/salome/examples/example5 b/doc/salome/examples/example5 new file mode 100644 index 000000000..59e3bc6a0 --- /dev/null +++ b/doc/salome/examples/example5 @@ -0,0 +1,50 @@ + +# create AttributeName +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeName") +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A = A._narrow(SALOMEDS.AttributeName) + +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" +A.SetValue("AttributesTesting") + +if A.Value() != "AttributesTesting": + print "Wrong value of AttributeName" + + +# save / restore study +#================================= +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeName +#====================================== + +res,A=father.FindAttribute("AttributeName") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeName" + +A = A._narrow(SALOMEDS.AttributeName) + +if A == None : + raise RuntimeError, "Can't create AttributeName attribute" + +if A.Value() != "AttributesTesting": + print "Wrong value of AttributeName" + diff --git a/doc/salome/examples/example6 b/doc/salome/examples/example6 new file mode 100644 index 000000000..71a5859e7 --- /dev/null +++ b/doc/salome/examples/example6 @@ -0,0 +1,47 @@ + +# create AttributeComment +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeComment") +if A == None : + raise RuntimeError, "Can't create AttributeComment attribute" +A = A._narrow(SALOMEDS.AttributeComment) + +if A == None : + raise RuntimeError, "Can't create AttributeComment attribute" + +A.SetValue("GEOM") + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeComment +#============================================================ + +res,A=father.FindAttribute("AttributeComment") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeComment" + +A = A._narrow(SALOMEDS.AttributeComment) + +if A == None : + raise RuntimeError, "Can't create AttributeComment attribute" + +if A.Value() != "GEOM": + "Error: wrong value of AttributeComment" + diff --git a/doc/salome/examples/example7 b/doc/salome/examples/example7 new file mode 100644 index 000000000..8ddf8bb2b --- /dev/null +++ b/doc/salome/examples/example7 @@ -0,0 +1,45 @@ + +# create AttributePersistentRef +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributePersistentRef") +if A == None : + raise RuntimeError, "Can't create AttributePersistentRef attribute" +A = A._narrow(SALOMEDS.AttributePersistentRef) + +if A == None : + raise RuntimeError, "Can't create AttributePersistentRef attribute" + +A.SetValue("/tmp/test;1") + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributePersistentRef +#============================================================ + +res,A=father.FindAttribute("AttributePersistentRef") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributePersistentRef" + +A = A._narrow(SALOMEDS.AttributePersistentRef) + +if A == None : + raise RuntimeError, "Can't create AttributePersistentRef attribute" + +if A.Value() != "/tmp/test;1": + "Error: wrong value of AttributePersistentRef" diff --git a/doc/salome/examples/example8 b/doc/salome/examples/example8 new file mode 100644 index 000000000..eadb13feb --- /dev/null +++ b/doc/salome/examples/example8 @@ -0,0 +1,54 @@ + +from batchmode_geompy import * +import os + +#-------------------------------------------------------------------------- +# create AttributeDrawable +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeDrawable") +if A == None : + raise RuntimeError, "Can't create AttributeDrawable attribute" +A = A._narrow(SALOMEDS.AttributeDrawable) + +if A == None : + raise RuntimeError, "Can't create AttributeDrawable attribute" + +A.SetDrawable(1) + +if A.IsDrawable() == 0: + "Error: wrong value of AttributeDrawable" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy=batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeDrawable +#============================================================ + +res,A=father.FindAttribute("AttributeDrawable") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeDrawable" + +A = A._narrow(SALOMEDS.AttributeDrawable) + +if A == None : + raise RuntimeError, "Can't create AttributeDrawable attribute" + +if A.IsDrawable() == 0: + "Error: wrong value of AttributeDrawable" + diff --git a/doc/salome/examples/example9 b/doc/salome/examples/example9 new file mode 100644 index 000000000..d29c9bab7 --- /dev/null +++ b/doc/salome/examples/example9 @@ -0,0 +1,50 @@ + +# create AttributeSelectable +#=========================================================== +A = batchmode_geompy.myBuilder.FindOrCreateAttribute(batchmode_geompy.father, "AttributeSelectable") +if A == None : + raise RuntimeError, "Can't create AttributeSelectable attribute" +A = A._narrow(SALOMEDS.AttributeSelectable) + +if A == None : + raise RuntimeError, "Can't create AttributeSelectable attribute" + +A.SetSelectable(1) + +if A.IsSelectable() == 0: + "Error: wrong value of AttributeSelectable" + + +# save / restore study +#============================================================ +str= os.getenv("TmpDir") +if str == None: + str = "/tmp" +file = str+"/test.hdf" + +batchmode_geompy.myStudyManager.SaveAs(file, batchmode_geompy.myStudy) +openedStudy = batchmode_geompy.myStudyManager.Open(file); + +if openedStudy == None: + raise RuntimeError, "Can't open saved study!" + +father = openedStudy.FindComponent("GEOM") +if father is None: + raise RuntimeError, "Geom component is not found! Wrong study is opened." + + +# find AttributeSelectable +#============================================================ + +res,A=father.FindAttribute("AttributeSelectable") +if res == 0 or A == None: + raise RuntimeError, "Error: not found AttributeSelectable" + +A = A._narrow(SALOMEDS.AttributeSelectable) + +if A == None : + raise RuntimeError, "Can't create AttributeSelectable attribute" + +if A.IsSelectable() == 0: + "Error: wrong value of AttributeSelectable" + diff --git a/doc/salome/gui/Makefile.am b/doc/salome/gui/Makefile.am new file mode 100644 index 000000000..6205e23b6 --- /dev/null +++ b/doc/salome/gui/Makefile.am @@ -0,0 +1,27 @@ +include $(top_srcdir)/salome_adm/unix/make_common_starter.am + +usr_docs: doxyfile ../Batch.html + echo "Running doxygen in directory: "`pwd`; \ + $(DOXYGEN) $< ; \ + cp -rf ../Batch.html KERNEL + +docs: usr_docs + +info_TEXINFOS = ../Batch.texi + +install-data-local: usr_docs + $(INSTALL) -d $(DESTDIR)$(docdir)/gui + cp -rp KERNEL $(DESTDIR)$(docdir)/gui + +uninstall-local: + rm -rf $(DESTDIR)$(docdir)/gui/KERNEL + +clean-local: + -rm -fr KERNEL log.txt + +dist-hook: + cp -Rp $(srcdir)/images $(distdir) ; \ + rm -rf $(distdir)/images/CVS ; \ + cp -Rp $(srcdir)/static $(distdir) ; \ + rm -rf $(distdir)/static/CVS + diff --git a/doc/salome/gui/doxyfile.in b/doc/salome/gui/doxyfile.in new file mode 100644 index 000000000..b81ddc6ed --- /dev/null +++ b/doc/salome/gui/doxyfile.in @@ -0,0 +1,252 @@ +# Doxyfile 1.4.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "SALOME v.@VERSION@" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = KERNEL +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = @top_builddir@ @top_srcdir@ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 5 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = YES +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 25 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = log.txt + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \ + @top_srcdir@/doc/salome \ + @top_srcdir@/bin \ + @top_srcdir@/idl \ + @top_srcdir@/src/Container \ + @top_srcdir@/src/LifeCycleCORBA \ + @top_srcdir@/src/NamingService \ + @top_srcdir@/src/Notification \ + @top_srcdir@/src/SALOMEDS/SALOME_DriverPy.py \ + @top_srcdir@/src/KERNEL_PY/salome.py \ + @top_srcdir@/src/KERNEL_PY/salome_iapp.py \ + @top_srcdir@/src/Utils \ + @top_srcdir@/src/DSC + +FILE_PATTERNS = *.dox *.idl *.hxx *.cxx *.py +RECURSIVE = YES +EXCLUDE = @top_srcdir@/doc/salome/batch.dox +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = @top_srcdir@/doc/salome/examples +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = @srcdir@/images +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +USE_HTAGS = NO +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 3 +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = . +HTML_FILE_EXTENSION = .html +HTML_HEADER = @srcdir@/static/header.html +HTML_FOOTER = @srcdir@/static/footer.html +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = YES +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DIRECTORY_GRAPH = NO +DOT_IMAGE_FORMAT = jpg +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1200 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = NO +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/doc/salome/gui/images/icon_about.png b/doc/salome/gui/images/icon_about.png new file mode 100755 index 000000000..bbbc7a931 Binary files /dev/null and b/doc/salome/gui/images/icon_about.png differ diff --git a/doc/salome/gui/static/footer.html b/doc/salome/gui/static/footer.html new file mode 100755 index 000000000..56d52a61a --- /dev/null +++ b/doc/salome/gui/static/footer.html @@ -0,0 +1,10 @@ + + + + + +
+
Copyright © 2003-2007 CEA, EDF
+
+ + diff --git a/doc/salome/gui/static/header.html b/doc/salome/gui/static/header.html new file mode 100755 index 000000000..bddc997ec --- /dev/null +++ b/doc/salome/gui/static/header.html @@ -0,0 +1,13 @@ + + + + + $title + + + +
+
+SALOME documentation central +
+
diff --git a/doc/salome/install.dox b/doc/salome/install.dox index 8090ff92f..f77b0a2e0 100644 --- a/doc/salome/install.dox +++ b/doc/salome/install.dox @@ -1,23 +1,20 @@ /*! \page INSTALL Installation instructions -NOT UP TO DATE %SALOME 4 -WORK in PROGRESS, INCOMPLETE DOCUMENT +NOT UP TO DATE AND INCOMPLETE DOCUMENT BUT CAN BE HELPFUL -You'll find here generic instructions for installing the SALOME2 platform. +You'll find here generic instructions for installing the SALOME platform. \section Summary -
    -
  1. \ref S1_install
  2. -
  3. \ref S2_install
  4. -
  5. \ref S3_install
  6. -
  7. \ref S4_install
  8. -
  9. \ref S5_install
  10. -
  11. \ref S6_install
  12. -
  13. \ref S7_install
  14. -
  15. \ref S8_install
  16. -
+-# \ref S1_install +-# \ref S2_install +-# \ref S3_install +-# \ref S4_install +-# \ref S5_install +-# \ref S6_install +-# \ref S7_install +-# \ref S8_install \section S1_install Quick Overview @@ -25,16 +22,16 @@ First of all, you have to check (or install if needed) the dependant software programs on your system. These programs are: - common development tools as gcc, automake, autoconf and libtools. -- third party softwares used in SALOME building or runtime process +- third party softwares used in %SALOME building or runtime process (python, OCC, VTK, ...) -Further details can be found in sections [2] and [3]. +Further details can be found in sections \ref S2_install and \ref S3_install. If the dependencies are installed on your system, then you have to set your shell environment to get access to the software components -(cf. [4]. "Preparing the shell environment"). +(cf. \ref S4_install). -The next step is to install the KERNEL (cf. [5] "Installing KERNEL"): +The next step is to install the KERNEL (cf. \ref S5_install): \code $ mkdir @@ -48,10 +45,10 @@ $ make install \endcode Then, the %SALOME components GEOM, MED, VISU, ... can be installed -with a similar procedure (cf. [6]). +with a similar procedure (cf. \ref S6_install). -Eventually, the platform ccodean be run by executing the shell script -runSalome (cf. [7]). Here, somme additionnal variables have to be set +Eventually, the platform can be run by executing the shell script +%runSalome (cf. \ref S7_install). Here, somme additionnal variables have to be set to describe the %SALOME runtime configuration (_ROOT_DIR, OMNIORB_CONFIG) @@ -122,7 +119,7 @@ Additionnal software may be installed for optional features: In the following, we assume that all the third-party softwares are installed in the same root directory, named /prerequis. -Then, your file system should probably look like:: +Then, your file system should probably look like: \code /prerequis/Python-2.2.2 @@ -133,7 +130,7 @@ Then, your file system should probably look like:: \section S4_install Preparing the shell environment -Some variables have to be set to get acces to third-party software +Some variables have to be set to get access to third-party software components (include files, executable, library, ...) during building process and runtime. @@ -157,7 +154,7 @@ $ source prerequis.sh We use here the notation to specify the source directory of the KERNEL component. The shell environment is supposed to have -been set (cf. 4). +been set (cf. \ref S4_install). Installing the KERNEL from a source package needs three directories: @@ -193,11 +190,11 @@ $ ./build_configure \endcode If it doesn't work, check your system automake tools as specified in - section [2]. + section \ref S2_install. STEP 3: configure the building process - go to the build directory and execute the configuration process:: + go to the build directory and execute the configuration process: \code $ cd @@ -207,7 +204,7 @@ $ /configure --prefix= Note that must be an absolute path. When the configure process is complete, check the status of - third-party softwares detection. You should have a status like:: + third-party softwares detection. You should have a status like: \code --------------------------------------------- @@ -250,7 +247,7 @@ installed (optional for most usages). STEP 4 : Building the binary files - Execute make in the directory:: + Execute make in the directory: \code $ make @@ -259,7 +256,7 @@ $ make STEP 5: Installing binary files, scripts and documentation - Execute install target in the directory:: + Execute install target in the directory: \code $ make install @@ -267,7 +264,7 @@ $ make install \section S6_install Installing the SALOME components -TInstalling a component is done by following the same +Installing a component is done by following the same instructions as given for the KERNEL, replacing KERNEL by (build_configure, configure, make, make install). @@ -277,7 +274,7 @@ You just have to be aware of the dependencies between components: - GEOM depends on KERNEL - SMESH depends on KERNEL, MED, GEOM - VISU depends on KERNEL, MED -- SUPERV depends on KERNEL +- YACS depends on KERNEL For example, installing the component SMESH needs the previous installation of the KERNEL component, and then the GEOM and MED components. @@ -294,23 +291,21 @@ building process of the SMESH component (STEP 3). \section S7_install Runtime -See SALOME_Application to define your own configuration of %SALOME and run it +See \ref SALOME_Application to define your own configuration of %SALOME and run it on one or several computers. This is the recommended way of configuration. The following explains the general principles. To run the %SALOME platform, the procedure is: -- set the shell environment to get acces to third-party softwares: - -\code +- set the shell environment to get access to third-party softwares: + \code $ source prerequis.sh -\endcode + \endcode - define the %SALOME configuration by setting the whole set of variables _ROOT_DIR. Here, you just have to set the - kernel and the components you need:: - + kernel and the components you need: \code $ export KERNEL_ROOT_DIR= $ export MED_ROOT_DIR= @@ -320,14 +315,12 @@ $ ... - define the CORBA configuration file by setting the variable OMNIORB_CONFIG. This variable must be set to a writable file path. The file may be arbitrary chosen and doesn't need to exist - before running. We suggest:: - + before running. We suggest: \code $ export OMNIORB_CONFIG=$HOME/.omniORB.cfg \endcode -- run the %SALOME platform by executing the script runSalome: - +- run the %SALOME platform by executing the script %runSalome: \code $KERNEL_ROOT_DIR/bin/salome/runSalome \endcode @@ -336,43 +329,39 @@ $KERNEL_ROOT_DIR/bin/salome/runSalome For convenience or customization, we suggest the following organisation: -- chose and create a root directory for the %SALOME platform, say +- choose and create a root directory for the %SALOME platform, say . - install the third-party softwares in a sub-directory "prerequis" - install the %SALOME components in a sub-directory "SALOME2" -- make personnal copies of the files prerequis.sh and runSalome in +- make personnal copies of the files prerequis.sh and %runSalome in : - \code $ cp /prerequis.sh /. $ cp /bin/salome/runSalome /. \endcode - Edit the file prerequis.sh and adjust it to your own configuration. -- define the SALOME2 configuration - +- define the SALOME2 configuration\n This step consists in setting the KERNEL_ROOT_DIR, the whole set of variables _ROOT_DIR you need, and the OMNIORB_CONFIG variable. - + \n We suggest to create a shell file envSalome.sh containing those settings. Then the configuration consists in loading envSalome.sh in the runtime shell: - -\code + \code $ source envSalome.sh -\endcode + \endcode - When installed with this file organisation, running %SALOME is done - with the following shell commands:: - + with the following shell commands: \code $ source /prerequis.sh $ source /envSalome.sh $ ./runSalome \endcode + */ diff --git a/doc/salome/kernel_resources.dox b/doc/salome/kernel_resources.dox index 6401e942b..1bcbead6f 100644 --- a/doc/salome/kernel_resources.dox +++ b/doc/salome/kernel_resources.dox @@ -1,12 +1,9 @@ /*! -\page kernel_resources SALOME Kernel resources for developer +\page kernel_resources Salome Kernel resources for developer -WORK in PROGRESS, INCOMPLETE DOCUMENT -\section S1_kernel_res Abstract - This document describes the development environment for C++ and Python. Makefiles generation and usage are introduced in another document: "using the %SALOME @@ -28,9 +25,7 @@ variables values and if necessary, to stop the execution at debug time, in order to validate all parts of code. -
    -
  1. -Two modes: debug and release +\subsection subsection21 Two modes: debug and release The goal of debug mode is to check as many features as possible during the early stages of the development @@ -49,9 +44,8 @@ end user is confronted to such a message, he may refer to a configuration documentation or send the message to the people in charge of %SALOME installation, or to the development team, following the kind of error. -
  2. -
  3. -C++ Macros for trace and debug + +\subsection subsection22 C++ Macros for trace and debug %SALOME provides C++ macros for trace and debug. These macros are in: @@ -62,11 +56,11 @@ KERNEL_SRC/src/SALOMELocalTrace/utilities.h This file must be included in C++ source. Some macros are activated only in debug mode, others are -always activated. To activate the debug mode, ``_DEBUG_`` +always activated. To activate the debug mode, _DEBUG_ must be defined, which is the case when %SALOME Makefiles are generated from configure, without -options. When ``_DEBUG_`` is undefined (release mode: -``configure --disable-debug --enable-production``), the +options. When _DEBUG_ is undefined (release mode: +configure --disable-debug --enable-production), the debug mode macros are defined empty (they do nothing). So, when switching from debug to release, it is possible (and recommended) to let the macro calls @@ -81,33 +75,23 @@ case of a multi machine configuration. Three informations are systematically added in front of the information displayed: - - the %thread number from which the message come from; - - the name of the source file in which the macros is set; - - the line number of the source file at which the macro is set. -
      -
    1. -Macros defined in debug and release modes -\n -INFOS_COMPILATION +\subsection subsection23 Macros defined in debug and release modes +- INFOS_COMPILATION\n The C++ macro INFOS_COMPILATION writes on the trace buffer pool informations about the compiling process: - - the name of the compiler : g++, KCC, CC, pgCC; - - the date and the time of the compiling processing process. - + . This macro INFOS_COMPILATION does not have any argument. Moreover, it is defined in both compiling - mode : _DEBUG_ and _RELEASE_. - + mode : _DEBUG_ and _RELEASE_.\n Example: - \code #include "utilities.h" int main(int argc , char **argv) @@ -115,17 +99,13 @@ int main(int argc , char **argv) INFOS_COMPILATION; ... } -INFOS(str) \endcode -\n -INFOS +- INFOS\n In both compiling mode _DEBUG_ and _RELEASE_, The C++ macro INFOS writes on the trace buffer pool %the string - which has been passed in argument by the user. - + which has been passed in argument by the user.\n Example: - \code #include "utilities.h" int main(int argc , char **argv) @@ -135,42 +115,33 @@ int main(int argc , char **argv) return 0; } \endcode - Displays: - \code main.cxx [5] : NORMAL END OF THE PROCESS \endcode -\n -INTERRUPTION(str) +- INTERRUPTION(str)\n In both compiling mode _DEBUG_ and _RELEASE_, The C++ macro INTERRUPTION writes on the trace buffer pool the %string, with a special ABORT type. When the %thread in charge of collecting messages finds this message, it terminates the application, after message treatment. -IMMEDIATE_ABORT(str) - +- IMMEDIATE_ABORT(str)\n In both compiling mode _DEBUG_ and _RELEASE_, The C++ macro IMMEDIATE_ABORT writes the message str immediately on standard error and exits the application. Remaining messages not treated by the message collector %thread are lost. -
    2. -
    3. -Macros defined only in debug mode -\n -MESSAGE(str) +\subsection subsection24 Macros defined only in debug mode +- MESSAGE(str)\n In _DEBUG_ compiling mode only, the C++ macro MESSAGE writes on the trace buffer pool the %string which has been passed in argument by the user. In _RELEASE_ - compiling mode, this macro is blank. - + compiling mode, this macro is blank.\n Example: - \code #include "utilities.h" #include @@ -189,25 +160,19 @@ int main(int argc , char **argv) } \endcode - Displays: - \code - Trace main.cxx [8] : Salome - Trace main.cxx [12] : Aster and CASTEM \endcode -\n -BEGIN_OF(func_name) - +- BEGIN_OF(func_name)\n In _DEBUG_ compiling mode, The C++ macro BEGIN_OF appends the %string "Begin of " to the one passed in argument by the user and displays the result on the trace buffer pool. In _RELEASE_ compiling mode, this - macro is blank. - + macro is blank.\n Example: - \code #include "utilities.h" int main(int argc , char **argv) @@ -216,23 +181,18 @@ int main(int argc , char **argv) return 0; } \endcode - Displays: - \code - Trace main.cxx [3] : Begin of a.out \endcode -\n -END_OF(func_name) +- END_OF(func_name)\n In _DEBUG_ compiling mode, The C++ macro END_OF appends the %string "Normal end of " to the one passed in argument by the user and displays the result on the trace buffer pool. In _RELEASE_ compiling mode, this - macro is blank. - + macro is blank.\n Example: - \code #include "utilities.h" int main(int argc , char **argv) @@ -241,22 +201,17 @@ int main(int argc , char **argv) return 0; } \endcode - Displays: - \code - Trace main.cxx [4] : Normal end of a.out \endcode -\n -SCRUTE(var) +- SCRUTE(var)\n In _DEBUG_ compiling mode, The C++ macro SCRUTE displays its argument which is an application variable followed by the value of the variable. In _RELEASE_ - compiling mode, this macro is blank. - + compiling mode, this macro is blank.\n Example: - \code #include "utilities.h" int main(int argc , char **argv) @@ -266,25 +221,20 @@ int main(int argc , char **argv) return 0; } \endcode - Displays: - \code - Trace main.cxx [5] : i=999 \endcode -\n -ASSERT(condition) +- ASSERT(condition)\n In _DEBUG_ compiling mode only, The C++ macro ASSERT checks the expression passed in argument to be not NULL. If it is NULL the condition is written with the macro INTERRUPTION (see above). The process exits after trace of this last message. In _RELEASE_ compiling mode, this macro is blank. N.B. : if ASSERT is already - defined, this macro is ignored. - + defined, this macro is ignored.\n Example: - \code #include "utilities.h" ... @@ -298,20 +248,11 @@ ASSERT(k<10); cout << table[k]; \endcode -
    4. -
    -
  4. -
- \section S3_kernel_res Exceptions -
    -
  1. -C++ exceptions: class SALOME_Exception +\subsection subsection31 C++ exceptions: class SALOME_Exception -
      -
    1. -definition +\subsubsection subsubsection311 Definition The class SALOME_Exception provides a generic method to send a message, with optional source file name and line @@ -324,9 +265,8 @@ log file. The class SALOME_Exception inherits its behavior from the STL class exception. -
    2. -
    3. -usage + +\subsubsection subsubsection312 Usage The header %SALOME/src/utils/utils_SALOME_Exception.hxx must be included in the C++ source, when raised or trapped: @@ -356,7 +296,7 @@ throw SALOME_Exception(LOCALIZED("my pertinent message")); \endcode where LOCALIZED is a macro provided with -``utils_SALOME_Exception.hxx`` which gives file name and +utils_SALOME_Exception.hxx which gives file name and line number. The exception is handled like this: @@ -374,15 +314,10 @@ catch (const SALOME_Exception &ex) The what() method overrides the one defined in the STL exception class. -
    4. -
    -
  2. -
  3. -CORBA exceptions -
      -
    1. -definition +\subsection subsection32 CORBA exceptions + +\subsubsection subsubsection321 Definition The idl SALOME_Exception provides a generic CORBA exception for %SALOME, with an attribute that gives an @@ -407,16 +342,12 @@ CORBA system and user exceptions already defined in the packages used within %SALOME, such as OmniORB exceptions, must be handled separately. -
    2. -
    3. -usage -
        -
      1. +\subsubsection subsubsection322 Usage CORBA servant, C++ The CORBA Server header for SALOME_Exception and a macro to throw the exception are provided with the - header ``KERNEL_SRC/src/Utils/Utils_CorbaException.hxx``: + header KERNEL_SRC/src/Utils/Utils_CorbaException.hxx: \code #include "Utils_CorbaException.hxx" @@ -431,17 +362,13 @@ if (myStudyName.size() == 0) SALOME::BAD_PARAM); \endcode -
      2. -
      3. -CORBA Client, GUI Qt C++ - - NO MORE AVAILABLE in %SALOME 3.x +CORBA Client, GUI Qt C++ (NO MORE AVAILABLE in %SALOME 3.x and later) The CORBA Client header for SALOME_Exception and a Qt function header that displays a message box are provided in: - ``KERNEL_SRC/src/SALOMEGUI/SALOMEGUI_QtCatchCorbaException.hxx`` + KERNEL_SRC/src/SALOMEGUI/SALOMEGUI_QtCatchCorbaException.hxx \code #include "SALOMEGUI_QtCatchCorbaException.hxx" @@ -461,8 +388,6 @@ catch (const SALOME::SALOME_Exception & S_ex) } \endcode -
      4. -
      5. CORBA Client, C++, without GUI Nothing specific has been provided to the developer @@ -470,20 +395,10 @@ catch (const SALOME::SALOME_Exception & S_ex) SALOMEGUI_QtCatchCorbaException.hxx to see how to get the information given by the exception %object. -
      6. -
      -
    4. -
    -
- \section S4_kernel_res Miscellaneous tools -
    -
  1. -Singleton -
      -
    1. -Definition +\subsection subsection41 Singleton +\subsubsection subsubsection411 Definition %A singleton is an application data which is created and deleted only once at the end of the application @@ -491,14 +406,12 @@ process. The C++ compiler allows the user to create a static singleton data before the first executable statement. They are deleted after the last statement execution. -The ``SINGLETON_`` template class deals with dynamic +The SINGLETON_ template class deals with dynamic singleton. It is useful for functor objects. For example, an %object that connects the application to a system at creation and disconnects the application at deletion. -
    2. -
    3. -Usage +\subsubsection subsubsection412 Usage To create a single instance of a POINT %object: @@ -524,36 +437,25 @@ POINT *p2=SINGLETON_::Instance() ; assert(p1==p2) \endcode -
    4. -
    5. -Design description +\subsubsection subsubsection413 Design description Here are the principles features of the singleton design: - - the user creates an %object of class TYPE by using the - class method ``SINGLETON_::Instance()`` which + class method SINGLETON_::Instance() which returns a pointer to the single %object ; - -- to create an %object, ``SINGLETON_::Instance()`` +- to create an %object, SINGLETON_::Instance() uses the default constructor of class TYPE ; - - at the same time, this class method creates a destructor %object which is added to the generic list of destructor objects to be executed at the end of the application (atexit) ; - - at the end of the application process all the - deletions are performed by the ``Nettoyage()`` C function + deletions are performed by the Nettoyage() C function which executes the destruction objects end then deletes the destructions objects themselves ; +- the Nettoyage() C function using atexit() C function + is embedded in a static single %object ATEXIT_(). -- the ``Nettoyage()`` C function using ``atexit()`` C function - is embedded in a static single %object ``ATEXIT_()``. - -
    6. -
    -
  2. -
*/ diff --git a/doc/salome/kernel_services.dox b/doc/salome/kernel_services.dox index d363c84cf..241a82ff0 100644 --- a/doc/salome/kernel_services.dox +++ b/doc/salome/kernel_services.dox @@ -1,8 +1,6 @@ /*! \page KERNEL_Services KERNEL Services for end user (Python interface) -WORK in PROGRESS, INCOMPLETE DOCUMENT - In a %SALOME application, distributed components, servers and clients use the CORBA middleware for comunication. CORBA interfaces are defined via idl files. All the different CORBA interfaces are available for users in Python, @@ -16,14 +14,12 @@ script). \section S1_kernel_ser General purpose services -
    -
  1. -%SALOME services access from a Python shell +\subsection subsection11 SALOME services access from a Python shell -See \ref SALOME_Application for detailed instructions to launch a Python -interpreter with full acces to the %SALOME environment and services. +See \ref SALOME_Application for detailed instructions on how to launch a Python +interpreter with full access to the %SALOME environment and services. -You can use the embedded Python interpreter in Grahic User Interface, or an +You can use the embedded Python interpreter in Graphical User Interface, or an external interpreter, with: \code @@ -42,11 +38,9 @@ In the embedded interpreter, it is already done, but there is no problem to do it several times, so it is preferable to add these instructions systematically in your scripts, to allow them to work in all configurations. -
  2. -
  3. -Container and component instanciation +\subsection subsection12 Container and component instanciation -See LifeCycleCORBA for the C++ interface (Python interface obtained with SWIG +See SALOME_LifeCycleCORBA for the C++ interface (Python interface obtained with SWIG is very similar). In the following example, a test component provided in KERNEL is launched @@ -83,7 +77,7 @@ without the _narrow() instruction: In the next example, a component instance is created in a specific Container defined by it's computer hostname and it's name. Here we use the local -computer. Note that in Utils_Identity, getShortHostName() gives the short +computer. Note that in Utils_Identity, Utils_Identity::getShortHostName() gives the short hostname of the computer, without domain suffixes, which is used in %SALOME. The container process is created here if it does not exists, and a new component instance is created: @@ -143,9 +137,7 @@ myStudyManager.object SalomeAppEngine.object \endcode -
  4. -
  5. -File transfer service +\subsection subsection13 File transfer service See SALOME_FileTransferCORBA for the C++ interface (Python interface obtained with SWIG is very similar). @@ -166,71 +158,165 @@ aFileTransfer=LifeCycleCORBA.SALOME_FileTransferCORBA('cli76cc',remotefile) localFile=aFileTransfer.getLocalFile() \endcode -
  6. -
  7. -CORBA Naming service access +\subsection subsection14 CORBA Naming service access See SALOME_NamingService for the C++ interface. The Python interface -SALOME_NamingServicePy is not yet derived from the C++ interface and offers +SALOME_NamingServicePy::SALOME_NamingServicePy_i is not yet derived from the C++ interface and offers only the most useful functions. -
  8. -
  9. -Batch services - -See \ref batch_page documentation (in french only). +\subsection subsection5 Batch services -
  10. -
+See Batch documentation (in french only). \section S2_kernel_ser All IDL Interfaces -
    -
  1. -Containers and component life cycle, File transfer service - -- Engines : engines CORBA module. -- Engines::Component : generic component interface. All %SALOME components inherit this interface. -- Engines::Container : host for C++ and Python components components instances -- Engines::fileTransfer : agent for file transfer created by a container copy a local file to a distent client -- Engines::fileRef : reference to a file, used by a container for file transfers -- Engines::ContainerManager : unique instance, in charge of container creation on remote computers -- Engines::MPIContainer : an exemple of parallel implementation for containers and components -- Engines::MPIObject - -
  2. -
  3. -Study management - -- SALOMEDS : SALOMEDS CORBA module -- SALOMEDS.idl -- SALOMEDS_Attributes.idl - -
  4. -
  5. -High speed transfer, object life cycle, exceptions, GUI interface... - -- SALOME : %SALOME CORBA module -- SALOME_Comm.idl -- SALOME_GenericObj.idl -- SALOME_Exception -- SALOME_Session.idl - -
  6. -
  7. -Miscelleanous - -- SALOME_ModuleCatalog -- SALOME_RessourcesCatalog -- SALOME_Registry.idl -- Logger.idl - -Other idl for test purposes -\n -- nstest.idl -- SALOME_TestComponent.idl -- SALOME_TestModuleCatalog.idl -- SALOME_TestMPIComponent.idl -- TestNotif.idl +-# Containers and component life cycle, File transfer service + - Engines : engines CORBA module. + - Engines::Component : generic component interface. All %SALOME components inherit this interface. + - Engines::Container : host for C++ and Python components components instances + - Engines::fileTransfer : agent for file transfer created by a container copy a local file to a distent client + - Engines::fileRef : reference to a file, used by a container for file transfers + - Engines::ContainerManager : unique instance, in charge of container creation on remote computers + - Engines::MPIContainer : a parallel implementation for containers and components + - Engines::MPIObject + . +-# Study management + - SALOMEDS : SALOMEDS CORBA module + - SALOMEDS.idl : \copybrief SALOMEDS.idl + - SALOMEDS_Attributes.idl : \copybrief SALOMEDS_Attributes.idl + . +-# High speed transfer, object life cycle, exceptions, GUI interface... + - SALOME : \copybrief SALOME + - SALOME_Comm.idl : \copybrief SALOME_Comm.idl + - SALOME_GenericObj.idl : \copybrief SALOME_GenericObj.idl + - SALOME_Exception.idl : \copybrief SALOME_Exception.idl + - SALOME_Session.idl : \copybrief SALOME_Session.idl + . +-# Miscelleanous + - SALOME_ModuleCatalog : \copybrief SALOME_ModuleCatalog + - SALOME_RessourcesCatalog : \copybrief SALOME_RessourcesCatalog + - Registry : \copybrief Registry + - SALOME_Logger : \copybrief SALOME_Logger + . +-# Other idl for test purposes + - NSTEST : for naming service test + - SALOME_TestComponent.idl : for Component test + - SALOME_TestModuleCatalog : for SALOME_ModuleCatalog test + - SALOME_TestMPIComponent.idl : \copybrief SALOME_TestMPIComponent.idl + - TestNotif.idl : \copybrief TestNotif.idl + . +-# Some useful command scripts + - waitNS.py : \copybrief waitNS.py + - waitContainers.py : \copybrief waitContainers.py + - showNS.py : \copybrief showNS.py + - shutdownSalome.py : \copybrief shutdownSalome.py + - killSalome.py : \copybrief killSalome.py + - killSalomeWithPort.py : \copybrief killSalomeWithPort.py + - appli_gen.py : \copybrief appli_gen.py + . */ + +/** \example example1 +AttributeReal interface (creations/saving/restoring) +\n +Methods : FindOrCreateAttribute, Value, SaveAs, SetValue, FindComponent, FindAttribute, Open + */ +/** \example example3 +AttributeSequenceOfReal interface(creations/saving/restoring)\n +AttributeSequenceOfReal : ChangeValue, Add, Value, Remove, Length\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open + */ +/** \example example16 +Methods : GetAvailableUndos, ChangeValue, FindOrCreateAttribute, SaveAs, GetAvailableRedos, Undo, FindComponent, Redo, FindAttribute, Open, CommitCommand, NewCommand + */ +/** \example example17 +SALOMEDS methods : RemoveAttribute, FindOrCreateAttribute, NewStudy, GetAllAttributes, NewCommand, CommitCommand, AbortCommand, NewComponent + */ +/** \example example18 +AttributeTreeNode interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, NewObject\n +Attribute methods : HasFirst, HasFather, SetPrevious, Next, InsertAfter, GetFather, HasNext, SetValue, Append, NewStudy, Label, IsRoot, Prepend, SetFather, Depth, HasPrevious + */ +/** \example example19 + SALOMEDS methods : FindOrCreateAttribute, Save, SaveAs, Close, Open, FindComponent, FindAttribute, FindObject, LoadWith +\n + Attribute methods : Value, SetValue + */ +/** \example example20 +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, NewCommand, GetProperties, Open, CommitCommand, NewBuilder\n +Attribute methods : SetLocked, IsLocked, GetCreationMode, SetCreationDate, IsModified, GetUserName, Value, SetUserName, SetValue, GetCreationDate + */ +/** \example example23 +Methods: + */ +/** \example example8 +AttributeDrawable interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : SetDrawable, IsDrawable + */ +/** \example example9 +AttributeSelectable interface(creations/saving/restoring)\n +SALOMEDS methods: FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods: SetSelectable, IsSelectable + */ +/** \example example10 +AttributeExpandable interface(creations/saving/restoring)\n +SALOMEDS methods : SaveAs FindComponent FindAttribute Open\n +Attribute methods : SetExpandable IsExpandable + */ +/** \example example11 +Test AttributeOpened (creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : SetOpened, IsOpened + */ +/** \example example12 +AttributeTextColor interface (creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : SetTextColor TextColor + */ +/** \example example13 +Test AttributeTextHighlightColor interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : SetTextHighlightColor TextHighlightColor + */ +/** \example example14 +AttributePixMap interface (creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : SetPixMap, GetPixMap + */ + +/** \example example21 +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods: GetValue, GetNbColumns, AddColumn, SetRowTitles, PutValue, GetColumn, GetColumnTitles, GetTitle, SetRow, GetRowTitles, SetColumnTitles, SetColumn, GetRow, GetNbRows, SetColumnTitle, AddRow, SetTitle, SetRowTitle + */ +/** \example example15 +AttributeLocalID interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : Value, SetValue +*/ +/** \example example22 +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent, FindAttribute, Open\n +Attribute methods : GetValue, GetNbColumns, AddColumn, SetRowTitles, PutValue, GetColumn, GetColumnTitles, GetTitle, SetRow, GetRowTitles, SetColumnTitles, SetColumn, GetRow, GetNbRows, SetColumnTitle, AddRow, SetTitle, SetRowTitle +*/ +/** \example example4 +AttributeSequenceOfInteger interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute FindComponent FindAttribute Open Add SaveAs +AttributeSequenceOfInteger methods : Value, Remove, Length +*/ +/** \example example5 +AttributeName interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent FindAttribute Open\n +Attribute methods : SetValue, Value +*/ +/** \example example6 +AttributeComment interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs FindComponent FindAttribute Open\n +Attribute methods : Value, SetValue +*/ +/** \example example7 +AttributePersistentRef interface(creations/saving/restoring)\n +SALOMEDS methods : FindOrCreateAttribute, SaveAs, FindComponent FindAttribute Open\n +Attribute methods : SetValue, Value +*/ + diff --git a/doc/salome/main.dox b/doc/salome/main.dox index 7515c353c..03c610c0e 100644 --- a/doc/salome/main.dox +++ b/doc/salome/main.dox @@ -1,82 +1,60 @@ /*! \mainpage SALOME KERNEL Reference Documentation - \image html kernel_about_4.png - - \section S1_main Introduction + \image html icon_about.png Welcome to the %SALOME KERNEL documentation ! Following your kind of usage of %SALOME, you will find some specific introductory documentation, listed below. - \section S2_main End user +\section S2_main End user -
      -
    1. - How to configure a %SALOME application - \n The end user may have to configure his own %SALOME application by selection of a +-# How to configure a %SALOME application\n + The end user may have to configure his own %SALOME application by selection of a subset of availables %SALOME modules. He also may want to install his application on several computers. See \subpage SALOME_Application to define your own configuration of %SALOME and run it on one or several computers. This is the recommended way of configuration. -
    2. -
    3. - How to launch %SALOME in a %SALOME application - \n See \ref SALOME_Application. -
    4. -
    5. - How to use KERNEL services in Python scripts - \n The %SALOME KERNEL offers a list of services available in Python. See \subpage KERNEL_Services. -
    6. -
    +-# How to launch %SALOME in a %SALOME application\n + See \ref SALOME_Application. +-# How to use KERNEL services in Python scripts\n + The %SALOME KERNEL offers a list of services available in Python. See \subpage KERNEL_Services. - \section S3_main Application Integrator +\section S3_main Application Integrator Applications integrators are in charge of configuration and installation of specific %SALOME applications over a local network. Application Integrators built %SALOME modules binaries from sources tarballs. -
      -
    1. - How to install %SALOME - \n See \subpage INSTALL for general information on required configuration and +-# How to install %SALOME\n + See \subpage INSTALL for general information on required configuration and prerequisites, compilation procedure, setting environment principles. -
    2. -
    3. - How to configure a %SALOME application - \n See \ref SALOME_Application to define your own configuration of %SALOME and run it +-# How to configure a %SALOME application\n + See \ref SALOME_Application to define your own configuration of %SALOME and run it on one or several computers. This is the recommended way of configuration. -
    4. -
    - \section S4_main Module maintainer +\section S4_main Module maintainer Module maintainers are in charge of the development and debug of the %SALOME modules. Each %SALOME module is stored in a CVS base. CVS bases are organised in separate branches for developments and debug. All official or development releases are identified by a CVS tag. -
      -
    1. - Source code structuration and Unit Tests - \n See \subpage UnitTests for general information on code directories structure, +-# Source code structuration and Unit Tests\n + See \subpage UnitTests for general information on code directories structure, unit tests associated to the different kind of classes, and how to run the unit tests. -
    2. -
    3. - Some development utilities - \n See \subpage kernel_resources for information on basic utilities for C++ and Python +-# Some development utilities \n + See \subpage kernel_resources for information on basic utilities for C++ and Python development, like trace and debug, exceptions, singleton. -
    4. -
    - \section S5_main SALOME programming model +\section S5_main SALOME programming model You will find in the next pages informations about specific points of %SALOME Kernel : - \subpage dsc_page : DSC documentation page. - \subpage salome_file_page : Salome_file documentation page. - - \subpage batch_page : BATCH documentation page. + - Batch documentation */ diff --git a/doc/salome/salome_application.dox b/doc/salome/salome_application.dox index d970338a3..31961aa32 100644 --- a/doc/salome/salome_application.dox +++ b/doc/salome/salome_application.dox @@ -1,17 +1,17 @@ /*! - \page SALOME_Application SALOME Application Concept + \page SALOME_Application Salome Application Concept - Configuration for one or more computers - - - **WORK in PROGRESS, INCOMPLETE DOCUMENT** The following explains how to configure your own application with your list of modules, how to define and run this application on one or more computers. \section S1_sal_appl General principles -%A %SALOME application is defined by a set of modules (GEOM, SMESH, ASTER...). +%A %SALOME application is defined by a set of modules (GEOM, SMESH, ASTER...). %A %SALOME application +lives in an application directory. +%A %SALOME application is a virtual installation of %SALOME in the application directory +(bin, lib, doc, share...), with, for each file (executable, script, data, +library, resources...), symbolic links to the actual files. %A %SALOME User can define several %SALOME Applications. These applications are runnable from the same user account. These applications may share the same @@ -42,126 +42,76 @@ computer. \section S2_sal_appl Application Directory -There are two ways for creation of an application directory, the recommended way is -the second, easier to configure. - -
      -
    1. - First way - references to different module directories - -The script createAppli.sh in ${KERNEL_ROOT_DIR}/bin/salome creates an -application directory with the given path in parameter. The path given, ${APPLI}, is -relative to ${HOME}. - -The directory is only a skeleton, the user has to edit several files to -configure his own application. These files are described after, the list is: - -- env.d/atFirst.sh -- env.d/envProducts.sh -- env.d/envSALOME.sh -- CatalogResources.xml -- SALOMEApp.xml - -
    2. -
    3. - Second and easiest way - one single virtual install directory - -The user must create a %SALOME application configuration file by modifying a +First, the user must create a %SALOME application configuration file by modifying a copy of ${KERNEL_ROOT_DIR}/bin/salome/config_appli.xml. The file describes the list of %SALOME modules used in the application, with their respective installation path. The configuration file also defines the path of an existing script which sets the %SALOME prerequisites, and optionnaly, the path of samples directory (SAMPLES_SRC). -The following command:: +The following command: \code python /bin/salome/appli_gen.py --prefix= --config= \endcode -creates a virtual installation of %SALOME in the application directory ${APPLI} -(bin, lib, doc, share...), with, for each file (executable, script, data, -library, resources...), symbolic links to the actual file. -Note: it is recommended to set the environment for %SALOME prerequisites -before invoking the above command, in order to use the same python as SALOME, -otherwise installation may be wrong +creates a %SALOME application in the application directory given by the prefix option (local directory +by default) with the configuration file given by the config option (config_appli.xml by default). Providing an existing script for %SALOME prerequisites (the same one used for modules compilation, or given with the modules installation), the installation works without further modification for a single computer (unless some modules needs a special environment not defined in the above script). + For a distributed application (several computers), one must copy and adapt CatalogResources.xml from ${KERNEL_ROOT_DIR}/bin/salome/appliskel (see below). -
    4. -
    \section S3_sal_appl General rules -Directory ${APPLI} must be created on each computer of the application. +The application directory must be created on each computer of the application. The easiest way is to use the same relative path (to ${HOME}) on each computer. (Sometimes it is not possible to use the same path everywhere, for instance when ${HOME} is shared with NFS, so it is possible to define different path following the computers). -The ${APPLI} directory contains scripts for environment and runs. Environment +The application directory contains scripts for environment and runs. Environment scripts must be configured (by the user) on each computer. All the environment -scripts are in the ${APPLI}/env.d directory. +scripts are in the env.d subdirectory. -The script ${APPLI}/envd sources **all** the files (\*.sh) in ${APPLI}/env.d -in alphanumeric order (after edition, think to remove backup files). the envd +The script envd sources \b all the files (*.sh) in subdirectory env.d +in alphanumeric order (after edition, think to remove backup files). The envd script is used by run scripts.
    1. env.d scripts -With the first way of installation, each user **must define** his own -configuration for these scripts, following the above rules. -With the virtual installation (second way, above), env.d -scripts are built automatically. - - **The following is only an example proposed by createAppli.sh, (first way of installation) not working as it is**. - -- atFirst.sh - Sets the computer configuration not directly related to %SALOME, - like useful tools, default PATH. - -- envProducts.sh - Sets the %SALOME prerequisites. - -- envSALOME.sh - Sets all the MODULE_ROOT_DIR that can be used in the %SALOME application. +env.d scripts are built automatically. - SALOMEAppConfig is also defined by: +You can add your own environment scripts in env.d subdirectory, they will be sourced as +the generated ones provided they have a .sh extension. -\code -export SALOMEAppConfig=${HOME}/${APPLI} -\endcode - - where SALOMEAppConfig designates the directory containing SALOMEApp.xml. - Note that ${APPLI} is already defined by the calling scripts when - env.d/envSALOME.sh is sourced.
    2. User run scripts The %SALOME user can use 4 scripts: -- runAppli +- runAppli\n Launches a %SALOME Session (similar to ${KERNEL_ROOT_DIR}/bin/salome/runSalome but with a different name to avoid confusions). See parameters below. -- runSession +- runSession\n Launches a shell script in the %SALOME application environment, with access to the current (last launched) %SALOME session (naming service), if any. Without arguments, the script is interactive. With arguments, the script executes the command in the %SALOME application environment. -- runConsole +- runConsole\n Gives a python console connected to the current %SALOME Session. It is also possible to use runSession, then python. -- runTests +- runTests\n Similar to runSession, used for unit testing, but runSession tries to use an already existing naming service definition from a running session (hostname and port number), and runTests defines a new configuration for naming service @@ -170,12 +120,12 @@ The %SALOME user can use 4 scripts:
    3. %SALOME internal run scripts -- envd +- envd\n Sets %SALOME application environment, envd is sourced by other scripts. For remote calls, %SALOME uses one script. -- runRemote.sh +- runRemote.sh\n This script is mainly used to launch containers. The first 3 arguments define the hostname and port userd for naming service, plus a working directory, the remaining arguments define the command to execute. @@ -183,20 +133,19 @@ For remote calls, %SALOME uses one script.
    4. Other configuration files -- SALOMEApp.xml +- SALOMEApp.xml\n This file is similar to the default given in ${GUI_ROOT_DIR}/share/SALOME/resources/gui -- CatalogRessources.xml - This files describes all the computers the application can use. The given - example is minimal and suppose ${APPLI} is the same relative path +- CatalogRessources.xml\n + This file describes all the computers the application can use. The given + example is minimal and suppose application directory is the same relative path to ${HOME}, on all the computers. %A different directory can be set on a particular computer with a line: - -\code + \code appliPath="my/specific/path/on/this/computer" -\endcode + \endcode
    @@ -207,7 +156,7 @@ appliPath="my/specific/path/on/this/computer"
  8. Launch a %SALOME session with a GUI interface -Launch is done with a command like:: +Launch is done with a command like: \code ./runAppli --logger @@ -216,7 +165,7 @@ Launch is done with a command like:: The --logger option means here : collect all the traces from the all the distributed process, via CORBA, in a single file : logger.log. -There are a lot of options, a complete list is given by:: +There are a lot of options, a complete list is given by: \code ./runAppli --help @@ -237,20 +186,20 @@ When the GUI is closed, the different %SALOME servers are still running. Close a %SALOME session, kill all the servers Inside the interactive python interpreter you get when you use runAppli -with arguments, you can kill all the servers of your session with:: +with arguments, you can kill all the servers of your session with: \code >>> killLocalPort() \endcode -or the servers of all the sessions with:: +or the servers of all the sessions with: \code >>> killAllPorts() \endcode If you have no active Python interpreter connected to your session, you can -kill all the %SALOME servers of **all the sessions** on a given computer:: +kill all the %SALOME servers of all the sessions on a given computer: \code ./runSession killSalome.py @@ -263,7 +212,7 @@ use the start menu to stop... When you use only one session at a time, you don't need more. To kill a given session (when several session are running), one needs -the naming service port number:: +the naming service port number: \code ./runSession killSalomeWithPort 2810 @@ -273,7 +222,7 @@ Note that the port number of the last launched session can be found on Linux, in the prompt, within a runSession shell (see below). It is also possible to get the Naming Service host and port number of -the last launched session with:: +the last launched session with: \code ./runSession NSparam.py @@ -295,7 +244,7 @@ import GEOM_usinggeom raw_input("Press a key and the servers will be killed ...") \endcode -This script is run in a non interactive way with:: +This script is run in a non interactive way with: \code ./runSession python test_session_geom.py @@ -310,23 +259,23 @@ All the process are automatically killed when Python is closed It's often easier to develop and try Python scripts outside the GUI embedded Python interpreter. Imagine, for instance, you are writing a script involving geometry and mesh modules. -first, launch a %SALOME session with gui, then, on another terminal:: +first, launch a %SALOME session with gui, then, on another terminal: \code ./runSession python \endcode -Import %SALOME module. salome_init() without arguments creates a new study -in the running session (note: SALOME_init(n) attachs to a running session whose -studyId is n):: +Import salome module. salome_init() without arguments creates a new study +in the running session (note: salome_init(n) attachs to a running session whose +studyId is n): \code import salome salome.salome_init() \endcode -An example of script given with SMESH:: +An example of script given with SMESH: \code import ex01_cube2build @@ -336,8 +285,8 @@ It is possible to connect the GUI interface to the study created in the above script with the file/connect menu, then browse study and display objects. Further modifications on study can be done either with GUI or external script (use refresh popup in GUI %object browser to see study modifications generated -by the external script). **AVOID modifications with GUI when a Python script -is running**. Not all the modules are protected against concurrent actions... +by the external script). AVOID modifications with GUI when a Python script +is running. Not all the modules are protected against concurrent actions...
  9. Different uses of the runSession shell interpreter @@ -349,13 +298,13 @@ connects to the last launched session (i.e. gets the naming service references of the session: hostname and port) On Linux, the shell prompt (bash) gives information on naming service -references, hostname and port:: +references, hostname and port: \code [NS=cli76cc:2811]prascle@cli76cc:~/SALOME2/Run/Virtual$ \endcode -If there is no running session, prompt looks like:: +If there is no running session, prompt looks like: \code [NS=:]prascle@cli76cc:~/SALOME2/Run/Virtual$ @@ -364,7 +313,7 @@ If there is no running session, prompt looks like:: runSession is useful to launch any script or program which needs the complete %SALOME environment, with or without a session already running. For instance, to launch the ddd debugger interface on the gui %server, first -launch a %SALOME session with gui, then, on another terminal:: +launch a %SALOME session with gui, then, on another terminal: \code ./runSession ddd diff --git a/doc/salome/salome_file.dox b/doc/salome/salome_file.dox index dffb378b9..2f29ea7d4 100644 --- a/doc/salome/salome_file.dox +++ b/doc/salome/salome_file.dox @@ -9,7 +9,7 @@ SALOME_FileTransfer. It extends it to enable a higher model for managing files i \section S1_Salome_file Principles Salome_file is a CORBA %object. It's role is to managed many system files. When a Salome_file -is created, no files are managed. Then, files are added using Salome_file interface. %A file is represented +is created, no files are managed. Then, files are added using Salome_file_i interface. %A file is represented by a name and a path. There is two different cases when a file is added : @@ -115,9 +115,4 @@ To avoid these cases, Salome_file API provides advanced methods : }; \endcode -\section S3_Salome_file Using Salome_file into %SALOME services - -Currently you can't use Salome_file into YACS schema. In the next version of %SALOME, -files ports will be available to connect output files to input files. - */ diff --git a/doc/salome/tui/Makefile.am b/doc/salome/tui/Makefile.am index 7aa79e067..b06306d1e 100644 --- a/doc/salome/tui/Makefile.am +++ b/doc/salome/tui/Makefile.am @@ -26,94 +26,36 @@ # include $(top_srcdir)/salome_adm/unix/make_common_starter.am -EXTRA_DIST = pythfilter.py - -dist-hook: - cp -rf $(srcdir)/KERNEL $(distdir) - if test -d "KERNEL"; then \ - find "KERNEL" -name "*.*" -exec cp -rf {} $(distdir)/KERNEL ';' ; \ - fi - rm -rf `find $(distdir) -name CVS` - -clean-local: - rm -rf KERNEL - chmod -R +w INPUT - @for filen in `find INPUT -type f` ; do \ - case $${filen} in \ - INPUT/doxydev | INPUT/doxyuser | INPUT/sources/static/tree.js ) ;; \ - . | .. ) ;; \ - *) echo "Removing $${filen}" ; rm -rf $${filen} ;; \ - esac ; \ - done ; - -KERNEL/main.html:../main.dox - cp -fr $(srcdir)/KERNEL/* ./INPUT; \ - cd ./INPUT; \ - pwd; ls;\ +dev_docs: echo "DOXYGEN SUPPORT PYTHON - $(DOXYGEN_WITH_PYTHON)"; \ if( test "x$(DOXYGEN_WITH_PYTHON)" = "xyes"); then \ - sed 's|python_extension_must_be_here|*.py|' ./doxyuser > ./doxyuser1; \ - $(DOXYGEN) -u ./doxyuser1; \ + sed 's|python_extension_must_be_here|*.py|' ./doxyfile > ./doxyfile1; \ + $(DOXYGEN) -u ./doxyfile1; \ else \ - sed 's|python_extension_must_be_here||' ./doxyuser > ./doxyuser1; \ + sed 's|python_extension_must_be_here||' ./doxyfile > ./doxyfile1; \ fi; \ echo "DOXYGEN SUPPORT STL - $(DOXYGEN_WITH_STL)"; \ if( test "x$(DOXYGEN_WITH_STL)" = "xyes"); then \ - sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyuser1 > ./doxyuser2; \ - mv -f doxyuser2 doxyuser1; \ + sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxyfile1 > ./doxyfile2; \ + mv -f doxyfile2 doxyfile1; \ fi; \ - $(DOXYGEN) ./doxyuser1; \ - cd ..; + $(DOXYGEN) ./doxyfile1 + +clean-local: + -rm -fr KERNEL log.txt doxyfile1.bak doxyfile1 -usr_docs:KERNEL/main.html - if test -d "KERNEL"; then b=; else b="$(srcdir)/"; fi; \ - cp -fr $(srcdir)/KERNEL/sources/static/*.* $(DESTDIR)$(docdir); \ - cp -fr $(srcdir)/KERNEL/sources/ $(DESTDIR)$(docdir); \ - find $$b"KERNEL" -name "*.*" -exec cp -rf {} $(DESTDIR)$(docdir) ';' ; \ - cp -fr $(srcdir)/KERNEL/HTML/ $(DESTDIR)$(docdir); \ - cp -f $(srcdir)/pythfilter.py $(DESTDIR)$(docdir); \ - cp -fr $(srcdir)/KERNEL/exemple/ $(DESTDIR)$(docdir); +install-data-local: + if test -d KERNEL; then \ + $(INSTALL) -d $(DESTDIR)$(docdir)/tui ; \ + cp -rp KERNEL $(DESTDIR)$(docdir)/tui ; \ + fi; uninstall-local: -# chmod +w $(DESTDIR)$(docdir)/sources -# chmod +w $(DESTDIR)$(docdir)/sources/static -# chmod +w $(DESTDIR)$(docdir)/HTML - chmod -R +w $(DESTDIR)$(docdir) - rm -rf $(DESTDIR)$(docdir)/pythfilter.py - find $(DESTDIR)$(docdir) -name "*.html" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.jpg" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.map" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.md5" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.png" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.gif" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.css" -type f -exec rm -rf {} \; - find $(DESTDIR)$(docdir) -name "*.js*" -type f -exec rm -rf {} \; - rm -rf $(DESTDIR)$(docdir)/sources - rm -rf $(DESTDIR)$(docdir)/HTML - rm -rf $(DESTDIR)$(docdir)/exemple - rm -rf $(DESTDIR)$(docdir)/*.in + rm -rf $(DESTDIR)$(docdir)/tui/KERNEL + +EXTRA_DIST=static KERNEL/exemple + +dist-hook: + rm -rf $(distdir)/static/CVS ; \ + rm -rf $(distdir)/KERNEL/exemple/CVS -dev_docs: - cp -fr $(srcdir)/KERNEL/* ./INPUT; \ - cd ./INPUT; \ - pwd; ls;\ - echo "DOXYGEN SUPPORT PYTHON - $(DOXYGEN_WITH_PYTHON)"; \ - if( test "x$(DOXYGEN_WITH_PYTHON)" = "xyes"); then \ - sed 's|python_extension_must_be_here|*.py|' ./doxydev > ./doxydev1; \ - $(DOXYGEN) -u ./doxydev1; \ - else \ - sed 's|python_extension_must_be_here||' ./doxydev > ./doxydev1; \ - fi; \ - echo "DOXYGEN SUPPORT STL - $(DOXYGEN_WITH_STL)"; \ - if( test "x$(DOXYGEN_WITH_STL)" = "xyes"); then \ - sed -e 's|BUILTIN_STL_SUPPORT = NO|BUILTIN_STL_SUPPORT = YES|' ./doxydev1 > ./doxydev2; \ - mv -f doxydev2 doxydev1; \ - fi; \ - $(DOXYGEN) ./doxydev1; \ - cd ..; - $(INSTALL) -d $(docdir)/tui/KERNEL; -# cp -fr KERNEL $(docdir)/tui -# cp -fr $(srcdir)/KERNEL/sources/static/*.* $(docdir)/tui/KERNEL; -# cp -fr $(srcdir)/KERNEL/sources/ $(docdir)/tui/KERNEL; -# cp -fr $(srcdir)/KERNEL/HTML/ $(docdir)/tui/KERNEL; -# cp -f $(srcdir)/pythfilter.py $(docdir)/tui/KERNEL; diff --git a/doc/salome/tui/doxyfile.in b/doc/salome/tui/doxyfile.in new file mode 100644 index 000000000..544dd2015 --- /dev/null +++ b/doc/salome/tui/doxyfile.in @@ -0,0 +1,240 @@ +# Doxyfile 1.4.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "SALOME v.@VERSION@" +PROJECT_NUMBER = +OUTPUT_DIRECTORY = KERNEL +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = @top_builddir@ @top_srcdir@ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 5 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = YES +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 25 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = log.txt + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = \ + @top_srcdir@/src/DSC +FILE_PATTERNS = *.idl *.cxx *.hxx *.h *.hh *.i *c *.cc python_extension_must_be_here +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 3 +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = . +HTML_FILE_EXTENSION = .html +HTML_HEADER = @srcdir@/static/header.html +HTML_FOOTER = @srcdir@/static/footer.html +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = YES +TOC_EXPAND = YES +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = NO + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = NO +UML_LOOK = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = jpg +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1200 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = NO +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/doc/salome/tui/static/footer.html b/doc/salome/tui/static/footer.html new file mode 100755 index 000000000..56d52a61a --- /dev/null +++ b/doc/salome/tui/static/footer.html @@ -0,0 +1,10 @@ + + + + + +
    +
    Copyright © 2003-2007 CEA, EDF
    +
    + + diff --git a/doc/salome/tui/static/header.html b/doc/salome/tui/static/header.html new file mode 100755 index 000000000..bddc997ec --- /dev/null +++ b/doc/salome/tui/static/header.html @@ -0,0 +1,13 @@ + + + + + $title + + + +
    +
    +SALOME documentation central +
    +
    diff --git a/doc/salome/unittests.dox b/doc/salome/unittests.dox index fc5ebdd47..199a0a392 100644 --- a/doc/salome/unittests.dox +++ b/doc/salome/unittests.dox @@ -10,60 +10,57 @@ the unit tests. \section S1_unit SALOME KERNEL source code structuration -
      -
    1. General structure of KERNEL_SRC +\subsection sub11 General structure of KERNEL_SRC -- KERNEL_SRC : +- KERNEL_SRC :\n Some README files and configuration tools for build -- KERNEL_SRC/adm_local : +- KERNEL_SRC/adm_local :\n Part of the configuration files, other modules have a directory with the same name. Not used in KERNEL. -- KERNEL_SRC/bin : +- KERNEL_SRC/bin :\n Python and shell scripts used at run time. Kit to install a %SALOME Application. -- KERNEL_SRC/doc : +- KERNEL_SRC/doc :\n Kit for KERNEL end user documentation production: public interfaces, Python, CORBA. Integrator and Developper documentation. -- KERNEL_SRC/idl : +- KERNEL_SRC/idl :\n All CORBA interfaces from KERNEL are regrouped here. -- KERNEL_SRC/resources : +- KERNEL_SRC/resources :\n Configuration files for servers (examples). Interfaces definitions for KERNEL test components. -- KERNEL_SRC/salome_adm : +- KERNEL_SRC/salome_adm :\n Configuration files used by autotools (M4 macros & co.) -- KERNEL_SRC/src : +- KERNEL_SRC/src :\n The source code (C++ and Python) -
    2. -
    3. -Directory src: C++ and Python source code +\subsection sub12 Directory src: C++ and Python source code
      1. Basic services non related to CORBA -- Basics +- Basics\n %A set of general purpose C++ services, not related to CORBA. Some general purpose services that are in Utils directory (CORBA related), are progressivley moved here, as they are not related to CORBA. -- SALOMELocalTrace +- SALOMELocalTrace\n %A multithread trace system that allows message tracing on standard error or a file. -- CASCatch +- CASCatch\n Exceptions and signal handler. -- HDFPersist +- HDFPersist\n %A C++ interface to HDF.
      2. @@ -71,22 +68,22 @@ the unit tests.
      3. Basic CORBA services -- Logger : +- Logger :\n %A CORBA %server that collects the trace messages from differents CORBA process. -- SALOMETraceCollector : +- SALOMETraceCollector :\n %A multithread trace system derived from SALOMELocalTrace, that sends messages to Logger %server via CORBA. -- Utils : +- Utils :\n %A set of general purpose services related to CORBA, such as basic CORBA exception system. See also Basics directory above. -- NamingService : +- NamingService :\n C++ and Python interfaces to name, store and retrieve CORBA objects -- GenericObj : +- GenericObj :\n %A generic CORBA interface for CORBA objects, to count distributed references, and to allow destruction by client. @@ -94,21 +91,21 @@ the unit tests.
      4. Miscellaneous CORBA servers -- %Registry : +- %Registry :\n Implements SALOME_registry.idl. Provides a CORBA %server library and a separate %server program. -- ModuleCatalog : +- ModuleCatalog :\n Implements SALOME_moduleCatalog.idl. Provide a CORBA %server library and separate %server and client programs. -- ModuleGenerator : +- ModuleGenerator :\n Tool to generate a module catalog from CORBA idl -- ResourcesManager : +- ResourcesManager :\n library included in container %server -- Notification : +- Notification :\n library included in differents servers (container) - NOTIFICATION_SWIG @@ -137,7 +134,7 @@ the unit tests. - SALOMEDSImpl -- SALOMEDS +- %SALOMEDS
      5. @@ -182,7 +179,7 @@ the unit tests. \section S2_unit Tools and principles used for Unit testing -**TO BE COMPLETED** +TO BE COMPLETED Unit Testing rely on cppunit package for C++ testing, and on unittest module for Python. See these products for general principles of unit testing. diff --git a/idl/Calcium_Ports.idl b/idl/Calcium_Ports.idl index cce57e90f..9f1096498 100644 --- a/idl/Calcium_Ports.idl +++ b/idl/Calcium_Ports.idl @@ -19,7 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SALOME_Ports.idl +// File : Calcium_Ports.idl // Author : Eric Fayolle, EDF // #ifndef _CALCIUM_PORTS_IDL_ @@ -27,8 +27,13 @@ #include "SALOME_Ports.idl" +/*! \file Calcium_Ports.idl \brief interfaces for Calcium ports +*/ + module Ports { +/*! \brief module that contains interfaces to define Calcium ports +*/ module Calcium_Ports { const long UNLIMITED_STORAGE_LEVEL = -70; diff --git a/idl/DSC_Engines.idl b/idl/DSC_Engines.idl index 5d42e6693..cbe349e27 100644 --- a/idl/DSC_Engines.idl +++ b/idl/DSC_Engines.idl @@ -29,9 +29,8 @@ #include "SALOME_Component.idl" #include "SALOME_Ports.idl" -/*! \file - This is a package that contains IDL interfaces that permits to add - a dynamic port model to the SALOME object model. +/*! \file DSC_Engines.idl + \brief interfaces that permits to add a dynamic port model to the SALOME object model. */ module Engines { @@ -63,6 +62,7 @@ module Engines { /*--------------------------------------------------------------------------------------------*/ /*-------------------------------------- Types Part ------------------------------------------*/ + //! a uses port /*! This sequence is a uses port. It's a sequence since a uses port can be connected with x provides port. Sometimes this kind of uses port is called multiple port. @@ -71,33 +71,25 @@ module Engines { */ typedef sequence uses_port; + //! This enumeration is used when the connection of a port (uses or provides) is changed. /*! - This enumeration is used when the connection of a port (uses or provides) - is changed. This information is for the component's user code. + This information is for the component's user code. */ enum Message {AddingConnection, RemovingConnection, ApplicationError}; - /*! - This exception is raised when a port's name is gived before - it is added to the component. - */ + //! This exception is raised when a port is used before it is added to the component. exception PortNotDefined {}; - /*! - This exception is raised if you try to add a port with the same - name than a previous defined port. - */ + //! This exception is raised if you try to add a port with the same name than a previous defined port. exception PortAlreadyDefined {}; - /*! - This exception is raised when you try to use a port that is not connected. - */ + //! This exception is raised when you try to use a port that is not connected. exception PortNotConnected {}; + //! This exception is raised if the type of the provides port is bad. /*! - This exception is raised if the type of the provides port is bad. This exception contains a string that gives what type is expected and the type that the operation received. */ @@ -106,27 +98,21 @@ module Engines { string received; }; - /*! - Port's reference is Nil ! - */ + //! Port's reference is Nil ! exception NilPort {}; - /*! - Port's reference is not the right reference. - */ + //! Port's reference is not the right reference. exception BadPortReference {}; - /*! - Object porperty is not good for the port - */ + //! Object property is not good for the port exception BadProperty {}; /*--------------------------------------------------------------------------------------------*/ /*-------------------------------------- Operation Part --------------------------------------*/ + //! This operation adds a provides port to the component. /*! - This operation adds a provides port to the component. \param ref port's Corba reference. \param provides_port_name port's name. @@ -146,8 +132,8 @@ module Engines { NilPort, BadProperty); + //! This operation adds a uses port to the component. /*! - This operation adds a uses port to the component. \param repository_id port's Corba repository id. Eg : IDL:toto.tata/MODULE/INTERFACE_NAME:1.0 @@ -166,8 +152,8 @@ module Engines { in Ports::PortProperties port_prop) raises(PortAlreadyDefined, BadProperty); + //! Get a provides port of the component. /*! - This operation is used to get a provides port of the component. It can be used by the framework or the component himself. If it's the framework that wants the port, the reference has to be gived @@ -191,8 +177,8 @@ module Engines { PortNotConnected, BadPortType); + //! Get a uses port of the component. /*! - This operation is used to get a uses port of the component. It can be used by the framework or the component himself. Actually, only the user layer of the component will use this operation. A uses port could be obtained if and only if the uses port is connected. The sequence @@ -215,8 +201,8 @@ module Engines { BadPortType); + //! Connect a provides port with a uses port. /*! - This operation connects a provides port with a uses port. \param provides_port_name provides port's name. @@ -226,8 +212,8 @@ module Engines { */ void connect_provides_port(in string provides_port_name) raises(PortNotDefined); + //! Connect a uses port with a provides port. /*! - This operation connects a uses port with a provides port. \param uses_port_name uses port's name. \param provides_port_ref provides port's Corba reference. @@ -240,9 +226,10 @@ module Engines { in Ports::Port provides_port_ref) raises(PortNotDefined, BadPortType, NilPort); + + //! Check if a port is connected. /*! - This operation tests if a port is connected. You can test - a uses port or a provides port. + You can test a uses port or a provides port. \param port_name port's name. \return true if the uses port is connected. @@ -251,8 +238,8 @@ module Engines { */ boolean is_connected(in string port_name) raises(PortNotDefined); + //! Disconnect a uses port from a provides port. /*! - This operation disconnects a uses port to a provides port. \param provides_port_name provides port's name. \param message state associated with the disconnection. @@ -264,8 +251,8 @@ module Engines { in Engines::DSC::Message message) raises(PortNotDefined, PortNotConnected); + //! Disconnect a provides port from a uses port. /*! - This operation disconnects a provides port to a uses port. \param uses_port_name uses port's name. \param provides_port_ref CORBA reference of the provides port. @@ -280,8 +267,8 @@ module Engines { in Engines::DSC::Message message) raises(PortNotDefined, PortNotConnected, BadPortReference); + //! Get port's property object. /*! - This operation permits to get port's property object. \param port_name port's name. \return properties object's CORBA reference. @@ -298,18 +285,14 @@ module Engines { */ interface ConnectionManager { - /*! - The Id gived to the disconnect method is bad. - */ + //! The Id given to the disconnect method is bad. exception BadId {}; - /*! - A connection Id. It's unique. - */ + //! A connection Id. It's unique. typedef short connectionId; + //! Connect a uses port with a provides port. /*! - This operation connects a uses port with a provides port. \param uses_component The component that have the uses port. \param uses_port_name uses port's name. @@ -331,9 +314,8 @@ module Engines { Engines::DSC::BadPortType, Engines::DSC::NilPort); + //! Release a connection that has been previously created by the ConnectionManager. /*! - This operation releases a connection that has been previously created by - the ConnectionManager. \param id The id of the connection previously gived by the connect operation of the ConnectionManager. @@ -347,14 +329,10 @@ module Engines { Engines::DSC::PortNotConnected, Engines::DSC::BadPortReference); - /*! - Shutdown the ConnectionManager process. - */ + //! Shutdown the ConnectionManager process. oneway void ShutdownWithExit(); - /*! - Returns the PID of the connection manager - */ + //! Return the PID of the connection manager long getPID(); }; @@ -368,9 +346,10 @@ module Engines { */ interface Superv_Component : Engines::DSC { + //! Operation to create the service ports before it is executed /*! The SUPERV module call this method before starting the service. Thus the service - can add is dynamics ports before it is started. + can add its dynamics ports before it is started. \param service_name service's name. \return true if the service is correctly initialised. diff --git a/idl/Logger.idl b/idl/Logger.idl index e69d5f2dd..91a0234c2 100644 --- a/idl/Logger.idl +++ b/idl/Logger.idl @@ -26,14 +26,26 @@ #define SALOME_LOGGER_IDL #pragma prefix "opencascade.com" +/*! \file Logger.idl \brief interfaces for %SALOME logger +*/ +/*! \brief module that provides interface to %SALOME logger +*/ module SALOME_Logger { +/*! \brief interface to use the %SALOME logger +*/ interface Logger { - //put message into one special place for all servers using Logger + /*! \brief put message into one special place for all servers using %SALOME logger + + \param message the message to send + */ oneway void putMessage (in string message); + + //! check if the logger is running void ping (); + //! shutdown the logger server void shutdown(); }; }; diff --git a/idl/Palm_Ports.idl b/idl/Palm_Ports.idl index 062d0bb5f..46223d805 100644 --- a/idl/Palm_Ports.idl +++ b/idl/Palm_Ports.idl @@ -19,7 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SALOME_Ports.idl +// File : Palm_Ports.idl // Author : André RIBES, EDF // #ifndef _PALM_PORTS_IDL_ @@ -27,8 +27,8 @@ #include "SALOME_Ports.idl" -/*! \file - This file contains IDL palm ports declations. +/*! \file Palm_Ports.idl + \brief This file contains IDL palm ports declarations. */ module Ports { @@ -39,8 +39,7 @@ module Ports { */ interface Palm_Data_Short_Port : Ports::Data_Port { - /*! - This operation permits to transmit a short. + /*! \brief This operation permits to transmit a short. \param data the short transmitted. \param time time associated to the short. @@ -57,8 +56,7 @@ module Ports { /*! \brief Interface of a sequence of short port. */ interface Palm_Data_Seq_Short_Port : Ports::Data_Port { - /*! - This operation permits to transmit a sequence of short. + /*! \brief This operation permits to transmit a sequence of short. \param data the sequence transmitted. \param time time associated to the data. diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 9c2877937..80b69b51a 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -23,8 +23,7 @@ // Author : Yves FRICAUD // $Header$ // -/*! - \file SALOMEDS.idl This file contains a set of interfaces used for creation, managment +/*! \file SALOMEDS.idl \brief This file contains a set of interfaces used for creation, management and modification of the %Study */ @@ -34,49 +33,43 @@ #include "SALOME_Exception.idl" #include "SALOME_GenericObj.idl" -/*! +/*! \brief This package contains the interfaces used for creation, managment and modification of the %Study */ module SALOMEDS { -/*! \typedef URL - Name of the file in which the %Study is saved. - +/*! \brief Name of the file in which the %Study is saved. */ typedef string URL; -/*! Main identifier of an object in %SALOME application +/*! \brief Main identifier of an object in %SALOME application */ typedef string ID; -/*! While saving the data, IOR is transformed into persistent reference +/*! \brief While saving the data, IOR is transformed into persistent reference */ typedef string PersistentReference; -/*! IOR of the study in %SALOME application +/*! \brief IOR of the study in %SALOME application */ typedef string SalomeReference; -/*! List of the names of studies which are currently open in this %SALOME session. +/*! \brief List of the names of studies which are currently open in this %SALOME session. + Since %SALOME is a multi-study application, it allows to open a lot of studies during each working session. */ typedef sequence ListOfOpenStudies; -/*! List of file names -*/ +//! List of file names typedef sequence ListOfFileNames; -/*! List of modification dates of a study -*/ +//! List of modification dates of a study typedef sequence ListOfDates ; -/*! An unbounded sequence of strings -*/ +//! An unbounded sequence of strings typedef sequence ListOfStrings ; -/*! An unbounded sequence of sequence of strings -*/ +//! An unbounded sequence of sequence of strings typedef sequence ListOfListOfStrings ; -/*! A byte stream which is used for binary data transfer between different components -*/ +//! A byte stream which is used for binary data transfer between different components typedef sequence TMPFile; // Reference to other objects is treated with function AddReference @@ -100,12 +93,10 @@ during each working session. interface UseCaseIterator; interface UseCaseBuilder; -/*! List of attributes of %SObjects -*/ +//! List of attributes of %SObjects typedef sequence ListOfAttributes; -/*! Exception indicating that this feature hasn't been implemented in %SALOME PRO application. -*/ +//! Exception indicating that this feature hasn't been implemented in %SALOME application. exception NotImplemented {}; @@ -128,19 +119,21 @@ during each working session. interface Study { +//! Invalid study context exception StudyInvalidContext {}; +//! Invalid study component exception StudyInvalidComponent {}; -/*! Invalid directory of the %study exception -*/ +//! Invalid directory of the %study exception exception StudyInvalidDirectory {}; -/*! Exception pointing that this name of the study has already been used. -*/ +//! Exception pointing that this name of the study has already been used. exception StudyNameAlreadyUsed {}; +//! study object already exists exception StudyObjectAlreadyExists {}; -/*! Invalid name of the %study exception -*/ +//! Invalid name of the %study exception exception StudyNameError {}; +//! Invalid study comment exception StudyCommentError {}; + /*! \brief The name of the %Study This is equivalent to the methods setName() & getName() @@ -151,139 +144,123 @@ during each working session. This is equivalent to the methods setID() & getID() */ attribute short StudyId; -/*! Sequence containing %SObjects -*/ +//! Sequence containing %SObjects typedef sequence ListOfSObject; -/*! - Gets the persistent reference to the %Study. -*/ +//! Get the persistent reference to the %Study. PersistentReference GetPersistentReference(); -/*! - Gets a transient reference to the %Study. -*/ +//! Get a transient reference to the %Study. SalomeReference GetTransientReference(); -/*! - Returns True if the %Study is empty +/*! \brief indicate whether the %Study is empty + + \return True if the %Study is empty */ boolean IsEmpty(); -/*! - Allows to find a %SComponent by its name. +/*! \brief Find a %SComponent by its name. + \param aComponentName It's a string value in the Comment Attribute of the Component, which is looked for, defining the data type of this Component. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. + */ SComponent FindComponent (in string aComponentName); -/*! - Allows to find a %SComponent by ID of the according %SObject + +/*! \brief Find a %SComponent by ID of the according %SObject */ SComponent FindComponentID(in ID aComponentID); -/*! - Allows to find a %SObject by the Name Attribute of this %SObject +/*! \brief Find a %SObject by the Name Attribute of this %SObject \param anObjectName String parameter defining the name of the object \return The obtained %SObject -
        See also an example of this method usage in batchmode of %SALOME application. - +See \ref example19 for an example of this method usage in batchmode of %SALOME application. */ SObject FindObject (in string anObjectName); -/*! - Allows to find a %SObject by its ID +/*! \brief Find a %SObject by its ID + \param aObjectID This parameter defines the ID of the required object \return The obtained %SObject - */ SObject FindObjectID (in ID aObjectID); -/*! - Allows to create a %SObject by its ID +/*! \brief Create a %SObject by its ID + \param aObjectID This parameter defines the ID of the required object \return The created %SObject - */ SObject CreateObjectID (in ID aObjectID); -/*! - Allows to find a %SObject by IOR of the object belonging to this %SObject. +/*! \brief Find a %SObject by IOR of the object belonging to this %SObject. + \param anObjectName This parameter defines the IOR of the object \return The obtained %SObject - */ SObject FindObjectIOR (in ID aObjectIOR); -/*! - Finds in the study all %SObjects produced by a given %Component. +/*! \brief Find in the study all %SObjects produced by a given %Component. + \param anObjectName The Name Attribute of the searched %SObjects should correspond to anObjectName. \param aComponentName The name of the component, which objects are searched for. */ ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName); -/*! - Allows to find a %SObject by the path to it. +/*! \brief Find a %SObject by the path to it. \param thePath The path to the required %SObject. \return The obtained %SObject. - */ SObject FindObjectByPath(in string thePath); -/*! - Returns the path to the %SObject. +/*! \brief Get the path to the %SObject. */ string GetObjectPath(in Object theObject); -/*! - Sets the context of the %Study. - \param thePath String parameter defining the context of the study. +/*! \brief Set the context of the %Study. -
        See also an example of this method usage in batchmode of %SALOME application. + \param thePath String parameter defining the context of the study. +See \ref example23 for an example of this method usage in batchmode of %SALOME application. */ void SetContext(in string thePath); -/*! - Gets the context of the %Study. +/*! \brief Get the context of the %Study. -
        See also an example of this method usage in batchmode of %SALOME application. - +See \ref example23 for an example of this method usage in batchmode of %SALOME application. */ string GetContext(); -/*! - Returns a list of names of objects corresponding to the context. +/*! \brief Get a list of names of objects corresponding to the context. + \note If the parameter theContext is empty, then the current context will be used. */ ListOfStrings GetObjectNames(in string theContext); -/*! - Returns a list of names of directories and subdirectories corresponding to the context. +/*! \brief Get a list of names of directories and subdirectories corresponding to the context. + \note If the parameter theContext is empty, then the current context will be used. */ ListOfStrings GetDirectoryNames(in string theContext); -/*! - Returns a list of names of Files corresponding to the context. +/*! \brief Get a list of names of Files corresponding to the context. + \note If the parameter theContext is empty, then the current context will be used. */ ListOfStrings GetFileNames(in string theContext); -/*! - Returns a list of names of Components corresponding to the context. +/*! \brief Get a list of names of Components corresponding to the context. + \note If the parameter theContext is empty, then the current context will be used. */ ListOfStrings GetComponentNames(in string theContext); -/*! - Creates a new iterator of child levels of the given %SObject. +/*! \brief Create a new iterator of child levels of the given %SObject. + \param aSO The given %SObject \return A new iterator of child levels of the given %SObject. */ ChildIterator NewChildIterator(in SObject aSO); -/*! - Creates a new iterator of the %SComponents. +/*! \brief Create a new iterator of the %SComponents. \return A new iterator of the %SComponents. */ SComponentIterator NewComponentIterator(); -/*! - Creates a new %StudyBuilder to add or modify an object in the study. - \return A new %StudyBuilder. +/*! \brief Create a new %StudyBuilder to add or modify an object in the study. -
        See also an example of this method usage in batchmode of %SALOME application. + \return A new %StudyBuilder. +See \ref example20 for an example of this method usage in batchmode of %SALOME application. */ StudyBuilder NewBuilder() ; /*! \brief Labels dependency @@ -294,28 +271,26 @@ during each working session. /*! \brief Getting properties of the study - Returns the attriubte, which contains the properties of this study. + Returns the attribute, which contains the properties of this study. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example20 for an example of this method usage in batchmode of %SALOME application. */ AttributeStudyProperties GetProperties(); -/*! - Determines whether the %study has been saved +/*! \brief Indicate whether the %study has been saved */ attribute boolean IsSaved; -/*! +/*! \brief Indicate whether the %study has been modified and not saved. + Returns True if the %study has been modified and not saved. */ boolean IsModified(); -/*! - Marks the %study as being modified and not saved. +/*! \brief Mark the %study as being modified and not saved. */ void Modified(); -/*! - Determines the file where the %study has been saved +/*! \brief Indicate the file where the %study has been saved */ attribute string URL; @@ -348,18 +323,15 @@ during each working session. \return An object */ Object ConvertIORToObject(in string theIOR); -/*! - Gets a new %UseCaseBuilder. +/*! \brief Get a new %UseCaseBuilder. */ UseCaseBuilder GetUseCaseBuilder(); -/*! - Closes the components in the study, removes itself from the %StudyManager. +/*! \brief Close the components in the study, remove itself from the %StudyManager. */ void Close(); -/*! - Enables(if isEnabled = True)/disables automatic addition of new %SObjects to the use case. +/*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case. */ void EnableUseCaseAutoFilling(in boolean isEnabled); @@ -376,15 +348,15 @@ during each working session. boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished); -/*! - Returns an AttributeParameter used to store common parameters for given %theSavePoint. +/*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint. + \param theID identifies a common parameters set (Example: "Interface Applicative") \param theSavePoint is number of a set of parameters as there can be several sets */ AttributeParameter GetCommonParameters(in string theID, in long theSavePoint); -/*! - Returns an AttributeParameter used to store parameters for given %theModuleName. +/*! \brief Get an AttributeParameter used to store parameters for given %theModuleName. + \param theID identifies a common parameters set (Example: "Interface Applicative") \param theModuleName is a name of the module (Example: "Geometry") \param theSavePoint is number of a set of parameters as there can be several sets @@ -392,8 +364,8 @@ during each working session. AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint); -/*! - Returns a default Python script to restore visual parameters for given %theModuleName. +/*! \brief Get a default Python script to restore visual parameters for given %theModuleName. + \param theID identifies a common parameters set (Example: "Interface Applicative") \param theModuleName is a name of the module (Example: "Geometry") */ @@ -408,101 +380,106 @@ during each working session. long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); -/*! - Marks this Study as being locked by the given locker. The lock status can be checked by method IsStudyLocked +/*! \brief Mark this Study as being locked by the given locker. + + The lock status can be checked by method IsStudyLocked \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study. */ void SetStudyLock(in string theLockerID); -/*! - Returns True if the Study was marked locked. +/*! \brief Indicate if the Study is locked + + Returns True if the Study was marked locked. */ boolean IsStudyLocked(); -/*! - Marks this Study as being unlocked by the given locker. The lock status can be checked by method IsStudyLocked +/*! \brief Mark this Study as being unlocked by the given locker. + + The lock status can be checked by method IsStudyLocked \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study. */ void UnLockStudy(in string theLockerID); -/*! - Returns the list iof IDs of the Study's lockers. +/*! \brief Get the list of IDs of the Study's lockers. */ ListOfStrings GetLockerID(); -/*! - Create real variable with Name theVarName value theValue - (or set if variable value in to theValue already exists) +/*! \brief Create real variable with Name theVarName and value theValue + + (or set if variable value into theValue already exists) \param theVarName is a name of the variable \param theVarName is a value of the variable. */ void SetReal( in string theVarName, in double theValue ); -/*! - Create integer variable with Name theVarName value theValue - (or set if variable value in to theValue already exists) +/*! \brief Create integer variable with Name theVarName and value theValue + + (or set if variable value into theValue already exists) \param theVarName is a name of the variable \param theVarName is a value of the variable. */ void SetInteger( in string theVarName, in long theValue ); -/*! - Create boolean variable with Name theVarName value theValue - (or set if variable value in to theValue already exists) +/*! \brief Create boolean variable with Name theVarName and value theValue + + (or set if variable value into theValue already exists) \param theVarName is a name of the variable \param theVarName is a value of the variable. */ void SetBoolean( in string theVarName, in boolean theValue ); -/*! - Return real value of the variable +/*! \brief Get value of a real variable + \param theVarName is a name of the variable. */ double GetReal( in string theVarName ); -/*! - Return integer value of the variable +/*! \brief Get value of an integer variable + \param theVarName is a name of the variable. */ long GetInteger( in string theVarName ); -/*! - Return boolean value of the variable +/*! \brief Get value of a boolean variable + \param theVarName is a name of the variable. */ boolean GetBoolean( in string theVarName ); -/*! +/*! \brief Indicate if a variable is real + Return true if variable is real otherwise return false. \param theVarName is a name of the variable. */ boolean IsReal( in string theVarName ); -/*! +/*! \brief Indicate if a variable is integer + Return true if variable is integer otherwise return false. \param theVarName is a name of the variable. */ boolean IsInteger( in string theVarName ); -/*! +/*! \brief Indicate if a variable is boolean + Return true if variable is boolean otherwise return false. \param theVarName is a name of the variable. */ boolean IsBoolean( in string theVarName ); -/*! +/*! \brief Indicate if a variable exists in the study + Return true if variable exists in the study, otherwise return false. \param theVarName is a name of the variable. */ boolean IsVariable( in string theVarName ); -/*! - Return names of all variables from the study. +/*! \brief Get names of all variables from the study. */ ListOfStrings GetVariableNames(); -/*! \brief Removing variable +/*! \brief Remove a variable Remove variable with the specified name from the study with substitution of its value. @@ -511,7 +488,7 @@ during each working session. */ boolean RemoveVariable( in string theVarName ); -/*! \brief Renaming variable +/*! \brief Rename a variable Rename variable with the specified name within the study. @@ -521,7 +498,7 @@ during each working session. */ boolean RenameVariable( in string theVarName, in string theNewVarName ); -/*! \brief Checking variable usage +/*! \brief Indicate whether variable is used Check that variable is used in the study. @@ -564,7 +541,7 @@ during each working session. Creates a new %SComponent \param ComponentDataType Data type of the %SComponent which will be created. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example17 for an example of this method usage in batchmode of %SALOME application. */ SComponent NewComponent(in string ComponentDataType) raises(LockProtection); @@ -587,7 +564,7 @@ during each working session. \param theFatherObject The father %SObject under which this one should be created. \return New %SObject -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example18 for an example of this method usage in batchmode of %SALOME application. */ @@ -620,7 +597,7 @@ during each working session. /*! Loads a %SComponent. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example19 for an example of this method usage in batchmode of %SALOME application. */ void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception); @@ -637,7 +614,7 @@ during each working session. \param anObject The %SObject corresponding to the attribute which is looked for. \param aTypeOfAttribute Type of the attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ GenericAttribute FindOrCreateAttribute(in SObject anObject, @@ -661,7 +638,7 @@ during each working session. \param anObject The %SObject corresponding to the attribute. \param aTypeOfAttribute Type of the attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example17 for an example of this method usage in batchmode of %SALOME application. */ void RemoveAttribute(in SObject anObject, in string aTypeOfAttribute) raises(LockProtection); @@ -685,7 +662,7 @@ during each working session. Adds a directory in the %Study. \param theName String parameter defining the name of the directory. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example23 for an example of this method usage in batchmode of %SALOME application. */ void AddDirectory(in string theName) raises(LockProtection); @@ -712,7 +689,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin Creates a new command which can contain several different actions. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void NewCommand(); // command management @@ -722,7 +699,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example16 for an example of this method usage in batchmode of %SALOME application. */ void CommitCommand() raises(LockProtection); // command management @@ -734,7 +711,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin Cancels all actions declared within the command. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example17 for an example of this method usage in batchmode of %SALOME application. */ void AbortCommand(); // command management /*! \brief Undolimit @@ -748,7 +725,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example16 for an example of this method usage in batchmode of %SALOME application. */ void Undo() raises (LockProtection); @@ -758,21 +735,21 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example16 for an example of this method usage in batchmode of %SALOME application. */ void Redo() raises (LockProtection); /*! Returns True if at this moment there are any actions which can be canceled. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example16 for an example of this method usage in batchmode of %SALOME application. */ boolean GetAvailableUndos(); /*! Returns True if at this moment there are any actions which can be redone. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ boolean GetAvailableRedos(); @@ -837,7 +814,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \param study_name String parameter defining the name of the study -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example17 for an example of this method usage in batchmode of %SALOME application. */ Study NewStudy(in string study_name); @@ -848,7 +825,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \param aStudyUrl The path to the study \warning This method doesn't activate the corba objects. Only a component can do it. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception); @@ -863,7 +840,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \param theMultiFile If this parameter is True the study will be saved in several files. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example19 for an example of this method usage in batchmode of %SALOME application. */ boolean Save(in Study aStudy, in boolean theMultiFile); @@ -880,7 +857,7 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin \param aStudy The study which will be saved \param theMultiFile If this parameter is True the study will be saved in several files. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ boolean SaveAs(in URL aUrl, // if the file already exists in Study aStudy, @@ -1027,7 +1004,7 @@ Gets the list of open studies \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject. \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ boolean FindAttribute(out GenericAttribute anAttribute, in string aTypeOfAttribute); @@ -1041,7 +1018,7 @@ Gets the list of open studies \return The list of all attributes of the given %SObject. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example17 for an example of this method usage in batchmode of %SALOME application. */ ListOfAttributes GetAllAttributes(); @@ -1107,14 +1084,17 @@ Gets the list of open studies */ void CheckLocked() raises (LockProtection); + //! Get Type string Type(); + //! Get the class type string GetClassType(); + //! Get SObject SObject GetSObject(); + //! Private method, returns an implementation of this GenericAttribute. /*! - Private method, returns an implementation of this GenericAttribute. \param theHostname is a hostname of the caller \param thePID is a process ID of the caller \param isLocal is set True if the GenericAttribute is launched locally with the caller @@ -1134,12 +1114,12 @@ Gets the list of open studies //========================================================================== interface SComponent : SObject { -/*! Gets the data type of the given %SComponent +/*! \brief Gets the data type of the given %SComponent \return The data type of this %SComponent. */ string ComponentDataType(); -/*! Gets the IOR of the given component +/*! \brief Gets the IOR of the given component \return True (if there is an instance of the given component) and its IOR. */ @@ -1158,22 +1138,22 @@ Gets the list of open studies interface SComponentIterator : SALOME::GenericObj { /*! -Activates the %SComponentIterator. +\brief Activates the %SComponentIterator. */ void Init(); -/*! Method More +/*! \brief Method More \return True if there is one more %SComponent in the list. */ boolean More(); /*! -Moves the iterator to the next %SComponent in the list. +\brief Moves the iterator to the next %SComponent in the list. */ void Next(); /*! - Returns the %SComponent corresponding to the current %SComponent found by the iterator. + \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ SComponent Value(); @@ -1190,27 +1170,27 @@ Moves the iterator to the next %SComponent in the list. { /*! -Activates the %ChildIterator. +\brief Activates the %ChildIterator. */ void Init(); /*! -Activates the %ChildIterator for all child levels. +\brief Activates the %ChildIterator for all child levels. \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels. */ void InitEx(in boolean allLevels); -/*! Method More +/*! \brief Method More \return True if there is one more %ChildIterator in the list. */ boolean More(); /*! - Passes the iterator to the next level. + \brief Passes the iterator to the next level. */ void Next(); /*! - Returns the %SObject corresponding to the current object found by the iterator. + \brief Returns the %SObject corresponding to the current object found by the iterator. */ SObject Value(); }; @@ -1336,7 +1316,7 @@ can be called by any component and which provide the following functionality: \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files. \return A byte stream TMPFile that contains all saved data -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example19 for an example of this method usage in batchmode of %SALOME application. */ @@ -1351,7 +1331,7 @@ can be called by any component and which provide the following functionality: \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files. \return A byte stream TMPFile that will contain all saved data -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example19 for an example of this method usage in batchmode of %SALOME application. */ TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile); diff --git a/idl/SALOMEDS_Attributes.idl b/idl/SALOMEDS_Attributes.idl index 787f9aadd..dd49ef584 100644 --- a/idl/SALOMEDS_Attributes.idl +++ b/idl/SALOMEDS_Attributes.idl @@ -19,11 +19,12 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// File : SALOMEDS.idl +// File : SALOMEDS_Attributes.idl // Author : Yves FRICAUD // $Header$ // -/*! \file SALOMEDS_Attributes.idl This file contains a set of interfaces +/*! \file SALOMEDS_Attributes.idl + \brief This file contains a set of interfaces for the attributes which can be assigned to %SObject */ #ifndef _SALOMEDS_AttributesIDL_ @@ -33,28 +34,23 @@ module SALOMEDS { -/*! Sequence of double values -*/ +//! Sequence of double values typedef sequence DoubleSeq; -/*! Sequence of long values -*/ +//! Sequence of long values typedef sequence LongSeq; -/*! Sequence of string values -*/ +//! Sequence of string values typedef sequence StringSeq; -/*! \struct Color - This structure stores a set of elements defining the color based on RGB palette. These elements are +/*! \brief This structure stores a set of elements defining the color based on RGB palette. + + These elements are used as input parameters for methods necessary for color definition of different items. */ struct Color { -/*! Red color -*/ +//! Red color double R; -/*! Green color -*/ +//! Green color double G; -/*! Blue color -*/ +//! Blue color double B; }; //========================================================================== @@ -66,16 +62,16 @@ module SALOMEDS interface AttributeReal : GenericAttribute { +//! Returns the value of this attribute. /*! - Returns the value of this attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ double Value(); + //! Sets the value of this attribute. /*! - Sets the value of this attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in double value); @@ -88,16 +84,17 @@ module SALOMEDS //========================================================================== interface AttributeInteger : GenericAttribute { + //! Returns the value of this attribute /*! - Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ long Value(); + + //! Sets the value of this attribute /*! - Sets the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in long value); }; @@ -109,51 +106,45 @@ module SALOMEDS //========================================================================== interface AttributeSequenceOfReal : GenericAttribute { + //! Initialization of the attribute with initial data. /*! - Initialization of the attribute with initial data. \param other Initially assigned sequence of real numbers. */ void Assign (in DoubleSeq other); -/*! - Returns the sequence of real numbers stored in the attribute. -*/ +//! Returns the sequence of real numbers stored in the attribute. DoubleSeq CorbaSequence(); -/*! - Adds to the end of the sequence a real number. +/*! \brief Adds to the end of the sequence a real number. \param value A real number added to the sequence. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Add (in double value); -/*! - Removes a real number with a definite index +/*! \brief Removes a real number with a definite index from the sequence of real numbers stored in the Attribute. \param index The index of the given real number */ void Remove(in long index); -/*! - Substitutes a given real number with a definite index for another real number. +/*! \brief Substitutes a given real number with a definite index for another real number. + \param index The index of the given real number. \param value The value of another real number. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void ChangeValue(in long index, in double value); -/*! - Returns a given real number with a definite index - in the sequence of real numbers stored in the Attribute. +/*! \brief Returns a given real number with a definite index in the sequence of real numbers stored in the Attribute. + \param index The index of the given real number. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ double Value(in short index); -/*! - Returns the length of the sequence of real numbers stored in the Attribute. +/*! \brief Returns the length of the sequence of real numbers stored in the Attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ long Length(); @@ -166,51 +157,44 @@ module SALOMEDS //========================================================================== interface AttributeSequenceOfInteger : GenericAttribute { -/*! - Initialisation of the attribute with initial data. +/*! \brief Initialisation of the attribute with initial data. \param other Initially assigned sequence of integer numbers. */ void Assign (in LongSeq other); -/*! - Returns the sequence of integer numbers stored in the Attribute. -*/ +//! Returns the sequence of integer numbers stored in the Attribute. LongSeq CorbaSequence(); -/*! - Adds to the end of the sequence an integer number. +/*! \brief Adds to the end of the sequence an integer number. + \param value An integer number added to the sequence. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Add (in long value); -/*! - Removes an integer number with a definite index - from the sequence of integer numbers stored in the Attribute. +/*! \brief Removes an integer number with a definite index from the sequence of integer numbers stored in the Attribute. + \param index The index of the given integer number. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Remove(in long index); -/*! - Substitutes an integer number with a definite index for another integer number. +/*! \brief Substitutes an integer number with a definite index for another integer number. + \param index The index of the given integer number. \param value The value of another integer number. */ void ChangeValue(in long index, in long value); -/*! - Returns a given integer number with a definite index - in the sequence of integer numbers stored in the Attribute. +/*! \brief Returns a given integer number with a definite index in the sequence of integer numbers stored in the Attribute. \param index The index of the given integer number. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ long Value(in short index); -/*! - Returns the length of the sequence of integer numbers stored in the Attribute. +/*! \brief Returns the length of the sequence of integer numbers stored in the Attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ long Length(); @@ -226,18 +210,16 @@ module SALOMEDS interface AttributeName : GenericAttribute { -/*! - Returns the value of this attribute +/*! \brief Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); -/*! - Sets the value of this attribute +/*! \brief Sets the value of this attribute \param value This parameter defines the value of this attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -251,17 +233,15 @@ module SALOMEDS //========================================================================== interface AttributeComment : GenericAttribute { -/*! - Returns the value of this attribute +/*! \brief Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); -/*! - Sets the value of this attribute +/*! \brief Sets the value of this attribute \param value This string parameter defines the value of this attribute - a description of a %SObject. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -295,14 +275,14 @@ module SALOMEDS /*! Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); /*! Sets the value of this attribute \param value This parameter defines the value of this attribute - IOR of a %SObject. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -318,14 +298,14 @@ module SALOMEDS /*! Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); /*! Sets the value of this attribute \param value This parameter defines the value of this attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -340,12 +320,12 @@ module SALOMEDS { /*! Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); /*! Sets the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -360,12 +340,12 @@ module SALOMEDS { /*! Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); /*! Sets the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -387,7 +367,7 @@ module SALOMEDS /*! Returns TRUE if the item is drawable (as it is by default) and FALSE if it isn't. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example8 for an example of this method usage in batchmode of %SALOME application. */ boolean IsDrawable(); @@ -396,7 +376,7 @@ Sets the item to be drawable. \param value If the value of this boolean parameter is TRUE (default) the item will be drawable. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example8 for an example of this method usage in batchmode of %SALOME application. */ void SetDrawable(in boolean value); @@ -415,7 +395,7 @@ Sets the item to be drawable. Returns TRUE if the item is selectable (as it is by default) and FALSE if it isn't. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example9 for an example of this method usage in batchmode of %SALOME application. */ boolean IsSelectable(); @@ -424,7 +404,7 @@ Sets the item to be selectable \param value If the value of this parameter is TRUE (the default) the item will be set as selectable. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example9 for an example of this method usage in batchmode of %SALOME application. */ void SetSelectable(in boolean value); @@ -443,7 +423,7 @@ Sets the item to be selectable /*! Returns TRUE if this item is expandable even when it has no children. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example10 for an example of this method usage in batchmode of %SALOME application. */ boolean IsExpandable(); @@ -451,7 +431,7 @@ Sets the item to be selectable \param value If the value of this boolean parameter is TRUE, this item will be set as expandable. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example10 for an example of this method usage in batchmode of %SALOME application. */ void SetExpandable(in boolean value); @@ -500,7 +480,7 @@ Sets the item to be selectable /*! Returns TRUE if this item is open (its children are visible) and FALSE if it isn't. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example11 for an example of this method usage in batchmode of %SALOME application. */ boolean IsOpened(); @@ -510,7 +490,7 @@ Sets the item to be selectable \param value If the value of this boolean parameter is TRUE this item will be set as open, and as closed if FALSE. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example11 for an example of this method usage in batchmode of %SALOME application. */ void SetOpened(in boolean value); @@ -526,7 +506,7 @@ Sets the item to be selectable /*! Returns the color of an item. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example12 for an example of this method usage in batchmode of %SALOME application. */ Color TextColor(); @@ -535,7 +515,7 @@ Sets the item to be selectable \param value This parameter defines the color of the item. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example12 for an example of this method usage in batchmode of %SALOME application. */ void SetTextColor(in Color value); @@ -554,7 +534,7 @@ Sets the item to be selectable -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example13 for an example of this method usage in batchmode of %SALOME application. */ Color TextHighlightColor(); @@ -562,7 +542,7 @@ Sets the item to be selectable Sets the highlight color of an item. \param value This parameter defines the highlight color of the item. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example13 for an example of this method usage in batchmode of %SALOME application. */ void SetTextHighlightColor(in Color value); @@ -582,7 +562,7 @@ Sets the item to be selectable /*! Returns the name of the icon in the format of a string. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example14 for an example of this method usage in batchmode of %SALOME application. */ string GetPixMap(); @@ -590,7 +570,7 @@ Sets the item to be selectable Sets the name of the icon. \param value This string parameter defines the name of the icon. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example14 for an example of this method usage in batchmode of %SALOME application. */ void SetPixMap(in string value); @@ -603,7 +583,7 @@ Sets the item to be selectable tree whith its own structure and identifier. The quantity of such trees with different identifiers can be arbitrary. -
        See also an example of usage of the methods of this interface in batchmode of %SALOME application. +See \ref example18 for an example of usage of the methods of this interface in batchmode of %SALOME application. */ //========================================================================== @@ -691,7 +671,7 @@ Sets the item to be selectable /*! Deletes a tree node. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Remove(); @@ -734,7 +714,7 @@ Sets the item to be selectable /*! Returns the value of this attribute. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ long Value(); /*! @@ -742,7 +722,7 @@ Sets the item to be selectable \param value This parameter defines the local ID which will be set. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in long value); }; @@ -758,13 +738,13 @@ Sets the item to be selectable /*! Returns the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ string Value(); /*! Sets the value of this attribute -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example1 for an example of this method usage in batchmode of %SALOME application. */ void SetValue(in string value); }; @@ -783,7 +763,7 @@ Sets the item to be selectable /*! Adds a %SObject to the list of %SObjects which refer to this %SObject. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Add(in SObject anObject); @@ -794,7 +774,7 @@ Sets the item to be selectable /*! Deletes a %SObject from the list of %SObjects which refer to this %SObject. -
        See also an example of this method usage in batchmode of %SALOME application. +See \ref example3 for an example of this method usage in batchmode of %SALOME application. */ void Remove(in SObject anObject); @@ -805,20 +785,16 @@ Sets the item to be selectable This attribute allows to store a table of integers (indexing from 1 like in CASCADE) and string titles of this table, of each row, of each column. -
        See also an example of usage of these methods in batchmode of %SALOME application. +See \ref example21 for an example of usage of these methods in batchmode of %SALOME application. */ //========================================================================== interface AttributeTableOfInteger : GenericAttribute { -/*! - This exception is raised when an incorrect index is passed as parameter. -*/ +//! This exception is raised when an incorrect index is passed as parameter. exception IncorrectIndex {}; -/*! - This exception is raised when an incorrect length of the argument is passed as parameter. -*/ +//! This exception is raised when an incorrect length of the argument is passed as parameter. exception IncorrectArgumentLength {}; // titles: for table, for each row, for each column @@ -964,20 +940,16 @@ Sets the item to be selectable This attribute allows to store a table of reals (indexing from 1 like in CASCADE) and string titles of this table, of each row, of each column. -
        See also an example of usage of these methods in batchmode of %SALOME application. +See \ref example21 for an example of usage of these methods in batchmode of %SALOME application. */ //========================================================================== interface AttributeTableOfReal : GenericAttribute { -/*! - This exception is raised when an incorrect index is passed as parameter. -*/ +//! This exception is raised when an incorrect index is passed as parameter. exception IncorrectIndex {}; -/*! - This exception is raised when an incorrect length of the argument is passed as parameter. -*/ +//! This exception is raised when an incorrect length of the argument is passed as parameter. exception IncorrectArgumentLength {}; // titles: for table, for each row, for each column @@ -1114,20 +1086,16 @@ Sets the item to be selectable This attribute allows to store a table of strings (indexing from 1 like in CASCADE) and string titles of this table, of each row, of each column. -
        See also an example of usage of these methods in batchmode of %SALOME application. +See \ref example21 for an example of usage of these methods in batchmode of %SALOME application. */ //========================================================================== interface AttributeTableOfString : GenericAttribute { -/*! - This exception is raised when an incorrect index is passed as parameter. -*/ +//! This exception is raised when an incorrect index is passed as parameter. exception IncorrectIndex {}; -/*! - This exception is raised when an incorrect length of the argument is passed as parameter. -*/ +//! This exception is raised when an incorrect length of the argument is passed as parameter. exception IncorrectArgumentLength {}; // titles: for table, for each row, for each column @@ -1263,7 +1231,7 @@ Sets the item to be selectable This attribute allows to store study properties: user name, creation date, creation mode, modified flag, locked flag. -
        See also an example of usage of these methods in batchmode of %SALOME application. +See \ref example20 for an example of usage of these methods in batchmode of %SALOME application. */ //========================================================================== diff --git a/idl/SALOME_Comm.idl b/idl/SALOME_Comm.idl index 3c2e3f173..31d5d9643 100644 --- a/idl/SALOME_Comm.idl +++ b/idl/SALOME_Comm.idl @@ -24,6 +24,11 @@ #include "SALOME_Exception.idl" +/*! + \file SALOME_Comm.idl \brief This file contains a set of interfaces used for communication + between components + */ + module SALOME { enum TypeOfDataTransmitted { _DOUBLE_,_INT_ }; diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index d12f1e190..e47f886d0 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -29,6 +29,9 @@ #include "SALOMEDS.idl" #include "SALOME_Exception.idl" +/*! \file SALOME_Component.idl \brief interfaces for Component and Container +*/ + /*! \brief This is a package of interfaces used for connecting new components to %SALOME application. It also contains a set of interfaces used for management of %MED @@ -42,9 +45,7 @@ module Engines */ typedef sequence TMPFile; - /*! - General Key Value Structure to set or get properties, for component - */ + //! General Key Value Structure to set or get properties, for component struct KeyValuePair { string key; @@ -66,8 +67,8 @@ module Engines interface Container { - /*! - Loads a new component class (dynamic library). + /*! \brief Loads a new component class (dynamic library). + \param componentName like COMPONENT, (Python or C++ implementation) try to make a Python import of COMPONENT, then a lib open of libCOMPONENTEngine.so @@ -75,8 +76,8 @@ module Engines */ boolean load_component_Library(in string componentName); + //! Create a new servant instance of a component. /*! - Creates a new servant instance of a component. Component library must be loaded. \param componentName Name of the component which will be registered in Registry and Name Service, @@ -88,8 +89,8 @@ module Engines Engines::Component create_component_instance(in string componentName, in long studyId); + //! Find a servant instance of a component /*! - Finds a servant instance of a component \param registeredName Name of the component in Registry or Name Service, without instance suffix number \param studyId 0 if instance is not associated to a study, @@ -99,8 +100,8 @@ module Engines Component find_component_instance(in string registeredName, in long studyId); + //! Find a servant instance of a component, or create a new one. /*! - Find a servant instance of a component, or create a new one. Loads the component library if needed. Only applicable to multiStudy components. \param nameToRegister Name of the component which will be registered @@ -112,52 +113,37 @@ module Engines Component load_impl(in string nameToRegister, in string componentName); + //! Remove the component servant, and deletes all related objects /*! - Stops the component servant, and deletes all related objects \param component_i Component to be removed */ void remove_impl(in Component component_i); - /*! - Discharges all components from the container. - */ + //! Unload component libraries from the container. void finalize_removal() ; - /*! - Determines whether the server has been loaded or not. - */ + //! Determines whether the server has been loaded or not. void ping(); - /*! - Name of the %container - */ + //! Name of the %container readonly attribute string name ; - /*! - working directory of the %container - */ + //! working directory of the %container readonly attribute string workingdir ; - /*! - name of the %container log file (this has been set by the launcher) - */ + //! name of the %container log file (this has been set by the launcher) attribute string logfilename ; - /*! - Shutdown the Container process. - */ + //! Shutdown the Container process. void Shutdown(); - /*! - Returns the hostname of the container - */ + //! Returns the hostname of the container string getHostName(); - /*! - Returns the PID of the container - */ + //! Returns the PID of the container long getPID(); + //! Kill the container /*! Returns True if the %container has been killed. Kept for Superv compilation but can't work, unless oneway... @@ -165,6 +151,7 @@ module Engines */ boolean Kill_impl() ; + //! Create a fileRef /*! returns a fileRef object if origFileName exists and is readable else returns null object. Only one fileRef is created for a given @@ -173,6 +160,7 @@ module Engines */ fileRef createFileRef(in string origFileName); + //! Create a Salome_file /*! returns a Salome_file object if origFileName exists and is readable else returns null object. @@ -183,6 +171,7 @@ module Engines */ Salome_file createSalome_file(in string origFileName); + //! Create a fileTransfer /*! returns a fileTransfer object used to copy files from the container machine to the clients machines. Only one fileTransfer instance is @@ -198,30 +187,25 @@ module Engines */ interface Component { - /*! - The name of the instance of the %Component - */ + //! The name of the instance of the %Component readonly attribute string instanceName ; - /*! - The name of the interface of the %Component - */ + //! The name of the interface of the %Component readonly attribute string interfaceName ; - /*! - Determines whether the server has already been loaded or not. - */ + //! Determines whether the server has already been loaded or not. void ping(); -// /*! +// // Set study associated to component instance // \param studyId // (=0: multistudy component instance, // >0: study id associated to this instance // \return false if already set with a different value (change not possible) -// */ +// // boolean setStudyId(in long studyId); + //! Get study associated to component instance /*! get study associated to component instance \return -1: not initialised (Internal Error) @@ -230,6 +214,7 @@ module Engines */ long getStudyId(); + //! Remove component instance from container /*! Deactivates the %Component. -- TO BE USED BY CONTAINER ONLY (Container housekeeping) -- @@ -237,11 +222,10 @@ module Engines */ void destroy() ; - /*! - Returns the container that the %Component refers to. - */ + //! Returns the container that the %Component refers to. Container GetContainerRef() ; + //! Set component instance properties /*! Gives a sequence of (key=string,value=any) to the component. Base class component stores the sequence in a map. @@ -250,12 +234,14 @@ module Engines */ void setProperties(in FieldsDict dico); + //! Get component instance properties /*! returns a previously stored map (key=string,value=any) as a sequence. See setProperties(in FieldsDict dico). */ FieldsDict getProperties(); + //! Set name of a node in a graph (for %SUPERVISOR use) /*! This method is used by the %SUPERVISOR component. It sets the names of the graph and of the node. @@ -264,33 +250,39 @@ module Engines */ void Names( in string aGraphName , in string aNodeName ) ; + //! Kill the component (if you can) /*! Returns True if the %Component has been killed. */ boolean Kill_impl() ; + //! Stop the component (if you can) /*! Returns True if the activity of the %Component has been stopped. (It's action can't be resumed) */ boolean Stop_impl() ; + //! Suspend the component /*! Returns True if the activity of the %Component has been suspended. (It's action can be resumed) */ boolean Suspend_impl() ; + //! Resume the component /*! Returns True if the activity of the %Component has been resumed. */ boolean Resume_impl() ; + //! Get the cpu used /*! - Returns the Cpu used (long does not run with python !...) + Returns the Cpu used */ long CpuUsed_impl() ; + //! Get a python dump /*! Returns a python script, which is being played back reproduces the data model of component @@ -300,8 +292,8 @@ module Engines out boolean isValidScript); + //! Returns a CORBA Ref of a input Salome_file managed by a service. /*! - Returns a CORBA Ref of a input Salome_file managed by a service. \param service_name service's name. \param file_name name of the requested file. @@ -314,6 +306,7 @@ module Engines Engines::Salome_file getInputFileToService(in string service_name, in string Salome_file_name) raises(SALOME::SALOME_Exception); + //! Check service input files (transfer them if needed) /*! This method is used before the activation of the service. It calls recvFiles() on all the input Salome_file files of the service. @@ -331,8 +324,8 @@ module Engines */ void checkInputFilesToService(in string service_name) raises(SALOME::SALOME_Exception); + //! This method adds a input Salome_file to a service of the component. /*! - This method adds a input Salome_file to a service of the component. \param service_name service's name. \param Salome_file_name name of the Salome_file @@ -345,8 +338,8 @@ module Engines Engines::Salome_file setInputFileToService(in string service_name, in string Salome_file_name) raises(SALOME::SALOME_Exception); + //! Returns a CORBA Ref of a output Salome_file managed by a service. /*! - Returns a CORBA Ref of a output Salome_file managed by a service. \param service_name service's name. \param file_name name of the requested file. @@ -359,6 +352,7 @@ module Engines Engines::Salome_file getOutputFileToService(in string service_name, in string Salome_file_name) raises(SALOME::SALOME_Exception); + //! Check service output files (transfer them if needed) /*! This method is used at the end of the service. It calls recvFiles() on all the output Salome_file files of the service. @@ -376,8 +370,8 @@ module Engines */ void checkOutputFilesToService(in string service_name) raises(SALOME::SALOME_Exception); + //! This method adds an output Salome_file to a service of the component. /*! - This method adds an output Salome_file to a service of the component. \param service_name service's name. \param Salome_file_name name of the Salome_file @@ -389,6 +383,8 @@ module Engines */ Engines::Salome_file setOutputFileToService(in string service_name, in string Salome_file_name) raises(SALOME::SALOME_Exception); + + //! Indicate if the component instance provides custom information about its objects. /*! Returns true if the component provides custom information about its objects, false otherwise. Should be redefined in the certain component to return true in case of this @@ -396,6 +392,7 @@ module Engines */ boolean hasObjectInfo(); + //! Get custom information about the given object. /*! This method is used to get the custom information about the given object. Should be redefined in the certain component in case of this @@ -414,10 +411,7 @@ module Engines void send_parallel_proxy_object(in Object proxy_ref); }; - /*! - A block of binary data used for file transfer. The maximum size of the - block is defined on server side. - */ + //! A block of binary data used for file transfer. The maximum size of the block is defined on server side. typedef sequence fileBlock; /*! \brief Interface of fileTransfer. @@ -426,6 +420,7 @@ module Engines */ interface fileTransfer { + //! Open the file transfer /*! open method returns a key (fileId) that identifies the structure (ex: C FILE), associated to the original file on the server. @@ -436,12 +431,14 @@ module Engines */ long open(in string fileName); + //! Close the file transfer /*! when the file transfer is finished, close method releases structures created by open method, identified by fileId. */ void close(in long fileId); + //! Get a file data block /*! Get successive blocks of octets from the original file. The last block is empty, and identifies the end of file. @@ -449,36 +446,35 @@ module Engines fileBlock getBlock(in long fileId); }; - /*! - This is a file managed by a Salome_file. It contains file's name, path and status. - The status is : "present" or "notpresent". - */ + //! A file managed by a Salome_file. struct file { + //! file name string file_name; - string path; + //! path name + string path; string type; string source_file_name; - string status; + //! status ("present" or "notpresent") + string status; long node; Engines::Container container; }; - /*! - A sequence of Engines::file. - */ + //! A sequence of Engines::file. typedef sequence files; - /*! - It is the state of a Salome_file. It contains the Salome_file's name, the name - of the hdf5 file where it can be saved, the number of files managed and the information - if all the files are received. - */ + //! The state of a Salome_file. struct SfState { - string name; - string hdf5_file_name; - long number_of_files; - boolean files_ok; + //! file name + string name; + //! hdf5 file where the file can be saved + string hdf5_file_name; + //! number of files managed + long number_of_files; + //! information if all the files are received + boolean files_ok; + }; /*! \brief Interface of a Salome_file managed @@ -488,8 +484,8 @@ module Engines */ interface Salome_file : Engines::fileTransfer { + //! Load a Salome_file from a hdf5 file. /*! - Load a Salome_file from a hdf5 file. \param hdf5_file name (with path) of the hdf5_file. @@ -497,8 +493,8 @@ module Engines */ void load(in string hdf5_file) raises (SALOME::SALOME_Exception); + //! Save a Salome_file into a hdf5_file. /*! - Save a Salome_file into a hdf5_file. \param hdf5_file name (with path) of the hdf5_file. @@ -507,9 +503,9 @@ module Engines */ void save(in string hdf5_file) raises (SALOME::SALOME_Exception); + //! Save a Salome_file into a hdf5_file. /*! - Save a Salome_file into a hdf5_file. All files that are managed - are saved into the hdf5_file + All files that are managed are saved into the hdf5_file \param hdf5_file name (with path) of the hdf5_file. @@ -520,8 +516,8 @@ module Engines /**************/ + //! Add a Local file to the Salome_file. /*! - Add a Local file to the Salome_file. \param file_name name of the file with the path. @@ -529,8 +525,8 @@ module Engines */ void setLocalFile(in string comp_file_name) raises (SALOME::SALOME_Exception); + //! Add a Distributed file to the Salome_file. /*! - Add a Distributed file to the Salome_file. \param comp_file_name name of the file with the path. @@ -538,8 +534,8 @@ module Engines */ void setDistributedFile(in string comp_file_name) raises (SALOME::SALOME_Exception); + //! Connect a Salome_file with another Salome_file. /*! - Connect a Salome_file with another Salome_file. It works only if the Salome_file managed only one file \param source_Salome_file Salome_file that managed the distributed version of the file. @@ -548,8 +544,8 @@ module Engines */ void connect(in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception); + //! Connect the managed file file_name to a Salome_file. /*! - Connect the managed file file_name to a Salome_file. \param file_name name of the file without the path. \param source_Salome_file Salome_file that managed the distributed version of the file. @@ -559,8 +555,8 @@ module Engines void connectDistributedFile(in string file_name, in Engines::Salome_file source_Salome_file) raises (SALOME::SALOME_Exception); + //! Connect the file_name with a Distributed file_name. /*! - Connect the file_name with a Distributed file_name. \param file_name name of the file without the path. \param source_file_name It's the name of the file managed by the distributed source Salome_file. @@ -572,9 +568,8 @@ module Engines /**************/ + //! Get all the distributed files managed by the Salome_file and check all the local files. /*! - Get all the distributed files managed by the Salome_file and - check all the local files. \exception raised if some of the files are not ok. */ @@ -582,8 +577,8 @@ module Engines /**************/ + //! Remove a file of the Salome_file. /*! - Remove a file of the Salome_file. \param file_name name of the file. @@ -591,21 +586,19 @@ module Engines */ void removeFile(in string file_name) raises (SALOME::SALOME_Exception); - /*! - Remove all the files of the Salome_file. - */ + //! Remove all the files of the Salome_file. void removeFiles(); /**************/ + //! Get the list of the files managed by the Salome_file. /*! - Get the list of the files managed by the Salome_file. The list can be empty. */ Engines::files getFilesInfos(); + //! Get a file managed by the Salome_file. /*! - Get a file managed by the Salome_file. \param file_name the name of the file. @@ -615,14 +608,12 @@ module Engines */ Engines::file getFileInfos(in string file_name) raises (SALOME::SALOME_Exception); - /*! - Return the state of the Salome_file. - */ + //! Return the state of the Salome_file. Engines::SfState getSalome_fileState(); + //! Set the container where files are. /*! - Set the container where files are. \param container container CORBA's reference. */ @@ -648,7 +639,9 @@ module Engines */ interface fileRef { + //! the original file readonly attribute string origFileName; + //! the machine of the original file readonly attribute string refMachine; Container getContainer(); diff --git a/idl/SALOME_ContainerManager.idl b/idl/SALOME_ContainerManager.idl index 7fe11b29b..32b8e364e 100644 --- a/idl/SALOME_ContainerManager.idl +++ b/idl/SALOME_ContainerManager.idl @@ -25,20 +25,22 @@ #include "SALOME_Exception.idl" #include "SALOME_Component.idl" +/*! \file SALOME_ContainerManager.idl \brief interfaces for %SALOME launcher and container manager +*/ + module Engines { -/*! - Type to transmit list of machines. -*/ +//! Type to transmit list of machines. typedef sequence MachineList; +//! components list typedef sequence CompoList; +//! files list typedef sequence FilesList; +//! modules list typedef sequence ModulesList; -/*! - Type to describe properties of resource. -*/ +//! Type to describe properties of a resource. struct MachineParameters { string container_name; @@ -63,26 +65,31 @@ struct MachineParameters long nb_component_nodes; }; -/*! - exception thrown if a computer is not found in the catalog -*/ +//! exception thrown if a computer is not found in the catalog exception NotFound {}; - enum policy {P_FIRST,P_CYCL,P_BEST}; +//! enumeration to set a resource management policy + enum policy { + //! first machine in the list of admissible computers + P_FIRST, + //! next machine in the list of admissible computers + P_CYCL, + //! best machine in the list of admissible computers + P_BEST}; +//! resource management policy typedef policy ResPolicy; -/*! - Structure used for Salome Batch Job parameters -*/ +//! Structure used for Salome Batch Job parameters struct BatchParameters { - string batch_directory; // Where batch command will be launched - // and log files will be created - string expected_during_time; // Time for the batch - // has to be like this : hh:mm - string mem; // Minimum of memory needed - // has to be like : 32gb or 512mb - long nb_proc; // Number of processors requested + //! Where batch command will be launched and log files will be created + string batch_directory; + //! Time for the batch (has to be like this : hh:mm) + string expected_during_time; + //! Minimum of memory needed (has to be like : 32gb or 512mb) + string mem; + //! Number of processors requested + long nb_proc; }; /*! \brief Interface of the %salomelauncher @@ -116,11 +123,12 @@ struct BatchParameters */ interface ContainerManager { + //! Find an existing container satisfying the constraints given by input parameters or start a new one. Container FindOrStartContainer( in MachineParameters params, in MachineList possibleComputers); - /*! - This operation launches a PaCO++ container. + //! This operation launches a PaCO++ container. + /*! \param Description of the container resquested. \param List of computers ressources. @@ -130,14 +138,23 @@ struct BatchParameters Container FindOrStartParallelContainer( in MachineParameters params, in MachineList possibleComputers); + //! Start a new container satisfying the constraints given by input parameters. Container StartContainer( in MachineParameters params, in ResPolicy policy, in CompoList componentList ); + //! Same as StartContainer except that in batch all containers have already been launched + /*! + + We are in batch if environment variable SALOME_BATCH is 1. + In this case, containers have been launched at the beginning of the Salome session and + the container manager picks one in the pool of existing containers. + */ Container GiveContainer( in MachineParameters params, in ResPolicy policy, in CompoList componentList ); + //! Shutdown all containers that have been launched by the container manager void ShutdownContainers(); } ; @@ -148,12 +165,19 @@ struct BatchParameters */ interface ResourcesManager { + //! Find first available computer in a computers list string FindFirst(in MachineList possibleComputers); + //! Get a list of computers that are best suited to launch a container given constraints + /*! + + The constraints are resource constraints (params) and components constraints (componentList) + */ MachineList GetFittingResources( in MachineParameters params, in CompoList componentList ) raises (SALOME::SALOME_Exception); + //! Get the current machine parameters of a computer MachineParameters GetMachineParameters( in string hostname ); } ; diff --git a/idl/SALOME_Exception.idl b/idl/SALOME_Exception.idl index e338e4220..aa39c1db5 100644 --- a/idl/SALOME_Exception.idl +++ b/idl/SALOME_Exception.idl @@ -23,8 +23,10 @@ // Author : Paul RASCLE, EDF // $Header$ // -/*! \file SALOME_Exception.idl This file contains the objects defining the main exception used -in %SALOME application. The idl SALOME_Exception provides a generic CORBA exception for SALOME, +/*! \file SALOME_Exception.idl \brief This file contains the objects defining the main exception used +in %SALOME application. + +The idl SALOME_Exception provides a generic CORBA exception for SALOME, with an attribute that gives an exception type,a message, plus optional source file name and line number. This idl is intended to serve for all user CORBA exceptions raised in SALOME code, as IDL specification does not support exception inheritance. So, all the user CORBA exceptions from SALOME could be @@ -34,25 +36,21 @@ handled in a single catch. #ifndef _SALOME_EXCEPTION_IDL_ #define _SALOME_EXCEPTION_IDL_ -/*! -Module %SALOME regroups all idl definitions for %SALOME Kernel component +/*! \brief +Module %SALOME contains all base interfaces of %SALOME Kernel + */ module SALOME { -/*! -This enumeration contains the elements indicating the type of the exception -which can be raised during %SALOME session. -*/ +//! This enumeration contains the elements indicating the type of the exception which can be raised during %SALOME session. enum ExceptionType { COMM, /*!< Communication problem */ BAD_PARAM, /*!< Bad User parameters */ INTERNAL_ERROR /*!< Application level problem, irrecoverable */ }; -/*! -This struct contains a set of fields defining the structure of the exception. -*/ +//! This struct contains a set of fields defining the structure of the exception. struct ExceptionStruct { ExceptionType type; /*! IORTab; + /*! \brief Interface of a parallel %object for the MPI parallel container. + */ interface MPIObject { attribute IORTab tior; diff --git a/idl/SALOME_ModuleCatalog.idl b/idl/SALOME_ModuleCatalog.idl index 683e93943..caccfeb0b 100644 --- a/idl/SALOME_ModuleCatalog.idl +++ b/idl/SALOME_ModuleCatalog.idl @@ -23,20 +23,19 @@ // Author : Estelle Deville // $Header$ // -/*! \file SALOME_ModuleCatalog.idl This file conatins a set of interfaces used for - creation of the catalog of components in %SALOME application +/*! \file SALOME_ModuleCatalog.idl \brief interfaces used for + getting information from module catalog in %SALOME application */ -/*! -The main package of interfaces used for creation of the module catalog in %SALOME application. +/*! \brief +The main package of interfaces used for the module catalog in %SALOME application. + Module catalog allows to manage components of %SALOME application, to call specified in the xml files interfaces with the help of AComponent interface. */ module SALOME_ModuleCatalog { - // Type Definitions -/*! -This enumeration contains a current set of definitions of the components integrated +/*! \brief This enumeration contains a current set of definitions of the components integrated into %SALOME application. */ enum ComponentType { GEOM, /*! ListOfServicesParameter; +//! The list of datastream parameters of service. typedef sequence ListOfServicesDataStreamParameter; +//! a string list typedef sequence ListOfString; + +//! enumeration to define data types used by services enum TypeKind { NONE , - Dble , - Int , - Str , - Bool , - Objref , - Seq , - Array , - Struc + Dble , /*!< a double */ + Int , /*!< an integer */ + Str , /*!< a string */ + Bool , /*!< a boolean */ + Objref , /*!< an object reference */ + Seq , /*!< a sequence of a content type */ + Array , /*!< an array */ + Struc /*!< a structure with named members */ }; + +//! struct to define members of a Struc TypeKind struct MemberDefinition { - string name; /*! Name of the member */ - string type; /*! Type of the member */ + string name; /*!< Member name */ + string type; /*!< Member type name */ }; +//! List of member definitions in a structure typedef sequence ListOfMemberDefinition; -/*! - * Struct to get the definition of types used in Salome catalogs - */ + +//! Struct to get the definition of types used in Salome catalogs struct TypeDefinition { - string name; /*! Name of the type */ - TypeKind kind; /*! Kind of the type.*/ - string id; /*! id (if needed) */ - string content; /*! Content type (if needed) */ - ListOfString bases; /*! Content type (if needed) */ - ListOfMemberDefinition members; /*! Members types (if needed) */ + string name; /*!< Type name*/ + TypeKind kind; /*!< Type kind.*/ + string id; /*!< id (if needed) */ + string content; /*!< Content type (if needed) */ + ListOfString bases; /*!< base types (if needed) */ + ListOfMemberDefinition members; /*!< Member types (if needed) */ }; +//! list of type definitions typedef sequence ListOfTypeDefinition; -/*! -This struct contains fields completely defining each service. -*/ - +//! This struct contains fields defining each service. struct Service { string ServiceName; /*! ListOfInterfaceService; -/*! -List of services. -*/ +//! List of services. typedef sequence ListOfServices ; -/*! -This struct contains fields defining each interface. -*/ +//! This struct contains fields defining each interface. struct DefinitionInterface { string interfacename ; /*! ListOfDefInterface ; -/*! -List of names of interfaces. -*/ +//! List of interface names. typedef sequence ListOfInterfaces ; -/*! -PathPrefix : association of a machine name and +/*! \brief PathPrefix : association of a machine name and a path to a component */ struct PathPrefix { @@ -160,24 +148,18 @@ a path to a component string path; }; -/*! -List of path prefixes -*/ +//! List of path prefixes typedef sequence PathPrefixes; -/*! -Implementation type -*/ +//! Component implementation type enum ImplType { - SO, /* component implemented as a dynamic library loadable with dlopen */ - PY, /* component implemented as a python module loadable with import */ - EXE, /* component implemented as an executable */ - CEXE /* component to be loaded by a container which executable is given in the catalog */ + SO, /*!< component implemented as a dynamic library loadable with dlopen */ + PY, /*!< component implemented as a python module loadable with import */ + EXE, /*!< component implemented as an executable */ + CEXE /*!< component to be loaded by a container which executable is given in the catalog */ } ; -/*! -Description of a component -*/ +//! Description of a component struct ComponentDef { ComponentType type; @@ -192,17 +174,11 @@ Description of a component PathPrefixes paths; }; -/*! -List of names of components. -*/ +//! List of component names. typedef sequence ListOfComponents ; -/*! -List of names of computers. -*/ +//! List of computer names. typedef sequence ListOfComputers ; -/*! -This struct contains GUI elements used for representation of the module in %IAPP component. -*/ +//! This struct contains GUI elements used for representation of the module in %IAPP component. struct IAPP_Affich { string modulename; /*! ListOfIAPP_Affich ; -/*! - This exception is raised when a %component, a %service or a % pathPrefix is not found. -*/ +//! This exception is raised when a %component, a %service or a %pathPrefix is not found. exception NotFound { string what ; /*!If the specified interface doesn't exist, Notfound exception is thrown \param interfacename Name of the interface \return Required interface */ DefinitionInterface GetInterface(in string interfacename) raises(NotFound); - // GetServiceList : operation to get a list of the services name of - // an interface of a component - /*! - Gets the list of names of services of a definite interface belonging to the component. + /*! \brief Get the list of service names of an interface belonging to the component. + \note
        If the specified interface doesn't exist, Notfound exception is thrown. \param interfacename Name of the interface \return List of services of the required interface @@ -260,77 +228,66 @@ List of pair GUI elements (component name, component icone) ListOfServices GetServiceList(in string interfacename) raises(NotFound); - // GetService : operation to get one service of an interface of a component - - /*! - Gets a definite service of an interface of the component. + /*! \brief Get a service of an interface of the component. + \note
        If the required service or the specified interface don't exist, Notfound exception is thrown. \param interfacename Name of the interface \param servicename Name of the service \return Required service */ - Service GetService(in string interfacename, in string servicename) raises(NotFound); - // GetDefaultService : operation to get the default service - // of an interface of a component -/*! - Gets the default service of an interface of the component. +/*! \brief Get the default service of an interface of the component. + \note
        If the required service or the specified interface don't exist, Notfound exception is thrown. \param interfacename Name of the interface \return Required service */ - Service GetDefaultService(in string interfacename) raises(NotFound); - // GetPathPrefix : operation to get the PathPrefix of a computer - /*! - Gets the prefix path of the computer containing the %component. + /*! \brief Get the prefix path of the computer containing the %component. + \note
        If the required computer doesn't exist, Notfound exception is thrown \param machinename Name of the machine \return Prefix path */ - string GetPathPrefix(in string machinename) raises(NotFound); -/*! - Get the constraint affected to the component - (to be resolved by LifeCycle for the computer choice) +/*! \brief Get the constraint affected to the component + + constraint to be resolved by LifeCycle for the computer choice */ readonly attribute string constraint ; -/*! -Get the name of the component +/*! \brief Get the component name */ readonly attribute string componentname; -/*! -Get the user name of the component +/*! \brief Get the user name of the component */ readonly attribute string componentusername; -/*! -Ask whether the component is multistudy or not +/*! \brief Get whether the component is multistudy or not */ readonly attribute boolean multistudy; -/*! -Ask the type of the component +/*! \brief Get the type of the component */ readonly attribute ComponentType component_type ; -/*! -Gets the icone of the component (for IAPP) +/*! \brief Get the icone of the component (for IAPP) */ readonly attribute string component_icone; -/*! -Gets the implementation type of the component : C++ (dyn lib), Python (module) or executable +/*! \brief Get the implementation type of the component + + C++ (dyn lib), Python (module) or executable */ readonly attribute ImplType implementation_type; -/*! -Gets the implementation name of the component : name of the dyn lib or the python module or the executable +/*! \brief Get the implementation name of the component + + It's the name of the dyn lib or the python module or the executable if the default naming scheme is not convenient. */ readonly attribute string implementation_name; @@ -338,69 +295,61 @@ if the default naming scheme is not convenient. /*! \brief %Module catalog interface -This interface is used for creation of the module catalog in %SALOME application. +Interface to get information about components from the module catalog in %SALOME application. */ interface ModuleCatalog { +/*! \brief ping the ModuleCatalog server +*/ void ping(); -/*! - Returns the PID of the server +/*! \brief Returns the PID of the ModuleCatalog server */ long getPID(); -/*! - Shutdown the ModuleCatalog process. +/*! \brief Shutdown the ModuleCatalog server */ oneway void ShutdownWithExit(); -/*! - * Get the types of the catalog +/*! \brief Get the types of the catalog */ ListOfTypeDefinition GetTypes(); -/*! - Gets a list of names of computers of the catalog +/*! \brief Get a list of computer names of the catalog */ ListOfComputers GetComputerList(); -/*! -Gets the %PathPrefix of a computer -*/ +//! Get the %PathPrefix of a computer string GetPathPrefix(in string machinename) raises(NotFound); -/*! - Gets a list of names of components of the catalog -*/ + +//! Get a list of component names of the catalog ListOfComponents GetComponentList(); -/*! -Gets a list of pair GUI elements (component name, component icone) + +/*! \brief Get a list of pair GUI elements (component name, component icone) used for representation of the module in %IAPP component. */ - ListOfIAPP_Affich GetComponentIconeList(); -/*! -Gets a list of names of components of a particular type, which belong to this catalog. + +/*! \brief Get a list of component names of a particular type, which belong to this catalog. */ - // GetComponentList : operation to get a list of the components name of - // a particular type of the catalog ListOfComponents GetTypedComponentList(in ComponentType _component_type); -/*! -Gets one component of the catalog. +/*! \brief Get one component of the catalog. */ Acomponent GetComponent(in string componentname) raises(NotFound); -/*! -Gets the description of a component of the catalog. +/*! \brief Get the description of a component of the catalog. */ ComponentDef GetComponentInfo(in string componentName) raises(NotFound); -/*! -Reads a xml file and imports new components from this file. +/*! \brief Read a xml file and import new components from this file. + New components replace existing components with the same name. */ void ImportXmlCatalogFile(in string filename) raises(NotFound); +/*! \brief Shutdown the module catalog server +*/ void shutdown(); } ; }; diff --git a/idl/SALOME_Ports.idl b/idl/SALOME_Ports.idl index 0032c6195..5763447aa 100644 --- a/idl/SALOME_Ports.idl +++ b/idl/SALOME_Ports.idl @@ -26,11 +26,13 @@ #ifndef _SALOME_PORTS_IDL_ #define _SALOME_PORTS_IDL_ -/*! \file - This file contains the IDL declarations of the kind of ports provided by the - SALOME component model. +/*! \file SALOME_Ports.idl + \brief This file contains the IDL base interfaces for ports in the SALOME component model. */ +/*! \brief module that contains interfaces to define the kind of ports provided by the +SALOME component model. +*/ module Ports { /*! \brief Interface of a DSC Port. @@ -68,21 +70,13 @@ module Ports { */ interface Data_And_Control_Port : Ports::Port {}; - /*! - This exception indicates that the property doesn't not exist. - */ + //! This exception indicates that the property doesn't not exist. exception NotDefined {}; - /*! - This exception indicates that the given value to the property is not - of a good type. - */ + //! This exception indicates that the given value to the property is not of a good type. exception BadType {}; - /*! - This exception indicates that the given value to the property is not - authorized. - */ + //! This exception indicates that the given value to the property is not authorized. exception BadValue {}; /*! \brief Interface of a PortProperties. @@ -92,8 +86,8 @@ module Ports { */ interface PortProperties { + //! This operation permits to set a value of a property. /*! - This operation permits to set a value of a property. \param name property's name. \param value value of the property. @@ -105,8 +99,8 @@ module Ports { Ports::BadValue, Ports::NotDefined); + //! This operation permits to get property's value. /*! - This operation permits to get property's value. \param name property's name. \return value of the property. @@ -122,6 +116,7 @@ module Ports { a port in the DSC_User programming model. */ interface Data_Short_Port : Ports::Data_Port { + //! this operation can be used by a uses port to send me a short void put(in short data); }; diff --git a/idl/SALOME_Registry.idl b/idl/SALOME_Registry.idl index 22e2f4700..03831123f 100644 --- a/idl/SALOME_Registry.idl +++ b/idl/SALOME_Registry.idl @@ -24,8 +24,14 @@ # ifndef __registry_idl__ # define __registry_idl__ +/*! \file SALOME_Registry.idl \brief interfaces for %SALOME registry +*/ + +/*! \brief module that provides interface to %SALOME registry +*/ module Registry { + //! a struct to collect informations about servers (processes) struct Infos { string name; @@ -43,20 +49,33 @@ module Registry string ior; // client }; + //! a list of informations typedef sequence AllInfos; +/*! \brief interface to use %SALOME registry +*/ interface Components { + //! check if registry is running void ping(); - long getPID(); + //! Get the pid of registry server + long getPID(); + //! Add one information to the registry unsigned long add ( in Infos lesInfos ) ; + //! Remove an information from the registry void remove ( in unsigned long id ) ; + //! Get the size of the registry unsigned long size() ; + //! Get all informations from registry AllInfos getall () ; + //! Get history information from registry AllInfos history () ; + //! Stop the registry (hard exit) oneway void end() ; + //! Say hello to registry from process id oneway void hello( in unsigned long id ) ; - void Shutdown(); + //! Shutdown registry server (CORBA exit) + void Shutdown(); } ; } ; diff --git a/idl/SALOME_RessourcesCatalog.idl b/idl/SALOME_RessourcesCatalog.idl index 42f657d05..c430744cd 100755 --- a/idl/SALOME_RessourcesCatalog.idl +++ b/idl/SALOME_RessourcesCatalog.idl @@ -23,42 +23,68 @@ // Author : Estelle Deville // $Header$ // + +/*! \file SALOME_RessourcesCatalog.idl \brief interfaces for %SALOME Resources Catalog +*/ + +/*! \brief module that provides interface to manage the Resources Catalog of %SALOME +*/ module SALOME_RessourcesCatalog{ - // Type Definitions - //Proc_info : information about a processor + //! Information about a processor struct proc_info{ + //! processor number long number; + //! model name string model_name; + //! frequency in MHz float cpu_mhz; + //! cache size in MB float cache_size; }; + //! a list of processor informations typedef sequence ListOfProc; - //Computer_info : information about a computer - // Os and informations about processors + //! Information about a computer + /*! + Os and informations about processors + */ struct computer_info{ + //! computer name string name; + //! OS name string OS; + //! OS version string OS_version; + //! processors list ListOfProc procs; }; - enum ContainerType {Cpp, python, NP}; + //! Container type + enum ContainerType { + Cpp, /*!< C++ container */ + python, /*!< python container */ + NP /*!< NP container */ + }; + //! a list of container types typedef sequence ListOfContainerType; + //! a list of computer names typedef sequence ListOfComputer; - // exception thrown if a computer is not found in the catalog - + //! exception thrown if a computer is not found in the catalog exception NotFound {}; //------------------------------------------------------------------ - //Interface +/*! \brief interface to get information about Resources +*/ interface RessourcesCatalog { + //! Get the catalog computers list ListOfComputer GetComputerList(); + //! Get the container types list for a given computer ListOfContainerType GetContainerTypeList (in string computer) raises(NotFound); + //! Get computer information for a given computer computer_info GetComputerInfo(in string computer) raises(NotFound); }; }; diff --git a/idl/SALOME_Session.idl b/idl/SALOME_Session.idl index 2b663a488..502104a43 100644 --- a/idl/SALOME_Session.idl +++ b/idl/SALOME_Session.idl @@ -25,9 +25,9 @@ // #include "SALOME_Component.idl" -/*! - This package contains interfaces used for management of the session in %SALOME application. -*/ +/*! \file SALOME_Session.idl \brief file that contains interface of the session + */ + module SALOME { /*! \brief State of the session @@ -35,8 +35,8 @@ module SALOME This enumeration contains values defining the state of the session */ - enum SessionState {asleep, /*! Session is inactive */ - running /*! Session is running */ + enum SessionState {asleep, /*!< Session is inactive */ + running /*!< Session is running */ } ; /*! \brief %Session State and Statistics @@ -50,17 +50,16 @@ module SALOME /*! \brief State of the session It can be: - * -# asleep : no running study - * -# running : one or more running studies + -# asleep : no running study + -# running : one or more running studies */ SessionState state ; -/*! Number of running studies -*/ +//! Number of running studies short runningStudies ; -/*! It is True if GUI is active in the session -*/ +//! It is True if GUI is active in the session boolean activeGUI ; } ; + /*! \brief Interface of the session The %session Server launches and stops GUI (Graphical User Interface). @@ -69,52 +68,34 @@ module SALOME interface Session { -/*! - This exception is raised when trying to stop the %session with active GUI -*/ +//! This exception is raised when trying to stop the %session with active GUI exception GUIActive {} ; -/*! - This exception is raised when trying to stop the %session with a number of running studies. -*/ +//! This exception is raised when trying to stop the %session with a number of running studies. exception RunningStudies {} ; -/*! - Launches GUI in the session -*/ +//! Launches GUI in the session void GetInterface(); -/*! - Returns a standalone component -*/ +//! Returns a standalone component Engines::Component GetComponent(in string theLibraryName); -/*! - Stops the %Session (It must be idle) -*/ +//! Stops the %Session (It must be idle) void StopSession() raises(GUIActive, RunningStudies) ; -/*! - Gets Session State -*/ +//! Gets Session State StatSession GetStatSession() ; -/*! - Determines whether the server has already been loaded or not. -*/ + +//! Determines whether the server has already been loaded or not. void ping(); -/*! - Returns the PID of the server -*/ +//! Returns the PID of the server long getPID(); -/*! - Get Active study ID -*/ +//! Get Active study ID long GetActiveStudyId(); -/*! - Restores a state of the study at theSavePoint -*/ +//! Restores a state of the study at theSavePoint boolean restoreVisualState(in long theSavePoint); + + //! Send a message to the session GUI desktop that will emit a qt signal /*! - Emit a qt signal from the session GUI desktop window. This method can be used to send a message to the GUI from the standalone container. Caution: this method can block the Session and the calling container @@ -123,6 +104,8 @@ module SALOME In such a case it is recommended to use oneway method. */ void emitMessage(in string theMessage); + + //! same as emitMessage but in a non blocking way /*! Emit a qt signal from the session GUI desktop window. This method can be used to send a message to the GUI from the standalone diff --git a/idl/SALOME_TestComponent.idl b/idl/SALOME_TestComponent.idl index dc6ae8c48..6bd472f21 100644 --- a/idl/SALOME_TestComponent.idl +++ b/idl/SALOME_TestComponent.idl @@ -25,9 +25,14 @@ // #include "SALOME_Component.idl" +/*! \file SALOME_TestComponent.idl \brief an interface for testing Component and Container +*/ + module Engines { +/*! \brief a component with 2 operations (Coucou and Setenv) +*/ interface TestComponent : Component { string Coucou(in long L); @@ -35,3 +40,4 @@ module Engines }; }; + diff --git a/idl/SALOME_TestMPIComponent.idl b/idl/SALOME_TestMPIComponent.idl index 090d74ef5..4aad69891 100644 --- a/idl/SALOME_TestMPIComponent.idl +++ b/idl/SALOME_TestMPIComponent.idl @@ -30,6 +30,9 @@ #include "SALOME_Component.idl" #include "SALOME_MPIObject.idl" +/*! \file SALOME_TestMPIComponent.idl \brief interface to test MPIObject and MPIContainer +*/ + module Engines { diff --git a/idl/SALOME_TestModuleCatalog.idl b/idl/SALOME_TestModuleCatalog.idl index 06be6c8db..39fa80084 100644 --- a/idl/SALOME_TestModuleCatalog.idl +++ b/idl/SALOME_TestModuleCatalog.idl @@ -27,6 +27,12 @@ #include "SALOME_Component.idl" +/*! \file SALOME_TestModuleCatalog.idl \brief interfaces for %SALOME module catalog test +*/ + +/*! \brief module to test SALOME_ModuleCatalog +*/ + module SALOME_TestModuleCatalog { interface Adder ; diff --git a/idl/TestNotif.idl b/idl/TestNotif.idl index ebf91fa51..f0170baa7 100644 --- a/idl/TestNotif.idl +++ b/idl/TestNotif.idl @@ -24,6 +24,11 @@ # ifndef __TESTNOTIF_IDL_ # define __TESTNOTIF_IDL_ +/*! \file TestNotif.idl \brief for testing notification service +*/ + +/* \brief interface to test notification service +*/ interface Solver { boolean Connect(); diff --git a/idl/TypeData.idl b/idl/TypeData.idl index c75ea69e2..692839d4a 100644 --- a/idl/TypeData.idl +++ b/idl/TypeData.idl @@ -24,6 +24,9 @@ #ifndef _SALOME_TYPEDATA_IDL_ #define _SALOME_TYPEDATA_IDL_ +/*! \file TypeData.idl \brief data definition for tests +*/ + module Engines { diff --git a/idl/nstest.idl b/idl/nstest.idl index c704ff273..3245a5253 100644 --- a/idl/nstest.idl +++ b/idl/nstest.idl @@ -22,17 +22,30 @@ #ifndef NSTEST_IDL #define NSTEST_IDL +/*! \file nstest.idl \brief interfaces for naming service test +*/ + +/*! \brief module with one interface to test naming service +*/ module NSTEST { +/*! \brief small interface for test +*/ interface echo { +/*! \brief operation that returns a long +*/ long getId(); }; +/*! \brief factory interface for test +*/ interface aFactory { +/*! \brief operation that creates a echo %object +*/ echo createInstance(); }; }; -#endif \ No newline at end of file +#endif diff --git a/salome_adm/cmake_files/FindBOOST.cmake b/salome_adm/cmake_files/FindBOOST.cmake index c8af5d003..0c4517cf6 100644 --- a/salome_adm/cmake_files/FindBOOST.cmake +++ b/salome_adm/cmake_files/FindBOOST.cmake @@ -25,7 +25,7 @@ IF(BOOST_ROOT) FIND_LIBRARY(BOOST_LIB_THREAD libboost_thread-vc90-mt-gd-1_35 ${BOOST_ROOT}/lib) FIND_LIBRARY(BOOST_LIB_DATE_TIME libboost_date_time-vc90-mt-gd-1_35 ${BOOST_ROOT}/lib) SET(BOOST_LIBS ${BOOST_LIB_THREAD} ${BOOST_LIB_DATE_TIME}) - SET(BOOST_CPPFLAGS -I${BOOST_INCLUDES}) + SET(BOOST_CPPFLAGS -I${BOOST_INCLUDES} -DBOOST_DISABLE_ASSERTS) ELSE(BOOST_ROOT) SET(boost_thread -lboost_thread) ENDIF(BOOST_ROOT) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 26ab21a36..39218dbd9 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -134,6 +134,11 @@ class CMakeFile(object): content = content.replace("-no-undefined -version-info 0:0:0", "") content = content.replace("-no-undefined -version-info 2:5:1", "") + # -- + # Compatibility netgen plugin + # -- + content = content.replace("../NETGEN/libNETGEN.la", "${NETGEN_LIBS}") + # -- cas_list = [ "BinLPlugin", @@ -318,8 +323,29 @@ class CMakeFile(object): "MEDWrapper_V2_2", "SalomeIDLMED", ] + smesh_list = [ + "MEFISTO2D", + "MeshDriverDAT", + "MeshDriverMED", + "MeshDriver", + "MeshDriverSTL", + "MeshDriverUNV", + "SalomeIDLSMESH", + "SMDS", + "SMESHClient", + "SMESHControls", + "SMESHDS", + "SMESHEngine", + "SMESHFiltersSelection", + "SMESHimpl", + "SMESHObject", + "SMESH", + "StdMeshersEngine", + "StdMeshersGUI", + "StdMeshers", + ] full_list = cas_list + kernel_list + gui_list - full_list += geom_list + med_list + full_list += geom_list + med_list + smesh_list # -- full_list += [ "boost_thread", @@ -460,6 +486,17 @@ class CMakeFile(object): INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake) """) pass + if self.module == "netgenplugin": + newlines.append(""" + SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR}) + SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR}) + SET(SMESH_ROOT_DIR $ENV{SMESH_ROOT_DIR}) + INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake) + INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake) + INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake) + INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindNETGEN.cmake) + """) + pass pass pass # -- @@ -505,6 +542,16 @@ class CMakeFile(object): SET(MED_ENABLE_GUI ON) """) pass + elif self.module == "smesh": + newlines.append(""" + SET(SMESH_ENABLE_GUI ON) + """) + pass + elif self.module == "netgenplugin": + newlines.append(""" + SET(NETGENPLUGIN_ENABLE_GUI ON) + """) + pass # -- pass # -- @@ -957,6 +1004,21 @@ class CMakeFile(object): ''') # -- newlines.append(r''' + IF(WINDOWS) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET(dir $ENV{F2CHOME}) + STRING(REPLACE "\\\\" "/" dir ${dir}) + SET(libadd ${libadd} ${dir}/LIBF77.lib) + SET(libadd ${libadd} ${dir}/LIBI77.lib) + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) + ENDIF(WINDOWS) + ''') + # -- + newlines.append(r''' SET(libs ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) ''') if key == "bin_PROGRAMS": @@ -998,6 +1060,13 @@ class CMakeFile(object): SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD") ENDIF(name STREQUAL ${target}) ENDFOREACH(target ${targets}) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) ENDIF(WINDOWS) ''') # -- @@ -1023,6 +1092,7 @@ class CMakeFile(object): SET(targets ${targets} GEOMEngine) SET(targets ${targets} MEDEngine) SET(targets ${targets} SMESHEngine) + SET(targets ${targets} SMESH) FOREACH(target ${targets}) IF(name STREQUAL ${target}) SET(var ${var} -DNOGDI) @@ -1033,6 +1103,20 @@ class CMakeFile(object): # -- newlines.append(r''' IF(WINDOWS) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET(dir $ENV{F2CHOME}) + STRING(REPLACE "\\\\" "/" dir ${dir}) + SET(var ${var} -I${dir}) + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) + ENDIF(WINDOWS) + ''') + # -- + newlines.append(r''' + IF(WINDOWS) SET(var ${var} -D_USE_MATH_DEFINES) ENDIF(WINDOWS) ''') @@ -1121,6 +1205,17 @@ class CMakeFile(object): FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) GET_FILENAME_COMPONENT(ext ${src} EXT) IF(ext STREQUAL .f) + IF(src STREQUAL trte.f) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + STRING(REPLACE ".f" ".c" src ${src}) + SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) + SET(output ${src}) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND f2c ${input} + MAIN_DEPENDENCY ${input} + ) + ELSE(src STREQUAL trte.f) SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) STRING(REPLACE ".f" ".o" src ${src}) SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) @@ -1135,6 +1230,7 @@ class CMakeFile(object): COMMAND ${F77} -c -o ${output} ${input} MAIN_DEPENDENCY ${input} ) + ENDIF(src STREQUAL trte.f) ENDIF(ext STREQUAL .f) SET(srcs ${srcs} ${src}) ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) @@ -1178,6 +1274,7 @@ class CMakeFile(object): newlines.append(r''' SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL %s_EXPORTS) '''%(upper_name)) + # -- newlines.append(r''' IF(name STREQUAL SalomeLauncher) SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SALOME%s_EXPORTS) @@ -1278,6 +1375,21 @@ class CMakeFile(object): SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEFISTO2D_EXPORTS) ENDIF(name STREQUAL MEFISTO2D) ''') + newlines.append(r''' + IF(name STREQUAL SMESHObject) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESHOBJECT_EXPORTS) + ENDIF(name STREQUAL SMESHObject) + ''') + newlines.append(r''' + IF(name STREQUAL _libSMESH_Swig) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESH_SWIG_EXPORTS) + ENDIF(name STREQUAL _libSMESH_Swig) + ''') + newlines.append(r''' + IF(name STREQUAL NETGENPluginGUI) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL NETGENPLUGIN_GUI_EXPORTS) + ENDIF(name STREQUAL NETGENPluginGUI) + ''') # -- self.setLibAdd(key, newlines) # -- diff --git a/salome_adm/unix/config_files/check_openmpi.m4 b/salome_adm/unix/config_files/check_openmpi.m4 index cbbe91f4d..5a57f165f 100644 --- a/salome_adm/unix/config_files/check_openmpi.m4 +++ b/salome_adm/unix/config_files/check_openmpi.m4 @@ -42,9 +42,15 @@ if test "$WITHOPENMPI" = yes; then AC_CHECK_HEADER(mpi.h,WITHOPENMPI="yes",WITHOPENMPI="no") CPPFLAGS="$CPPFLAGS_old" + LIBS_old="$LIBS" + LIBS="-L${OPENMPI_HOME}/lib $LIBS" + AC_CHECK_LIB(mpi,MPI_Publish_name,WITHMPI2="yes",WITHMPI2="no") + LIBS="$LIBS_old" + AC_MSG_CHECKING(for openmpi) if test "$WITHOPENMPI" = "yes";then mpi_ok=yes + CPPFLAGS="-DOMPI_IGNORE_CXX_SEEK -DWITHOPENMPI $CPPFLAGS" AC_MSG_RESULT(yes) else mpi_ok=no diff --git a/src/Container/Component_i.cxx b/src/Container/Component_i.cxx index dfcae478f..eca25186b 100644 --- a/src/Container/Component_i.cxx +++ b/src/Container/Component_i.cxx @@ -56,6 +56,11 @@ static Engines_Component_i * theEngines_Component ; bool Engines_Component_i::_isMultiStudy = true; bool Engines_Component_i::_isMultiInstance = false; +/*! \class Engines_Component_i + * \brief C++ implementation of Engines::Component interface + * + */ + //============================================================================= /*! * Default constructor, not for use @@ -69,8 +74,8 @@ Engines_Component_i::Engines_Component_i():_myConnexionToRegistry(0), _notifSupp } //============================================================================= -/*! - * Standard Constructor for generic Component, used in derived class +/*! \brief Standard Constructor for generic Component, used in derived class + * * Connection to Registry and Notification * \param orb Object Request broker given by Container * \param poa Portable Object Adapter from Container (normally root_poa) @@ -78,6 +83,7 @@ Engines_Component_i::Engines_Component_i():_myConnexionToRegistry(0), _notifSupp * \param instanceName unique instance name for this object (see Container_i) * \param interfaceName component class name * \param notif use of notification + * \param regist (true or false) use of registry (default true) */ //============================================================================= @@ -86,7 +92,8 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, - bool notif) : + bool notif, + bool regist ) : _instanceName(instanceName), _interfaceName(interfaceName), _myConnexionToRegistry(0), @@ -100,23 +107,25 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, _CanceledThread(false) { MESSAGE("Component constructor with instanceName "<< _instanceName); - //SCRUTE(pd_refCount); _orb = CORBA::ORB::_duplicate(orb); _poa = PortableServer::POA::_duplicate(poa); _contId = contId ; CORBA::Object_var o = _poa->id_to_reference(*contId); // container ior... _container=Engines::Container::_narrow(o); - const CORBA::String_var ior = _orb->object_to_string(o); - _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", - _instanceName.c_str()); + + if(regist) + { + const CORBA::String_var ior = _orb->object_to_string(o); + _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", + _instanceName.c_str()); + } _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif); - //SCRUTE(pd_refCount); } //============================================================================= -/*! - * Standard Constructor for standalone Component, used in derived class +/*! \brief Standard Constructor for standalone Component, used in derived class + * * Connection to Registry and Notification * \param orb Object Request broker given by Container * \param poa Portable Object Adapter from Container (normally root_poa) @@ -167,48 +176,6 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, } -//============================================================================= -/*! - * Standard constructor for parallel component - * Connection Notification (no connection to Registry !) - * \param orb Object Request broker given by Container - * \param poa Portable Object Adapter from Container (normally root_poa) - * \param contId container CORBA id inside the server - * \param instanceName unique instance name for this object (see Container_i) - * \param interfaceName component class name - * \param flag not used... - * \param notif use of notification - */ -//============================================================================= - -Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - int flag, - bool notif ) : - _instanceName(instanceName), - _interfaceName(interfaceName), - _myConnexionToRegistry(0), - _notifSupplier(0), - _ThreadId(0) , - _ThreadCpuUsed(0) , - _Executed(false) , - _graphName("") , - _nodeName(""), - _studyId(-1), - _CanceledThread(false) -{ - _orb = CORBA::ORB::_duplicate(orb); - _poa = PortableServer::POA::_duplicate(poa); - _contId = contId ; - CORBA::Object_var o = _poa->id_to_reference(*contId); // container ior... - _container=Engines::Container::_narrow(o); - - _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif); -} - //============================================================================= /*! * Destructor: call Container for decrement of instances count. diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 954c8fcf7..7558ef37e 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -64,10 +64,6 @@ bool _Sleeping = false ; int _ArgC ; char ** _ArgV ; - -// Containers with name FactoryServer are started via rsh in LifeCycleCORBA -// Other Containers are started via start_impl of FactoryServer - extern "C" {void ActSigIntHandler() ; } #ifndef WIN32 extern "C" {void SigIntHandler(int, siginfo_t *, void *) ; } @@ -87,6 +83,12 @@ map Engines_Container_i::_library_map; map Engines_Container_i::_toRemove_map; omni_mutex Engines_Container_i::_numInstanceMutex ; +/*! \class Engines_Container_i + * \brief C++ implementation of Engines::Container interface + * + */ + + //============================================================================= /*! * Default constructor, not for use @@ -94,7 +96,7 @@ omni_mutex Engines_Container_i::_numInstanceMutex ; //============================================================================= Engines_Container_i::Engines_Container_i () : -_numInstance(0) +_numInstance(0),_id(0),_NS(0) { } @@ -111,7 +113,7 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, bool activAndRegist, bool isServantAloneInProcess ) : -_numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) + _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess),_id(0),_NS(0) { _pid = (long)getpid(); @@ -227,12 +229,14 @@ _numInstance(0),_isServantAloneInProcess(isServantAloneInProcess) Engines_Container_i::~Engines_Container_i() { MESSAGE("Container_i::~Container_i()"); - delete _id; + if(_id) + delete _id; if(_NS) delete _NS; } //============================================================================= +//! Get container name /*! * CORBA attribute: Container name (see constructor) */ @@ -244,6 +248,7 @@ char* Engines_Container_i::name() } //============================================================================= +//! Get container working directory /*! * CORBA attribute: Container working directory */ @@ -257,6 +262,7 @@ char* Engines_Container_i::workingdir() } //============================================================================= +//! Get container log file name /*! * CORBA attribute: Container log file name */ @@ -267,12 +273,14 @@ char* Engines_Container_i::logfilename() return CORBA::string_dup(_logfilename.c_str()) ; } +//! Set container log file name void Engines_Container_i::logfilename(const char* name) { _logfilename=name; } //============================================================================= +//! Get container host name /*! * CORBA method: Get the hostName of the Container (without domain extensions) */ @@ -286,6 +294,7 @@ char* Engines_Container_i::getHostName() } //============================================================================= +//! Get container PID /*! * CORBA method: Get the PID (process identification) of the Container */ @@ -297,6 +306,7 @@ CORBA::Long Engines_Container_i::getPID() } //============================================================================= +//! Ping the servant to check it is still alive /*! * CORBA method: check if servant is still alive */ @@ -308,6 +318,7 @@ void Engines_Container_i::ping() } //============================================================================= +//! Shutdown the container /*! * CORBA method, oneway: Server shutdown. * - Container name removed from naming service, @@ -473,6 +484,7 @@ int findpathof(string& pth, const string& exe) //============================================================================= +//! load a new component class /*! * CORBA method: load a new component class (Python or C++ implementation) * \param componentName like COMPONENT @@ -572,6 +584,7 @@ Engines_Container_i::load_component_Library(const char* componentName) } //============================================================================= +//! Create a new component instance /*! * CORBA method: Creates a new servant instance of a component. * The servant registers itself to naming service and Registry. @@ -749,6 +762,7 @@ Engines_Container_i::create_component_instance(const char*genericRegisterName, } //============================================================================= +//! Find an existing (in the container) component instance /*! * CORBA method: Finds a servant instance of a component * \param registeredName Name of the component in Registry or Name Service, @@ -783,11 +797,15 @@ Engines_Container_i::find_component_instance( const char* registeredName, } //============================================================================= +//! Find or create a new component instance /*! * CORBA method: find or create an instance of the component (servant), * load a new component class (dynamic library) if required, +* * ---- FOR COMPATIBILITY WITH 2.2 ---- +* * ---- USE ONLY FOR MULTISTUDY INSTANCES ! -------- +* * The servant registers itself to naming service and Registry. * \param genericRegisterName Name of the component to register * in Registry & Name Service @@ -809,6 +827,7 @@ Engines_Container_i::load_impl( const char* genericRegisterName, //============================================================================= +//! Remove the component instance from container /*! * CORBA method: Stops the component servant, and deletes all related objects * \param component_i Component to be removed @@ -828,6 +847,7 @@ void Engines_Container_i::remove_impl(Engines::Component_ptr component_i) } //============================================================================= +//! Unload component libraries from the container /*! * CORBA method: Discharges unused libraries from the container. */ @@ -856,6 +876,7 @@ void Engines_Container_i::finalize_removal() } //============================================================================= +//! Kill the container /*! * CORBA method: Kill the container process with exit(0). * To remove : never returns ! @@ -876,6 +897,7 @@ bool Engines_Container_i::Kill_impl() } //============================================================================= +//! Get or create a file reference object associated to a local file (to transfer it) /*! * CORBA method: get or create a fileRef object associated to a local file * (a file on the computer on which runs the container server), which stores @@ -916,6 +938,7 @@ Engines_Container_i::createFileRef(const char* origFileName) } //============================================================================= +//! Get a fileTransfer reference /*! * CORBA method: * \return a reference to the fileTransfer object @@ -931,6 +954,7 @@ Engines_Container_i::getFileTransfer() } +//! Create a Salome file Engines::Salome_file_ptr Engines_Container_i::createSalome_file(const char* origFileName) { @@ -962,6 +986,7 @@ Engines_Container_i::createSalome_file(const char* origFileName) return theSalome_file; } //============================================================================= +//! Finds an already existing component instance or create a new instance /*! * C++ method: Finds an already existing servant instance of a component, or * create an instance. @@ -973,20 +998,19 @@ Engines_Container_i::createSalome_file(const char* origFileName) * \return a loaded component * * example with names: -* aGenRegisterName = COMPONENT (= first argument) -* impl_name = libCOMPONENTEngine.so (= second argument) -* _containerName = /Containers/cli76ce/FactoryServer -* factoryName = COMPONENTEngine_factory -* component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT -* -* instanceName = COMPONENT_inst_1 -* component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1 +* - aGenRegisterName = COMPONENT (= first argument) +* - impl_name = libCOMPONENTEngine.so (= second argument) +* - _containerName = /Containers/cli76ce/FactoryServer +* - factoryName = COMPONENTEngine_factory +* - component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT +* - instanceName = COMPONENT_inst_1 +* - component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1 */ //============================================================================= Engines::Component_ptr -Engines_Container_i::find_or_create_instance(string genericRegisterName, - string componentLibraryName) +Engines_Container_i::find_or_create_instance(std::string genericRegisterName, + std::string componentLibraryName) { string aGenRegisterName = genericRegisterName; string impl_name = componentLibraryName; @@ -1044,6 +1068,7 @@ Engines_Container_i::find_or_create_instance(string genericRegisterName, } //============================================================================= +//! Create a new component instance /*! * C++ method: create a servant instance of a component. * \param genericRegisterName Name of the component instance to register @@ -1055,17 +1080,17 @@ Engines_Container_i::find_or_create_instance(string genericRegisterName, * \return a loaded component * * example with names: -* aGenRegisterName = COMPONENT (= first argument) -* _containerName = /Containers/cli76ce/FactoryServer -* factoryName = COMPONENTEngine_factory -* component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT -* instanceName = COMPONENT_inst_1 -* component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1 +* - aGenRegisterName = COMPONENT (= first argument) +* - _containerName = /Containers/cli76ce/FactoryServer +* - factoryName = COMPONENTEngine_factory +* - component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT +* - instanceName = COMPONENT_inst_1 +* - component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1 */ //============================================================================= Engines::Component_ptr -Engines_Container_i::createInstance(string genericRegisterName, +Engines_Container_i::createInstance(std::string genericRegisterName, void *handle, int studyId) { @@ -1161,12 +1186,13 @@ Engines_Container_i::createInstance(string genericRegisterName, } //============================================================================= +//! Decrement component instance reference count /*! * */ //============================================================================= -void Engines_Container_i::decInstanceCnt(string genericRegisterName) +void Engines_Container_i::decInstanceCnt(std::string genericRegisterName) { if(_cntInstances_map.count(genericRegisterName)==0) return; @@ -1190,6 +1216,7 @@ void Engines_Container_i::decInstanceCnt(string genericRegisterName) } //============================================================================= +//! Indicate if container is a python one /*! * Retrieves only with container naming convention if it is a python container */ diff --git a/src/Container/SALOME_ComponentPy.py b/src/Container/SALOME_ComponentPy.py index dd7320643..1d5722ad9 100755 --- a/src/Container/SALOME_ComponentPy.py +++ b/src/Container/SALOME_ComponentPy.py @@ -26,6 +26,11 @@ # Module : SALOME # $Header$ # +## @package SALOME_ComponentPy +# \brief python implementation of component interface for Kernel +# +# + import os import sys import time @@ -46,8 +51,9 @@ from thread import * _Sleeping = 0 -#define an implementation of the component interface - +## define an implementation of the component interface Engines::Component +# +# class SALOME_ComponentPy_i (Engines__POA.Component): _orb = None _poa = None @@ -288,3 +294,14 @@ class SALOME_ComponentPy_i (Engines__POA.Component): def getStudyId(self): return self._studyId + + #------------------------------------------------------------------------- + + def hasObjectInfo(self): + return 0 + + #------------------------------------------------------------------------- + + def getObjectInfo(self, studyId, entry): + return "" + diff --git a/src/Container/SALOME_Component_i.hxx b/src/Container/SALOME_Component_i.hxx index ccf8ddff2..361b87eb3 100644 --- a/src/Container/SALOME_Component_i.hxx +++ b/src/Container/SALOME_Component_i.hxx @@ -59,7 +59,8 @@ public: PortableServer::ObjectId * contId, const char *instanceName, const char *interfaceName, - bool notif = false); + bool notif = false, + bool regist = true); //Constructor for standalone component Engines_Component_i(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, @@ -67,15 +68,7 @@ public: const char *instanceName, const char *interfaceName, bool notif = false, - bool regist=true); - // Constructor for parallel component : don't call registry - Engines_Component_i(CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::ObjectId * contId, - const char *instanceName, - const char *interfaceName, - int flag, - bool notif = false); + bool regist = true); virtual ~Engines_Component_i(); @@ -100,23 +93,23 @@ public: bool Resume_impl(); CORBA::Long CpuUsed_impl() ; - virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, - CORBA::Boolean isPublished, - CORBA::Boolean& isValidScript); + virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, + CORBA::Boolean isPublished, + CORBA::Boolean& isValidScript); - // CORBA operations for Salome_file - virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name, - const char* Salome_file_name); - virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name, - const char* Salome_file_name); + // CORBA operations for Salome_file + virtual Engines::Salome_file_ptr getInputFileToService(const char* service_name, + const char* Salome_file_name); + virtual Engines::Salome_file_ptr getOutputFileToService(const char* service_name, + const char* Salome_file_name); - virtual void checkInputFilesToService(const char* service_name); - virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name, - const char* Salome_file_name); + virtual void checkInputFilesToService(const char* service_name); + virtual Engines::Salome_file_ptr setInputFileToService(const char* service_name, + const char* Salome_file_name); - virtual void checkOutputFilesToService(const char* service_name); - virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name, - const char* Salome_file_name); + virtual void checkOutputFilesToService(const char* service_name); + virtual Engines::Salome_file_ptr setOutputFileToService(const char* service_name, + const char* Salome_file_name); // Object information virtual bool hasObjectInfo() { return false; } @@ -143,8 +136,8 @@ public: void CancelThread() ; virtual void configureSalome_file(std::string service_name, - std::string file_port_name, - Salome_file_i * file); + std::string file_port_name, + Salome_file_i * file); protected: diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index 9b6d7f893..1a92f6b54 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -26,6 +26,11 @@ # Module : SALOME # $Header$ # +## @package SALOME_Container +# \brief python implementation of container interface for Kernel +# +# + import os import sys import string diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 2d543ddcb..e56d42d90 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -62,7 +62,6 @@ SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb, PortableSer MESSAGE("constructor"); _NS = ns; _ResManager = rm; - _id=0; PortableServer::POAManager_var pman = poa->the_POAManager(); _orb = CORBA::ORB::_duplicate(orb) ; @@ -177,8 +176,8 @@ void SALOME_ContainerManager::ShutdownContainers() } //============================================================================= +//! Find a suitable Container in a list of machines, or start one /*! CORBA Method: - * Find a suitable Container in a list of machines, or start one * \param params Machine Parameters required for the container * \param possibleComputers list of machines usable for find or start */ @@ -199,10 +198,13 @@ FindOrStartContainer(const Engines::MachineParameters& params, } //============================================================================= -/*! CORBA Method: - * Start a suitable Container in a list of machines +//! Start a suitable Container in a list of machines with constraints and a policy +/*! C++ Method: + * Constraints are given by a machine parameters struct * \param params Machine Parameters required for the container * \param possibleComputers list of machines usable for start + * \param policy policy to use (first,cycl or best) + * \param container_exe specific container executable (default=SALOME_Container) */ //============================================================================= @@ -217,9 +219,7 @@ StartContainer(const Engines::MachineParameters& params, if (parallelLib != "") return FindOrStartParallelContainer(params, possibleComputers); #endif - long id; string containerNameInNS; - char idc[3*sizeof(long)]; Engines::Container_ptr ret = Engines::Container::_nil(); MESSAGE("SALOME_ContainerManager::StartContainer " << @@ -254,15 +254,6 @@ StartContainer(const Engines::MachineParameters& params, MESSAGE("try to launch it on " << theMachine); - // Get Id for container: a parallel container registers in Naming Service - // on the machine where is process 0. ContainerManager does'nt know the name - // of this machine before the launch of the parallel container. So to get - // the IOR of the parallel container in Naming Service, ContainerManager - // gives a unique Id. The parallel container registers his name under - // /ContainerManager/Id directory in NamingService - - id = GetIdForContainer(); - string command; if(theMachine==""){ MESSAGE("SALOME_ContainerManager::StartContainer : " << @@ -270,19 +261,14 @@ StartContainer(const Engines::MachineParameters& params, return Engines::Container::_nil(); } else if(theMachine==Kernel_Utils::GetHostname()) - command = BuildCommandToLaunchLocalContainer(params,id,container_exe); + command = BuildCommandToLaunchLocalContainer(params,container_exe); else - command = BuildCommandToLaunchRemoteContainer(theMachine,params,id,container_exe); - - // RmTmpFile(); Too early! May be this function has not been used for a long time... + command = BuildCommandToLaunchRemoteContainer(theMachine,params,container_exe); //check if an entry exists in Naming service if(params.isMPI) - { - containerNameInNS = "/ContainerManager/id"; - sprintf(idc,"%ld",id); - containerNameInNS += idc; - } + // A parallel container register on zero node in NS + containerNameInNS = _NS->BuildContainerNameForNS(params,GetMPIZeroNode(theMachine).c_str()); else containerNameInNS = _NS->BuildContainerNameForNS(params,theMachine.c_str()); @@ -314,13 +300,13 @@ StartContainer(const Engines::MachineParameters& params, if (status == -1){ MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " << "(system command status -1)"); - RmTmpFile(); // command file can be removed here + RmTmpFile(_TmpFileName); // command file can be removed here return Engines::Container::_nil(); } else if (status == 217){ MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " << "(system command status 217)"); - RmTmpFile(); // command file can be removed here + RmTmpFile(_TmpFileName); // command file can be removed here return Engines::Container::_nil(); } else{ @@ -352,16 +338,17 @@ StartContainer(const Engines::MachineParameters& params, ret->logfilename(logFilename.c_str()); } - RmTmpFile(); // command file can be removed here + RmTmpFile(_TmpFileName); // command file can be removed here return ret; } } //============================================================================= +//! Start a suitable Container for a list of components with constraints and a policy /*! CORBA Method: - * Start a suitable Container in a list of machines * \param params Machine Parameters required for the container - * \param possibleComputers list of machines usable for start + * \param policy policy to use (first,cycl or best) + * \param componentList list of component to be loaded on this container */ //============================================================================= @@ -516,33 +503,33 @@ FindOrStartParallelContainer(const Engines::MachineParameters& params_const, proxy->start(); } catch(CORBA::SystemException& e) - { - INFOS("Caught CORBA::SystemException. : " << e); - } + { + INFOS("Caught CORBA::SystemException. : " << e); + } catch(PortableServer::POA::ServantAlreadyActive&) - { - INFOS("Caught CORBA::ServantAlreadyActiveException"); - } + { + INFOS("Caught CORBA::ServantAlreadyActiveException"); + } catch(CORBA::Exception&) - { - INFOS("Caught CORBA::Exception."); - } + { + INFOS("Caught CORBA::Exception."); + } catch(std::exception& exc) - { - INFOS("Caught std::exception - "<ContainerName(params); - command += " -id "; - sprintf(idc,"%ld",id); - command += idc; command += " -"; AddOmninamesParams(command); @@ -914,12 +887,11 @@ SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer string SALOME_ContainerManager::BuildCommandToLaunchLocalContainer -(const Engines::MachineParameters& params, const long id,const std::string& container_exe) +(const Engines::MachineParameters& params, const std::string& container_exe) { _TmpFileName = BuildTemporaryFileName(); string command; int nbproc = 0; - //char idc[3*sizeof(long)]; ofstream command_file( _TmpFileName.c_str() ); @@ -946,14 +918,23 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer #ifdef WITHLAM //command += "-x PATH,LD_LIBRARY_PATH,OMNIORB_CONFIG,SALOME_trace "; command_file << "-x PATH,LD_LIBRARY_PATH,OMNIORB_CONFIG,SALOME_trace "; +#elif defined(WITHOPENMPI) + //command += "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace "; + if( getenv("OMPI_URI_FILE") == NULL ) + command_file << "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace"; + else + { + command_file << "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace -ompi-server file:"; + command_file << getenv("OMPI_URI_FILE"); + } #endif if (isPythonContainer(params.container_name)) //command += "pyMPI SALOME_ContainerPy.py "; - command_file << "pyMPI SALOME_ContainerPy.py "; + command_file << " pyMPI SALOME_ContainerPy.py "; else //command += "SALOME_MPIContainer "; - command_file << "SALOME_MPIContainer "; + command_file << " SALOME_MPIContainer "; } else @@ -998,16 +979,8 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer } - - /*command += _NS->ContainerName(params); - command += " -id "; - sprintf(idc,"%ld",id); - command += idc; - command += " -"; - AddOmninamesParams(command);*/ - command_file << _NS->ContainerName(params); - command_file << " -id " << id << " -"; + command_file << " -"; AddOmninamesParams(command_file); command_file.close(); @@ -1027,9 +1000,9 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalContainer */ //============================================================================= -void SALOME_ContainerManager::RmTmpFile() +void SALOME_ContainerManager::RmTmpFile(std::string& tmpFileName) { - int lenght = _TmpFileName.size(); + int lenght = tmpFileName.size(); if ( lenght > 0) { #ifdef WIN32 @@ -1038,13 +1011,13 @@ void SALOME_ContainerManager::RmTmpFile() string command = "rm "; #endif if ( lenght > 4 ) - command += _TmpFileName.substr(0, lenght - 3 ); + command += tmpFileName.substr(0, lenght - 3 ); else - command += _TmpFileName; + command += tmpFileName; command += '*'; system(command.c_str()); //if dir is empty - remove it - string tmp_dir = Kernel_Utils::GetDirByPath( _TmpFileName ); + string tmp_dir = Kernel_Utils::GetDirByPath( tmpFileName ); if ( Kernel_Utils::IsEmptyDir( tmp_dir ) ) { #ifdef WIN32 @@ -1064,11 +1037,11 @@ void SALOME_ContainerManager::RmTmpFile() //============================================================================= void SALOME_ContainerManager::AddOmninamesParams(string& command) const - { - CORBA::String_var iorstr = _NS->getIORaddr(); - command += "ORBInitRef NameService="; - command += iorstr; - } +{ + CORBA::String_var iorstr = _NS->getIORaddr(); + command += "ORBInitRef NameService="; + command += iorstr; +} //============================================================================= @@ -1078,11 +1051,11 @@ void SALOME_ContainerManager::AddOmninamesParams(string& command) const //============================================================================= void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const - { - CORBA::String_var iorstr = _NS->getIORaddr(); - fileStream << "ORBInitRef NameService="; - fileStream << iorstr; - } +{ + CORBA::String_var iorstr = _NS->getIORaddr(); + fileStream << "ORBInitRef NameService="; + fileStream << iorstr; +} //============================================================================= /*! @@ -1091,16 +1064,16 @@ void SALOME_ContainerManager::AddOmninamesParams(ofstream& fileStream) const //============================================================================= string SALOME_ContainerManager::BuildTemporaryFileName() const - { - //build more complex file name to support multiple salome session - string aFileName = Kernel_Utils::GetTmpFileName(); +{ + //build more complex file name to support multiple salome session + string aFileName = Kernel_Utils::GetTmpFileName(); #ifndef WIN32 - aFileName += ".sh"; + aFileName += ".sh"; #else - aFileName += ".bat"; + aFileName += ".bat"; #endif - return aFileName; - } + return aFileName; +} //============================================================================= @@ -1152,6 +1125,13 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer tempOutputFile << nbproc << " "; #ifdef WITHLAM tempOutputFile << "-x PATH,LD_LIBRARY_PATH,OMNIORB_CONFIG,SALOME_trace "; +#elif defined(WITHOPENMPI) + if( getenv("OMPI_URI_FILE") == NULL ) + tempOutputFile << "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace"; + else{ + tempOutputFile << "-x PATH -x LD_LIBRARY_PATH -x OMNIORB_CONFIG -x SALOME_trace -ompi-server file:"; + tempOutputFile << getenv("OMPI_URI_FILE"); + } #endif } @@ -1160,9 +1140,9 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer if (params.isMPI) { if (isPythonContainer(params.container_name)) - tempOutputFile << "pyMPI SALOME_ContainerPy.py "; + tempOutputFile << " pyMPI SALOME_ContainerPy.py "; else - tempOutputFile << "SALOME_MPIContainer "; + tempOutputFile << " SALOME_MPIContainer "; } else @@ -1320,7 +1300,7 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalParallelContainer(const std::s // Nodes case command = "mpirun -np " + string(buffer) + " "; -// command += "gdb --args "; + // command += "gdb --args "; command += real_exe_name; command += " " + _NS->ContainerName(rtn); command += " " + parallelLib; @@ -1359,24 +1339,24 @@ SALOME_ContainerManager::BuildCommandToLaunchLocalParallelContainer(const std::s } } else - { - std::string message("Unknown parallelLib" + parallelLib); - throw SALOME_Exception(message.c_str()); - } + { + std::string message("Unknown parallelLib" + parallelLib); + throw SALOME_Exception(message.c_str()); + } return command; -/* if (log == "xterm") - { - command = "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH; echo $LD_LIBRARY_PATH; echo $PATH; " + command + "; cat \" &"; - } -*/ -/* command = "cd ; rm " + fichier_commande + "; touch " + \ - fichier_commande + "; echo \" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; " + \ - command + " >& /tmp/ribes_" + fichier_commande + " & \" > " + fichier_commande + ";"; - command += "ssh cn01 sh " + fichier_commande + " &"; - cerr << "La commande : " << command << endl; -*/ + /* if (log == "xterm") + { + command = "/usr/X11R6/bin/xterm -e \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; export PATH=$PATH; echo $LD_LIBRARY_PATH; echo $PATH; " + command + "; cat \" &"; + } + */ + /* command = "cd ; rm " + fichier_commande + "; touch " + \ + fichier_commande + "; echo \" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; " + \ + command + " >& /tmp/ribes_" + fichier_commande + " & \" > " + fichier_commande + ";"; + command += "ssh cn01 sh " + fichier_commande + " &"; + cerr << "La commande : " << command << endl; + */ } void SALOME_ContainerManager::startMPI() @@ -1401,8 +1381,27 @@ void SALOME_ContainerManager::startMPI() _MpiStarted = true; } else - { - _MpiStarted = true; - } + { + _MpiStarted = true; + } } +string SALOME_ContainerManager::GetMPIZeroNode(string machine) +{ + int status; + string zeronode; + string cmd; + string tmpFile = BuildTemporaryFileName(); + + cmd = "ssh " + machine + " mpirun -np 1 hostname > " + tmpFile; + + status = system(cmd.c_str()); + if( status == 0 ){ + ifstream fp(tmpFile.c_str(),ios::in); + fp >> zeronode; + } + + RmTmpFile(tmpFile); + + return zeronode; +} diff --git a/src/Container/SALOME_ContainerManager.hxx b/src/Container/SALOME_ContainerManager.hxx index 7b1f26eab..d57dfba1d 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -50,12 +50,12 @@ public: StartContainer(const Engines::MachineParameters& params, const Engines::MachineList& possibleComputer, Engines::ResPolicy policy, - const std::string& container_exe="SALOME_Container"); + const std::string& container_exe="SALOME_Container"); Engines::Container_ptr StartContainer(const Engines::MachineParameters& params, - Engines::ResPolicy policy, - const Engines::CompoList& componentList); + Engines::ResPolicy policy, + const Engines::CompoList& componentList); Engines::Container_ptr GiveContainer(const Engines::MachineParameters& params, @@ -88,19 +88,17 @@ protected: void fillBatchLaunchedContainers(); - long GetIdForContainer(void); - std::string BuildCommandToLaunchRemoteContainer(const std::string& machine, - const Engines::MachineParameters& params, const long id, - const std::string& container_exe="SALOME_Container"); + const Engines::MachineParameters& params, + const std::string& container_exe="SALOME_Container"); - std::string BuildCommandToLaunchLocalContainer(const Engines::MachineParameters& params, const long id, + std::string BuildCommandToLaunchLocalContainer(const Engines::MachineParameters& params, const std::string& container_exe="SALOME_Container"); std::string BuildTempFileToLaunchRemoteContainer(const std::string& machine, const Engines::MachineParameters& params) throw(SALOME_Exception); - void RmTmpFile(); + void RmTmpFile(std::string& tmpFile); void AddOmninamesParams(std::string& command) const; @@ -108,6 +106,8 @@ protected: std::string BuildTemporaryFileName() const; + std::string GetMPIZeroNode(std::string machine); + // Parallel extension std::string BuildCommandToLaunchLocalParallelContainer(const std::string& exe_name, const Engines::MachineParameters& params, @@ -115,7 +115,6 @@ protected: void startMPI(); bool _MpiStarted; - long _id; CORBA::ORB_var _orb; PortableServer::POA_var _poa; diff --git a/src/Container/SALOME_FileTransfer_i.cxx b/src/Container/SALOME_FileTransfer_i.cxx index 2c7d762f2..b11959726 100644 --- a/src/Container/SALOME_FileTransfer_i.cxx +++ b/src/Container/SALOME_FileTransfer_i.cxx @@ -27,6 +27,11 @@ #include "SALOME_FileTransfer_i.hxx" #include "utilities.h" +/*! \class fileTransfer_i + \brief A class to manage file transfer in SALOME + +*/ + //============================================================================= /*! * Default constructor, @@ -52,8 +57,9 @@ fileTransfer_i::~fileTransfer_i() //============================================================================= -/*! - * CORBA method: try to open the file given. If the file is readable, return +/*! \brief open the given file + * + * CORBA method: try to open the file. If the file is readable, return * a positive integer else return 0; * \param fileName path to the file to be transfered * \return fileId = positive integer > 0 if open OK. @@ -76,7 +82,8 @@ CORBA::Long fileTransfer_i::open(const char* fileName) } //============================================================================= -/*! +/*! \brief close a file + * * CORBA method: close the file associated to the fileId given at open. * \param fileId got in return from open method */ @@ -93,8 +100,11 @@ void fileTransfer_i::close(CORBA::Long fileId) else fclose(fp); } +#define FILEBLOCK_SIZE 256*1024 + //============================================================================= -/*! +/*! \brief get a data block from a file + * * CORBA method: get a block of data from the file associated to the fileId * given at open. * \param fileId got in return from open method @@ -102,8 +112,6 @@ void fileTransfer_i::close(CORBA::Long fileId) */ //============================================================================= -#define FILEBLOCK_SIZE 256*1024 - Engines::fileBlock* fileTransfer_i::getBlock(CORBA::Long fileId) { MESSAGE("fileTransfer_i::getBlock"); diff --git a/src/Container/Salome_file_i.cxx b/src/Container/Salome_file_i.cxx index 525dcc08d..567fd1dc5 100644 --- a/src/Container/Salome_file_i.cxx +++ b/src/Container/Salome_file_i.cxx @@ -38,6 +38,11 @@ # include #endif +/*! \class Salome_file_i + * \brief A class to manage file transfer in %SALOME + * + */ + //============================================================================= /*! diff --git a/src/DSC/DSC_Basic/DSC_Callbacks.hxx b/src/DSC/DSC_Basic/DSC_Callbacks.hxx index 24ba2b006..c1e8b884b 100644 --- a/src/DSC/DSC_Basic/DSC_Callbacks.hxx +++ b/src/DSC/DSC_Basic/DSC_Callbacks.hxx @@ -33,7 +33,8 @@ /*! \class DSC_Callbacks * \brief This is an abstract class that defines methods that the component - * uses to prevent the component user code that the state of the component has changed. + * uses to notify the component user code that the state of the component has changed. + * * Currently only port's connection modifications are signaled. */ class DSC_BASIC_EXPORT DSC_Callbacks @@ -42,11 +43,10 @@ class DSC_BASIC_EXPORT DSC_Callbacks DSC_Callbacks() {} virtual ~DSC_Callbacks() {} - /*! - * This method is used by the component when the number of connection - * on a provides port changes. This information helps the user code to detect - * operation on its ports. - * + /*! \brief This method is used by the component when the number of connection + * on a provides port changes. + * + * This information helps the user code to detect operation on its ports. * * \param provides_port_name the name of the provides name that has changed. * \param connection_nbr the new number of connection on the provides port. @@ -56,11 +56,10 @@ class DSC_BASIC_EXPORT DSC_Callbacks int connection_nbr, const Engines::DSC::Message message) = 0; - /*! - * This method is used by the component when the number of connection - * on a uses port changes. This information helps the user code to detect - * operation on its ports. - * + /*! \brief This method is used by the component when the number of connection + * on a uses port changes. + * + * This information helps the user code to detect operation on its ports. * * \param uses_port_name the name of the uses name that has changed. * \param new_uses_port the new sequence representing the uses port. diff --git a/src/DSC/DSC_Python/dsccalcium.py b/src/DSC/DSC_Python/dsccalcium.py index d928701c8..6aa2d6c4b 100644 --- a/src/DSC/DSC_Python/dsccalcium.py +++ b/src/DSC/DSC_Python/dsccalcium.py @@ -19,20 +19,26 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## @package dsccalcium +# \brief Module that provides the base class for DSC components implemented in python +# +# + import calcium import SALOME_ComponentPy import SALOME_DriverPy import Engines +## The SALOME base class for all DSC components implemented in python (interface Engines::Superv_Component). +# +# class PyDSCComponent(SALOME_ComponentPy.SALOME_ComponentPy_i, SALOME_DriverPy.SALOME_DriverPy_i): """ - A Python SALOME component is implemented by a Python class that has + A Python DSC component is implemented by a Python class that has the name of the component and is located in a python module that has the name of the component. - This class is a base class for Python DSC components. - You must derive it and implement init_service and those methods that are services of the component. """ diff --git a/src/HDFPersist/HDFascii.cc b/src/HDFPersist/HDFascii.cc index 2498319d6..17642df5b 100644 --- a/src/HDFPersist/HDFascii.cc +++ b/src/HDFPersist/HDFascii.cc @@ -187,12 +187,12 @@ void SaveGroupInASCIIfile(HDFgroup *hdf_group, FILE* fp, int ident) char* name = makeName(hdf_group->GetName()); fprintf(fp, "%s %i\n", name, nbsons+nbAttr); - delete name; + delete [] name; for(unsigned j=0; jGetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_group); - delete name; + delete [] name; SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1); hdf_attribute = 0; } @@ -241,7 +241,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) fprintf(fp, "%s\n", DATASET_ID); fprintf(fp, "%s %i %i\n", name, type, nbAttr); - delete name; + delete [] name; hdf_dataset->GetDim(dim); fprintf(fp, " %i\n", ndim); @@ -251,7 +251,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } fprintf(fp, "\n"); - delete dim; + delete [] dim; fprintf(fp, "%li %i:", size, order); @@ -259,7 +259,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) char* val = new char[size]; hdf_dataset->ReadFromDisk(val); fwrite(val, 1, size, fp); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64* val = new hdf_float64[size]; hdf_dataset->ReadFromDisk(val); @@ -272,7 +272,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) } else fprintf(fp," "); } - delete val; + delete [] val; } else if(type == HDF_INT64) { hdf_int64* val = new hdf_int64[size]; hdf_dataset->ReadFromDisk(val); @@ -284,7 +284,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) j = 0; } } - delete val; + delete [] val; } else if(type == HDF_INT32) { hdf_int32* val = new hdf_int32[size]; hdf_dataset->ReadFromDisk(val); @@ -296,7 +296,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) j = 0; } } - delete val; + delete [] val; } fprintf(fp, "\n"); @@ -305,7 +305,7 @@ void SaveDatasetInASCIIfile(HDFdataset *hdf_dataset, FILE* fp, int ident) { name = hdf_dataset->GetAttributeName(j); HDFattribute *hdf_attribute = new HDFattribute(name, hdf_dataset); - delete name; + delete [] name; SaveAttributeInASCIIfile(hdf_attribute, fp, ident+1); hdf_attribute = 0; } @@ -332,7 +332,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) fprintf(fp, "%s\n", ATTRIBUTE_ID); fprintf(fp, "%s %i %i\n", name, type, size); - delete name; + delete [] name; if (type == HDF_STRING) { char* val = new char[size+1]; @@ -340,7 +340,7 @@ void SaveAttributeInASCIIfile(HDFattribute *hdf_attribute, FILE* fp, int ident) fprintf(fp, ":"); fwrite(val, 1, size, fp); fprintf(fp, "\n"); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64 val; hdf_attribute->ReadFromDisk(&val); @@ -447,7 +447,7 @@ bool CreateGroupFromASCII(HDFcontainerObject *father, FILE *fp) HDFgroup* hdf_group = new HDFgroup(new_name, father); - delete new_name; + delete [] new_name; hdf_group->CreateOnDisk(); @@ -526,8 +526,8 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) order = H5T_ORDER_NONE; HDFdataset* hdf_dataset = new HDFdataset(new_name, father,type, sizeArray, nbDim, order); - delete new_name; - delete sizeArray; + delete [] new_name; + delete [] sizeArray; hdf_dataset->CreateOnDisk(); @@ -535,28 +535,28 @@ bool CreateDatasetFromASCII(HDFcontainerObject *father, FILE *fp) char *val = new char[size+1]; fread(val, 1, size, fp); hdf_dataset->WriteOnDisk(val); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64* val = new hdf_float64[size]; for(i=0; iWriteOnDisk(val); - delete val; + delete [] val; } else if(type == HDF_INT64) { hdf_int64* val = new hdf_int64[size]; for(i=0; iWriteOnDisk(val); - delete val; + delete [] val; } else if(type == HDF_INT32) { hdf_int32* val = new hdf_int32[size]; for(i=0; iWriteOnDisk(val); - delete val; + delete [] val; } char token[MAX_ID_SIZE]; @@ -605,7 +605,7 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) hdf_attribute->CreateOnDisk(); - delete new_name; + delete [] new_name; if (type == HDF_STRING) { char tmp; @@ -614,7 +614,7 @@ bool CreateAttributeFromASCII(HDFinternalObject *father, FILE* fp) val[size] = (char)0; fread(val, 1, size, fp); hdf_attribute->WriteOnDisk(val); - delete val; + delete [] val; } else if (type == HDF_FLOAT64) { hdf_float64 val; read_float64(fp, &val); diff --git a/src/KERNEL_PY/salome.py b/src/KERNEL_PY/salome.py index 4756cd580..446c3e08d 100755 --- a/src/KERNEL_PY/salome.py +++ b/src/KERNEL_PY/salome.py @@ -24,49 +24,62 @@ # Module : SALOME # $Header$ # -""" +""" Module salome gives access to Salome ressources. variables: - salome.orb : CORBA - salome.naming_service : instance of naming Service class - methods: - Resolve(name) : find a CORBA object (ior) by its pathname - Register(name) : register a CORBA object under a pathname - salome.lcc : instance of lifeCycleCORBA class - methods: - FindOrLoadComponent(server,name) : + - salome.orb : CORBA + - salome.naming_service : instance of naming Service class + - methods: + - Resolve(name) : find a CORBA object (ior) by its pathname + - Register(name) : register a CORBA object under a pathname + + - salome.lcc : instance of lifeCycleCORBA class + - methods: + - FindOrLoadComponent(server,name) : obtain an Engine (CORBA object) or launch the Engine if not found, with a Server name and an Engine name - salome.sg - methods: - updateObjBrowser(bool): - getActiveStudyId(): - getActiveStudyName(): - SelectedCount(): returns number of selected objects - getSelected(i): returns entry of selected object number i - getAllSelected(): returns list of entry of selected objects - AddIObject(Entry): select an existing Interactive object - RemoveIObject(Entry): remove object from selection - ClearIObjects(): clear selection + - salome.sg : salome object to communicate with the graphical user interface (if any) + - methods: + - updateObjBrowser(bool): + - getActiveStudyId(): + - getActiveStudyName(): + + - SelectedCount(): returns number of selected objects + - getSelected(i): returns entry of selected object number i + - getAllSelected(): returns list of entry of selected objects + - AddIObject(Entry): select an existing Interactive object + - RemoveIObject(Entry): remove object from selection + - ClearIObjects(): clear selection - Display(*Entry): - DisplayOnly(Entry): - Erase(Entry): - DisplayAll(): - EraseAll(): + - Display(*Entry): + - DisplayOnly(Entry): + - Erase(Entry): + - DisplayAll(): + - EraseAll(): - IDToObject(Entry): returns CORBA reference from entry + - IDToObject(Entry): returns CORBA reference from entry - salome.myStudyName : active Study Name - salome.myStudyId : active Study Id - salome.myStudy : the active Study itself (CORBA ior) - methods : defined in SALOMEDS.idl + - salome.myStudyName : active Study Name + - salome.myStudyId : active Study Id + - salome.myStudy : the active Study itself (CORBA ior) + - methods : defined in SALOMEDS.idl """ +## @package salome +# Module salome gives access to Salome ressources. +# +# \param salome.orb : CORBA orb object +# \param salome.naming_service : instance of naming Service class (SALOME_NamingServicePy::SALOME_NamingServicePy_i) +# \param salome.lcc : instance of lifeCycleCORBA class (SALOME_LifeCycleCORBA) +# \param salome.sg : Salome object to communicate with the graphical user interface, if running (see interface in salome_iapp::SalomeOutsideGUI) +# \param salome.myStudyName : active Study Name +# \param salome.myStudyId : active Study Id +# \param salome.myStudy : the active Study (interface SALOMEDS::Study) + from salome_kernel import * from salome_study import * diff --git a/src/KERNEL_PY/salome_iapp.py b/src/KERNEL_PY/salome_iapp.py index 323a079e3..b8e394ae6 100644 --- a/src/KERNEL_PY/salome_iapp.py +++ b/src/KERNEL_PY/salome_iapp.py @@ -24,6 +24,10 @@ # Module : SALOME # $Header$ # +## @package salome_iapp +# Module salome gives access to Salome GUI ressources (if GUI has been launched). +# + import salome_ComponentGUI #-------------------------------------------------------------------------- @@ -70,69 +74,86 @@ class SalomeOutsideGUI(object): global myStudyId, myStudyName def hasDesktop(self): + """Indicate if GUI is running""" return False def updateObjBrowser(self, bid): + """update the GUI object browser""" print "SalomeOutsideGUI: no objectBrowser update outside GUI" pass def getActiveStudyId(self): + """Get the active study id""" print "SalomeOutsideGUI.getActiveStudyId: avoid use outside GUI" return myStudyId def getActiveStudyName(self): + """Get the active study name""" print "SalomeOutsideGUI.getActiveStudyName: avoid use outside GUI" return myStudyName def SelectedCount(self): + """Get the number of active selections""" print "SalomeOutsideGUI: no selection mecanism available outside GUI" return 0 def getSelected(self, i): + """Get the selection number i """ print "SalomeOutsideGUI: no selection mecanism available outside GUI" return none def AddIObject(self, Entry): + """Add an entry""" print "SalomeOutsideGUI.AddIOObject: not available outside GUI" pass def RemoveIObject(self, Entry): + """Remove an entry""" print "SalomeOutsideGUI.REmoveIOObject: not available outside GUI" pass def ClearIObjects(self): + """Clear entries""" print "SalomeOutsideGUI.ClearIOObject: not available outside GUI" pass def Display(self, Entry): + """Display an entry""" print "SalomeOutsideGUI.Display: not available outside GUI" pass def DisplayOnly(self, Entry): + """Display only an entry""" print "SalomeOutsideGUI.DisplayOnly: not available outside GUI" pass def Erase(self, Entry): + """Erase en entry""" print "SalomeOutsideGUI.Erase: not available outside GUI" pass def DisplayAll(self): + """Display all""" print "SalomeOutsideGUI.Erase: not available outside GUI" pass def EraseAll(self): + """Erase all""" print "SalomeOutsideGUI.EraseAll: not available outside GUI" pass def IsInCurrentView(self, Entry): + """Indicate if an entry is in current view""" print "SalomeOutsideGUI.IsIncurentView: not available outside GUI" return False def getComponentName(self, ComponentUserName ): + """Get component name from component user name""" print "SalomeOutsideGUI.getComponentName: not available outside GUI" return "" def getComponentUserName( self, ComponentName ): + """Get component user name from component name""" print "SalomeOutsideGUI.getComponentUserName: not available outside GUI" return "" diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index b2c653586..3f80d7453 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -31,6 +31,11 @@ using namespace std; +/*! \class SALOME_FileTransferCORBA + \brief A class to manage file transfer in SALOME (CORBA context) + +*/ + //============================================================================= /*! * Default constructor, not for use. @@ -43,8 +48,8 @@ SALOME_FileTransferCORBA::SALOME_FileTransferCORBA() } //============================================================================= -/*! - * Constructor to use when we get a fileRef CORBA object from a component. +/*! \brief Constructor to use when we get a fileRef CORBA object from a component + * * \param aFileRef file reference CORBA object */ //============================================================================= @@ -57,9 +62,9 @@ SALOME_FileTransferCORBA::SALOME_FileTransferCORBA(Engines::fileRef_ptr } //============================================================================= -/*! - * Constructor to use when we have the file name and machine from which to - * copy, plus an optional Container name on the machine. +/*! \brief Constructor to use when we have the file name and machine from which to + * copy, plus an optional Container name on the machine. + * * \param refMachine the machine on which is the file to transfer * \param origFileName abolute file path on refMachine * \param containerName default container name used (FactoryServer) if empty @@ -93,8 +98,9 @@ SALOME_FileTransferCORBA::~SALOME_FileTransferCORBA() } //============================================================================= -/*! - * CORBA method: get a local copy of the reference file. +/*! \brief Get a local copy of the reference file + * + * CORBA method * \param localFile optional absolute path to store the copy * \return the file name (absolute path) of the copy, may be different from * localFile parameter if the copy was already done before the call diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index e6e5936e7..a9ab219c8 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -64,6 +64,11 @@ IncompatibleComponent::IncompatibleComponent(const IncompatibleComponent &ex): { } +/*! \class SALOME_LifeCycleCORBA + \brief A class to manage life cycle of SALOME components. + +*/ + //============================================================================= /*! * Constructor @@ -112,15 +117,14 @@ SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA() } //============================================================================= -/*! Public - - * Find and aready existing and registered component instance. +/*! \brief Find an already existing and registered component instance. + * * \param params machine parameters like type or name... * \param componentName the name of component class * \param studyId default = 0 : multistudy instance * \return a CORBA reference of the component instance, or _nil if not found */ //============================================================================= - Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, const char *componentName, @@ -144,8 +148,8 @@ SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, } //============================================================================= -/*! Public - - * Load a component instance on a container defined by machine parameters +/*! \brief Load a component instance on a container defined by machine parameters + * * \param params machine parameters like type or name... * \param componentName the name of component class * \param studyId default = 0 : multistudy instance @@ -178,9 +182,9 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, } //============================================================================= -/*! Public - - * Find and aready existing and registered component instance or load a new - * component instance on a container defined by machine parameters. +/*! \brief Find an already existing and registered component instance or load a new + * component instance on a container defined by machine parameters. + * * \param params machine parameters like type or name... * \param componentName the name of component class * \param studyId default = 0 : multistudy instance @@ -220,9 +224,9 @@ FindOrLoad_Component(const Engines::MachineParameters& params, } //============================================================================= -/*! Public - - * Find and aready existing and registered component instance or load a new - * component instance on a container defined by name +/*! \brief Find an already existing and registered component instance or load a new + * component instance on a container defined by name + * * \param containerName the name of container, under one of the forms * - 1 aContainer (local container) * - 2 machine/aContainer (container on hostname = machine) @@ -292,8 +296,8 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, } //============================================================================= -/*! Public - - * Check if the component class is known in module catalog +/*! \brief Check if the component class is known in module catalog + * * \param componentName the name of component class * \return true if found, false otherwise */ @@ -330,7 +334,7 @@ bool SALOME_LifeCycleCORBA::isKnownComponentClass(const char *componentName) } //============================================================================= -/*! Public - +/*! * Not so complex... useful ? */ //============================================================================= @@ -347,9 +351,8 @@ SALOME_LifeCycleCORBA::isMpiContainer(const Engines::MachineParameters& params) //============================================================================= -/*! Public - - * Pre initialisation of a given Engines::MachineParameters with default - * values. +/*! \brief Initialisation of a given Engines::MachineParameters with default values. + * * - container_name = "" : not relevant * - hostname = "" : not relevant * - OS = "" : not relevant @@ -377,7 +380,7 @@ void SALOME_LifeCycleCORBA::preSet( Engines::MachineParameters& params) } //============================================================================= -/*! Public - +/*! * \return a number of processors not 0, only for MPI containers */ //============================================================================= @@ -397,7 +400,8 @@ int SALOME_LifeCycleCORBA::NbProc(const Engines::MachineParameters& params) } //============================================================================= -/*! Public - +/*! \brief Get the container manager + * * \return the container Manager */ //============================================================================= @@ -410,7 +414,8 @@ Engines::ContainerManager_ptr SALOME_LifeCycleCORBA::getContainerManager() } //============================================================================= -/*! Public - +/*! \brief Get the resources manager + * * \return the container Manager */ //============================================================================= @@ -423,8 +428,7 @@ Engines::ResourcesManager_ptr SALOME_LifeCycleCORBA::getResourcesManager() } //============================================================================= -/*! Public - - * shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd +/*! \brief shutdown all the SALOME servers except SALOME_Session_Server, omniNames and notifd */ //============================================================================= @@ -516,8 +520,7 @@ void SALOME_LifeCycleCORBA::shutdownServers() } //============================================================================= -/*! Public - - * shutdown omniNames and notifd +/*! \brief shutdown omniNames and notifd */ //============================================================================= @@ -550,15 +553,16 @@ void SALOME_LifeCycleCORBA::killOmniNames() } //============================================================================= -/*! Protected - - * Find and aready existing and registered component instance. +/*! \brief Find an already existing and registered component instance. + * + * - build a list of machines on which an instance of the component is running, + * - find the best machine among the list + * * \param params machine parameters like type or name... * \param componentName the name of component class * \param studyId default = 0 : multistudy instance * \param listOfMachines list of machine address * \return a CORBA reference of the component instance, or _nil if not found - * - build a list of machines on which an instance of the component is running, - * - find the best machine among the list */ //============================================================================= @@ -610,16 +614,17 @@ _FindComponent(const Engines::MachineParameters& params, } //============================================================================= -/*! Protected - - * Load a component instance. +/*! \brief Load a component instance. + * + * - Finds a container in the list of machine or start one. + * - Try to load the component library in the container, + * - then create an instance of the component. + * * \param params machine parameters like type or name... * \param componentName the name of component class * \param studyId default = 0 : multistudy instance * \param listOfMachines list of machine address * \return a CORBA reference of the component instance, or _nil if problem - * - Finds a container in the list of machine or start one. - * - Try to load the component library in the container, - * - then create an instance of the component. */ //============================================================================= @@ -646,6 +651,15 @@ _LoadComponent(const Engines::MachineParameters& params, return myInstance._retn(); } +//============================================================================= +/*! \brief Load a parallel component instance. + * + * \param params machine parameters like type or name... + * \param componentName the name of component class + * \param studyId default = 0 : multistudy instance + * \return a CORBA reference of the parallel component instance, or _nil if problem + */ +//============================================================================= Engines::Component_ptr SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::MachineParameters& params, const char *componentName, diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index ecdfba30c..e7bd42494 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -23,7 +23,7 @@ // File : MPIContainer_i.cxx // Module : SALOME // -#include +#include #include #include #include "Basics_Utils.hxx" @@ -48,52 +48,22 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, int argc, char *argv[]) : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc) { - long id=0; - string IdContainerinNS; - char idc[3*sizeof(long)]; - MESSAGE("[" << numproc << "] activate object"); _id = _poa->activate_object(this); - - if(argc>1) - { - for(int i=0;iid_to_reference(*_id); + Engines::Container_var pCont = Engines::Container::_narrow(obj); + _remove_ref(); if(numproc==0){ _NS = new SALOME_NamingService(); _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ; - CORBA::Object_var obj=_poa->id_to_reference(*_id); - Engines::Container_var pCont = Engines::Container::_narrow(obj); - string hostname = Kernel_Utils::GetHostname(); _containerName = _NS->BuildContainerNameForNS(containerName,hostname.c_str()); SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str()); - // A parallel container registers in Naming Service - // on the machine where is process 0. ContainerManager does'nt know the name - // of this machine before the launch of the parallel container. So to get - // the IOR of the parallel container in Naming Service, ContainerManager - // gives a unique Id. The parallel container registers his name under - // /ContainerManager/Id directory in NamingService - - IdContainerinNS = "/ContainerManager/id"; - sprintf(idc,"%ld",id); - IdContainerinNS += idc; - SCRUTE(IdContainerinNS); - _NS->Register(pCont, IdContainerinNS.c_str()); - } // Root recupere les ior des container des autre process @@ -121,6 +91,24 @@ void Engines_MPIContainer_i::Shutdown() for(ip= 1;ip<_nbproc;ip++) (Engines::MPIContainer::_narrow((*_tior)[ip]))->Shutdown(); } + + std::map::iterator itm; + for (itm = _listInstances_map.begin(); itm != _listInstances_map.end(); itm++) + { + try + { + itm->second->destroy(); + } + catch(const CORBA::Exception& e) + { + // ignore this entry and continue + } + catch(...) + { + // ignore this entry and continue + } + } + _orb->shutdown(0); } @@ -149,7 +137,6 @@ bool Engines_MPIContainer_i::Lload_component_Library(const char* componentName) // --- try dlopen C++ component string impl_name = string ("lib") + aCompName + string("Engine.so"); - SCRUTE(impl_name); _numInstanceMutex.lock(); // lock to be alone // (see decInstanceCnt, finalize_removal)) @@ -167,12 +154,15 @@ bool Engines_MPIContainer_i::Lload_component_Library(const char* componentName) { _library_map[impl_name] = handle; _numInstanceMutex.unlock(); + MESSAGE("[" << _numproc << "] Library " << impl_name << " loaded"); + MPI_Barrier(MPI_COMM_WORLD); return true; } else { - INFOS("[" << _numproc << "] Can't load shared library : " << impl_name); - INFOS("[" << _numproc << "] error dlopen: " << dlerror()); + MESSAGE("[" << _numproc << "] Can't load shared library : " << impl_name); + MESSAGE("[" << _numproc << "] error dlopen: " << dlerror()); + MPI_Barrier(MPI_COMM_WORLD); } _numInstanceMutex.unlock(); @@ -287,17 +277,15 @@ Engines_MPIContainer_i::Lcreate_component_instance( const char* genericRegisterN //--- try C++ string impl_name = string ("lib") + genericRegisterName +string("Engine.so"); - void* handle = _library_map[impl_name]; - if ( !handle ) { - INFOS("shared library " << impl_name <<"must be loaded before instance"); - return Engines::Component::_nil() ; - } - else { - iobject = createMPIInstance(genericRegisterName, - handle, - studyId); - return iobject._retn(); - } + if (_library_map.count(impl_name) != 0) // C++ component + { + void* handle = _library_map[impl_name]; + iobject = createMPIInstance(genericRegisterName, + handle, + studyId); + return iobject._retn(); + } + } Engines::Component_ptr @@ -311,7 +299,6 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, string aGenRegisterName = genericRegisterName; string factory_name = aGenRegisterName + string("Engine_factory"); - SCRUTE(factory_name) ; typedef PortableServer::ObjectId * (*MPIFACTORY_FUNCTION) (int,int, @@ -321,17 +308,17 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, const char *, const char *) ; - MPIFACTORY_FUNCTION MPIComponent_factory - = (MPIFACTORY_FUNCTION) dlsym(handle, factory_name.c_str()); + dlerror(); + MPIFACTORY_FUNCTION MPIComponent_factory = (MPIFACTORY_FUNCTION) dlsym(handle, factory_name.c_str()); - char *error ; - if ( (error = dlerror() ) != NULL) { - // Try to load a sequential component - MESSAGE("[" << _numproc << "] Try to load a sequential component"); - _numInstanceMutex.unlock() ; - iobject = Engines_Container_i::createInstance(genericRegisterName,handle,studyId); - if( CORBA::is_nil(iobject) ) return Engines::Component::_duplicate(iobject); - } + if ( !MPIComponent_factory ) + { + INFOS( "[" << _numproc << "] Can't resolve symbol: " + factory_name ); + SCRUTE( dlerror() ); + pobj = Engines::MPIObject::_nil(); + BCastIOR(_orb,pobj,false); + return Engines::Component::_nil(); + } // --- create instance @@ -370,8 +357,6 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, //SCRUTE(servant->pd_refCount); _listInstances_map[instanceName] = iobject; _cntInstances_map[aGenRegisterName] += 1; - SCRUTE(aGenRegisterName); - SCRUTE(_cntInstances_map[aGenRegisterName]); //SCRUTE(servant->pd_refCount); bool ret_studyId = servant->setStudyId(studyId); ASSERT(ret_studyId); @@ -387,10 +372,14 @@ Engines_MPIContainer_i::createMPIInstance(string genericRegisterName, BCastIOR(_orb,pobj,false); } - catch (...) - { - INFOS( "Container_i::createInstance exception catched" ) ; - } + catch(const POException &ex){ + INFOS( ex.msg << " on process number " << ex.numproc ) ; + return Engines::Component::_nil(); + } + catch (...){ + INFOS( "Container_i::createInstance exception catched" ) ; + return Engines::Component::_nil(); + } return iobject._retn(); } @@ -450,6 +439,7 @@ Engines::Component_ptr Engines_MPIContainer_i::Lload_impl( string factory_name = _nameToRegister + string("Engine_factory"); MESSAGE("[" << _numproc << "] factory_name=" << factory_name) ; + dlerror(); PortableServer::ObjectId * (*MPIComponent_factory) (int,int, CORBA::ORB_ptr, PortableServer::POA_ptr, diff --git a/src/MPIContainer/MPIObject_i.cxx b/src/MPIContainer/MPIObject_i.cxx index f68a739b6..ff45f5e5e 100644 --- a/src/MPIContainer/MPIObject_i.cxx +++ b/src/MPIContainer/MPIObject_i.cxx @@ -23,10 +23,10 @@ // File : MPIObject_i.cxx // Module : SALOME // -#include #include "MPIObject_i.hxx" #include "utilities.h" using namespace std; +#define TIMEOUT 5 MPIObject_i::MPIObject_i() { @@ -65,7 +65,7 @@ void MPIObject_i::tior(const Engines::IORTab& ior) } void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, - bool amiCont) + bool amiCont) throw(POException) { int err, ip, n; char *ior; @@ -95,13 +95,14 @@ void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, } iort[ip] = orb->string_to_object(ior); delete [] ior; + if(CORBA::is_nil(iort[ip])) + throw POException(ip,"MPI Component not loaded"); } // On donne le tableau des ior a l'objet Corba du process 0 if( amiCont ) tior(*(iort._retn())); else pobj->tior(*(iort._retn())); - } else{ // Conversion IOR vers string @@ -123,3 +124,78 @@ void MPIObject_i::BCastIOR(CORBA::ORB_ptr orb, Engines::MPIObject_ptr pobj, } +#ifdef HAVE_MPI2 +MPI_Comm MPIObject_i::remoteMPI2Connect(string service) throw(POException) +{ + int i; + MPI_Comm gcom; + char port_name_clt[MPI_MAX_PORT_NAME]; + + _srv = 0; + _service = service; + + MPI_Barrier(MPI_COMM_WORLD); + + MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); + if( _numproc == 0 ){ + /* rank 0 try to be a server. If service is already published, try to be a cient */ + MPI_Open_port(MPI_INFO_NULL, _port_name); + if ( MPI_Publish_name((char*)_service.c_str(), MPI_INFO_NULL, _port_name) == MPI_SUCCESS ) { + _srv = 1; + MESSAGE("[" << _numproc << "] service " << _service << " available at " << _port_name << "\n"); + } + else if ( MPI_Lookup_name((char*)_service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ){ + MESSAGE("[" << _numproc << "] I get the connection with " << _service << " at " << port_name_clt << "!\n"); + MPI_Close_port( _port_name ); + } + else{ + /* Throw exception */ + MESSAGE("[" << _numproc << "] Error on connection with " << _service << " at " << port_name_clt << "!\n"); + throw POException(_numproc,"Error on connection with " + _service + " at " + port_name_clt); + } + } + else{ + i=0; + /* Waiting rank 0 publish name and try to be a client */ + while ( i != TIMEOUT ) { + sleep(1); + if ( MPI_Lookup_name((char*)_service.c_str(), MPI_INFO_NULL, port_name_clt) == MPI_SUCCESS ){ + MESSAGE("[" << _numproc << "] I get the connection with " << _service << " at " << port_name_clt << "!\n"); + break; + } + i++; + } + if(i==TIMEOUT){ + /* Throw exception */ + MESSAGE("[" << _numproc << "] Error on connection with " << _service << " at " << port_name_clt << "!\n"); + throw POException(_numproc,"Error on connection with " + _service + " at " + port_name_clt); + } + } + MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); + + /* If rank 0 is server, all processes call MPI_Comm_accept */ + /* If rank 0 is not server, all processes call MPI_Comm_connect */ + MPI_Bcast(&_srv,1,MPI_INT,0,MPI_COMM_WORLD); + if ( _srv ) + MPI_Comm_accept( _port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &gcom ); + else + MPI_Comm_connect(port_name_clt, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &gcom ); + + /* only rank 0 can be server for unpublish name */ + if(_numproc != 0) _srv = 0; + + return gcom; + +} + +void MPIObject_i::remoteMPI2Disconnect(MPI_Comm gcom) +{ + MPI_Comm_disconnect( &gcom ); + if ( _srv ) { + MPI_Unpublish_name((char*)_service.c_str(), MPI_INFO_NULL, _port_name); + MESSAGE("[" << _numproc << "] " << _service << ": close port " << _port_name << "\n"); + MPI_Close_port( _port_name ); + } +} +#endif + diff --git a/src/MPIContainer/MPIObject_i.hxx b/src/MPIContainer/MPIObject_i.hxx index 21ea9d84c..641cb1138 100644 --- a/src/MPIContainer/MPIObject_i.hxx +++ b/src/MPIContainer/MPIObject_i.hxx @@ -26,8 +26,19 @@ #ifndef _SALOME_POBJECT_I_H_ #define _SALOME_POBJECT_I_H_ +#include +#include #include #include CORBA_SERVER_HEADER(SALOME_MPIObject) +#define defaultService "SERVER" + +class POException +{ +public: + const std::string msg; + const int numproc; + POException(const int ip,const std::string m) : numproc(ip),msg(m) {} +}; class MPIObject_i: public POA_Engines::MPIObject { @@ -47,7 +58,19 @@ class MPIObject_i: public POA_Engines::MPIObject // IOR des objets paralleles sur tous les process mpi Engines::IORTab* _tior; // Echange des IOR de l'objet entre process - void BCastIOR(CORBA::ORB_ptr orb,Engines::MPIObject_ptr pobj,bool amiCont); + void BCastIOR(CORBA::ORB_ptr orb,Engines::MPIObject_ptr pobj,bool amiCont) throw(POException); +#ifdef HAVE_MPI2 + // MPI2 connection + MPI_Comm remoteMPI2Connect(std::string service=defaultService) throw(POException); + // MPI2 disconnection + void remoteMPI2Disconnect(MPI_Comm gcom); +#endif + +private: + int _srv; + char _port_name[MPI_MAX_PORT_NAME]; + std::string _service; + } ; #endif diff --git a/src/MPIContainer/SALOME_MPIContainer.cxx b/src/MPIContainer/SALOME_MPIContainer.cxx index 647e54470..c288ec8cf 100644 --- a/src/MPIContainer/SALOME_MPIContainer.cxx +++ b/src/MPIContainer/SALOME_MPIContainer.cxx @@ -83,7 +83,7 @@ int main(int argc, char* argv[]) } MESSAGE("[" << numproc << "] MPIContainer: load MPIContainer servant"); - myContainer = new Engines_MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName,argc,argv); + new Engines_MPIContainer_i(nbproc,numproc,orb,factory_poa, containerName,argc,argv); pman->activate(); @@ -106,13 +106,11 @@ int main(int argc, char* argv[]) INFOS("Caught unknown exception."); } - if(myContainer) - delete myContainer; + MPI_Finalize(); END_OF("[" << numproc << "] " << argv[0]); - // delete myThreadTrace; - MPI_Finalize(); + exit(0); } diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index be057c0f8..33e94851b 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -36,6 +36,11 @@ using namespace std; +/*! \class SALOME_NamingService + \brief A class to manage the SALOME naming service + +*/ + // ============================================================================ /*! \brief Default Constructor without ORB reference. * @@ -513,7 +518,8 @@ SALOME_NamingService::ResolveComponent(const char* hostname, else { SCRUTE(name); - if (Change_Directory(name.c_str())) + string basename = name; + if (Change_Directory(basename.c_str())) { vector contList = list_subdirs(); @@ -537,6 +543,8 @@ SALOME_NamingService::ResolveComponent(const char* hostname, if ( !CORBA::is_nil(obj) ) return obj; + else + Change_Directory(basename.c_str()); } } diff --git a/src/NamingService/SALOME_NamingServicePy.py b/src/NamingService/SALOME_NamingServicePy.py index 1a41f7ddb..3797ae961 100644 --- a/src/NamingService/SALOME_NamingServicePy.py +++ b/src/NamingService/SALOME_NamingServicePy.py @@ -26,6 +26,11 @@ # Module : SALOME # $Header$ # +## @package SALOME_NamingServicePy +# \brief Module to manage SALOME naming service from python +# +# + import sys import time from omniORB import CORBA @@ -37,6 +42,9 @@ from SALOME_utilities import * #============================================================================= class SALOME_NamingServicePy_i(object): + """ + A class to manage SALOME naming service from python code + """ _orb = None _root_context=None _current_context=None @@ -45,13 +53,18 @@ class SALOME_NamingServicePy_i(object): #------------------------------------------------------------------------- def __init__(self, orb): + """ + Standard Constructor, with ORB reference. + + Initializes the naming service root context + """ #MESSAGE ( "SALOME_NamingServicePy_i::__init__" ) self._orb = orb # initialize root context and current context - ok = 0 - steps = 240 - while steps > 0 and ok == 0: - try: + ok = 0 + steps = 240 + while steps > 0 and ok == 0: + try: obj =self._orb.resolve_initial_references("NameService") self._root_context =obj._narrow(CosNaming.NamingContext) self._current_context = self._root_context @@ -60,13 +73,13 @@ class SALOME_NamingServicePy_i(object): if self._root_context is None : #MESSAGE ( "Name Service Reference is invalid" ) #sys.exit(1) - MESSAGE(" Name service not found") - else: - ok = 1 - except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): - MESSAGE(" Name service not found") - time.sleep(0.25) - steps = steps - 1 + MESSAGE(" Name service not found") + else: + ok = 1 + except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): + MESSAGE(" Name service not found") + time.sleep(0.25) + steps = steps - 1 if steps == 0 and self._root_context is None: MESSAGE ( "Name Service Reference is invalid" ) sys.exit(1) @@ -180,6 +193,10 @@ class SALOME_NamingServicePy_i(object): #------------------------------------------------------------------------- def Create_Directory(self,ObjRef, Path): + """ ns.Create_Directory(ObjRef, Path) + + create a sub directory + """ MESSAGE ( "SALOME_NamingServicePy_i::Create_Directory" ) _not_exist = 0 path_list = list(Path) @@ -205,6 +222,10 @@ class SALOME_NamingServicePy_i(object): MESSAGE ( "Create_Directory : CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE" ) def Destroy_Name(self,Path): + """ ns.Destroy_Name(Path) + + remove a name in naming service + """ resolve_path=string.split(Path,'/') if resolve_path[0] == '': del resolve_path[0] dir_path=resolve_path[:-1] @@ -221,6 +242,10 @@ class SALOME_NamingServicePy_i(object): return def Destroy_FullDirectory(self,Path): + """ ns.Destroy_FullDirectory(Path) + + remove recursively a directory + """ context_name=[] for e in string.split(Path,'/'): if e == '':continue diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 1602fcce9..a80bc83bf 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -317,7 +317,11 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { _resources_list[_resource.HostName] = _resource; if(_resource.HostName == "localhost") - _resources_list[Kernel_Utils::GetHostname()] = _resource; + { + _resource.HostName = Kernel_Utils::GetHostname(); + _resource.DataForSort._hostName = Kernel_Utils::GetHostname(); + _resources_list[Kernel_Utils::GetHostname()] = _resource; + } } } else @@ -332,6 +336,7 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) iter != _resources_list.end(); iter++) { + std::cerr << (*iter).first << std::endl; std::cerr << (*iter).second.HostName << std::endl; std::cerr << (*iter).second.Alias << std::endl; std::cerr << (*iter).second.UserName << std::endl; diff --git a/src/SALOMEDS/SALOME_DriverPy.py b/src/SALOMEDS/SALOME_DriverPy.py index f59953f84..c47e814b9 100644 --- a/src/SALOMEDS/SALOME_DriverPy.py +++ b/src/SALOMEDS/SALOME_DriverPy.py @@ -19,11 +19,17 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +## @package SALOME_DriverPy +# \brief python implementation of SALOMEDS::Driver interface +# +# import SALOMEDS__POA +## Python implementation of generic SALOMEDS::Driver. +# +# class SALOME_DriverPy_i(SALOMEDS__POA.Driver): """ - Python implementation of generic SALOMEDS driver. Should be inherited by any Python module's engine to provide persistence mechanism. """ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx index d15a29561..d0a564c89 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx @@ -307,7 +307,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const string& value) strncpy(aName, &(aCopy[anIndex]), aNameSize); aName[aNameSize] = 0; SetModification(aName,aMinute,aHour,aDay,aMonth,aYear); - delete(aName); + delete [] (aName); anIndex += aNameSize + 1; } if (aCopy[1] == 'l') { diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx index aace61317..91c4560c5 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_AttributeTreeNode.cxx @@ -443,7 +443,7 @@ string SALOMEDSImpl_AttributeTreeNode::Type() char* aNodeName = new char[127]; sprintf(aNodeName, "AttributeTreeNodeGUID%s", ID().c_str()); string ret(aNodeName); - delete aNodeName; + delete [] aNodeName; return ret; } @@ -462,7 +462,7 @@ string SALOMEDSImpl_AttributeTreeNode::Save() char* aResult = new char[aLength]; sprintf(aResult, "%s %s %s %s", aFather.c_str(), aPrevious.c_str(), aNext.c_str(), aFirst.c_str()); string ret(aResult); - delete aResult; + delete [] aResult; return ret; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index 3149d8738..619e22ccc 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -24,6 +24,8 @@ #include "SALOMEDSImpl_ScalarVariable.hxx" #include "SALOMEDSImpl_GenericVariable.hxx" #include +#include + using namespace std; //============================================================================ diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx index 2b88c9b89..063562ae3 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx @@ -767,7 +767,7 @@ bool SALOMEDSImpl_Study::IsModified() _errorCode = ""; // True if is modified - if (_doc->IsModified()) return true; + if (_doc && _doc->IsModified()) return true; return false; } diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx index 823cde555..ee5457b34 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx @@ -125,9 +125,9 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const string& aUrl) char* aResultPath = HDFascii::ConvertFromASCIIToHDF(aUrl.c_str()); aC_HDFUrl = new char[strlen(aResultPath) + 19]; sprintf(aC_HDFUrl, "%shdf_from_ascii.hdf", aResultPath); - delete(aResultPath); + delete [] (aResultPath); aHDFUrl = aC_HDFUrl; - delete aC_HDFUrl; + delete [] aC_HDFUrl; } else { aHDFUrl = aUrl; } @@ -1195,7 +1195,7 @@ static void ReadAttributes(SALOMEDSImpl_Study* theStudy, } else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") || !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string)); - delete(current_string); + delete [] (current_string); hdf_dataset->CloseOnDisk(); return; } else { @@ -1206,7 +1206,7 @@ static void ReadAttributes(SALOMEDSImpl_Study* theStudy, anAttr->Load(current_string); } - delete(current_string); + delete [] (current_string); hdf_dataset->CloseOnDisk(); } @@ -1319,7 +1319,7 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup) new_dataset->CloseOnDisk(); new_dataset = 0; //will be deleted by hdf_sco_group destructor order = atoi(currentVarIndex); - delete currentVarIndex; + delete [] currentVarIndex; } else order = iVar; @@ -1337,14 +1337,14 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup) SALOMEDSImpl_GenericVariable::VariableTypes aVarType = SALOMEDSImpl_GenericVariable::String2VariableType(string(currentVarType)); - delete currentVarType; + delete [] currentVarType; //Create variable and add it in the study SALOMEDSImpl_GenericVariable* aVariable = new SALOMEDSImpl_ScalarVariable(aVarType,string(aVarName)); aVariable->Load(string(currentVarValue)); aVarsMap.insert(make_pair(order,aVariable)); - delete currentVarValue; + delete [] currentVarValue; } } diff --git a/src/TestMPIContainer/TestMPIComponentEngine.hxx b/src/TestMPIContainer/TestMPIComponentEngine.hxx index 4a027f02e..ac82d4321 100644 --- a/src/TestMPIContainer/TestMPIComponentEngine.hxx +++ b/src/TestMPIContainer/TestMPIComponentEngine.hxx @@ -30,7 +30,7 @@ #ifndef _SALOME_TESTCOMPONENT_I_HXX_ #define _SALOME_TESTCOMPONENT_I_HXX_ -#include +#include #include #include CORBA_SERVER_HEADER(SALOME_TestMPIComponent) #include "SALOME_Component_i.hxx" diff --git a/src/Utils/Utils_Identity.py b/src/Utils/Utils_Identity.py index 489060f8c..26d5a21ee 100644 --- a/src/Utils/Utils_Identity.py +++ b/src/Utils/Utils_Identity.py @@ -26,19 +26,25 @@ # Module : SALOME # $Header$ # +## @package Utils_Identity +# \brief Module to get information about user and version +# +# + import sys import os import socket if not sys.platform == "win32": import pwd - + import time import string def getShortHostName(): """ gives Hostname without domain extension. + SALOME naming service needs short Hostnames (without domain extension). HOSTNAME is not allways defined in environment, socket.gethostname() gives short or complete Hostname, depending on @@ -51,18 +57,18 @@ class Identity: self._name = name self._pid = os.getpid() self._machine = socket.gethostname() - self._adip = socket.gethostbyname(self._machine) # IP adress + self._adip = socket.gethostbyname(self._machine) # IP adress if sys.platform == "win32": - self._uid = os.getpid() - self._pwname = os.environ["USER"] - else: - self._uid = os.getuid() - list = pwd.getpwuid(self._uid) - self._pwname = list[0] # user name + self._uid = os.getpid() + self._pwname = os.environ["USER"] + else: + self._uid = os.getuid() + list = pwd.getpwuid(self._uid) + self._pwname = list[0] # user name - self._tc_start = time.time() + self._tc_start = time.time() self._cstart = time.ctime(self._tc_start) - self._cdir = os.getcwd() + self._cdir = os.getcwd() def getapplipath(): """