salomeinclude_DATA = KERNEL_version.h
EXTRA_DIST = \
+ build_cmake \
+ build_cmake.bat \
build_configure \
clean_configure \
LICENCE \
+++ /dev/null
-This file is only here for CVS:
-CVS does not always create empty directory, and adm_local/unix/config_file
-is needed by build_configure.
+++ /dev/null
-<!DOCTYPE ResourcesCatalog>
-<resources>
- <machine hostname="localhost" />
-</resources>
=======================================
Set of scripts for a SALOME application
=======================================
-*html version of this document is produced with docutils*::
- rest2html < doc.txt > doc.html
-
-This document corresponds to SALOME2 3.1. (alpha version)
-
-+-------------------------------------------+
-| **WORK in PROGRESS, INCOMPLETE DOCUMENT** |
-+-------------------------------------------+
+This document corresponds to SALOME 6.4.0
SALOME Application concept
--------------------------
-See SALOME_Application_ to define your own configuration of SALOME and run it
-on one or several computers. This is the recommended way of configuration.
-
-.. _SALOME_Application: ../../doc/SALOME_Application.html
+See the documentation of KERNEL module for more information on SALOME
+Application concept and to learn how to define your own configuration of
+SALOME and run it on one or several computers. The recommended way to create
+a new application is with the script appli_gen.py that can be found in KERNEL
+installation. An application has probably already been generated for you if
+you downloaded a binary version of SALOME.
+To find all the files described below, please refer to a generated
+application as some of them are generated automatically and thus are not
+present in this appliskel directory.
User run scripts
----------------
with a running SALOME session. runSession tries to use an already existing
naming service definition from a running session (hostname & port number).
-killCurrentPort
- Kills the last SALOME session corresponding to this application, and
- intially launched from this computer.
- Cleans associated config files.
-
SALOME internal run scripts
---------------------------
arguments define the command to execute.
-The following files must be adapted to your environment and SALOME Application
+The following files can be adapted to your environment and SALOME Application
------------------------------------------------------------------------------
- CatalogResources.xml
- env.d/envProducts.sh
- env.d/envSalome.sh
-CatalogRessources.xml
- This files describes all the computer the application can use. The given
- example is minimal and suppose ${APPLI} is the same relative path
- to ${HOME}, on all the computers. A different directory can be set on a
+CatalogResources.xml
+ This files describes all the computers the application can use. The default
+ file is minimal. A specific application directory can be set on a
particular computer with a line::
appliPath="my/specific/path/on/this/computer"
Proposal for env.d scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~
-Each user **must define** his own configuration for these scripts, following
-the above rules. **The following is only an example not working as it is**.
-
-atFirst.sh
- Sets the computer configuration not directly related to SALOME,
- like useful tools, default PATH.
+Each user can define his own configuration for these scripts, following
+the above rules. The generated files are good examples to start with.
envProducts.sh
Sets the SALOME prerequisites.
-envSALOME.sh
+configSalome.sh
Sets all the MODULE_ROOT_DIR that can be used in the SALOME application.
- SalomeAppConfig is also defined by::
+configGUI.sh
+ Sets variables necessary for SALOME GUI.
+ SalomeAppConfig is defined by::
export SalomeAppConfig=${HOME}/${APPLI}
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.
+ env.d/configGUI.sh is sourced.
+++ /dev/null
-<document>
- <section name="desktop" >
- <parameter name="state" value="max"/>
- <parameter name="pos_x" value="100"/>
- <parameter name="pos_y" value="050"/>
- <parameter name="width" value="640"/>
- <parameter name="height" value="480"/>
- </section>
- <section name="launch">
- <parameter name="gui" value="yes"/>
- <parameter name="splash" value="yes"/>
- <parameter name="file" value="no"/>
- <parameter name="key" value="no"/>
- <parameter name="interp" value="no"/>
- <parameter name="logger" value="no"/>
- <parameter name="xterm" value="no"/>
- <parameter name="portkill" value="no"/>
- <parameter name="killall" value="no"/>
- <parameter name="modules" value="GUI,GEOM,SMESH,VISU,MED,COMPONENT,LIGHT,PYHELLO,PYCALCULATOR"/>
- <parameter name="pyModules" value=""/>
- <parameter name="embedded" value="SalomeAppEngine,cppContainer,registry,moduleCatalog,study"/>
- <parameter name="standalone" value="pyContainer"/>
- </section>
- <section name="language">
- <parameter name="language" value="en"/>
- <parameter name="translators" value="%P_msg_%L.qm|%P_icons.qm|%P_images.qm"/>
- </section>
- <section name="resources">
- <parameter name="SUIT" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="STD" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="Plot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SPlot2d" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="GLViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="OCCViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="VTKViewer" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="SalomeApp" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="OB" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="CAM" value="${GUI_ROOT_DIR}/share/salome/resources/gui"/>
- <parameter name="GEOM" value="${GEOM_ROOT_DIR}/share/salome/resources/geom"/>
- <parameter name="SMESH" value="${SMESH_ROOT_DIR}/share/salome/resources/smesh"/>
- <parameter name="VISU" value="${VISU_ROOT_DIR}/share/salome/resources/visu"/>
- <parameter name="MED" value="${MED_ROOT_DIR}/share/salome/resources/med"/>
- <parameter name="StdMeshers" value="${SMESH_ROOT_DIR}/share/salome/resources/smesh"/>
- <parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
- <parameter name="GHS3DPlugin" value="${GHS3DPLUGIN_ROOT_DIR}/share/salome/resources/ghs3dplugin"/>
- <parameter name="COMPONENT" value="${COMPONENT_ROOT_DIR}/share/salome/resources/component"/>
- <parameter name="PYHELLO" value="${PYHELLO_ROOT_DIR}/share/salome/resources/pyhello"/>
- <parameter name="PYCALCULATOR" value="${PYCALCULATOR_ROOT_DIR}/share/salome/resources/pycalculator"/>
- <parameter name="LIGHT" value="${LIGHT_ROOT_DIR}/share/salome/resources/light"/>
-
- </section>
- <section name="GEOM">
- <parameter name="name" value="Geometry"/>
- <parameter name="icon" value="ModuleGeom.png"/>
- </section>
- <section name="SMESH">
- <parameter name="name" value="Mesh"/>
- <parameter name="icon" value="ModuleMesh.png"/>
- </section>
- <section name="VISU">
- <parameter name="name" value="Post-Pro"/>
- <parameter name="icon" value="ModuleVisu.png"/>
- </section>
- <section name="MED">
- <parameter name="name" value="Med"/>
- <parameter name="icon" value="ModuleMed.png"/>
- </section>
- <section name="PYHELLO">
- <parameter name="name" value="PyHello"/>
- <parameter name="icon" value="PYHELLO.png"/>
- <parameter name="library" value="libSalomePyQtGUI.so"/>
- </section>
- <section name="LIGHT">
- <parameter name="name" value="Light"/>
- <parameter name="icon" value="LIGHT.png"/>
- </section>
-
-<!-- values below this line are just an example, they are not used -->
- <section name="application">
- <parameter name="QuickDirList" value=""/>
- <!-- Here go other common user preferences -->
- </section>
- <section name="Geometry" >
- <parameter value="255, 255, 0" name="shading_color" />
- </section>
- <section name="SMESH">
- <parameter name="plugins" value="GHS3DPlugin,GHS3DPRLPlugin,BLSURFPlugin,NETGENPlugin,HexoticPLUGIN"/>
- <!-- Here go SMESH module user preferences -->
- </section>
- <!-- Here go optional sections for other modules -->
- <section name="resources">
- <parameter name="salome" value="${KERNEL_ROOT_DIR}/share/salome/res"/>
- <!-- Here go resource directories for other modules -->
- </section>
-</document>
+++ /dev/null
-#!/bin/sh
-# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-#------------------------------------------------
-# to be sourced first, used in following scripts
-#------------------------------------------------
-#
-export LD_LIBRARY_PATH="."
-export PATH="/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/prascle/bin:."
-export PYTHONPATH=""
-
-export RAC=${HOME}
-export PAKSAL=/opt
-export PUB=${RAC}/public
-export TARP=${RAC}/tarpublic
-export PYPACKAGES=${PUB}/site_packages
-
-# ------------------------------------------------
-# ---- gdb 5.3
-
-export PATH=${PAKSAL}/gdb53/bin:${PATH}
-export LD_LIBRARY_PATH=${PAKSAL}/gdb53/lib:${LD_LIBRARY_PATH}
-
-# ------------------------------------------------
-# ---- ddd 3.3.7
-
-export PATH=${PAKSAL}/ddd337/bin:${PATH}
-export LD_LIBRARY_PATH=${PAKSAL}/ddd337/lib:${LD_LIBRARY_PATH}
-
-# ------------------------------------------------
-# --- Java 1.4
-
-export JDKHOME=${PUB}/j2sdk_nb/j2sdk1.4.2
-export JAVAHOME=${PUB}/j2sdk_nb/j2sdk1.4.2
-export PATH=${JAVAHOME}/bin:${PATH}
-export LD_LIBRARY_PATH=${JAVAHOME}/lib:${LD_LIBRARY_PATH}
-export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386:${LD_LIBRARY_PATH}
-export LD_LIBRARY_PATH=${JAVAHOME}/jre/lib/i386/client:${LD_LIBRARY_PATH}
-
-# ------------------------------------------------
-# --- gsl -1.4
-
-export GSLHOME=${PAKSAL}/gsl-1.4
-export PATH=${GSLHOME}/bin:${PATH}
-export LD_LIBRARY_PATH=${GSLHOME}/lib:${LD_LIBRARY_PATH}
-
-# ------------------------------------------------
-# --- fltk 1.1.4
-
-export FLTKHOME=${PAKSAL}/fltk114
-export PATH=${FLTKHOME}/bin:${PATH}
-export LD_LIBRARY_PATH=${FLTKHOME}/lib:${LD_LIBRARY_PATH}
-
-# ------------------------------------------------
-# --- gmsh 1.48
-
-export GMSHHOME=${PAKSAL}/gmsh148
-export PATH=${GMSHHOME}/bin:${PATH}
-
-# ------------------------------------------------
-# ---- tkcvs, tkdiffb, cvs
-
-export PATH=${PAKSAL}/tkcvs7.2/bin:${PAKSAL}/cvs1.11.14/bin:${PATH}
+++ /dev/null
-#!/bin/sh
-# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# ------------------------------------------------
-# ---- openpbs
-#
-export OPENPBS=/optroot/openpbs2316
-export PATH=${OPENPBS}/bin:${PATH}
-export LD_LIBRARY_PATH=${OPENPBS}/lib:${LD_LIBRARY_PATH}
-
-#------------------------------------------------------------------------------
-
-export INSTALL_ROOT=/home/prascle/PAL_SALOME141
-#------ gcc ------
-export GCC_ROOT=/usr
-export CXX=${GCC_ROOT}/bin/g++
-export CC=${GCC_ROOT}/bin/gcc
-##
-#------ boost ------
-export BOOSTDIR=${INSTALL_ROOT}/boost-1.30.2
-##
-
-#------ tcltk ------
-export TCLHOME=/usr
-
-#------ Python ------
-export PYTHONHOME=/usr
-export PYTHONPATH=${PYPACKAGES}:${PYTHONPATH}
-##
-#------ Qt ------
-#export QTDIR=/usr/lib/qt-3.0.5
-export QTDIR=/usr/lib/qt3-gcc3.2
-export PATH=${PATH}:${QTDIR}/bin
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${QTDIR}/lib
-##
-#------ Sip ------
-export SIPDIR=/usr
-export PYQTDIR=/usr
-##
-#------ PyQt ------
-export PYQT_SIPS=/usr/share/sip/qt
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/python2.2/site-packages
-##
-#------ Swig ------
-export SWIG_ROOT=${INSTALL_ROOT}/SWIG-1.3.17
-export PATH=${SWIG_ROOT}/bin:${PATH}
-export LD_LIBRARY_PATH=${SWIG_ROOT}/lib:${LD_LIBRARY_PATH}
-##
-#------ OpenCascade ------
-export CASROOT=/opt/CAS52patch
-export LD_LIBRARY_PATH=${CASROOT}/Linux/lib:${LD_LIBRARY_PATH}
-export PATH=${CASROOT}/Linux/bin:${PATH}
-# Variable for Foundation Classes :
-export CSF_UnitsLexicon=${CASROOT}/src/UnitsAPI/Lexi_Expr.dat
-export CSF_UnitsDefinition=${CASROOT}/src/UnitsAPI/Units.dat
-# Variable for DataExchange :
-export CSF_SHMessage=${CASROOT}/src/SHMessage
-export CSF_XSMessage=${CASROOT}/src/XSMessage
-# Variable for Font :
-export CSF_MDTVFontDirectory=${CASROOT}/src/FontMFT
-export CSF_MDTVTexturesDirectory=${CASROOT}/src/Textures
-##
-export CSF_LANGUAGE=us
-export MMGT_CLEAR=1
-export CSF_EXCEPTION_PROMPT=1
-export CSF_StandardDefaults=${CASROOT}/src/StdResource
-export CSF_PluginDefaults=${CASROOT}/src/StdResource
-export CSF_XCAFDefaults=${CASROOT}/src/StdResource
-export CSF_GraphicShr=${CASROOT}/Linux/lib/libTKOpenGl.so
-export CSF_IGESDefaults=${CASROOT}/src/XSTEPResource
-export CSF_STEPDefaults=${CASROOT}/src/XSTEPResource
-##
-#export TCLLIBPATH=$TCLHOME/lib
-##
-#------ Qwt ------
-export QWTHOME=${INSTALL_ROOT}/qwt-0.4.1
-export LD_LIBRARY_PATH=${QWTHOME}/lib:${LD_LIBRARY_PATH}
-##
-#------ Hdf ------
-export HDF5HOME=${INSTALL_ROOT}/hdf5-1.4.4
-export PATH=${HDF5HOME}/bin:$PATH
-export LD_LIBRARY_PATH=${HDF5HOME}/lib:${LD_LIBRARY_PATH}
-##
-#------ Med ------
-export MED2HOME=/opt/med2.2.2
-export PATH=${MED2HOME}/bin:${PATH}
-export LD_LIBRARY_PATH=${MED2HOME}/lib:${LD_LIBRARY_PATH}
-##
-#------ Vtk ------
-export VTKHOME=${INSTALL_ROOT}/VTK-4.2.2
-export PATH=${VTKHOME}/bin:${PATH}
-export LD_LIBRARY_PATH=${VTKHOME}/lib/vtk:${LD_LIBRARY_PATH}
-export PYTHONPATH=${VTKHOME}/lib/vtk:${VTKHOME}/lib/python2.2/site-packages/vtk_python:${PYTHONPATH}
-##
-#------ netgen ------
-export NETGENROOT=${INSTALL_ROOT}/netgen4.3
-export NETGEN_HOME=${INSTALL_ROOT}/netgen4.3
-##
-#------ OmniORB ------
-export OMNIORBDIR=${INSTALL_ROOT}/omniORB-3.0.5
-export OMNIORB_CONFIG=${OMNIORBDIR}/.omniORB.cfg
-export PYTHONPATH=${OMNIORBDIR}/lib/python:${OMNIORBDIR}/lib/i586_linux_2.0_glibc2.1:${PYTHONPATH}
-export PATH=$OMNIORBDIR/bin/i586_linux_2.0_glibc2.1:$PATH
-export LD_LIBRARY_PATH=$OMNIORBDIR/lib/i586_linux_2.0_glibc2.1:$LD_LIBRARY_PATH
-##
-#------ Numeric ------
-export PYTHONPATH=${INSTALL_ROOT}/Numeric-22.0/lib/python2.2/site-packages/Numeric:${PYTHONPATH}
-##
-#------ HappyDoc ------
-export PATH=${INSTALL_ROOT}/HappyDoc-r2_1/bin:${PATH}
-export PYTHONPATH=${INSTALL_ROOT}/HappyDoc-r2_1/lib/python2.2/site-packages:${PYTHONPATH}
-##
-#------ Doxygen ------
-export PATH=${INSTALL_ROOT}/doxygen-1.3-rc2/bin:${PATH}
-##
-#------ Graphviz ------
-export PATH=${INSTALL_ROOT}/graphviz-1.9/bin:${PATH}
-export LD_LIBRARY_PATH=${INSTALL_ROOT}/graphviz-1.9/lib/graphviz:${LD_LIBRARY_PATH}
-##
-
-#------------------------------------------------------------------------------
+++ /dev/null
-#!/bin/sh
-# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- example to adapt to your own configuration ---
-# --- envSalome.sh gives a set of MODULE_ROOT_DIR, to source
-# --- you must at least define and export KERNEL_ROOT_DIR
-#
-REPINST=/home/prascle/SALOME2/Install
-
-export KERNEL_ROOT_DIR=${REPINST}/KERNEL_V301
-
-export GUI_ROOT_DIR=${REPINST}/GUI_V301
-#export SalomeAppConfig=${GUI_ROOT_DIR}/share/salome/resources/gui
-export SalomeAppConfig=${HOME}/${APPLI}
-
-export GEOM_ROOT_DIR=${REPINST}/GEOM_V301
-export MED_ROOT_DIR=${REPINST}/MED_V301
-export SMESH_ROOT_DIR=${REPINST}/SMESH_V301
-export VISU_ROOT_DIR=${REPINST}/VISU_V301
-export NETGENPLUGIN_ROOT_DIR=${REPINST}/NETGENPLUGIN_V301
-export COMPONENT_ROOT_DIR=${REPINST}/COMPONENT_V301
-export PYCALCULATOR_ROOT_DIR=${REPINST}/PYCALCULATOR_V301
-export PYHELLO_ROOT_DIR=${REPINST}/PYHELLO_V301
-export PYTIX_ROOT_DIR=${REPINST}/PYTIX_V301
-
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-# --- retrieve APPLI path, relative to $HOME, set ${APPLI}
-
-APPLI_HOME=`dirname $0`
-export APPLI=`${APPLI_HOME}/getAppliPath.py`
-
-# --- set the SALOME environment (prerequisites, MODULES_ROOT_DIR...)
-
-. ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
-
-# --- find omniORB configuration relative to current session if any
-
-fileOmniConfig=${HOME}/${APPLI}/USERS/.omniORB_${USER}_last.cfg
-
-if [ -f $fileOmniConfig ]; then
- OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_last.cfg
- export OMNIORB_CONFIG
-fi
-
-currentPort=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
-echo $currentPort
-
-# --- kill current salome session
-${KERNEL_ROOT_DIR}/bin/salome/shutdownSalome.py
-${KERNEL_ROOT_DIR}/bin/salome/killSalomeWithPort.py $currentPort
-
-# --- delete config files
-
-if [ -s $fileOmniConfig ]; then
- refConfig=`ls -l $fileOmniConfig | awk '{print \$NF}'`
- if [ -f $refConfig ]; then
- rm $refConfig
- fi
- rm $fileOmniConfig
-fi
+++ /dev/null
-#!/bin/bash
-# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-./KillCurrentPort
-
-./runAppli --logger
-
import optparse
import types
-from salome_utils import verbose, setVerbose, getPortNumber
+from salome_utils import verbose, setVerbose, getPortNumber, getHomeDir
# names of tags in XML configuration file
doc_tag = "document"
# values passed as arguments, NOT read from XML config file, but set from within this script
appname_nam = "appname"
port_nam = "port"
+salomecfgname = "salome"
salomeappname = "SalomeApp"
script_nam = "pyscript"
# Calculate and return configuration file unique ID
# For example: for SALOME version 3.1.0a1 the id is 300999701
###
-def version_id( fname ):
+def version_id(fname):
+ major = minor = release = dev1 = dev2 = 0
vers = fname.split(".")
- major = int(vers[0])
- minor = int(vers[1])
- mr = re.search(r'^([0-9]+)([A-Za-z]?)([0-9]*)',vers[2])
- release = dev = 0
- if mr:
- release = int(mr.group(1))
- dev1 = dev2 = 0
- if len(mr.group(2)): dev1 = ord(mr.group(2))
- if len(mr.group(3)): dev2 = int(mr.group(3))
- dev = dev1 * 100 + dev2
- else:
- return None
+ if len(vers) > 0: major = int(vers[0])
+ if len(vers) > 1: minor = int(vers[1])
+ if len(vers) > 2:
+ mr = re.search(r'^([0-9]+)([A-Za-z]?)([0-9]*)',vers[2])
+ if mr:
+ release = int(mr.group(1))
+ if mr.group(2).strip(): dev1 = ord(mr.group(2).strip())
+ if mr.group(3).strip(): dev2 = int(mr.group(3).strip())
+ pass
+ pass
+ dev = dev1 * 100 + dev2
ver = major
ver = ver * 100 + minor
ver = ver * 100 + release
return ver
###
-# Get user configuration file name
+# Get default user configuration file name
+# For SALOME, it is:
+# - on Linux: ~/.config/salome/.SalomeApprc.[version]
+# - on Windows: ~/SalomeApp.xml.[version]
+# where [version] is a version number
###
-def userFile(appname):
+def defaultUserFile(appname=salomeappname, cfgname=salomecfgname):
v = version()
- if not v:
- return "" # not unknown version
+ if v: v = ".%s" % v
if sys.platform == "win32":
- filename = "%s\%s.xml.%s" % (os.environ['HOME'], appname, v)
+ filename = os.path.join(getHomeDir(), "%s.xml%s" % (appname, v))
else:
- filename = "%s/.%src.%s" % (os.environ['HOME'], appname, v)
- if os.path.exists(filename):
- return filename # user preferences file for the current version exists
- # initial id
- id0 = version_id( v )
- # get all existing user preferences files
+ if cfgname:
+ filename = os.path.join(getHomeDir(), ".config", cfgname, ".%src%s" % (appname, v))
+ pass
+ else:
+ filename = os.path.join(getHomeDir(), ".%src%s" % (appname, v))
+ pass
+ pass
+ return filename
+
+###
+# Get user configuration file name
+###
+def userFile(appname, cfgname):
+ # get app version
+ v = version()
+ if not v: return None # unknown version
+
+ # get default user file name
+ filename = defaultUserFile(appname, cfgname)
+ if not filename: return None # default user file name is bad
+
+ # check that default user file exists
+ if os.path.exists(filename): return filename # user file is found
+
+ # otherwise try to detect any appropriate user file
+
+ # ... calculate default version id
+ id0 = version_id(v)
+ if not id0: return None # bad version id -> can't detect appropriate file
+
+ # ... get all existing user preferences files
if sys.platform == "win32":
- files = glob.glob( os.environ['HOME'] + "\." + appname + ".xml.*" )
+ files = glob.glob(os.path.join(getHomeDir(), "%s.xml.*" % appname))
else:
- files = glob.glob( os.environ['HOME'] + "/." + appname + "rc.*" )
- f2v = {}
- for file in files:
- match = re.search( r'\.%src\.([a-zA-Z0-9.]+)$'%appname, file )
- if match: f2v[file] = match.group(1)
- last_file = ""
- last_version = 0
- for file in f2v:
- ver = version_id( f2v[file] )
- if ver and abs(last_version-id0) > abs(ver-id0):
- last_version = ver
- last_file = file
- return last_file
+ files = []
+ if cfgname: files += glob.glob(os.path.join(getHomeDir(), ".config", cfgname, ".%src.*" % appname))
+ files += glob.glob(os.path.join(getHomeDir(), ".%src.*" % appname))
+ pass
+
+ # ... loop through all files and find most appopriate file (with closest id)
+ appr_id = -1
+ appr_file = ""
+ for f in files:
+ if sys.platform == "win32":
+ match = re.search( r'%s\.xml\.([a-zA-Z0-9.]+)$'%appname, f )
+ else:
+ match = re.search( r'\.%src\.([a-zA-Z0-9.]+)$'%appname, f )
+ if match:
+ ver = version_id(match.group(1))
+ if not ver: continue # bad version id -> skip file
+ if appr_id < 0 or abs(appr_id-id0) > abs(ver-id0):
+ appr_id = ver
+ appr_file = f
+ pass
+ pass
+ pass
+ return appr_file
# --
if os.path.exists(absfname + ext) :
absfname += ext
if absfname in self.importHistory :
- if verbose(): print "Configure parser: file %s is already imported" % absfname
+ if verbose(): print "Configure parser: Warning : file %s is already imported" % absfname
return # already imported
break
pass
else:
- if verbose(): print "Configure parser: Error : file %s does NOT exists" % absfname
+ if verbose(): print "Configure parser: Error : file %s does not exist" % absfname
return
# importing file
dest="py_scripts",
help=help_str)
- # Configuration XML file. Default: $(HOME)/.SalomeApprc.$(version).
+ # Configuration XML file. Default: see defaultUserFile() function
help_str = "Parse application settings from the <file> "
- help_str += "instead of default $(HOME)/.SalomeApprc.$(version)"
+ help_str += "instead of default %s" % defaultUserFile()
o_r = optparse.Option("-r",
"--resources",
metavar="<file>",
args = {}
#def get_env():
#args = []
-def get_env(theAdditionalOptions=[], appname="SalomeApp"):
+def get_env(theAdditionalOptions=[], appname=salomeappname, cfgname=salomecfgname):
###
# Collect launch configuration files:
# - The environment variable "<appname>Config" (SalomeAppConfig) which can
# has higher priority: it means that if some configuration options
# is found in the next analyzed cofiguration file - it will be replaced
# - The last configuration file which is parsed is user configuration file
- # situated in the home directory: "~/.<appname>rc[.<version>]" (~/SalomeApprc.3.2.0)
- # (if it exists)
+ # situated in the home directory (if it exists):
+ # * ~/.config/salome/.<appname>rc[.<version>]" for Linux (e.g. ~/.config/salome/.SalomeApprc.6.4.0)
+ # * ~/<appname>.xml[.<version>] for Windows (e.g. ~/SalomeApp.xml.6.4.0)
# - Command line options have the highest priority and replace options
# specified in configuration file(s)
###
# parse SalomeApp.xml files in directories specified by SalomeAppConfig env variable
for dir in dirs:
- #filename = dir+'/'+appname+'.xml'
- filename = dir+'/'+salomeappname+'.xml'
+ filename = os.path.join(dir, appname+'.xml')
if not os.path.exists(filename):
- print "Configure parser: Warning : could not find configuration file %s" % filename
+ if verbose(): print "Configure parser: Warning : can not find configuration file %s" % filename
else:
try:
p = xml_parser(filename, _opts)
_opts = p.opts
except:
- print "Configure parser: Error : can not read configuration file %s" % filename
+ if verbose(): print "Configure parser: Error : can not read configuration file %s" % filename
pass
# parse user configuration file
# It can be set via --resources=<file> command line option
- # or is given by default from ${HOME}/.<appname>rc.<version>
+ # or is given from default location (see defaultUserFile() function)
# If user file for the current version is not found the nearest to it is used
user_config = cmd_opts.resources
if not user_config:
- user_config = userFile(appname)
+ user_config = userFile(appname, cfgname)
+ if verbose(): print "Configure parser: user configuration file is", user_config
if not user_config or not os.path.exists(user_config):
- print "Configure parser: Warning : could not find user configuration file"
+ if verbose(): print "Configure parser: Warning : can not find user configuration file"
else:
try:
p = xml_parser(user_config, _opts)
_opts = p.opts
except:
- print 'Configure parser: Error : can not read user configuration file'
+ if verbose(): print 'Configure parser: Error : can not read user configuration file'
user_config = ""
args = _opts
'getAppName',
'getPortNumber',
'getTmpDir',
+ 'getHomeDir',
'generateFileName',
'makeTmpDir',
'uniteFiles',
# ---
+def getHomeDir():
+ """
+ Get home directory.
+ """
+ import os, sys
+ if sys.platform == "win32":
+ # for Windows the home directory is detected in the following way:
+ # 1. try USERPROFILE env variable
+ # 2. try combination of HOMEDRIVE and HOMEPATH env variables
+ # 3. try HOME env variable
+ # TODO: on Windows, also GetUserProfileDirectoryW() system function might be used
+ dir = os.getenv("USERPROFILE")
+ if not dir and os.getenv("HOMEDRIVE") and os.getenv("HOMEPATH"):
+ dir = os.path.join(os.getenv("HOMEDRIVE"), os.getenv("HOMEPATH"))
+ if not dir:
+ dir = os.getenv("HOME")
+ pass
+ else:
+ # for Linux: use HOME variable
+ dir = os.getenv("HOME")
+ pass
+ return dir
+# ---
+
def getTmpDir():
"""
Get directory to be used for the temporary files.
if not os.path.exists(module_lib_py_dir):
print "Python directory %s does not exist" % module_lib_py_dir
else:
- # __GBO__ specific action for the package salome
+ # Specific action for the package salome
module_lib_pypkg_dir=os.path.join(module_lib_py_dir,"salome")
lib_pypkg_dir=os.path.join(lib_py_dir,"salome")
mkdir(lib_pypkg_dir)
- # __GBO__
mkdir(lib_py_shared_dir)
for fn in os.listdir(module_lib_py_dir):
if fn == "shared_modules": continue
- # __GBO__
if fn == "salome": continue
- # __GBO__
symlink(os.path.join(module_lib_py_dir, fn), os.path.join(lib_py_dir, fn))
pass
if os.path.exists(module_lib_py_shared_dir):
symlink(os.path.join(module_lib_py_shared_dir, fn), os.path.join(lib_py_shared_dir, fn))
pass
pass
- # __GBO__
if os.path.exists(module_lib_pypkg_dir):
for fn in os.listdir(module_lib_pypkg_dir):
symlink(os.path.join(module_lib_pypkg_dir, fn), os.path.join(lib_pypkg_dir, fn))
pass
pass
- # __GBO__
else:
if verbose:
print module_lib_py_shared_dir, " doesn't exist"
if os.path.exists(module_share_dir):
mkdir(share_dir)
for fn in os.listdir(module_share_dir):
- if fn=="resources":
- #resources : create it and link content
- mkdir(os.path.join(share_dir,"resources"))
- for ffn in os.listdir(os.path.join(module_share_dir,"resources")):
- symlink(os.path.join(module_share_dir, "resources", ffn), os.path.join(share_dir,"resources", ffn))
- else:
- #other directories (not resources)
- symlink(os.path.join(module_share_dir, fn), os.path.join(share_dir, fn))
+ if fn in ["resources","plugins"] :
+ # Create the directory and then link the content
+ mkdir(os.path.join(share_dir,fn))
+ for ffn in os.listdir(os.path.join(module_share_dir,fn)):
+ symlink(os.path.join(module_share_dir, fn, ffn), os.path.join(share_dir,fn, ffn))
+ else:
+ #other directories (not resources)
+ symlink(os.path.join(module_share_dir, fn), os.path.join(share_dir, fn))
else:
print "share/salome directory %s does not exist" % module_share_dir
pass
# ================================================================
#AC_PREREQ(2.59)
#
-AC_INIT([Salome2 Project], [6.3.1], [paul.rascle@edf.fr], [SalomeKERNEL])
+AC_INIT([Salome2 Project], [6.4.0], [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, ...
src/Utils/Makefile \
src/Utils/Test/Makefile \
src/KernelHelpers/Makefile \
+ src/KernelHelpers/Test/Makefile \
])
SUBDIRS = salome docutils
-EXTRA_DIST = configuration_examples
+EXTRA_DIST = configuration_examples README.cluster-CCRT
docs: usr_docs
PAPEROPT_a4 = -D latex_paper_size=a4
ALLSPHINXOPTS = -d doctrees $(PAPEROPT_a4) $(SPHINXOPTS) $(SOURCEDIR)
+if WITH_PACO_PARALLEL
+SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/bin/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages:$(PACOPATH)/lib/python$(PYTHON_VERSION):$(PACOPATH)/lib/python
+else
SPHINX_PYTHONPATH = $(prefix)/lib/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/lib64/python$(PYTHON_VERSION)/site-packages/salome:$(prefix)/bin/salome:$(OMNIORB_ROOT)/lib/python$(PYTHON_VERSION)/site-packages:$(OMNIORB_ROOT)/lib64/python$(PYTHON_VERSION)/site-packages
+endif
SPHINX_LD_LIBRARY_PATH = $(OMNIORB_ROOT)/lib
-
.PHONY: latex
if SPHINX_IS_OK
KERNEL_SRC
Some README files and configuration tools for build
-KERNEL_SRC/adm_local
- Part of the configuration files, other modules have a directory with the
- same name. Not used in KERNEL.
-
KERNEL_SRC/bin
Python and shell scripts used at run time.
Kit to install a SALOME Application.
EXTRA_DIST= main.dox install.dox \
kernel_resources.dox kernel_services.dox kernel_services_cpphelpers.dox \
salome_application.dox unittests.dox \
- salome_file.dox kernel_salome.dox
+ salome_file.dox kernel_salome.dox \
+ examples
fi;
uninstall-local:
- rm -rf $(DESTDIR)$(docdir)/tui/KERNEL
+ -test -d $(DESTDIR)$(docdir)/tui/KERNEL && chmod -R +w $(DESTDIR)$(docdir)/tui/KERNEL && rm -rf $(DESTDIR)$(docdir)/tui/KERNEL
- KERNEL_SRC :\n
Some README files and configuration tools for build
-- 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 :\n
Python and shell scripts used at run time.
Kit to install a %SALOME Application.
EXTRA_DIST= $(BASEIDL_FILES) $(MPIIDL_FILES) $(OTHER_IDL_FILES) \
SALOME_Component.xml DSC_Engines.xml SALOME_Ports.xml \
SALOME_PACOExtension.xml SALOME_ParamPorts.xml \
- SALOME_GenericObj.xml
+ SALOME_GenericObj.xml SALOME_Exception.xml
# This variable defines the files to be installed
salomeidl_DATA = $(IDL_FILES)
if WITHONLYLAUNCHER
dist_salomeres_DATA=\
- CatalogResources.xml \
CatalogModulePersonnel.xml_skel
+
+ # VSR: little trick to avoid putting if generated files to the distribution archive
+ nodist_salomeres_DATA=\
+ CatalogResources.xml
else
dist_salomeres_DATA=\
- CatalogResources.xml \
CatalogModulePersonnel.xml_skel \
channel.cfg \
- KERNELCatalog.xml \
SALOMEDS_Resources
+
+ # VSR: little trick to avoid putting if generated files to the distribution archive
+ nodist_salomeres_DATA=\
+ CatalogResources.xml \
+ KERNELCatalog.xml
endif
+
+EXTRA_DIST = CatalogDataType.xml
FIND_LIBRARY(TOOLSDS TOOLSDS ${KERNEL_ROOT_DIR}/lib/salome)
FIND_LIBRARY(UtilsTest UtilsTest ${KERNEL_ROOT_DIR}/lib/salome)
FIND_LIBRARY(with_loggerTraceCollector with_loggerTraceCollector ${KERNEL_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(SalomeKernelHelpers SalomeKernelHelpers ${KERNEL_ROOT_DIR}/lib/salome)
"TOOLSDS",
"UtilsTest",
"with_loggerTraceCollector",
+ "SalomeKernelHelpers",
]
gui_list = [
"caf",
pass
# --
newlines.append("""
- set(VERSION 6.3.1)
- set(XVERSION 0x060301)
+ set(VERSION 6.4.0)
+ set(XVERSION 0x060400)
""")
pass
# --
SET(VERSION_INFO 0.0.0)
SET(SOVERSION_INFO 0)
SET(SUBDIRS)
- SET(AM_CPPFLAGS -I${CMAKE_BINARY_DIR )
+ SET(AM_CPPFLAGS -I${CMAKE_BINARY_DIR} )
SET(AM_CXXFLAGS -I${CMAKE_BINARY_DIR})
SET(LDADD)
SET(pythondir lib/python${PYTHON_VERSION}/site-packages)
SET(salomepythondir ${pythondir}/salome)
SET(salomepypkgdir ${salomepythondir}/salome)
""")
+
+ if self.module == "smesh" and self.root[-len('SMESH_PY'):] == 'SMESH_PY':
+ newlines.append("""
+ SET(smeshpypkgdir ${salomepythondir}/salome/smesh)
+ """)
+ pass
if self.module == "netgen":
newlines.append(r'''
SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DNO_PARALLEL_THREADS -DOCCGEOMETRY -I${CMAKE_CURRENT_SOURCE_DIR})
if self.module == "gui":
newlines.append(r'''
IF(KERNEL_ROOT_DIR)
- SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DWITH_SALOMEDS_OBSERVER)
- SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DWITH_SALOMEDS_OBSERVER)
+ SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DWITH_SALOMEDS_OBSERVER -DSUIT_ENABLE_PYTHON)
+ SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DWITH_SALOMEDS_OBSERVER -DSUIT_ENABLE_PYTHON)
ENDIF(KERNEL_ROOT_DIR)
''')
pass
# --
fields = value.split()
+
+ #rnv: Temporary solution for windows platform:
+ #rnv: To remove GUI_SRC/tools directory, because it contains shell scripts
+ #rnv: Will be fixed in the future
+ from sys import platform
+ if platform == "win32" and self.module == 'gui' and self.root[-len('GUI_SRC'):] == 'GUI_SRC' and key.endswith("SUBDIRS"):
+ fields.remove("tools")
+
for i in range(len(fields)):
newlines.append("%s %s"%(spaces, fields[i]))
pass
''')
pass
+ # --
+ # --
+ key = "MOC_FILES_HXX"
+ if self.__thedict__.has_key(key):
+ newlines.append('''
+ FOREACH(output ${MOC_FILES_HXX})
+ ''')
+ newlines.append('''
+ STRING(REGEX REPLACE _moc.cxx .hxx input ${output})
+ ''')
+ newlines.append('''
+ SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+ SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${output}
+ COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input} -o ${output}
+ MAIN_DEPENDENCY ${input}
+ )
+ ENDFOREACH(output ${MOC_FILES_HXX})
+ ''')
+ pass
+
# --
# --
key = "UIC_FILES"
SET(input_path ${CMAKE_CURRENT_SOURCE_DIR}/${input})
IF (NOT EXISTS ${input_path})
SET(input_path ${CMAKE_CURRENT_BINARY_DIR}/${input})
- ENDIF (NOT EXISTS input_path)
+ ENDIF (NOT EXISTS ${input_path})
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
COMMAND ${QT_UIC_EXECUTABLE} -o ${output} ${input_path}
SET(input_path ${CMAKE_CURRENT_SOURCE_DIR}/${input})
IF (NOT EXISTS ${input_path})
SET(input_path ${CMAKE_CURRENT_BINARY_DIR}/${input})
- ENDIF (NOT EXISTS input_path)
+ ENDIF (NOT EXISTS ${input_path})
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input_path} -o ${output}
SET(libadd ${libadd} ${dir}/LIBI77.lib)
ENDIF(name STREQUAL ${target})
ENDFOREACH(target ${targets})
+ ELSE(WINDOWS)
+ SET(targets)
+ SET(targets ${targets} MEFISTO2D)
+ FOREACH(target ${targets})
+ IF(name STREQUAL ${target})
+ SET(libadd ${libadd} -lf2c)
+ ENDIF(name STREQUAL ${target})
+ ENDFOREACH(target ${targets})
ENDIF(WINDOWS)
''')
# --
SET(targets ${targets} MEDEngine)
SET(targets ${targets} SMESHEngine)
SET(targets ${targets} SMESH)
+ SET(targets ${targets} SalomeIDLSPADDER)
+ SET(targets ${targets} MeshJobManagerEngine)
SET(targets ${targets} StdMeshersEngine)
SET(targets ${targets} VISUEngineImpl)
FOREACH(target ${targets})
pass
pass
# --
- from sys import stdout
for f in files:
if f in ["Makefile.am", "Makefile.am.cmake"]:
convertAmFile(the_root, root, dirs, files, f, module)
pass
pass
#
+ from sys import stdout
if nok:
if nok == 1:
msg = "%s file has been converted to cmake"%(nok)
AC_SUBST(HDF5_INCLUDES)
AC_SUBST(HDF5_LIBS)
AC_SUBST(HDF5_MT_LIBS)
+AC_SUBST(HDF5HOME)
HDF5_INCLUDES=""
HDF5_LIBS=""
// Autor : Alexander A. BORODIN
// Module : SALOME
//
+
#include "Basics_Utils.hxx"
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <execinfo.h>
-#else
-#include <winsock2.h>
#endif
+
namespace Kernel_Utils
{
std::string GetHostname()
#define _Basics_UTILS_HXX_
#include "SALOME_Basics.hxx"
-
#include <string>
#include <iostream>
+
#ifndef WIN32
#include <sys/time.h>
#else
-#include <sys/timeb.h>
+#include <winsock2.h>
+#include <windows.h>
+#pragma comment(lib,"winmm.lib")
#endif
// Helper macro for time analysis
// =============================================================
//
-
+#ifndef WIN32
#define START_TIMING(name) static long name##tcount=0;static long name##cumul;long name##tt0; timeval name##tv; gettimeofday(&name##tv,0); \
name##tt0=name##tv.tv_usec+name##tv.tv_sec*1000000; \
if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;
if(name##tcount==NUMBER){ \
std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
name##tcount=0;name##cumul=0;}
+#else
+
+#define START_TIMING(name) static long name##tcount=0;static DWORD name##cumul;DWORD name##tv;DWORD name##tt0 = timeGetTime(); \
+ if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;
+
+#define END_TIMING(name,NUMBER) name##tcount=name##tcount+1; name##tv = timeGetTime(); \
+ name##cumul=name##cumul+name##tv - name##tt0; \
+ if(name##tcount==NUMBER){ \
+ std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
+ name##tcount=0;name##cumul=0;}
+#endif
+
//
#include "SALOME_NamingService.hxx"
#include "Basics_Utils.hxx"
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
#include <Python.h>
#include "Container_init_python.hxx"
#include <SALOMEconfig.h>
#include <pthread.h> // must be before Python.h !
+
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
#include <Python.h>
+++ /dev/null
-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-// File : Calcium.c
-// Author : Eric Fayolle (EDF)
-// Module : KERNEL
-//
-#include "calcium.h"
-#include "calciumf.h"
-#include "CalciumFortranInt.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stddef.h>
-
-// Interface C de SalomeCalcium
-
-typedef int InfoType;
-typedef char bool;
-
-//TODO: ajouter les prototypes pour eviter les pbs de passage par valeur
-InfoType ecp_fint_ (void * component, char* nomVar, float t);
-InfoType ecp_fini_ (void * component, char* nomVar, int i);
-InfoType ecp_efft_ (void * component, char* nomVar, float t);
-InfoType ecp_effi_ (void * component, char* nomVar, int i);
-
-/************************************/
-/* INTERFACES DE LECTURE EN 0 COPIE */
-/************************************/
-
-/* Definition des méthodes calcium étendues en 0 copie */
-/* Le buffer est alloué par le port pas par l'utilisateur */
-/* Remarquer le type ** de data */
-/* L'utilisateur devra appeler ecp_..._free pour désallouer le buffer interne */
-/* Attention en cas de lectures multiples : le buffer retourné est le même */
-/* Attention si les niveaux sont actifs le buffer peut être supprimé automatiquement par calcium. */
-
-#define CALCIUM_EXT_LECT_INTERFACE_C_(_name,_timeType,_type,_typeName,_qual) \
- InfoType ecp_##_name (void * component, int mode, \
- _timeType * ti, _timeType * tf, int * i, \
- char * nomvar, int bufferLength, \
- int * nRead, _type _qual ** data ) { \
- size_t _nRead; \
- long _i=*i; \
- fflush(stdout); \
- fflush(stderr); \
- \
- InfoType info = ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \
- nomvar, bufferLength, &_nRead, \
- data ); \
- /* std::cout << "-------- CalciumInterface(C Part), Valeur de data : " << std::endl; */ \
- /* std::cout << "Ptr :" << *data << std::endl; */ \
- /* for (int j=0; j<_nRead;++j) */ \
- /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \
- /* std::cout << "Ptr :" << *data << std::endl; */ \
- /* */ \
- /* std::cerr << "-------- CalciumInterface(C Part) MARK 2 ------------------" << std::endl; */ \
- if(mode == CP_SEQUENTIEL) \
- *i = _i; \
- *nRead=_nRead; \
- /* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \
- \
- return info; \
- }; \
- void ecp_##_name##_free ( _type _qual * data) { \
- ecp_lecture_##_typeName##_free(data); \
- };
-
-
-/* L'interface de cette routine diffère de celle obtenue par la macro :
- CALCIUM_LECT_INTERFACE_C_.
- Le paramètre supplémentaire strSize indique la taille fixe et identique
- des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
-*/
-InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i,
- char * nomvar, int bufferLength, int * nRead,
- char *** data, int strSize) {
-
- size_t _nRead;
- long _i=*i;
- fflush(stdout);fflush(stderr);
-
- InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
- nomvar, bufferLength, &_nRead,
- data);/*, strSize );
- strSize est inutile pour les ports CALCIUM
- qui gèrent des tailles quelconques de chaines. */
- if(mode == CP_SEQUENTIEL)
- *i = _i;
- *nRead=_nRead;
- fflush(stdout);fflush(stderr);
- return info;
-};
-
-void ecp_lch_free (char* * data) { \
- ecp_lecture_str_free(data); \
-};
-
-
-#define STAR *
-/*REVERIFIER MAINTENANT 0 COPY avec int2integer*/
-CALCIUM_EXT_LECT_INTERFACE_C_(len,float,int,int2integer,);
-CALCIUM_EXT_LECT_INTERFACE_C_(lre,float,float,float,);
-CALCIUM_EXT_LECT_INTERFACE_C_(ldb,double,double,double,);
-CALCIUM_EXT_LECT_INTERFACE_C_(llo,float,int,bool,);
-CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,);
-/* CALCIUM_EXT_LECT_INTERFACE_C_(lch,float,char,STAR[]); */
-
-
-/**************************************/
-/* INTERFACES DE LECTURE AVEC RECOPIE */
-/**************************************/
-
-#define CALCIUM_LECT_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- _calInt cp_##_name (void * component, _calInt mode, \
- _timeType * ti, _timeType * tf, _calInt * i, \
- char * nomvar, _calInt bufferLength, \
- _calInt * nRead, _type _qual * data \
- lastarg ) { \
- \
- int _mode = (int) mode; \
- size_t _bufferLength = bufferLength; \
- size_t _nRead; \
- long _i =*i; \
- fflush(stdout); \
- fflush(stderr); \
- \
- if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \
- \
- _calInt info = ecp_lecture_##_typeName (component, _mode, ti, tf, &_i, \
- nomvar, _bufferLength, &_nRead, \
- &data ); \
- if(mode == CP_SEQUENTIEL) \
- *i = _i; \
- *nRead=_nRead; \
- fflush(stdout); \
- fflush(stderr); \
- \
- return info; \
- }; \
- void cp_##_name##_free ( _type _qual * data) { \
- ecp_lecture_##_typeName##_free(data); \
- };
-
-
-/* L'interface de cette routine diffère de celle obtenue par la macro :
- CALCIUM_LECT_INTERFACE_C_.
- Le paramètre supplémentaire strSize indique la taille fixe et identique
- des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
-*/
-
-/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */
-/* char * nomvar, int bufferLength, int * nRead, */
-/* char ** data, int strSize) { */
-
-/* size_t _nRead; */
-/* long _i=*i; */
-/* fflush(stdout);fflush(stderr); */
-/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
-/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
-/* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */
-/* nomvar, bufferLength, &_nRead, */
-/* &data);*/
-/*, strSize ); */
-/* strSize est inutile pour les ports CALCIUM */
-/* qui gèrent des tailles quelconques de chaines. */
-/* if(mode == CP_SEQUENTIEL) */
-/* *i = _i; */
-/* *nRead=_nRead; */
-/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
-/* fflush(stdout);fflush(stderr); */
-/* return info; */
-/* }; */
-
-
-/* Definition des méthodes calcium standard */
-/* CALCIUM_LECT_INTERFACE_C_( <suffixe du nom de l'interface à générer>, <type du paramètre temporel>, <type d'entier à utiliser pour les paramètres de type entier>,
- <type de données>, <nom de l'interface C2CPP à utiliser>, <qualificateur de type optionnel des données>,<paramètres supplémentaire ignoré>)*/
-
-CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,);
-/*llg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
- sinon problème de conversion de 64bits vers 32bits */
-CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,);
-
-CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,);
-
-CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,);
-CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,);
-CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
-CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,);
-#define STAR *
-#define LCH_LAST_PARAM ,int strsize
-CALCIUM_LECT_INTERFACE_C_(lch,float ,int,char ,str,STAR, LCH_LAST_PARAM );
-
-
-/* Definition des méthodes calcium destinées à l'interfaçage fortran
- avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
-
-CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,);
-CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,);
-/*llg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
- sinon problème de conversion de 64bits vers 32bits */
-CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,);
-
-CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,);
-CALCIUM_LECT_INTERFACE_C_(ldb_fort_,double,cal_int,double ,double,,);
-CALCIUM_LECT_INTERFACE_C_(llo_fort_,float ,cal_int,int ,bool,,); /*int pour bool ou cal_int */
-CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,);
-CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM );
-
-CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,);
-
-/**********************************************/
-/* INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */
-/**********************************************/
-
-InfoType cp_cd (void * component, char * instanceName) {
- InfoType info = ecp_cd_(component,instanceName);
- return info;
-}
-
-InfoType cp_fin (void * component, int code) {
- /* TODO : gérer avec les callbacks des ports DSC */
-
- InfoType info = ecp_fin_(component,code);
-
- return info;
-}
-
-
-/***************************/
-/* INTERFACES D'ECRITURE */
-/***************************/
-
-#define CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
- _calInt cp_##_name (void * component, _calInt mode, \
- _timeType t, _calInt i, \
- char * nomvar, _calInt nbelem, \
- _type _qual * data \
- lastarg ) { \
- \
- int _mode = mode; \
- long _i = i; \
- size_t _nbelem = nbelem; \
- _timeType _t = t; \
- fflush(stdout); \
- fflush(stderr); \
- if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \
- \
- _calInt info = ecp_ecriture_##_typeName (component, _mode, &_t, _i, \
- nomvar, _nbelem, \
- data ); \
- fflush(stdout); \
- fflush(stderr); \
- \
- return info; \
- }; \
-
-
-
-
-/* InfoType cp_ech(void * component, int mode, float t, int i, */
-/* char * nomvar, int nbelem, */
-/* char ** data, int strSize) { */
-
-/*long _i=i;*/
-/* fflush(stdout);fflush(stderr); */
-/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
-/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
-
-/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
-/* nomvar, nbelem, */
-/* data); */
-/*, strSize );*/
-/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
-/* fflush(stdout); */
-/* fflush(stderr); */
-
-/* return info; */
-/* }; */
-
-/* Definition des méthodes calcium standard */
-/* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */
-CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,);
-/*elg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
- sinon problème de conversion de 64bits vers 32bits */
-CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,);
-CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,);
-CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,);
-CALCIUM_ECR_INTERFACE_C_(elo,float ,int,int ,bool,,);
-CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,);
-CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM );
-
-CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,);
-
-/* Definition des méthodes calcium destinées à l'interfaçage fortran
- avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
-
-CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,);
-/*elg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
- sinon problème de conversion de 64bits vers 32bits */
-CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,);
-CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,);
-CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,);
-CALCIUM_ECR_INTERFACE_C_(edb_fort_,double,cal_int,double,double,,);
-CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,);
-CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,);
-CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM );
-
-CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,);
-
-/***************************/
-/* Interface for cleaning */
-/***************************/
-
-InfoType cp_fini (void * component, char * nomvar, int i)
-{
- InfoType info = ecp_fini_(component,nomvar,i);
- return info;
-}
-
-InfoType cp_fint (void * component, char * nomvar, float t)
-{
- InfoType info = ecp_fint_(component,nomvar,t);
- return info;
-}
-
-InfoType cp_effi (void * component, char * nomvar, int i)
-{
- InfoType info = ecp_effi_(component,nomvar,i);
- return info;
-}
-
-InfoType cp_efft (void * component, char * nomvar, float t)
-{
- InfoType info = ecp_efft_(component,nomvar,t);
- return info;
-}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : Calcium.c
+// Author : Eric Fayolle (EDF)
+// Module : KERNEL
+//
+#include "calcium.h"
+#include "calciumf.h"
+#include "CalciumFortranInt.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <stddef.h>
+
+// Interface C de SalomeCalcium
+
+typedef int InfoType;
+typedef char bool;
+
+//TODO: ajouter les prototypes pour eviter les pbs de passage par valeur
+InfoType ecp_fint_ (void * component, char* nomVar, float t);
+InfoType ecp_fini_ (void * component, char* nomVar, int i);
+InfoType ecp_efft_ (void * component, char* nomVar, float t);
+InfoType ecp_effi_ (void * component, char* nomVar, int i);
+
+/************************************/
+/* INTERFACES DE LECTURE EN 0 COPIE */
+/************************************/
+
+/* Definition des méthodes calcium étendues en 0 copie */
+/* Le buffer est alloué par le port pas par l'utilisateur */
+/* Remarquer le type ** de data */
+/* L'utilisateur devra appeler ecp_..._free pour désallouer le buffer interne */
+/* Attention en cas de lectures multiples : le buffer retourné est le même */
+/* Attention si les niveaux sont actifs le buffer peut être supprimé automatiquement par calcium. */
+
+#define CALCIUM_EXT_LECT_INTERFACE_C_(_name,_timeType,_type,_typeName,_qual) \
+ InfoType ecp_##_name (void * component, int mode, \
+ _timeType * ti, _timeType * tf, int * i, \
+ char * nomvar, int bufferLength, \
+ int * nRead, _type _qual ** data ) { \
+ size_t _nRead; \
+ long _i=*i; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ InfoType info = ecp_lecture_##_typeName (component, mode, ti, tf, &_i, \
+ nomvar, bufferLength, &_nRead, \
+ data ); \
+ /* std::cout << "-------- CalciumInterface(C Part), Valeur de data : " << std::endl; */ \
+ /* std::cout << "Ptr :" << *data << std::endl; */ \
+ /* for (int j=0; j<_nRead;++j) */ \
+ /* printf("--- Valeur de data[%d] : %d \n",j,(*data)[j]); */ \
+ /* std::cout << "Ptr :" << *data << std::endl; */ \
+ /* */ \
+ /* std::cerr << "-------- CalciumInterface(C Part) MARK 2 ------------------" << std::endl; */ \
+ if(mode == CP_SEQUENTIEL) \
+ *i = _i; \
+ *nRead=_nRead; \
+ /* std::cerr << "-------- CalciumInterface(C Part) MARK 3 ------------------" << std::endl; */ \
+ \
+ return info; \
+ }; \
+ void ecp_##_name##_free ( _type _qual * data) { \
+ ecp_lecture_##_typeName##_free(data); \
+ };
+
+
+/* L'interface de cette routine diffère de celle obtenue par la macro :
+ CALCIUM_LECT_INTERFACE_C_.
+ Le paramètre supplémentaire strSize indique la taille fixe et identique
+ des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
+*/
+InfoType ecp_lch(void * component, int mode, float * ti, float * tf, int * i,
+ char * nomvar, int bufferLength, int * nRead,
+ char *** data, int strSize) {
+
+ size_t _nRead;
+ long _i=*i;
+ fflush(stdout);fflush(stderr);
+
+ InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i,
+ nomvar, bufferLength, &_nRead,
+ data);/*, strSize );
+ strSize est inutile pour les ports CALCIUM
+ qui gèrent des tailles quelconques de chaines. */
+ if(mode == CP_SEQUENTIEL)
+ *i = _i;
+ *nRead=_nRead;
+ fflush(stdout);fflush(stderr);
+ return info;
+};
+
+void ecp_lch_free (char* * data) { \
+ ecp_lecture_str_free(data); \
+};
+
+
+#define STAR *
+/*REVERIFIER MAINTENANT 0 COPY avec int2integer*/
+CALCIUM_EXT_LECT_INTERFACE_C_(len,float,int,int2integer,);
+CALCIUM_EXT_LECT_INTERFACE_C_(lre,float,float,float,);
+CALCIUM_EXT_LECT_INTERFACE_C_(ldb,double,double,double,);
+CALCIUM_EXT_LECT_INTERFACE_C_(llo,float,int,bool,);
+CALCIUM_EXT_LECT_INTERFACE_C_(lcp,float,float,cplx,);
+/* CALCIUM_EXT_LECT_INTERFACE_C_(lch,float,char,STAR[]); */
+
+
+/**************************************/
+/* INTERFACES DE LECTURE AVEC RECOPIE */
+/**************************************/
+
+#define CALCIUM_LECT_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
+ _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType * ti, _timeType * tf, _calInt * i, \
+ char * nomvar, _calInt bufferLength, \
+ _calInt * nRead, _type _qual * data \
+ lastarg ) { \
+ \
+ int _mode = (int) mode; \
+ size_t _bufferLength = bufferLength; \
+ size_t _nRead; \
+ long _i =*i; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ if ( (data == NULL) || (_bufferLength < 1) ) return CPNTNULL; \
+ \
+ _calInt info = ecp_lecture_##_typeName (component, _mode, ti, tf, &_i, \
+ nomvar, _bufferLength, &_nRead, \
+ &data ); \
+ if(mode == CP_SEQUENTIEL) \
+ *i = _i; \
+ *nRead=_nRead; \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ return info; \
+ }; \
+ void cp_##_name##_free ( _type _qual * data) { \
+ ecp_lecture_##_typeName##_free(data); \
+ };
+
+
+/* L'interface de cette routine diffère de celle obtenue par la macro :
+ CALCIUM_LECT_INTERFACE_C_.
+ Le paramètre supplémentaire strSize indique la taille fixe et identique
+ des chaînes stockées dans data (les ports CALCIUM n'en n'ont pas besoin)
+*/
+
+/* InfoType cp_lch(void * component, int mode, float * ti, float * tf, int * i, */
+/* char * nomvar, int bufferLength, int * nRead, */
+/* char ** data, int strSize) { */
+
+/* size_t _nRead; */
+/* long _i=*i; */
+/* fflush(stdout);fflush(stderr); */
+/* fprintf(stderr,"Beginning of cp_lch: %s %d %f\n",nomvar,*i,*ti); */
+/* if ( (data == NULL) || (bufferLength < 1) ) return CPNTNULL; */
+/* InfoType info = ecp_lecture_str (component, mode, ti, tf, &_i, */
+/* nomvar, bufferLength, &_nRead, */
+/* &data);*/
+/*, strSize ); */
+/* strSize est inutile pour les ports CALCIUM */
+/* qui gèrent des tailles quelconques de chaines. */
+/* if(mode == CP_SEQUENTIEL) */
+/* *i = _i; */
+/* *nRead=_nRead; */
+/* fprintf(stderr,"End of cp_lch: %s %d \n",nomvar,*i); */
+/* fflush(stdout);fflush(stderr); */
+/* return info; */
+/* }; */
+
+
+/* Definition des méthodes calcium standard */
+/* CALCIUM_LECT_INTERFACE_C_( <suffixe du nom de l'interface à générer>, <type du paramètre temporel>, <type d'entier à utiliser pour les paramètres de type entier>,
+ <type de données>, <nom de l'interface C2CPP à utiliser>, <qualificateur de type optionnel des données>,<paramètres supplémentaire ignoré>)*/
+
+CALCIUM_LECT_INTERFACE_C_(len,float ,int,int ,int2integer,,);
+/*llg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
+CALCIUM_LECT_INTERFACE_C_(llg,float ,int,long ,long2integer,,);
+
+CALCIUM_LECT_INTERFACE_C_(lln,float ,int,long ,long,,);
+
+CALCIUM_LECT_INTERFACE_C_(lre,float ,int,float ,float,,);
+CALCIUM_LECT_INTERFACE_C_(ldb,double,int,double ,double,,);
+CALCIUM_LECT_INTERFACE_C_(llo,float ,int,int ,bool,,);
+CALCIUM_LECT_INTERFACE_C_(lcp,float ,int,float ,cplx,,);
+#define STAR *
+#define LCH_LAST_PARAM ,int strsize
+CALCIUM_LECT_INTERFACE_C_(lch,float ,int,char ,str,STAR, LCH_LAST_PARAM );
+
+
+/* Definition des méthodes calcium destinées à l'interfaçage fortran
+ avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
+
+CALCIUM_LECT_INTERFACE_C_(len_fort_,float ,cal_int,cal_int ,integer,,);
+CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int ,int2integer,,);
+/*llg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
+CALCIUM_LECT_INTERFACE_C_(llg_fort_,float ,cal_int,long ,long2integer,,);
+
+CALCIUM_LECT_INTERFACE_C_(lre_fort_,float ,cal_int,float ,float,,);
+CALCIUM_LECT_INTERFACE_C_(ldb_fort_,double,cal_int,double ,double,,);
+CALCIUM_LECT_INTERFACE_C_(llo_fort_,float ,cal_int,int ,bool,,); /*int pour bool ou cal_int */
+CALCIUM_LECT_INTERFACE_C_(lcp_fort_,float ,cal_int,float ,cplx,,);
+CALCIUM_LECT_INTERFACE_C_(lch_fort_,float ,cal_int,char ,str,STAR, LCH_LAST_PARAM );
+
+CALCIUM_LECT_INTERFACE_C_(lln_fort_,float ,cal_int,long ,long,,);
+
+/**********************************************/
+/* INTERFACES DE DÉBUT ET DE FIN DE COUPLAGE */
+/**********************************************/
+
+InfoType cp_cd (void * component, char * instanceName) {
+ InfoType info = ecp_cd_(component,instanceName);
+ return info;
+}
+
+InfoType cp_fin (void * component, int code) {
+ /* TODO : gérer avec les callbacks des ports DSC */
+
+ InfoType info = ecp_fin_(component,code);
+
+ return info;
+}
+
+
+/***************************/
+/* INTERFACES D'ECRITURE */
+/***************************/
+
+#define CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,_type,_typeName,_qual,lastarg) \
+ _calInt cp_##_name (void * component, _calInt mode, \
+ _timeType t, _calInt i, \
+ char * nomvar, _calInt nbelem, \
+ _type _qual * data \
+ lastarg ) { \
+ \
+ int _mode = mode; \
+ long _i = i; \
+ size_t _nbelem = nbelem; \
+ _timeType _t = t; \
+ fflush(stdout); \
+ fflush(stderr); \
+ if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; \
+ \
+ _calInt info = ecp_ecriture_##_typeName (component, _mode, &_t, _i, \
+ nomvar, _nbelem, \
+ data ); \
+ fflush(stdout); \
+ fflush(stderr); \
+ \
+ return info; \
+ }; \
+
+
+
+
+/* InfoType cp_ech(void * component, int mode, float t, int i, */
+/* char * nomvar, int nbelem, */
+/* char ** data, int strSize) { */
+
+/*long _i=i;*/
+/* fflush(stdout);fflush(stderr); */
+/* fprintf(stderr,"Beginning of cp_ech: %s %d %f\n",nomvar,i,t); */
+/* if ( (data == NULL) || (nbelem < 1) ) return CPNTNULL; */
+
+/* InfoType info = ecp_ecriture_str (component, mode, &t, i, */
+/* nomvar, nbelem, */
+/* data); */
+/*, strSize );*/
+/* fprintf(stderr,"End of cp_ech: %s %d \n",nomvar,i); */
+/* fflush(stdout); */
+/* fflush(stderr); */
+
+/* return info; */
+/* }; */
+
+/* Definition des méthodes calcium standard */
+/* CALCIUM_ECR_INTERFACE_C_(_name,_timeType,_calInt,type,_typeName,_qual) */
+CALCIUM_ECR_INTERFACE_C_(een,float ,int,int ,int2integer,,);
+/*elg ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
+CALCIUM_ECR_INTERFACE_C_(elg,float ,int,long ,long2integer,,);
+CALCIUM_ECR_INTERFACE_C_(ere,float ,int,float ,float,,);
+CALCIUM_ECR_INTERFACE_C_(edb,double,int,double,double,,);
+CALCIUM_ECR_INTERFACE_C_(elo,float ,int,int ,bool,,);
+CALCIUM_ECR_INTERFACE_C_(ecp,float ,int,float ,cplx,,);
+CALCIUM_ECR_INTERFACE_C_(ech,float ,int,char ,str,STAR,LCH_LAST_PARAM );
+
+CALCIUM_ECR_INTERFACE_C_(eln,float ,int,long ,long,,);
+
+/* Definition des méthodes calcium destinées à l'interfaçage fortran
+ avec une taille des INTEGER fortran paramétrés à la configuration du KERNEL */
+
+CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,);
+/*elg_fort_ ne fonctionnera pas toujours correctement (port calcium_integer) si sizeof(long) == 64 bits && cal_int==int (32 bits)
+ sinon problème de conversion de 64bits vers 32bits */
+CALCIUM_ECR_INTERFACE_C_(elg_fort_,float ,cal_int,long ,long2integer,,);
+CALCIUM_ECR_INTERFACE_C_(ein_fort_,float ,cal_int,int ,int2integer,,);
+CALCIUM_ECR_INTERFACE_C_(ere_fort_,float ,cal_int,float ,float,,);
+CALCIUM_ECR_INTERFACE_C_(edb_fort_,double,cal_int,double,double,,);
+CALCIUM_ECR_INTERFACE_C_(elo_fort_,float ,cal_int,int ,bool,,);
+CALCIUM_ECR_INTERFACE_C_(ecp_fort_,float ,cal_int,float ,cplx,,);
+CALCIUM_ECR_INTERFACE_C_(ech_fort_,float ,cal_int,char ,str,STAR,LCH_LAST_PARAM );
+
+CALCIUM_ECR_INTERFACE_C_(eln_fort_,float ,cal_int,long ,long,,);
+
+/***************************/
+/* Interface for cleaning */
+/***************************/
+
+InfoType cp_fini (void * component, char * nomvar, int i)
+{
+ InfoType info = ecp_fini_(component,nomvar,i);
+ return info;
+}
+
+InfoType cp_fint (void * component, char * nomvar, float t)
+{
+ InfoType info = ecp_fint_(component,nomvar,t);
+ return info;
+}
+
+InfoType cp_effi (void * component, char * nomvar, int i)
+{
+ InfoType info = ecp_effi_(component,nomvar,i);
+ return info;
+}
+
+InfoType cp_efft (void * component, char * nomvar, float t)
+{
+ InfoType info = ecp_efft_(component,nomvar,t);
+ return info;
+}
AM_CFLAGS = -fexceptions
lib_LTLIBRARIES = libCalciumC.la
-libCalciumC_la_SOURCES = Calcium.c Calcium.cxx calciumf.c
+libCalciumC_la_SOURCES = CalciumC.c Calcium.cxx calciumf.c
libCalciumC_la_CXXFLAGS = $(COMMON_CPPFLAGS)
#
deprecation.py \
logger.py \
termcolor.py \
- logconfig.py \
unittester.py \
pyunittester.py \
enumerate.py \
datamodeler.py \
testdata.py \
diclookup.py \
- threadhelper.py
+ threadhelper.py \
+ syshelper.py
+
+nodist_mypkgpython_PYTHON = \
+ logconfig.py
# This set of modules required a running SALOME application.
mypkgpython_PYTHON += \
"""
This module provides several functions to indicate the deprecation of a
module, a method or a function.
+
+Example::
+
+ from salome.kernel.deprecation import deprecated
+
+ @deprecated("Deprecated since version 6.3.0. Consider replacement with "
+ "newFunction()")
+ def oldFunction():
+ ...
+
"""
import sys
else:
file.write(str)
+# Enable warnings for deprecated functions and modules (in Python 2.7, they
+# are disabled by default)
+warnings.filterwarnings("always", "Call to *", DeprecationWarning)
+warnings.filterwarnings("always", "Importation of *", DeprecationWarning)
warnings.showwarning = __show_colored_warning
datamodeler.py \
testdata.py \
diclookup.py \
- pyunittester.py \
+ syshelper.py \
+ pyunittester.py \
__init__.py"
# This files should be add to the list
for file in $listfiles; do
# Uncomment this line (and comment the next one) to display
# the start line of a test and not only the result:
- #python $file | grep '^\[TEST'
+ #python $package_path/$file | grep '^\[TEST'
python $package_path/$file | grep '^\[TEST' | grep -v 'test in progress'
done
cd $here
if salome.lcc is None:
try:
salome.salome_init()
- except RuntimeError, e:
+ except Exception, e:
print e
# Note that the salome module provides you with standard SALOME
``salome.myStudyId`` variable.
"""
salome.salome_init()
- # _GBO_WARN: note that salome.getActiveStudy() returns an id. It
- # should return the study or be renammed in getActiveStudyId.
- return salome.getActiveStudy()
+ # Warning: we don't use salome.getActiveStudy() here because it doesn't
+ # work properly when called from Salome modules (multi-study interpreter
+ # issue)
+ if salome.hasDesktop():
+ return salome.sg.getActiveStudyId()
+ else:
+ return salome.myStudyId
def getActiveStudy():
return salome.myStudyManager.GetStudyByID(getActiveStudyId())
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+__author__="gboulant"
+__date__ ="$21 mai 2010 18:00:23$"
+
+
+def findFiles(rootpath, excludes=[]):
+ """
+ This looks after files recursively from the specified rootpath,
+ but without visiting directories whose basename is in the list
+ @param excludes.
+ """
+ if not os.path.exists(rootpath):
+ raise RuntimeError("the path %s does not exists"%rootpath)
+
+ exclude_options=""
+ for excludepath in excludes:
+ exclude_options+="-e %s "%excludepath
+
+ listfiles=[]
+ stream=os.popen("find %s -type f | grep -v -e '\.svn' %s 2>/dev/null"%(rootpath,exclude_options))
+ for line in stream.readlines():
+ listfiles.append(line.split('\n')[0])
+
+ return listfiles
+
+import sys
+from stat import ST_MODE, S_ISDIR, S_ISREG
+def walktree(rootpath, callback, **kwargs):
+ '''
+ This recursively descends the directory tree rooted at rootpath,
+ calling the callback function for each regular file
+ '''
+ for f in os.listdir(rootpath):
+ pathname = os.path.join(rootpath, f)
+ try:
+ mode = os.stat(pathname)[ST_MODE]
+ except OSError, e:
+ # It probably means that the file is a broken inode
+ mode = -1
+ if S_ISDIR(mode):
+ # It's a directory, recurse into it
+ walktree(pathname, callback, **kwargs)
+ elif S_ISREG(mode):
+ # It's a file, call the callback function
+ callback(pathname, **kwargs)
+ else:
+ # Unknown file type, print a message
+ print 'Skipping %s' % pathname
+
+
+#
+# =============================================================
+# Use cases and unit test functions
+# =============================================================
+#
+import os
+try:
+ TESTDOCDIR=os.path.join(os.environ["KERNEL_ROOT_DIR"],"share")
+except KeyError:
+ TESTDOCDIR="/tmp"
+
+def TEST_findFiles():
+ print "########## find 1"
+ rootpath=TESTDOCDIR
+ listfiles=findFiles(rootpath)
+ for filename in listfiles:
+ print filename
+
+ print "########## find 2"
+ excludes=[os.path.join(TESTDOCDIR,"doc")]
+ listfiles=findFiles(rootpath,excludes)
+ for filename in listfiles:
+ print filename
+
+ return True
+
+# This is the test callback function
+def visitfile_withargs(file, rootid):
+ print 'visiting file %s (rootid=%s)'%(file,str(rootid))
+
+def visitfile_withoutargs(file):
+ print 'visiting file %s'%(file)
+
+def TEST_walktree():
+ #walktree(TESTDOCDIR, visitfile_withargs, rootid=2)
+ walktree(TESTDOCDIR, visitfile_withoutargs)
+ return True
+
+if __name__ == "__main__":
+ import unittester
+ unittester.run("syshelper", "TEST_findFiles")
+ unittester.run("syshelper", "TEST_walktree")
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// File : SALOME_Basics.hxx
+// Author : Roman NIKOLAEV
+// Module : SALOME
+// $Header$
+//
+#ifndef _SALOME_KERNEL_HELPERS_HXX_
+#define _SALOME_KERNEL_HELPERS_HXX_
+
+
+#ifdef WIN32
+# if defined KERNELHELPERS_EXPORTS || defined SalomeKernelHelpers_EXPORTS
+# define KERNELHELPERS_EXPORT __declspec( dllexport )
+# else
+# define KERNELHELPERS_EXPORT __declspec( dllimport )
+# endif
+#else
+# define KERNELHELPERS_EXPORT
+#endif
+
+#endif //_SALOME_KERNEL_HELPERS_HXX_
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author: Guillaume Boulant (EDF/R&D)
+
+#include "SALOME_KernelServices.hxx"
+#include "Basics_Utils.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_TestComponent)
+
+bool TEST_corba() {
+ CORBA::ORB_var orb = KERNEL::getORB();
+ if ( CORBA::is_nil(orb) ) {
+ LOG("TEST_Corba: orb ERROR");
+ return false;
+ }
+ SALOME_NamingService * ns = KERNEL::getNamingService();
+ if ( ns == NULL ) {
+ LOG("TEST_Corba: ns ERROR");
+ return false;
+
+ }
+ SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
+ if ( lcc == NULL ) {
+ LOG("TEST_Corba: lcc ERROR");
+ return false;
+ }
+ LOG("TEST_Corba: OK");
+ return true;
+}
+
+#include <string.h>
+bool TEST_getLifeCycleCORBA() {
+ Engines::EngineComponent_var component =
+ KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
+
+ Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
+ char * coucou_res = engine->Coucou(123.);
+ const char * coucou_ref = "L = 123";
+ LOG(coucou_res);
+ if ( strcmp(coucou_res, coucou_ref) == 0 ) {
+ return false;
+ }
+ return true;
+}
+
+bool TEST_getStudyManager() {
+ SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
+ if ( CORBA::is_nil(myTestStudy) ) {
+ return false;
+ }
+
+ // One can use the study to store some general properties
+ myTestStudy->SetString("material","wood");
+ myTestStudy->SetReal("volume",3.23);
+
+ // The study is characterized by an ID
+ int myTestStudyId = myTestStudy->StudyId();
+ LOG("TestComponentImpl::testkernel: study id = "<<myTestStudyId);
+ return true;
+}
+
+
+bool TEST_getSalomeLauncher() {
+ Engines::SalomeLauncher_var salomeLauncher = KERNEL::getSalomeLauncher();
+ for (int i=0; i<10; i++) {
+ try {
+ int pid = salomeLauncher->getPID();
+ LOG("["<<i<<"] SALOME launcher PID = " << pid);
+ }
+ catch (const SALOME::SALOME_Exception & ex) {
+ LOG("SALOME Exception in createJob !" <<ex.details.text.in());
+ return false;
+ }
+ catch (const CORBA::SystemException& ex) {
+ LOG("Receive SALOME System Exception: "<<ex);
+ LOG("Check SALOME servers...");
+ return false;
+ }
+ catch (const std::exception& ex) {
+ LOG("Receive undefined exception : "<<ex.what());
+ }
+#ifndef WIN32
+ sleep(2);
+#else
+ Sleep(2000);
+#endif
+ }
+ return true;
+}
+
+// TODO:
+// - complete the coverture of the KernelService interface
+// - provide use case for the StudyEditor
+
+
+
+int main (int argc, char * argv[]) {
+ TEST_corba();
+ TEST_getLifeCycleCORBA();
+ TEST_getStudyManager();
+ TEST_getSalomeLauncher();
+ return 0;
+}
salomeinclude_HEADERS = \
SALOME_KernelServices.hxx \
SALOME_StudyEditor.hxx \
- SALOMEDS_DriverDefaultImpl.hxx
+ SALOMEDS_DriverDefaultImpl.hxx \
+ KernelHelpers.hxx
# Libraries targets
lib_LTLIBRARIES = libSalomeKernelHelpers.la
OMNIORB_CXXFLAGS=@OMNIORB_CXXFLAGS@ @OMNIORB_INCLUDES@
OMNIORB_LIBS=@OMNIORB_LIBS@
-libSalomeKernelHelpers_la_CPPFLAGS = \
- $(OMNIORB_CXXFLAGS) \
- -I$(srcdir)/../NamingService \
+libSalomeKernelHelpers_la_CPPFLAGS = \
+ $(OMNIORB_CXXFLAGS) \
+ -I$(srcdir)/../NamingService \
-I$(srcdir)/../SALOMELocalTrace \
- -I$(srcdir)/../Basics \
- -I$(srcdir)/../Utils \
- -I$(srcdir)/../LifeCycleCORBA \
- -I$(srcdir)/../Container \
- -I$(srcdir)/../Notification \
- -I$(srcdir)/../GenericObj \
+ -I$(srcdir)/../Basics \
+ -I$(srcdir)/../Utils \
+ -I$(srcdir)/../LifeCycleCORBA \
+ -I$(srcdir)/../Container \
+ -I$(srcdir)/../Notification \
+ -I$(srcdir)/../GenericObj \
-I$(top_builddir)/idl
-libSalomeKernelHelpers_la_LDFLAGS = \
- $(OMNIORB_LIBS) \
- ../NamingService/libSalomeNS.la \
- ../SALOMELocalTrace/libSALOMELocalTrace.la \
- ../Basics/libSALOMEBasics.la \
- ../Utils/libOpUtil.la \
+libSalomeKernelHelpers_la_LDFLAGS = \
+ $(OMNIORB_LIBS) \
+ ../NamingService/libSalomeNS.la \
+ ../SALOMELocalTrace/libSALOMELocalTrace.la \
+ ../Basics/libSALOMEBasics.la \
+ ../Utils/libOpUtil.la \
../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \
- ../Container/libSalomeContainer.la \
- ../Notification/libSalomeNotification.la \
- ../GenericObj/libSalomeGenericObj.la \
+ ../Container/libSalomeContainer.la \
+ ../Notification/libSalomeNotification.la \
+ ../GenericObj/libSalomeGenericObj.la \
$(top_builddir)/idl/libSalomeIDLKernel.la
#
# Executables targets
# ===============================================================
#
-bin_PROGRAMS = TestKernelHelpers
-TestKernelHelpers_SOURCES = TestKernelHelpers.cxx
-TestKernelHelpers_CPPFLAGS =\
+bin_PROGRAMS = KernelHelpersUseCases
+KernelHelpersUseCases_SOURCES = KernelHelpersUseCases.cxx
+KernelHelpersUseCases_CPPFLAGS =\
$(libSalomeKernelHelpers_la_CPPFLAGS)
-TestKernelHelpers_LDADD = \
+KernelHelpersUseCases_LDADD = \
libSalomeKernelHelpers.la \
$(libSalomeKernelHelpers_la_LDFLAGS)
#ifndef __SALOMEDS_DRIVER_DEFAULT_IMPL_H__
#define __SALOMEDS_DRIVER_DEFAULT_IMPL_H__
+#include "KernelHelpers.hxx"
+
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
//---------------------------------------------------------
-class SALOMEDS_DriverDefaultImpl:
+class KERNELHELPERS_EXPORT SALOMEDS_DriverDefaultImpl:
public virtual POA_SALOMEDS::Driver
//---------------------------------------------------------
{
SALOMEDS_DriverDefaultImpl();
public:
SALOMEDS_DriverDefaultImpl(CORBA::ORB_ptr orb,
- PortableServer::POA_ptr poa,
- PortableServer::ObjectId * contId,
- const char *instanceName,
- const char *interfaceName);
+ PortableServer::POA_ptr poa,
+ PortableServer::ObjectId * contId,
+ const char *instanceName,
+ const char *interfaceName);
virtual ~SALOMEDS_DriverDefaultImpl();
//virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool isMultiFile);
+ const char* theURL,
+ bool isMultiFile);
virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
- const char* theURL,
- bool isMultiFile);
+ const char* theURL,
+ bool isMultiFile);
virtual bool Load(SALOMEDS::SComponent_ptr,
- const SALOMEDS::TMPFile &,
- const char* theURL,
- bool isMultiFile);
+ const SALOMEDS::TMPFile &,
+ const char* theURL,
+ bool isMultiFile);
virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
- const SALOMEDS::TMPFile &,
- const char* theURL,
- bool isMultiFile);
+ const SALOMEDS::TMPFile &,
+ const char* theURL,
+ bool isMultiFile);
virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
virtual char* ComponentDataType();
virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
- const char* IORString,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII);
+ const char* IORString,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
- const char* aLocalPersistentID,
- CORBA::Boolean isMultiFile,
- CORBA::Boolean isASCII);
+ const char* aLocalPersistentID,
+ CORBA::Boolean isMultiFile,
+ CORBA::Boolean isASCII);
virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
virtual SALOMEDS::SObject_ptr PublishInStudy
(SALOMEDS::Study_ptr theStudy,
- SALOMEDS::SObject_ptr theSObject,
- CORBA::Object_ptr theObject,
- const char* theName)
- throw (SALOME::SALOME_Exception);
+ SALOMEDS::SObject_ptr theSObject,
+ CORBA::Object_ptr theObject,
+ const char* theName)
+ throw (SALOME::SALOME_Exception);
virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
CORBA::Long theObjectID);
virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
- CORBA::Long theObjectID,
- SALOMEDS::SObject_ptr theObject);
+ CORBA::Long theObjectID,
+ SALOMEDS::SObject_ptr theObject);
};
#endif
#ifndef __KERNEL_SERVICES_H__
#define __KERNEL_SERVICES_H__
+#include "KernelHelpers.hxx"
+
#include "SALOMEconfig.h"
#include CORBA_SERVER_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
// ---------------------------------------------
// SALOME KERNEL main services
- CORBA::ORB_ptr getORB();
- SALOME_NamingService * getNamingService();
- SALOME_LifeCycleCORBA * getLifeCycleCORBA();
- SALOME::Session_ptr getSalomeSession();
- SALOMEDS::StudyManager_ptr getStudyManager();
- Engines::SalomeLauncher_ptr getSalomeLauncher();
- Engines::ResourcesManager_ptr getResourcesManager();
+ KERNELHELPERS_EXPORT CORBA::ORB_ptr getORB();
+ KERNELHELPERS_EXPORT SALOME_NamingService * getNamingService();
+ KERNELHELPERS_EXPORT SALOME_LifeCycleCORBA * getLifeCycleCORBA();
+ KERNELHELPERS_EXPORT SALOME::Session_ptr getSalomeSession();
+ KERNELHELPERS_EXPORT SALOMEDS::StudyManager_ptr getStudyManager();
+ KERNELHELPERS_EXPORT Engines::SalomeLauncher_ptr getSalomeLauncher();
+ KERNELHELPERS_EXPORT Engines::ResourcesManager_ptr getResourcesManager();
// ---------------------------------------------
// SALOME KERNEL services to deal with a SALOME study, SObject and
// SComponent.
//
- SALOMEDS::Study_ptr getStudyById(int aStudyId);
- int getStudyId(SALOMEDS::Study_ptr study);
- CORBA::Object_ptr IORToObject(char * IOR);
- CORBA::Object_ptr SObjectToObject(SALOMEDS::SObject_ptr);
+ KERNELHELPERS_EXPORT SALOMEDS::Study_ptr getStudyById(int aStudyId);
+ KERNELHELPERS_EXPORT int getStudyId(SALOMEDS::Study_ptr study);
+ KERNELHELPERS_EXPORT CORBA::Object_ptr IORToObject(char * IOR);
+ KERNELHELPERS_EXPORT CORBA::Object_ptr SObjectToObject(SALOMEDS::SObject_ptr);
// ---------------------------------------------
// To create a standard SALOME exception embedding a simple text
- SALOME::SALOME_Exception createSalomeException(const char * text);
+ KERNELHELPERS_EXPORT SALOME::SALOME_Exception createSalomeException(const char * text);
}
#ifndef __STUDY_EDITOR_HXX__
#define __STUDY_EDITOR_HXX__
+#include "KernelHelpers.hxx"
+
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(SALOMEDS)
#include CORBA_SERVER_HEADER(SALOME_Component)
#include <vector>
-class SALOME_StudyEditor {
+class KERNELHELPERS_EXPORT SALOME_StudyEditor {
public:
SALOME_StudyEditor(int studyId);
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "KernelHelpersUnitTests.hxx"
+
+#include "SALOME_KernelServices.hxx"
+#include "Basics_Utils.hxx"
+
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_TestComponent)
+
+// ============================================================================
+/*!
+ * Set up the environment
+ */
+// ============================================================================
+
+void KernelHelpersUnitTests::setUp()
+{
+}
+
+// ============================================================================
+/*!
+ * - delete
+ */
+// ============================================================================
+
+void KernelHelpersUnitTests::tearDown()
+{
+}
+
+// ============================================================================
+/*!
+ * Check SalomeApp functionality
+ */
+// ============================================================================
+void KernelHelpersUnitTests::TEST_corba()
+{
+ CORBA::ORB_var orb = KERNEL::getORB();
+ CPPUNIT_ASSERT(!CORBA::is_nil(orb));
+
+
+ SALOME_NamingService * ns = KERNEL::getNamingService();
+ CPPUNIT_ASSERT(ns!=NULL);
+
+ SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
+ CPPUNIT_ASSERT(lcc!=NULL);
+}
+
+void KernelHelpersUnitTests::TEST_getLifeCycleCORBA() {
+ Engines::EngineComponent_var component =
+ KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
+
+ Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
+ char * coucou_res = engine->Coucou(123.);
+ const char * coucou_ref = "TestComponent_i : L = 123";
+ LOG(coucou_res);
+ CPPUNIT_ASSERT( strcmp(coucou_res, coucou_ref) == 0 );
+}
+
+void KernelHelpersUnitTests::TEST_getStudyManager() {
+ SALOMEDS::Study_ptr myTestStudy = KERNEL::getStudyManager()->NewStudy("kerneltest");
+ CPPUNIT_ASSERT(!CORBA::is_nil(myTestStudy));
+
+ // One can use the study to store some general properties
+ myTestStudy->SetString("material","wood");
+ myTestStudy->SetReal("volume",3.23);
+
+ // The study is characterized by an ID
+ int myTestStudyId = myTestStudy->StudyId();
+ LOG("TestComponentImpl::testkernel: study id = "<<myTestStudyId);
+}
+
+void KernelHelpersUnitTests::TEST_getSalomeLauncher() {
+ Engines::SalomeLauncher_var salomeLauncher = KERNEL::getSalomeLauncher();
+ try {
+ int pid = salomeLauncher->getPID();
+ LOG("SALOME launcher PID = " << pid);
+ }
+ catch (const SALOME::SALOME_Exception & ex) {
+ LOG("SALOME Exception in createJob !" <<ex.details.text.in());
+ CPPUNIT_ASSERT(false);
+ }
+ catch (const CORBA::SystemException& ex) {
+ LOG("Receive SALOME System Exception: "<<ex);
+ LOG("Check SALOME servers...");
+ CPPUNIT_ASSERT(false);
+ }
+ catch (const std::exception& ex) {
+ LOG("Receive undefined exception : "<<ex.what());
+ CPPUNIT_ASSERT(false);
+ }
+}
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _SalomeAppTEST_HXX_
+#define _SalomeAppTEST_HXX_
+
+#include <cppunit/extensions/HelperMacros.h>
+
+class KernelHelpersUnitTests : public CppUnit::TestFixture
+{
+ CPPUNIT_TEST_SUITE( KernelHelpersUnitTests );
+ CPPUNIT_TEST( TEST_corba );
+ CPPUNIT_TEST( TEST_getLifeCycleCORBA );
+ CPPUNIT_TEST( TEST_getStudyManager );
+ CPPUNIT_TEST( TEST_getSalomeLauncher );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+
+ void setUp();
+ void tearDown();
+
+ void TEST_corba();
+ void TEST_getLifeCycleCORBA();
+ void TEST_getStudyManager();
+ void TEST_getSalomeLauncher();
+};
+
+#endif
--- /dev/null
+# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# Author: Guillaume Boulant (EDF/R&D)
+
+include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+
+lib_LTLIBRARIES = libSalomeKernelHelpersTest.la
+
+salomeinclude_HEADERS = KernelHelpersUnitTests.hxx
+
+dist_libSalomeKernelHelpersTest_la_SOURCES = KernelHelpersUnitTests.cxx
+
+OMNIORB_CXXFLAGS=@OMNIORB_CXXFLAGS@ @OMNIORB_INCLUDES@
+OMNIORB_LIBS=@OMNIORB_LIBS@
+
+libSalomeKernelHelpersTest_la_CXXFLAGS = \
+ @CPPUNIT_INCLUDES@ \
+ $(OMNIORB_CXXFLAGS) \
+ -I$(top_srcdir)/src/Basics/Test \
+ -I$(srcdir)/.. \
+ -I$(top_srcdir)/src/NamingService \
+ -I$(top_srcdir)/src/SALOMELocalTrace \
+ -I$(top_srcdir)/src/Basics \
+ -I$(top_srcdir)/src/Utils \
+ -I$(top_srcdir)/src/LifeCycleCORBA \
+ -I$(top_srcdir)/src/Container \
+ -I$(top_srcdir)/src/Notification \
+ -I$(top_srcdir)/src/GenericObj \
+ -I$(top_builddir)/idl
+
+
+libSalomeKernelHelpersTest_la_LIBADD = \
+ @CPPUNIT_LIBS@ \
+ ../libSalomeKernelHelpers.la \
+ $(OMNIORB_LIBS) \
+ $(top_builddir)/src/NamingService/libSalomeNS.la \
+ $(top_builddir)/src/SALOMELocalTrace/libSALOMELocalTrace.la \
+ $(top_builddir)/src/Basics/libSALOMEBasics.la \
+ $(top_builddir)/src/Utils/libOpUtil.la \
+ $(top_builddir)/src/LifeCycleCORBA/libSalomeLifeCycleCORBA.la \
+ $(top_builddir)/src/Container/libSalomeContainer.la \
+ $(top_builddir)/src/Notification/libSalomeNotification.la \
+ $(top_builddir)/src/GenericObj/libSalomeGenericObj.la \
+ $(top_builddir)/idl/libSalomeIDLKernel.la
+
+
+bin_PROGRAMS = TestKernelHelpers
+
+TestKernelHelpers_SOURCES = TestKernelHelpers.cxx
+
+TestKernelHelpers_CXXFLAGS = $(libSalomeKernelHelpersTest_la_CXXFLAGS)
+TestKernelHelpers_LDADD = $(libSalomeKernelHelpersTest_la_LIBADD) libSalomeKernelHelpersTest.la
+
+dist_salomescript_PYTHON = TestKernelHelpers.py
+UNIT_TEST_PROG = TestKernelHelpers
--- /dev/null
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "KernelHelpersUnitTests.hxx"
+
+// --- Registers the fixture into the 'registry'
+
+CPPUNIT_TEST_SUITE_REGISTRATION( KernelHelpersUnitTests );
+
+// --- generic Main program from Basic/Test
+
+#include "BasicMainTest.hxx"
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+import sys, os,signal,string,commands
+import runSalome
+import orbmodule
+import TestKiller
+
+# get SALOME environment :
+
+args, modules_list, modules_root_dir = runSalome.get_config()
+runSalome.set_env(args, modules_list, modules_root_dir)
+
+# launch CORBA naming server
+
+clt=orbmodule.client()
+
+# launch CORBA logger server
+
+myServer=runSalome.LoggerServer(args)
+myServer.run()
+clt.waitLogger("Logger")
+
+# execute Unit Test
+
+command = ['TestKernelHelpers']
+ret = os.spawnvp(os.P_WAIT, command[0], command)
+
+# kill Test process
+
+TestKiller.killProcess(runSalome.process_id)
+++ /dev/null
-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author: Guillaume Boulant (EDF/R&D)
-
-#include "SALOME_KernelServices.hxx"
-#include "Basics_Utils.hxx"
-
-#include <SALOMEconfig.h>
-#include CORBA_CLIENT_HEADER(SALOME_TestComponent)
-
-void TEST_corba() {
- CORBA::ORB_var orb = KERNEL::getORB();
- SALOME_NamingService * ns = KERNEL::getNamingService();
- SALOME_LifeCycleCORBA * lcc = KERNEL::getLifeCycleCORBA();
-}
-
-void TEST_getLifeCycleCORBA() {
- Engines::EngineComponent_var component =
- KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","SalomeTestComponent" );
-
- Engines::TestComponent_var engine = Engines::TestComponent::_narrow(component);
- STDLOG(engine->Coucou(123.));
-}
-
-// TODO:
-// - complete the coverture of the KernelService interface
-// - provide use case for the StudyEditor
-
-int main (int argc, char * argv[]) {
- TEST_getLifeCycleCORBA();
- return 0;
-}
$(COMMON_CPPFLAGS)
SALOME_LauncherServer_LDADD =\
+ libLauncher.la \
libSalomeLauncher.la \
../Basics/libSALOMEBasics.la \
../SALOMELocalTrace/libSALOMELocalTrace.la \
LifeCycleCORBA/Test \
LifeCycleCORBA_SWIG/Test \
SALOMEDSImpl/Test \
- SALOMEDS/Test
+ SALOMEDS/Test \
+ KernelHelpers/Test
SUBDIR_CPPUNIT_GENERAL = \
UnitTests
{
SALOMEDS_Study_i * st_servant = SALOMEDS_Study_i::GetStudyServant(theStudy, _orb);//new SALOMEDS_Study_i (theStudy, _orb);
SALOMEDS::Study_var st = SALOMEDS::Study::_narrow(st_servant->_this());
- Engines::EngineComponent_ptr aComponent = Engines::EngineComponent::_narrow(_driver);
SALOMEDS::unlock();
- CORBA::Boolean aValidScript, aPublished = isPublished;
- Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, isMultiFile, aValidScript);
+
+ Engines::TMPFile_var aStream;
+ CORBA::Boolean aValidScript = true; // VSR: maybe should be false by default ???
+
+ Engines::EngineComponent_ptr aComponent = Engines::EngineComponent::_narrow(_driver);
+ if ( !CORBA::is_nil( aComponent ) )
+ aStream = aComponent->DumpPython(st.in(), isPublished, isMultiFile, aValidScript);
+
SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
theStreamLength = aTMPFile->Size();
isValidScript = aValidScript;
+
SALOMEDS::lock();
return aTMPFile;
#include "HDFexplorer.hxx"
#include "Basics_Utils.hxx"
+//Warning undef of Ascii Winwows define
+#ifdef WIN32
+# undef GetUserName
+#endif
+
#include "SALOMEDSImpl_Attributes.hxx"
#include "SALOMEDSImpl_Tool.hxx"
#include "SALOMEDSImpl_SComponent.hxx"
#include <stdlib.h>
#include <string.h>
-#ifdef WIN32
-#include <Windows.h>
-#endif
-
-//Warning undef of Ascii Winwows define
-#ifdef WIN32
-# undef GetUserName
-#endif
-
#define USE_CASE_LABEL_ID "0:2"
static void SaveAttributes(const SALOMEDSImpl_SObject& SO, HDFgroup *hdf_group_sobject);