]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Merge from V6_main 13/12/2012 V7_1_0_pre
authorvsr <vsr@opencascade.com>
Thu, 13 Dec 2012 07:38:01 +0000 (07:38 +0000)
committervsr <vsr@opencascade.com>
Thu, 13 Dec 2012 07:38:01 +0000 (07:38 +0000)
73 files changed:
CMakeLists.txt
bin/CMakeLists.txt
bin/Makefile.am
bin/ORBConfigFile.py [new file with mode: 0644]
bin/appliskel/runRemote.sh
bin/appliskel/runSession
bin/appliskel/runTests
bin/appliskel/searchFreePort.sh
bin/killSalome.py
bin/killSalomeWithPort.py
bin/launchConfigureParser.py
bin/launchSalome.py
bin/orbmodule.py
bin/runSalome.ksh
bin/runSalome.py
bin/salomeConsole.py
bin/salome_session.py
bin/salome_utils.py
bin/searchFreePort.py [new file with mode: 0644]
bin/setenv.py
bin/shutdownSalome.py
doc/docutils/CMakeLists.txt [new file with mode: 0755]
doc/salome/gui/CMakeLists.txt
doc/salome/kernel_salome.dox
doc/salome/tui/CMakeLists.txt
doc/salome/tui/doxyfile.in
idl/SALOMEDS_Attributes.idl
idl/SALOME_Component.idl
salome_adm/CMakeLists.txt
salome_adm/cmake_files/FindPLATFORM.cmake
salome_adm/cmake_files/SalomeMacros.cmake
salome_adm/cmake_files/am2cmake.py
salome_adm/cmake_files/prepare_generating_doc.py
salome_adm/unix/CMakeLists.txt [new file with mode: 0755]
salome_adm/unix/config_files/CMakeLists.txt [new file with mode: 0755]
salome_adm/unix/config_files/check_cas.m4
src/Container/Component_i.cxx
src/Container/SALOME_ComponentPy.py
src/Container/SALOME_Component_i.hxx
src/Container/SALOME_ContainerManager.cxx
src/DSC/DSC_Python/calcium.i
src/DSC/DSC_User/Datastream/Calcium/CalciumC.c
src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.cxx
src/DSC/DSC_User/Datastream/Calcium/CalciumCInterface.hxx
src/DSC/DSC_User/Datastream/Calcium/calcium.h
src/DSC/DSC_User/Datastream/Calcium/calciumf.c
src/DSC/DSC_User/Datastream/Calcium/calciumf.h
src/KERNEL_PY/salome_study.py
src/Launcher/BatchTest.cxx
src/Launcher/Launcher.cxx
src/Launcher/Launcher_Job_Command.cxx
src/Launcher/Launcher_Job_SALOME.cxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx
src/ResourcesManager/SALOME_ResourcesManager.cxx
src/SALOMEDS/Makefile.am
src/SALOMEDS/SALOMEDS_AttributeStudyProperties.cxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties.hxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.cxx
src/SALOMEDS/SALOMEDS_AttributeStudyProperties_i.hxx
src/SALOMEDS/SALOMEDS_Driver_i.cxx
src/SALOMEDS/SALOMEDS_Driver_i.hxx
src/SALOMEDS/SALOMEDS_StudyBuilder.cxx
src/SALOMEDS/SALOMEDS_StudyManager.cxx
src/SALOMEDS/SALOMEDS_StudyManager_i.cxx
src/SALOMEDS/SALOME_DriverPy.py
src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.cxx
src/SALOMEDSImpl/SALOMEDSImpl_AttributeStudyProperties.hxx
src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx

index 80dd89acfa801310a3e62665fadbfd98eb81352e..326f97bba1763ff26919f703db33970fe5105e85 100755 (executable)
@@ -37,7 +37,7 @@ SET(WITH_LOCAL 1)
 SET(WITH_BATCH 1)
 
 ENABLE_TESTING()
-SET(VERSION "6.5.0")
+SET(VERSION "7.0.0")
 SET(VERSION_DEV "1")
 
 INCLUDE(${CMAKE_SOURCE_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake)
index 2f453680323475ddc49a9ba5a2488622f737122a..61db93c627fa21cbe217d3eec1729956bb6589a5 100755 (executable)
@@ -52,11 +52,13 @@ SET(SCRIPTS
   nameserver.py
   NSparam.py
   orbmodule.py
+  ORBConfigFile.py
   runNS.py
   runSalome.py
   salomeConsole.py
   salome_session.py
   salome_utils.py
+  searchFreePort.py
   server.py
   setenv.py
   showNS.py
index 039f9b468476d630b1efdc5230f1e65e49da5f4f..b50c281365172a6bdcde938ffdb0fb9bea54c885 100644 (file)
@@ -20,7 +20,7 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-# -* Makefile *- 
+# -* Makefile *-
 # Author : Guillaume Boulant (CSSI)
 # Module : KERNEL
 # $Header$
@@ -68,11 +68,13 @@ dist_salomescript_PYTHON =          \
        nameserver.py                   \
        NSparam.py                      \
        orbmodule.py                    \
+       ORBConfigFile.py                \
        runNS.py                        \
        runSalome.py                    \
        salomeConsole.py                \
        salome_session.py               \
-       salome_utils.py                 \
+       salome_utils.py                 \
+       searchFreePort.py               \
        server.py                       \
        setenv.py                       \
        showNS.py                       \
@@ -83,5 +85,5 @@ dist_salomescript_PYTHON =            \
 
 install-data-hook:
        @for f in $(dist_salomescript_PYTHON) ; do \
-          chmod -f a+x $(DESTDIR)$(salomescriptdir)/$$f ; \
-        done
+               chmod -f a+x $(DESTDIR)$(salomescriptdir)/$$f ; \
+       done
diff --git a/bin/ORBConfigFile.py b/bin/ORBConfigFile.py
new file mode 100644 (file)
index 0000000..58b6c20
--- /dev/null
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  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
+#
+
+# IMPORTANT NOTE: do not add any print call (cf. note at the bottom of the file)
+def writeORBConfigFile(path, host, port, kwargs={}):
+
+  from salome_utils import generateFileName
+  omniorb_config = generateFileName(path, prefix="omniORB",
+                                    extension="cfg",
+                                    hidden=True,
+                                    with_hostname=True,
+                                    with_port=port,
+                                    **kwargs)
+  import os
+  os.environ['OMNIORB_CONFIG'] = omniorb_config
+  os.environ['NSPORT'] = "%s"%(port)
+  os.environ['NSHOST'] = "%s"%(host)
+
+  from omniORB import CORBA
+  prefix = "" if CORBA.ORB_ID == "omniORB4" else "ORB"
+
+  GIOP_MaxMsgSize=2097152000  # 2 GBytes
+
+  orbdata = []
+  orbdata.append("%sInitRef = NameService=corbaname::%s:%s"%(prefix,host,port))
+  orbdata.append("%sgiopMaxMsgSize = %s # 2 GBytes"%(prefix,GIOP_MaxMsgSize))
+  orbdata.append("%straceLevel = 0 # critical errors only"%(prefix))
+  orbdata.append("")
+
+  f = open(omniorb_config, "w")
+  f.write("\n".join(orbdata))
+  f.close()
+
+  return [ omniorb_config, GIOP_MaxMsgSize ]
+
+# -----------------------------------------------------------------------------
+
+if __name__ == "__main__":
+  import sys, getopt
+
+  path = sys.argv[1]
+  host = sys.argv[2]
+  port = sys.argv[3]
+  argv = sys.argv[4:]
+
+  kwargs = {}
+  for a in argv:
+    alist = str(a).split("=", 1)
+    opt = str(alist[0])
+    arg = alist[1]
+    kwargs[opt] = arg
+    pass
+
+  [ filename, msgSize ] = writeORBConfigFile(path, host, port, kwargs)
+
+  # :TRICKY: print values so they can be read from caller bash script
+  # Example of bash script:
+  # RETURN_VALUES=$(python ORBConfigFile.py path host port)
+  # RETURN_VALUE_1=$(echo ${RETURN_VALUES} | cut -d' ' -f1)
+  # RETURN_VALUE_2=$(echo ${RETURN_VALUES} | cut -d' ' -f2)
+  # ...
+  # IMPORTANT NOTE: this print call MUST BE the first one!!
+  print filename, msgSize
index dead646a762619e7c6f52d08a81db8cdccaceb0e..7170850680079d414ab739fe47b0186a324a3bd3 100755 (executable)
@@ -50,15 +50,12 @@ export APPLI=`${APPLI_HOME}/getAppliPath.py`
 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
 
 # --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
+export NSHOST=$1
+export NSPORT=$2
 
-OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_$1_$2.cfg
-export OMNIORB_CONFIG
-NSHOST=$1
-export NSHOST
-NSPORT=$2
-export NSPORT
-initref="NameService=corbaname::"$1":$2"
-echo "InitRef = $initref" > $OMNIORB_CONFIG
+# Get (in bash) the configuration filename from (Python) ORBConfigFile return values
+RETURN_VALUES=$(${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/ORBConfigFile.py ${HOME}/${APPLI}/USERS ${NSHOST} ${NSPORT} with_username=${USER})
+export OMNIORB_CONFIG=$(echo ${RETURN_VALUES} | cut -d' ' -f1)
 
 #go to the requested working directory if any
 if test "x$3" == "xWORKINGDIR"; then
index f12e53c2171abb937ace36a55692a56dd0696f38..e1616f18b5f1194400308ba7834f8648981395da 100755 (executable)
@@ -68,6 +68,23 @@ export APPLI=`${APPLI_HOME}/getAppliPath.py`
 
 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
 
+# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
+# Usage: writeConfigFile PORT HOST
+function writeConfigFile
+{
+  if [ $# -ne 2 ]; then
+    echo "Usage: $0 PORT HOST"
+    return
+  fi
+  export NSPORT=$1
+  export NSHOST=$2
+
+  # Get (in bash) the configuration filename from (Python) ORBConfigFile return values
+  RETURN_VALUES=$(${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/ORBConfigFile.py ${HOME}/${APPLI}/USERS ${NSHOST} ${NSPORT} with_username=${USER})
+  export OMNIORB_CONFIG=$(echo ${RETURN_VALUES} | cut -d' ' -f1)
+}
+
+
 if test "x${NSPORT}" == "xlast"; then
   #PORT is not given
   if test "x${NSHOST}" == "xlocalhost"; then
@@ -75,47 +92,28 @@ if test "x${NSPORT}" == "xlast"; then
     # --- set omniORB configuration 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
+      export OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_last.cfg
       # --- set environment variables for port and hostname of NamingService
-      NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
-      NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
-      export NSPORT
-      export NSHOST
+      export NSHOST=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py host`
+      export NSPORT=`${KERNEL_ROOT_DIR}/bin/salome/NSparam.py port`
     fi
   else
     #MACHINE is given PORT is not given
-    NSPORT=2810
-    OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${NSHOST}_${NSPORT}.cfg
-    export OMNIORB_CONFIG
-    #if omniorb config file exists do not override (perhaps too conservative)
-    if [ ! -f ${OMNIORB_CONFIG} ]; then
-      echo "InitRef = NameService=corbaname::${NSHOST}:${NSPORT}" > ${OMNIORB_CONFIG}
-    fi
-    export NSPORT
-    export NSHOST
+    writeConfigFile 2810 ${NSHOST}
   fi
 else
   #PORT is given
   if test "x${NSHOST}" == "xlocalhost"; then
     #MACHINE is not given PORT is given
-    NSHOST=`hostname`
+      NSHOST=`hostname`
   fi
-  OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${NSHOST}_${NSPORT}.cfg
-  export OMNIORB_CONFIG
-  #if omniorb config file exists do not override (perhaps too conservative)
-  if [ ! -f ${OMNIORB_CONFIG} ]; then
-    echo "InitRef = NameService=corbaname::${NSHOST}:${NSPORT}" > ${OMNIORB_CONFIG}
-  fi
-  export NSPORT
-  export NSHOST
+  writeConfigFile ${NSPORT} ${NSHOST}
 fi
 
 # --- invoke shell with or without args
 
 if [ $# -ne 0 ] ; then
-    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py -exec $*
+  ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py -exec $*
 else
-
-    ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
+  ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc
 fi
index 352daad91b67207b84726eb383de9adbed778b5a..f7f9ad98cefb1777e548752f24a2151802ae9886 100755 (executable)
@@ -30,44 +30,6 @@ export APPLI=`${APPLI_HOME}/getAppliPath.py`
 
 . ${HOME}/${APPLI}/envd ${HOME}/${APPLI}
 
-# --- define port for CORBA naming service
-
-searchFreePort() {
-    echo -n "Searching for a free port for naming service: "
-    export NSPORT=2810
-    local limit=$NSPORT
-    let limit=limit+100
-    while [ 1 ]
-    do
-        aRes=`netstat -ltn | grep -E :${NSPORT}`
-        if [ -z "$aRes" ]; then
-            echo ${NSPORT} - Ok
-           local myhost=`hostname`
-            OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${myhost}_${NSPORT}.cfg
-            export OMNIORB_CONFIG
-           export NSPORT
-            NSHOST=${myhost}
-            export NSHOST
-            local initref="NameService=corbaname::"`hostname`":$NSPORT"
-            #echo "ORBInitRef $initref" > $OMNIORB_CONFIG
-            echo "InitRef = $initref" > $OMNIORB_CONFIG
-            LAST_RUNNING_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${myhost}_test.cfg
-            export LAST_RUNNING_CONFIG
-           rm ${LAST_RUNNING_CONFIG}
-            ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG}
-            break
-        fi
-        echo -n "${NSPORT} "
-        if [[ $NSPORT -eq $limit ]] ; then
-            echo
-            echo "Can't find a free port to launch omniNames"
-            echo "Try to kill the running servers and then launch SALOME again."
-            exit
-        fi
-        let NSPORT=NSPORT+1
-    done
-}
-
 # --- if mpi lam, start lam (seems safe to be done several times)
 #     arret manuel avec lamhalt
 
@@ -77,7 +39,7 @@ fi
 
 # --- invoque shell with or without args
 
-searchFreePort
+searchFreePort save test
 
 if [ $# -ne 0 ] ; then
     ${KERNEL_ROOT_DIR}/bin/salome/envSalome.py /bin/bash --rcfile ${HOME}/${APPLI}/.bashrc -c "$*"
index 8d0346561e9ca8eb5a566cc816a46e20e130f42a..bda749fc7c2509e2cebd3cf69db5a883d74400de 100755 (executable)
 
 # --- define port for CORBA naming service
 
+DEFAULT=default
+
+# call: searchFreePort [ save [test] ]
 searchFreePort() {
+    # if not specified by optional first parameter, savemode is set to default
+    savemode=${1:-$DEFAULT}
+    # if not specified by optional second parameter, testmode is set to default
+    testmode=${2:-$DEFAULT}
+
     echo -n "Searching for a free port for naming service: "
-    NSPORT=2810
-    export NSPORT
+    export NSPORT=2810
     local limit=$NSPORT
     let limit=limit+100
+
     while [ 1 ]
     do
         aRes=`netstat -ltn | grep -E :${NSPORT}`
         if [ -z "$aRes" ]; then
             echo ${NSPORT} - Ok
-           local myhost=`hostname`
-            OMNIORB_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${myhost}_${NSPORT}.cfg
-            export OMNIORB_CONFIG
-           export NSPORT
-            NSHOST=${myhost}
-            export NSHOST
-            local initref="NameService=corbaname::"`hostname`":$NSPORT"
-            #echo "ORBInitRef $initref" > $OMNIORB_CONFIG
-            echo "InitRef = $initref" > $OMNIORB_CONFIG
-            LAST_RUNNING_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_last.cfg
-            export LAST_RUNNING_CONFIG
-           rm ${LAST_RUNNING_CONFIG}
-            ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG}
+            export NSPORT
+            export NSHOST=`hostname`
+
+            RETURN_VALUES=$(${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python ${KERNEL_ROOT_DIR}/bin/salome/ORBConfigFile.py ${HOME}/${APPLI}/USERS ${NSHOST} ${NSPORT} with_username=${USER})
+            export OMNIORB_CONFIG=$(echo ${RETURN_VALUES} | cut -d' ' -f1)
+
+            if [ "$savemode" = save ]
+            then
+                if [ "$testmode" = test ]
+                then
+                    export LAST_RUNNING_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_${NSHOST}_test.cfg
+                else
+                    export LAST_RUNNING_CONFIG=${HOME}/${APPLI}/USERS/.omniORB_${USER}_last.cfg
+                fi
+
+                rm ${LAST_RUNNING_CONFIG}
+                ln -s ${OMNIORB_CONFIG} ${LAST_RUNNING_CONFIG}
+            fi
+
             break
         fi
         echo -n "${NSPORT} "
@@ -59,4 +73,3 @@ searchFreePort() {
         let NSPORT=NSPORT+1
     done
 }
-
index 020f7ed4497b13962e70aa2e86a90a351cfae35d..26dc0bb6fa0cefb8fcc02387f240a0f0cb85f2fa 100755 (executable)
@@ -96,4 +96,3 @@ def killAllPorts():
 if __name__ == "__main__":
     killAllPorts()
     pass
-    
index 57729aa88a3601a7e0a2ffd7647817b7acdfa1df..c6c128b234aca035c1ac4104a1e6a2441fca083f 100755 (executable)
@@ -117,7 +117,7 @@ def appliCleanOmniOrbConfig(port):
             os.remove(omniorb_config)
             pass
 
-        if os.path.lexists(last_running_config):return 
+        if os.path.lexists(last_running_config):return
 
         #try to relink last.cfg to an existing config file if any
         files = glob.glob(os.path.join(os.environ["HOME"],Utils_Identity.getapplipath(),
@@ -137,21 +137,21 @@ def appliCleanOmniOrbConfig(port):
 
 ########## kills all salome processes with the given port ##########
 
-def shutdownMyPort(port):
+def shutdownMyPort(port, cleanup=True):
     """
     Shutdown SALOME session running on the specified port.
     Parameters:
     - port - port number
     """
     if not port: return
-    
+
     from salome_utils import generateFileName
 
     # set OMNIORB_CONFIG variable to the proper file
     home  = os.getenv("HOME")
     appli = os.getenv("APPLI")
     kwargs = {}
-    if appli is not None: 
+    if appli is not None:
         home = os.path.join(os.path.realpath(home), appli,"USERS")
         kwargs["with_username"]=True
         pass
@@ -162,22 +162,29 @@ def shutdownMyPort(port):
                                       with_port=port,
                                       **kwargs)
     os.environ['OMNIORB_CONFIG'] = omniorb_config
+    os.environ['NSPORT'] = str(port)
 
     # give the chance to the servers to shutdown properly
     try:
         import time
-        import salome_kernel
-        orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init()
+        from omniORB import CORBA
+        from LifeCycleCORBA import LifeCycleCORBA
         # shutdown all
+        orb = CORBA.ORB_init([''], CORBA.ORB_ID)
+        lcc = LifeCycleCORBA(orb)
         lcc.shutdownServers()
         # give some time to shutdown to complete
         time.sleep(1)
         # shutdown omniNames and notifd
-        salome_kernel.LifeCycleCORBA.killOmniNames()
+        if cleanup:
+            lcc.killOmniNames()
+            time.sleep(1)
+            pass
+        pass
     except:
         pass
     pass
-    
+
 def killMyPort(port):
     """
     Kill SALOME session running on the specified port.
@@ -185,12 +192,12 @@ def killMyPort(port):
     - port - port number
     """
     from salome_utils import getShortHostName, getHostName
-    
+
     # try to shutdown session nomally
     import threading, time
-    threading.Thread(target=shutdownMyPort, args=(port,)).start()
+    threading.Thread(target=shutdownMyPort, args=(port,False)).start()
     time.sleep(3) # wait a little, then kill processes (should be done if shutdown procedure hangs up)
-    
+
     # new-style dot-prefixed pidict file
     filedict = getPiDict(port, hidden=True)
     # provide compatibility with old-style pidict file (not dot-prefixed)
@@ -218,7 +225,7 @@ def killMyPort(port):
                                          suffix="Pid_omniNames",
                                          extension="log",
                                          with_port=port)
-        if not sys.platform == 'win32':        
+        if not sys.platform == 'win32':
             cmd = 'pid=`ps -eo pid,command | egrep "[0-9] omniNames -start %s"` ; echo $pid > %s' % ( str(port), fpidomniNames )
             a = os.system(cmd)
             pass
@@ -255,7 +262,7 @@ def killMyPort(port):
                     try:
                         if sys.platform == "win32":
                             import win32pm
-                            win32pm.killpid(int(pid),0)                            
+                            win32pm.killpid(int(pid),0)
                         else:
                             os.kill(int(pid),signal.SIGKILL)
                             pass
@@ -285,7 +292,7 @@ def killMyPort(port):
     #
     appliCleanOmniOrbConfig(port)
     pass
-            
+
 def killNotifdAndClean(port):
     """
     Kill notifd daemon and clean application running on the specified port.
@@ -355,10 +362,19 @@ def killMyPortSpy(pid, port):
     return
 
 if __name__ == "__main__":
+    if len(sys.argv) < 2:
+        print "Usage: "
+        print "  %s <port>" % os.path.basename(sys.argv[0])
+        print
+        print "Kills SALOME session running on specified <port>."
+        sys.exit(1)
+        pass
     if sys.argv[1] == "--spy":
-        pid = sys.argv[2]
-        port = sys.argv[3]
-        killMyPortSpy(pid, port)
+        if len(sys.argv) > 3:
+            pid = sys.argv[2]
+            port = sys.argv[3]
+            killMyPortSpy(pid, port)
+            pass
         sys.exit(0)
         pass
     for port in sys.argv[1:]:
index 1bb30d33a244be9ac0b28f05cfe55ac9c3725e10..92b5e9aea20eb2a489e9a2341c2dc8018098f060 100755 (executable)
@@ -173,11 +173,11 @@ 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
 
@@ -186,7 +186,7 @@ def userFile(appname, cfgname):
     # ... 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.path.join(getHomeDir(), "%s.xml.*" % appname))
@@ -301,11 +301,11 @@ class xml_parser:
     def startElement(self, name, attrs):
         self.space.append(name)
         self.current = None
-        
+
         # if we are importing file
         if self.space == [doc_tag, import_tag] and nam_att in attrs.getNames():
             self.importFile( attrs.getValue(nam_att) )
-        
+
         # if we are analyzing "section" element and its "name" attribute is
         # either "launch" or module name -- set section_name
         if self.space == [doc_tag, sec_tag] and nam_att in attrs.getNames():
@@ -366,14 +366,14 @@ class xml_parser:
     def endDocument(self):
         self.read = None
         pass
-    
+
     def importFile(self, fname):
         # get absolute name
         if os.path.isabs (fname) :
             absfname = fname
         else:
             absfname = os.path.join(os.path.dirname(self.fileName), fname)
-        
+
         # check existing and registry file
         for ext in ["", ".xml", ".XML"] :
             if os.path.exists(absfname + ext) :
@@ -386,7 +386,7 @@ class xml_parser:
         else:
             if verbose(): print "Configure parser: Error : file %s does not exist" % absfname
             return
-         
+
         # importing file
         try:
             # copy current options
@@ -404,7 +404,7 @@ class xml_parser:
         except:
             if verbose(): print "Configure parser: Error : can not read configuration file %s" % absfname
         pass
-      
+
 
 # -----------------------------------------------------------------------------
 
@@ -876,7 +876,7 @@ def get_env(theAdditionalOptions=[], appname=salomeappname, cfgname=salomecfgnam
 
     # Process --print-port option
     if cmd_opts.print_port:
-        from runSalome import searchFreePort
+        from searchFreePort import searchFreePort
         searchFreePort({})
         print "port:%s"%(os.environ['NSPORT'])
         sys.exit(0)
index 9fe2af56b1f63d7bad342661d3d8343969c1a3c7..0998452da3e80ea305d9898bf59795df911c0013 100755 (executable)
@@ -47,10 +47,10 @@ def findFreePort(startPort, step) :
         except Exception, inst:
             print str(currentPort) + ": " + str(inst.args);
             currentPort = currentPort+step;
-    
-    
-    
-    
+
+
+
+
     if (portFound != 1) :
         currentPort = -1;
     return currentPort;
@@ -68,9 +68,6 @@ hostName = socket.gethostname();
 if (len(sys.argv) > 1) and sys.argv[1] == "-nothing" :
     print "port:" + str(freePort);
     sys.exit(0)
-    
-
-        
 
 if freePort < 0 :
     print
@@ -78,15 +75,10 @@ if freePort < 0 :
     print "Try to kill the running servers and then launch SALOME again."
     print
     sys.exit(0)
-    
-else :
-    omniCfgFileContent = "InitRef = NameService=corbaname::" + str(hostName) + ":" + str(freePort);
-    omniCfgFilePath = os.environ.get('HOME') + "/" + ".omniORB_" + str(hostName) + "_" + str(freePort) + ".cfg";
 
-    omni_file = file(omniCfgFilePath,'w+');
-    omni_file.write(omniCfgFileContent);
-    omni_file.write("\n");
-    omni_file.close();
+else :
+    from ORBConfigFile import writeORBConfigFile
+    writeORBConfigFile(os.environ.get('HOME'), hostName, freePort)
 
     if (len(sys.argv) > 1) and sys.argv[1] == "--save-config" :
         omniCfgCurrent = os.environ.get('HOME') + "/.omniORB_current.cfg";
@@ -96,11 +88,9 @@ else :
         else :
             #copy the file
             shutil.copy(omniCfgFilePath, omniCfgCurrent);
-            
+
         omniCfgFilePath = omniCfgCurrent;
-            
-    
-    
+
 
     ## 2. Set the OMNIORB_CONFIG environment variable
     os.environ['OMNIORB_CONFIG']=omniCfgFilePath;
@@ -111,4 +101,3 @@ else :
 
     if os.path.isfile(runSalomePyFilePath) :
         execfile(runSalomePyFilePath);
-        
index 0499db75b0aa1f732518ce80bc6404c018f22a0a..507c68c3950c41fb90aa762e82ddff7d6283a073 100755 (executable)
@@ -41,10 +41,9 @@ class client:
    """Client for SALOME"""
 
    def __init__(self,args=None):
-      #set GIOP message size for bug 10560: impossible to get field values in TUI mode
-      sys.argv.extend(["-ORBgiopMaxMsgSize", "104857600"]) ## = 100 * 1024 * 1024
       # Initialise the ORB
       self.orb=CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
+
       # Initialise the Naming Service
       self.initNS(args or {})
 
@@ -59,7 +58,7 @@ class client:
       except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
           self.rootContext = None
           if verbose(): print "Launch Naming Service++",
-          
+
       # On lance le Naming Server (doit etre dans le PATH)
       test = True
       if args['wake_up_session']:
@@ -142,14 +141,14 @@ class client:
           count += 1
           if count > maxcount : raise RuntimeError, "Impossible de trouver %s" % name
           obj=self.Resolve(name)
-          if obj : 
+          if obj :
               print " found in %s seconds " % ((count-1)*delta)
               break
           else:
               sys.stdout.write('+')
               sys.stdout.flush()
               time.sleep(delta)
+
       if typobj is None:return obj
 
       nobj = obj._narrow(typobj)
@@ -170,7 +169,7 @@ class client:
            raise RuntimeError, "Process %d for %s not found" % (thePID,theName)
          aCount += 1
          anObj = self.Resolve(theName)
-         if anObj: 
+         if anObj:
             print " found in %s seconds " % ((aCount-1)*aDelta)
             break
          else:
@@ -179,7 +178,7 @@ class client:
             time.sleep(aDelta)
             pass
          pass
-      
+
       if theTypObj is None:
          return anObj
 
@@ -206,7 +205,7 @@ class client:
       except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE):
           obj = None
       return obj
-   
+
    # --------------------------------------------------------------------------
 
    def waitLogger(self,name,typobj=None,maxcount=40):
@@ -217,18 +216,17 @@ class client:
           count += 1
           if count > maxcount : raise RuntimeError, "Impossible de trouver %s" % name
           obj=self.ResolveLogger(name)
-          if obj : 
+          if obj :
               print " found in %s seconds " % ((count-1)*delta)
               break
           else:
               sys.stdout.write('+')
               sys.stdout.flush()
               time.sleep(delta)
+
       if typobj is None:return obj
 
       nobj = obj._narrow(typobj)
       if nobj is None:
             print "%s exists but is not a %s" % (name,typobj)
       return nobj
-
index 57804f295c92a3615e4212554beb193a2819256e..2a02cf68d9133d98778acc3319e1423795c724bc 100644 (file)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-searchFreePort() {
-    echo -n "Searching for a free port for naming service: "
-    NSPORT=2810
-    export NSPORT
-    local limit=$NSPORT
-    let limit=limit+100
-    while [ 1 ]
-    do
-        aRes=`netstat -ltn | grep -E :${NSPORT}`
-        if [ -z "$aRes" ]; then
-            echo ${NSPORT} - Ok
-           local myhost=`hostname`
-            OMNIORB_CONFIG=${HOME}/.omniORB_${myhost}_${NSPORT}.cfg
-            export OMNIORB_CONFIG
-           local initref="NameService=corbaname::"`hostname`":$NSPORT"
-           export NSPORT
-           if [[ `python -c "import CORBA; print CORBA.ORB_ID"` = "omniORB4" ]]; then
-                echo "InitRef = $initref" > $OMNIORB_CONFIG
-           else
-               echo "ORBInitRef $initref" > $OMNIORB_CONFIG
-           fi
-            break
-        fi
-        echo -n "${NSPORT} "
-        if [[ $NSPORT -eq $limit ]] ; then
-            echo
-            echo "Can't find a free port to launch omniNames"
-            echo "Try to kill the running servers and then launch SALOME again."
-            exit
-        fi
-        let NSPORT=NSPORT+1
-    done
-}
-
 searchFreePort
 
 if [[ "$*" = "-nothing" ]]; then
     echo "port:$NSPORT"
 elif [ $# -ne 0 ] ; then
-    python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $* 
+    python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py $*
 else
     python ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py
 fi
@@ -73,7 +39,7 @@ fi
 #     - parameters for launching are taken from SalomeApp.xml;
 #     - if the config file does not exist, it is created with default values.
 #
-#  
+#
 #  $: ${KERNEL_ROOT_DIR}/bin/salome/runSalome --modules=GEOM,SMESH,VISU,MED --embedded=registry,study,moduleCatalog,cppContainer --standalone=pyContainer --xterm --killall
 #
 #     parameters from command line supersede those from SalomeApp.xml
@@ -92,7 +58,7 @@ fi
 # par defaut, les differents serveurs ouvrent des fenêtres xterm
 # (cf. runSalome.py)
 # le serveur Logger n'est pas obligatoire (commenté dans runSalome.py)
-# 
+#
 # -----------------------------------------------------------------------------
 # Example on CCRT (without ihm) :
 # ${KERNEL_ROOT_DIR}/bin/salome/runSalome.py --terminal --modules=MED,CALCULATOR,COMPONENT --standalone=registry,study,moduleCatalog,cppContainer,pyContainer --killall
index c56da55cfad7cfb034187ece4484655605b2e515..f6e76652fe1427cb5edc5ddb99fd734465ea0bd2 100755 (executable)
@@ -46,7 +46,7 @@ def killLocalPort():
     kill servers from a previous SALOME exection, if needed,
     on the CORBA port given in args of runSalome
     """
-    
+
     from killSalomeWithPort import killMyPort
     my_port=str(args['port'])
     try:
@@ -55,13 +55,13 @@ def killLocalPort():
         print "problem in killLocalPort()"
         pass
     pass
-    
+
 def givenPortKill(port):
     """
     kill servers from a previous SALOME exection, if needed,
     on the same CORBA port
     """
-    
+
     from killSalomeWithPort import killMyPort
     my_port=port
     try:
@@ -96,7 +96,7 @@ class InterpServer(Server):
           self.CMD=['xterm', '-e']+ env_ld_library_path + ['python']
         else:
           self.CMD=['cmd', '/c', 'start cmd.exe', '/K', 'python']
-       
+
     def run(self):
         global process_id
         command = self.CMD
@@ -152,7 +152,7 @@ class CatalogServer(Server):
         self.SCMD2=[]
         home_dir=os.getenv('HOME')
         if home_dir is not None:
-            self.SCMD2=['-personal',os.path.join(home_dir,'Salome/resources/CatalogModulePersonnel.xml')] 
+            self.SCMD2=['-personal',os.path.join(home_dir,'Salome/resources/CatalogModulePersonnel.xml')]
 
     def setpath(self,modules_list,modules_root_dir):
         list_modules = modules_list[:]
@@ -250,7 +250,7 @@ class SessionServer(Server):
             self.SCMD1+=['--with','ModuleCatalog','(','-common']
             home_dir=os.getenv('HOME')
             if home_dir is not None:
-                self.SCMD2+=['-personal',os.path.join(home_dir,'Salome/resources/CatalogModulePersonnel.xml')] 
+                self.SCMD2+=['-personal',os.path.join(home_dir,'Salome/resources/CatalogModulePersonnel.xml')]
             self.SCMD2+=[')']
         if 'study' in self.args['embedded']:
             self.SCMD2+=['--with','SALOMEDS','(',')']
@@ -258,7 +258,7 @@ class SessionServer(Server):
             self.SCMD2+=['--with','Container','(','FactoryServer',')']
         if 'SalomeAppEngine' in self.args['embedded']:
             self.SCMD2+=['--with','SalomeAppEngine','(',')']
-            
+
         if 'cppContainer' in self.args['standalone'] or 'cppContainer' in self.args['embedded']:
             self.SCMD2+=['CPP']
         if 'pyContainer' in self.args['standalone'] or 'pyContainer' in self.args['embedded']:
@@ -276,6 +276,10 @@ class SessionServer(Server):
                     self.SCMD2+=['--study-hdf=%s'%self.args['study_hdf']]
                     pass
                 pass
+                if self.args.has_key('pyscript') and len(self.args['pyscript']) > 0:
+                    self.SCMD2+=['--pyscript=%s'%(",".join(self.args['pyscript']))]
+                    pass
+                pass
             pass
         if self.args['noexcepthandler']:
             self.SCMD2+=['noexcepthandler']
@@ -294,9 +298,8 @@ class SessionServer(Server):
                   list_modules.insert(0,m)
             list_modules.reverse()
             self.SCMD2+=['--modules (%s)' % ":".join(list_modules)]
-
-        if self.args.has_key('pyscript') and len(self.args['pyscript']) > 0:
-            self.SCMD2+=['--pyscript=%s'%(",".join(self.args['pyscript']))]
+            pass
+        pass
 
     def setpath(self,modules_list,modules_root_dir):
         list_modules = modules_list[:]
@@ -333,7 +336,7 @@ class SessionServer(Server):
                 self.CMD = ["xterm", "-e", "gdb", "--command=.gdbinit4salome", self.CMD[0]]
                 pass
             pass
-        
+
         if self.args["valgrind_session"]:
             l = ["valgrind"]
             val = os.getenv("VALGRIND_OPTIONS")
@@ -342,7 +345,7 @@ class SessionServer(Server):
                 pass
             self.CMD = l + self.CMD
             pass
-        
+
 # ---
 
 class LauncherServer(Server):
@@ -406,7 +409,7 @@ def startGUI(clt):
     import SALOME_Session_idl
     session=clt.waitNS("/Kernel/Session",SALOME.Session)
     session.GetInterface()
-  
+
 # -----------------------------------------------------------------------------
 
 def startSalome(args, modules_list, modules_root_dir):
@@ -414,13 +417,13 @@ def startSalome(args, modules_list, modules_root_dir):
     init_time = os.times()
 
     if verbose(): print "startSalome ", args
-    
+
     #
     # Set server launch command
     #
     if args.has_key('server_launch_mode'):
         Server.set_server_launch_mode(args['server_launch_mode'])
-    
+
     #
     # Wake up session option
     #
@@ -430,7 +433,7 @@ def startSalome(args, modules_list, modules_root_dir):
             home  = os.getenv("HOME")
             appli = os.getenv("APPLI")
             kwargs={}
-            if appli is not None: 
+            if appli is not None:
                 home = os.path.join(os.path.realpath(home), appli,"USERS")
                 kwargs["with_username"] = True
                 pass
@@ -442,11 +445,11 @@ def startSalome(args, modules_list, modules_root_dir):
             os.environ['OMNIORB_CONFIG'] = last_running_config
             pass
         pass
-    
+
     #
     # Initialisation ORB and Naming Service
     #
-   
+
     clt=orbmodule.client(args)
 
     #
@@ -478,7 +481,7 @@ def startSalome(args, modules_list, modules_root_dir):
         session.GetInterface()
         args["session_object"] = session
         return clt
-    
+
     # Save Naming service port name into
     # the file args["ns_port_log_file"]
     if args.has_key('ns_port_log_file'):
@@ -505,7 +508,7 @@ def startSalome(args, modules_list, modules_root_dir):
 
     if sys.platform != "win32":
       if verbose(): print "Notify Server to launch"
-    
+
       myServer=NotifyServer(args,modules_root_dir)
       myServer.run()
 
@@ -563,7 +566,7 @@ def startSalome(args, modules_list, modules_root_dir):
     #
     # Launch LauncherServer
     #
-    
+
     myCmServer = LauncherServer(args)
     myCmServer.setpath(modules_list,modules_root_dir)
     myCmServer.run()
@@ -577,7 +580,7 @@ def startSalome(args, modules_list, modules_root_dir):
 
 
     from Utils_Identity import getShortHostName
-    
+
     if os.getenv("HOSTNAME") == None:
         if os.getenv("HOST") == None:
             os.environ["HOSTNAME"]=getShortHostName()
@@ -585,13 +588,13 @@ def startSalome(args, modules_list, modules_root_dir):
             os.environ["HOSTNAME"]=os.getenv("HOST")
 
     theComputer = getShortHostName()
-    
+
     #
     # Launch local C++ Container (FactoryServer),
     # and wait until it is registered in naming service
     #
 
-    if ('cppContainer' in args['standalone']) | (args["gui"] == 0) : 
+    if ('cppContainer' in args['standalone']) | (args["gui"] == 0) :
         myServer=ContainerCPPServer(args)
         myServer.run()
         if sys.platform == "win32":
@@ -615,9 +618,9 @@ def startSalome(args, modules_list, modules_root_dir):
     #
     # Wait until Session Server is registered in naming service
     #
-    
+
     if args["gui"]:
-##----------------        
+##----------------
         import Engines
         import SALOME
         import SALOMEDS
@@ -641,7 +644,7 @@ def startSalome(args, modules_list, modules_root_dir):
     # additionnal external python interpreters
     #
     nbaddi=0
-    
+
     try:
         if 'interp' in args:
             nbaddi = args['interp']
@@ -651,7 +654,7 @@ def startSalome(args, modules_list, modules_root_dir):
         print "-------------------------------------------------------------"
         print "-- to get an external python interpreter:runSalome --interp=1"
         print "-------------------------------------------------------------"
-        
+
     if verbose(): print "additional external python interpreters: ", nbaddi
     if nbaddi:
         for i in range(nbaddi):
@@ -666,7 +669,7 @@ def startSalome(args, modules_list, modules_root_dir):
             import readline
         except ImportError:
             pass
-        
+
     return clt
 
 # -----------------------------------------------------------------------------
@@ -678,7 +681,7 @@ def useSalome(args, modules_list, modules_root_dir):
     show registered objects in Naming Service.
     """
     global process_id
-    
+
     clt=None
     try:
         clt = startSalome(args, modules_list, modules_root_dir)
@@ -688,7 +691,7 @@ def useSalome(args, modules_list, modules_root_dir):
         print
         print
         print "--- Error during Salome launch ---"
-        
+
     #print process_id
 
     from addToKillList import addToKillList
@@ -702,28 +705,28 @@ def useSalome(args, modules_list, modules_root_dir):
     if verbose(): print """
     Saving of the dictionary of Salome processes in %s
     To kill SALOME processes from a console (kill all sessions from all ports):
-      python killSalome.py 
+      python killSalome.py
     To kill SALOME from the present interpreter, if it is not closed :
       killLocalPort()      --> kill this session
                                (use CORBA port from args of runSalome)
-      givenPortKill(port)  --> kill a specific session with given CORBA port 
+      givenPortKill(port)  --> kill a specific session with given CORBA port
       killAllPorts()       --> kill all sessions
-    
+
     runSalome, with --killall option, starts with killing
     the processes resulting from the previous execution.
     """%filedict
-    
+
     #
     #  Print Naming Service directory list
     #
-    
+
     if clt != None:
         if verbose():
             print
             print " --- registered objects tree in Naming Service ---"
             clt.showNS()
             pass
-        
+
         if not args['gui'] or not args['session_gui']:
             if args['shutdown_servers']:
                 class __utils__(object):
@@ -739,7 +742,7 @@ def useSalome(args, modules_list, modules_root_dir):
                 args['shutdown_servers'] = __utils__(args['port'])
                 pass
             pass
-        
+
         # run python scripts, passed via --execute option
         toimport = []
         if args.has_key('pyscript'):
@@ -781,7 +784,7 @@ def useSalome(args, modules_list, modules_root_dir):
             pass
         pass
     return clt
-    
+
 def execScript(script_path):
     print 'executing', script_path
     sys.path.insert(0, os.path.dirname(script_path))
@@ -809,112 +812,6 @@ def registerEnv(args, modules_list, modules_root_dir):
 
 # -----------------------------------------------------------------------------
 
-def searchFreePort(args, save_config=1):
-    print "Searching for a free port for naming service:",
-    #
-    if sys.platform == "win32":
-        tmp_file = os.getenv('TEMP');
-    else:
-        tmp_file = '/tmp'
-    tmp_file = os.path.join(tmp_file, '.netstat_%s'%os.getpid())
-    #
-    ###status = os.system("netstat -ltn | grep -E :%s > /dev/null 2>&1"%(NSPORT))
-    os.system( "netstat -a -n > %s" % tmp_file );
-    f = open( tmp_file, 'r' );
-    ports = f.readlines();
-    f.close();
-    os.remove( tmp_file );
-    #
-    def portIsUsed(port, data):
-        regObj = re.compile( ".*tcp.*:([0-9]+).*:.*listen", re.IGNORECASE );
-        for item in data:
-            try:
-                p = int(regObj.match(item).group(1))
-                if p == port: return True
-                pass
-            except:
-                pass
-            pass
-        return False
-    #
-    NSPORT=2810
-    limit=NSPORT+100
-    #
-    while 1:
-        if not portIsUsed(NSPORT, ports):
-            print "%s - OK"%(NSPORT)
-            #
-            from salome_utils import generateFileName, getHostName
-            hostname = getHostName()
-            #
-            home  = os.getenv("HOME")
-            appli = os.getenv("APPLI")
-            kwargs={}
-            if appli is not None: 
-              home = os.path.join(os.path.realpath(home), appli,"USERS")
-              kwargs["with_username"]=True
-            #
-            omniorb_config = generateFileName(home, prefix="omniORB",
-                                              extension="cfg",
-                                              hidden=True,
-                                              with_hostname=True,
-                                              with_port=NSPORT,
-                                              **kwargs)
-            orbdata = []
-            initref = "NameService=corbaname::%s:%s"%(hostname, NSPORT)
-            from omniORB import CORBA
-            if CORBA.ORB_ID == "omniORB4":
-                orbdata.append("InitRef = %s"%(initref))
-                orbdata.append("giopMaxMsgSize = 2097152000  # 2 GBytes")
-                orbdata.append("traceLevel = 0 # critical errors only")
-            else:
-                orbdata.append("ORBInitRef %s"%(initref))
-                orbdata.append("ORBgiopMaxMsgSize = 2097152000  # 2 GBytes")
-                orbdata.append("ORBtraceLevel = 0 # critical errors only")
-                pass
-            orbdata.append("")
-            f = open(omniorb_config, "w")
-            f.write("\n".join(orbdata))
-            f.close()
-            #
-            os.environ['OMNIORB_CONFIG'] = omniorb_config
-            os.environ['NSPORT'] = "%s"%(NSPORT)
-            os.environ['NSHOST'] = "%s"%(hostname)
-            args['port'] = os.environ['NSPORT']
-            #
-            if save_config:
-                last_running_config = generateFileName(home, prefix="omniORB",
-                                                       suffix="last",
-                                                       extension="cfg",
-                                                       hidden=True,
-                                                       **kwargs)
-                try:
-                    if sys.platform == "win32":
-                        import shutil       
-                        shutil.copyfile(omniorb_config, last_running_config)
-                    else:
-                        try:
-                            os.remove(last_running_config)
-                        except OSError:
-                            pass
-                        os.symlink(omniorb_config, last_running_config)
-                        pass
-                    pass
-                except:
-                    pass
-            break
-        print "%s"%(NSPORT),
-        if NSPORT == limit:
-            msg  = "\n"
-            msg += "Can't find a free port to launch omniNames\n"
-            msg += "Try to kill the running servers and then launch SALOME again.\n"
-            raise RuntimeError, msg
-        NSPORT=NSPORT+1
-        pass
-    return
-    
-# -----------------------------------------------------------------------------
-
 def no_main():
     """Salome Launch, when embedded in other application"""
     fileEnv = os.environ["SALOME_LAUNCH_CONFIG"]
@@ -922,6 +819,7 @@ def no_main():
     args, modules_list, modules_root_dir = pickle.load(fenv)
     fenv.close()
     kill_salome(args)
+    from searchFreePort import searchFreePort
     searchFreePort(args, 0)
     clt = useSalome(args, modules_list, modules_root_dir)
     return clt
@@ -933,6 +831,7 @@ def main():
     from salome_utils import getHostName
     print "runSalome running on %s" % getHostName()
     args, modules_list, modules_root_dir = setenv.get_config()
+
     kill_salome(args)
     save_config = True
     if args.has_key('save_config'):
@@ -943,6 +842,7 @@ def main():
         test = False
         pass
     if test:
+        from searchFreePort import searchFreePort
         searchFreePort(args, save_config)
         pass
     # --
@@ -992,7 +892,7 @@ def foreGround(clt, args):
       server.CMD = [os.getenv("PYTHONBIN"), "-m", "killSalomeWithPort", "--spy", "%s"%(os.getpid()), "%s"%(port)]
     else:
       server.CMD = ["killSalomeWithPort.py", "--spy", "%s"%(os.getpid()), "%s"%(port)]
-    server.run()   
+    server.run()
     # os.system("killSalomeWithPort.py --spy %s %s &"%(os.getpid(), port))
     # --
     dt = 1.0
index a8c4a60a4ff32d6fdc4dd1628328228a4b9af6d5..be01caa681a965d927087c703764f7a6b4518a36 100755 (executable)
@@ -67,14 +67,14 @@ else:
      if rep == "y":
         filename=f
         break
-     
+
 if filename != "":
   os.environ['OMNIORB_CONFIG']=filename
 else:
   rep= raw_input("Do you want to try a local session on port 2810 ? [y|n]")
   if rep == "y":
      # Try a local session running on port 2810
-     sys.argv=sys.argv+['-ORBInitRef','NameService=corbaname::localhost:2810']
+     sys.argv=sys.argv+['-ORBInitRef','NameService=corbaname::localhost:2810']#+['-ORBgiopMaxMsgSize','2097152000']  # 2 GBytes
   else:
      sys.exit(1)
 
index d2ca5b09439b6cdbfc4b3f999fc0940fa31d8bee..17e984b9e406b41672565dfbc30eeb88844c6e6c 100644 (file)
@@ -36,6 +36,7 @@ _session = None
 def startSession(modules=[]):
     global _session
     if _session: return
+    from searchFreePort import searchFreePort
     searchFreePort()
     _session = SalomeSession(modules)
     return
@@ -51,59 +52,6 @@ def getShortHostName():
     from salome_utils import getShortHostName
     return getShortHostName()
 
-def searchFreePort():
-    """
-    Search free port for SALOME session.
-    Returns first found free port number.
-    """
-    print "Searching a free port for naming service:",
-    from salome_utils import generateFileName, getHostName
-    hostname = getHostName()
-    NSPORT = 2810
-    limit  = NSPORT+100
-    while 1:
-        print "%s "%(NSPORT),
-        status = os.system("netstat -ltn | grep -E :%s"%(NSPORT))
-        if status:
-            home  = os.getenv("HOME")
-            appli = os.getenv("APPLI")
-            kwargs={}
-            if appli is not None: 
-              home = os.path.join(os.path.realpath(home), appli,"USERS")
-              kwargs["with_username"]=True
-            omniorb_config = generateFileName(home, prefix="omniORB",
-                                              extension="cfg",
-                                              hidden=True,
-                                              with_hostname=True,
-                                              with_port=NSPORT,
-                                              **kwargs)
-            f = open(omniorb_config, "w")
-            f.write("ORBInitRef NameService=corbaname::%s:%s\n"%(hostname, NSPORT))
-            f.close()
-            os.environ['OMNIORB_CONFIG'] = omniorb_config
-            last_running_config = generateFileName(home, prefix="omniORB",
-                                                   suffix="last",
-                                                   extension="cfg",
-                                                   hidden=True,
-                                                   **kwargs)
-            os.environ['LAST_RUNNING_CONFIG'] = last_running_config
-            if os.access(last_running_config,os.F_OK):
-                os.unlink(last_running_config)
-                pass
-            os.symlink(omniorb_config,last_running_config)
-            print "- Ok"
-            break
-        if NSPORT == limit:
-            msg  = ""
-            msg += "Can not find a free port to launch omniNames\n"
-            msg += "Kill the running servers and try again.\n"
-            raise RuntimeError, msg
-        NSPORT = NSPORT+1
-        pass
-    os.environ['NSHOST'] = hostname
-    os.environ['NSPORT'] = str(NSPORT)
-    return NSPORT
-
 
 class SalomeSession(object):
     """Salome session launcher"""
index 95e87f42cfdbc871f708f0014f1320c4abf10384..295b05d24db391172e8c3586a57d3b8de9a6a9e5 100644 (file)
@@ -194,8 +194,11 @@ def getPortNumber(use_default=True):
         return int( os.getenv( "NSPORT" ) )
     except:
         pass
-    port = getPortFromORBcfg()
-    if port is not None: return port
+    try:
+        port = int( getPortFromORBcfg() )
+        if port is not None: return port
+    except:
+        pass
     if use_default: return 2809 # '2809' is default port number
     return None
 
diff --git a/bin/searchFreePort.py b/bin/searchFreePort.py
new file mode 100644 (file)
index 0000000..32d858f
--- /dev/null
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2012  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
+#
+
+def searchFreePort(args={}, save_config=1):
+  """
+  Search free port for SALOME session.
+  Returns first found free port number.
+  """
+  import sys, os, re, shutil
+  print "Searching for a free port for naming service:",
+
+  # :NOTE: Under windows:
+  #        netstat options -l and -t are unavailable
+  #        grep command is unavailable
+
+  from subprocess import Popen, PIPE
+  (stdout, stderr) = Popen(['netstat','-an'], stdout=PIPE).communicate()
+  import StringIO
+  buf = StringIO.StringIO(stdout)
+  ports = buf.readlines()
+
+  #
+  def portIsUsed(port, data):
+    regObj = re.compile( ".*tcp.*:([0-9]+).*:.*listen", re.IGNORECASE );
+    for item in data:
+      try:
+        p = int(regObj.match(item).group(1))
+        if p == port: return True
+        pass
+      except:
+        pass
+      pass
+    return False
+  #
+  NSPORT=2810
+  limit=NSPORT+100
+  #
+
+  while 1:
+    if not portIsUsed(NSPORT, ports):
+      print "%s - OK"%(NSPORT)
+      #
+      from salome_utils import generateFileName, getHostName
+      hostname = getHostName()
+      #
+      home  = os.getenv("HOME")
+      appli = os.getenv("APPLI")
+      kwargs={}
+      if appli is not None:
+        home = os.path.join(os.path.realpath(home), appli,"USERS")
+        kwargs["with_username"]=True
+      #
+      from ORBConfigFile import writeORBConfigFile
+      omniorb_config, giopsize = writeORBConfigFile(home, hostname, NSPORT, kwargs)
+
+      args['port'] = os.environ['NSPORT']
+      #
+      if save_config:
+        last_running_config = generateFileName(home, prefix="omniORB",
+                                               suffix="last",
+                                               extension="cfg",
+                                               hidden=True,
+                                               **kwargs)
+        os.environ['LAST_RUNNING_CONFIG'] = last_running_config
+        try:
+          if sys.platform == "win32":
+            import shutil
+            shutil.copyfile(omniorb_config, last_running_config)
+          else:
+            try:
+              if os.access(last_running_config, os.F_OK):
+                os.remove(last_running_config)
+            except OSError:
+              pass
+            os.symlink(omniorb_config, last_running_config)
+            pass
+          pass
+        except:
+          pass
+      #
+      break
+    print "%s"%(NSPORT),
+    if NSPORT == limit:
+      msg  = "\n"
+      msg += "Can't find a free port to launch omniNames\n"
+      msg += "Try to kill the running servers and then launch SALOME again.\n"
+      raise RuntimeError, msg
+    NSPORT=NSPORT+1
+    pass
+  return
index 44ac6dbe7e83fba3630e7db15f6dc34cb579cb27..46bc337bed9a9ddb795f5c9a42a2a77713eee993 100755 (executable)
@@ -172,7 +172,8 @@ def set_env(args, modules_list, modules_root_dir, silent=False):
     for module in modules_list :
         if modules_root_dir.has_key(module):
             module_root_dir = modules_root_dir[module]
-            modules_root_dir_list[:0] = [module_root_dir]
+            if module_root_dir not in modules_root_dir_list:
+              modules_root_dir_list[:0] = [module_root_dir]
             if sys.platform == "win32":
               add_path(os.path.join(module_root_dir,get_lib_dir(),salome_subdir),
                      "PATH")
index b7d319696acc7f3926d1cb1e033554689291eb03..ed81e00e83660501e57db3f2e755fc55fc54470e 100755 (executable)
 #
 
 import time
-import salome_kernel
-orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init()
+from omniORB import CORBA
+from LifeCycleCORBA import *
+
+orb = CORBA.ORB_init([''], CORBA.ORB_ID)
+lcc = LifeCycleCORBA(orb)
 lcc.shutdownServers()
-#give some time to shutdown to complete
 time.sleep(1)
-salome_kernel.LifeCycleCORBA.killOmniNames()
+LifeCycleCORBA.killOmniNames()
+time.sleep(1)
diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..71b6d67
--- /dev/null
@@ -0,0 +1,66 @@
+# Copyright (C) 2012  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
+#
+
+SET(SPHINXOPTS
+)
+SET(SOURCEDIR
+  ${CMAKE_CURRENT_SOURCE_DIR}
+)
+SET(PAPEROPT_a4
+  -D
+  latex_paper_size=a4
+)
+SET(ALLSPHINXOPTS
+  -d
+  doctrees
+  ${PAPEROPT_a4}
+  ${SPHINXOPTS}
+  ${SOURCEDIR}
+)
+
+SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py")                
+
+IF(WINDOWS)
+  STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\python2.6\\site-packages\\salome\;%PYTHONPATH%
+  @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH%
+  @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH%
+  @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PYTHONPATH%
+  @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\python\;%PYTHONPATH%
+  @SET PATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PATH%
+  ")
+  SET(EXT "bat")
+  SET(CALL_STR "call")
+ELSE(WINDOWS)
+  SET(SCR "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python2.6/site-packages/salome:\${PYTHONPATH}
+  export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH}
+  export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH}
+  export PYTHONPATH=${OMNIORB_ROOT_USER}/lib:\${PYTHONPATH}
+  export PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python2.6/site-packages:\${PYTHONPATH}
+  export LD_LIBRARY_PATH=${OMNIORB_ROOT_USER}/lib:\${LD_LIBRARY_PATH}
+  ")
+  SET(EXT "sh")
+  SET(CALL_STR ".")
+ENDIF(WINDOWS)
+
+FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")
+
+ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html
+  COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\"
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
index d98151fa1a6e467266fae008aed26c1312935668..8bd8df903d5cacc2748f55af31da0d859c8063cf 100755 (executable)
@@ -25,11 +25,11 @@ SET(datadir ${CMAKE_INSTALL_PREFIX}/share)
 SET(docdir ${datadir}/doc/salome)
 
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
 
 ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE} 
  COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/KERNEL''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}/KERNEL''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/KERNEL'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/KERNEL''')"
  VERBATIM 
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )
-
+ADD_DEPENDENCIES(usr_docs html_docs)
index d36db176a50b3a60ab0c3af3cb46b4eef125d529..75deb29601f9bc856fb4ab1e3c527b170772f237 100644 (file)
@@ -112,6 +112,7 @@ study = salome.myStudyManager.GetStudyByName("/home/user/MyStudy.hdf")
 # ...
 \endcode
 
+\anchor salome_myStudy
 \li \b myStudy Reference to the current (active) study
 
 This variable can be used to manipulate with the date of the study:
@@ -296,4 +297,37 @@ name_1 = salome.generateName() # name_1 is something like "Study682"
 name_1 = salome.generateName("Obj") # name_1 is something like "Obj32"
 \endcode
 
+\li \b GetComponentVersion() Get version of component data stored in
+the study
+
+This function allows to obtain the version of the component data
+stored in the current study.
+\note This function does not provide a current version of the
+component being used but that one initially stored in the study
+document.
+
+The first parameter specifies the name of the component. If the
+specified component data is not stored in the study, the result value
+is "no component data". If the version of data is undefined, the
+result is "unknown".
+
+The second parameter (\c False by default), when set to \c True,
+allows to retrieve all versions of the component data stored in the
+study. This is useful to check if version information is valid (the
+data might be updated and/or re-stored in %SALOME of versions different
+from initial one). 
+
+\code
+# get initial version of GEOM module data stored in the study
+geom_version = salome.GetComponentVersion('GEOM')
+# get all versions of GEOM module data stored in the study
+all_geom_versions = salome.GetComponentVersion('GEOM', True)
+\endcode
+
+This function is introduced in %SALOME 6.6.0 (it does not work with
+studies created before version 6.6.0).
+
+\note The study should be initialized before calling this function
+(see \ref salome_myStudy "salome.myStudy").
+
 */
index ae05910b6b916b49f4fc623ade6d5a89a358054a..51ce739b329929a71dfd5a467755f4a21e6fc00d 100755 (executable)
@@ -25,7 +25,7 @@ SET(datadir ${CMAKE_INSTALL_PREFIX}/share)
 SET(docdir ${datadir}/doc/salome)
 
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/doxyfile)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html)
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
 
 ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u
   COMMAND ${DOXYGEN_EXECUTABLE}
index ae335beb4e45d1e7c566e7f21ef21b78764babc9..97365620465100bf027689fdca5a3a61b39683ca 100644 (file)
@@ -1,32 +1,53 @@
-# Doxyfile 1.4.6
+# Copyright (C) 2007-2012  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
+#
 
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = "SALOME KERNEL Developer"
-PROJECT_NUMBER         = 
+PROJECT_NUMBER         =
 OUTPUT_DIRECTORY       = KERNEL
 CREATE_SUBDIRS         = NO
 OUTPUT_LANGUAGE        = English
 USE_WINDOWS_ENCODING   = NO
 BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = NO
-ABBREVIATE_BRIEF       = 
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       =
 ALWAYS_DETAILED_SEC    = YES
 INLINE_INHERITED_MEMB  = YES
 FULL_PATH_NAMES        = YES
-STRIP_FROM_PATH        = @top_builddir@ @top_srcdir@
-STRIP_FROM_INC_PATH    = 
+STRIP_FROM_PATH        = @top_srcdir@ @top_builddir@
+STRIP_FROM_INC_PATH    =
 SHORT_NAMES            = NO
 JAVADOC_AUTOBRIEF      = YES
+QT_AUTOBRIEF           = YES
 MULTILINE_CPP_IS_BRIEF = NO
 DETAILS_AT_TOP         = NO
 INHERIT_DOCS           = YES
 SEPARATE_MEMBER_PAGES  = NO
 TAB_SIZE               = 5
-ALIASES                = 
+ALIASES                =
 OPTIMIZE_OUTPUT_FOR_C  = YES
-OPTIMIZE_OUTPUT_JAVA   = NO
+OPTIMIZE_OUTPUT_JAVA   = YES
 BUILTIN_STL_SUPPORT    = @DOXYGEN_SUPPORT_STL@
 DISTRIBUTE_GROUP_DOC   = NO
 SUBGROUPING            = YES
@@ -48,18 +69,18 @@ CASE_SENSE_NAMES       = YES
 HIDE_SCOPE_NAMES       = NO
 SHOW_INCLUDE_FILES     = YES
 INLINE_INFO            = YES
-SORT_MEMBER_DOCS       = NO
+SORT_MEMBER_DOCS       = YES
 SORT_BRIEF_DOCS        = NO
 SORT_BY_SCOPE_NAME     = YES
-GENERATE_TODOLIST      = NO
-GENERATE_TESTLIST      = NO
-GENERATE_BUGLIST       = NO
-GENERATE_DEPRECATEDLIST= NO
-ENABLED_SECTIONS       = 
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       =
 MAX_INITIALIZER_LINES  = 25
 SHOW_USED_FILES        = NO
 SHOW_DIRECTORIES       = NO
-FILE_VERSION_FILTER    = 
+FILE_VERSION_FILTER    =
 
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
@@ -75,39 +96,41 @@ WARN_LOGFILE           = log.txt
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT                  = \
-                      @top_srcdir@/src/DSC \
-                      @srcdir@/input
-FILE_PATTERNS          = *.dox *.idl *.cxx *.hxx *.h *.hh *.i *c *.cc @DOXYGEN_PYTHON_EXTENSION@
+INPUT                  = @top_srcdir@/src \
+                         @top_srcdir@/bin \
+                         @top_srcdir@/idl \
+                         @top_builddir@/bin \
+                         @srcdir@/input
+FILE_PATTERNS          = *.idl *.hxx *.cxx *.h *.c *.hh *.cc @DOXYGEN_PYTHON_EXTENSION@ *.doc
 RECURSIVE              = YES
-EXCLUDE                = 
+EXCLUDE                =
 EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
+EXCLUDE_PATTERNS       =
+EXAMPLE_PATH           =
+EXAMPLE_PATTERNS       =
 EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = 
-INPUT_FILTER           = 
-FILTER_PATTERNS        = 
-FILTER_SOURCE_FILES    = NO
+IMAGE_PATH             = @srcdir@/images
+INPUT_FILTER           =
+FILTER_PATTERNS        =
+FILTER_SOURCE_FILES    = YES
 
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
-SOURCE_BROWSER         = NO
-INLINE_SOURCES         = NO
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = YES
 STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = NO
+REFERENCED_BY_RELATION = YES
 REFERENCES_RELATION    = YES
-USE_HTAGS              = NO
+#USE_HTAGS              = NO
 VERBATIM_HEADERS       = YES
 
 #---------------------------------------------------------------------------
 # configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 ALPHABETICAL_INDEX     = YES
-COLS_IN_ALPHA_INDEX    = 3
-IGNORE_PREFIX          = 
+COLS_IN_ALPHA_INDEX    = 2
+IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # configuration options related to the HTML output
@@ -120,8 +143,8 @@ HTML_FOOTER            = @srcdir@/static/footer.html
 HTML_STYLESHEET        = @srcdir@/static/doxygen.css
 HTML_ALIGN_MEMBERS     = YES
 GENERATE_HTMLHELP      = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
+CHM_FILE               =
+HHC_LOCATION           =
 GENERATE_CHI           = NO
 BINARY_TOC             = YES
 TOC_EXPAND             = YES
@@ -139,8 +162,8 @@ LATEX_CMD_NAME         = latex
 MAKEINDEX_CMD_NAME     = makeindex
 COMPACT_LATEX          = NO
 PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
+EXTRA_PACKAGES         =
+LATEX_HEADER           =
 PDF_HYPERLINKS         = NO
 USE_PDFLATEX           = NO
 LATEX_BATCHMODE        = NO
@@ -153,8 +176,8 @@ GENERATE_RTF           = NO
 RTF_OUTPUT             = rtf
 COMPACT_RTF            = NO
 RTF_HYPERLINKS         = NO
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
+RTF_STYLESHEET_FILE    =
+RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # configuration options related to the man page output
@@ -169,8 +192,8 @@ MAN_LINKS              = NO
 #---------------------------------------------------------------------------
 GENERATE_XML           = NO
 XML_OUTPUT             = xml
-XML_SCHEMA             = 
-XML_DTD                = 
+XML_SCHEMA             =
+XML_DTD                =
 XML_PROGRAMLISTING     = YES
 
 #---------------------------------------------------------------------------
@@ -184,59 +207,59 @@ GENERATE_AUTOGEN_DEF   = NO
 GENERATE_PERLMOD       = NO
 PERLMOD_LATEX          = NO
 PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
+PERLMOD_MAKEVAR_PREFIX =
 
 #---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
+# Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 ENABLE_PREPROCESSING   = YES
 MACRO_EXPANSION        = YES
 EXPAND_ONLY_PREDEF     = NO
 SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
+INCLUDE_PATH           =
+INCLUDE_FILE_PATTERNS  =
+PREDEFINED             =
+EXPAND_AS_DEFINED      =
 SKIP_FUNCTION_MACROS   = NO
 
 #---------------------------------------------------------------------------
-# Configuration::additions related to external references   
+# Configuration::additions related to external references
 #---------------------------------------------------------------------------
-TAGFILES               = 
-GENERATE_TAGFILE       = 
+TAGFILES               =
+GENERATE_TAGFILE       =
 ALLEXTERNALS           = NO
 EXTERNAL_GROUPS        = YES
 PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
+# Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 CLASS_DIAGRAMS         = YES
 HIDE_UNDOC_RELATIONS   = NO
 HAVE_DOT               = YES
 CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-GROUP_GRAPHS           = NO
-UML_LOOK               = YES
+COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
 TEMPLATE_RELATIONS     = YES
 INCLUDE_GRAPH          = YES
-INCLUDED_BY_GRAPH      = NO
+INCLUDED_BY_GRAPH      = YES
 CALL_GRAPH             = NO
 GRAPHICAL_HIERARCHY    = YES
 DIRECTORY_GRAPH        = YES
 DOT_IMAGE_FORMAT       = png
 DOT_FONTNAME           = Arial
-DOT_PATH               = 
-DOTFILE_DIRS           = 
+DOT_PATH               =
+DOTFILE_DIRS           =
 MAX_DOT_GRAPH_WIDTH    = 1024
-MAX_DOT_GRAPH_HEIGHT   = 1200
+MAX_DOT_GRAPH_HEIGHT   = 1000
 MAX_DOT_GRAPH_DEPTH    = 0
 DOT_TRANSPARENT        = NO
 DOT_MULTI_TARGETS      = NO
-GENERATE_LEGEND        = NO
+GENERATE_LEGEND        = YES
 DOT_CLEANUP            = YES
 
 #---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
+# Configuration::additions related to the search engine
 #---------------------------------------------------------------------------
 SEARCHENGINE           = NO
index fbc70d655e6b138b88760bb516bd23001b0e626f..9941794cb783be60df0344ac0f96b5e27998b5e8 100644 (file)
@@ -1650,6 +1650,27 @@ module SALOMEDS
       \return units
     */
     string GetUnits();
+
+    /*!
+      \brief Returns list of components which data was stored
+      (after previous sessions) in the study.
+      \return list of component names
+    */
+    StringSeq GetStoredComponents();
+
+    /*!
+      \brief Returns version of component data stored in the study
+      \param comp component name
+      \return version of stored component data
+    */
+    string GetComponentVersion( in string comp );
+
+    /*!
+      \brief Returns all versions of component data stored in the study
+      \param comp component name
+      \return versions of stored component data
+    */
+    StringSeq GetComponentVersions( in string comp );
   };
 
   //==========================================================================
index 9d55e154be208f748d5bf1ae95028f4479bf6f42..4a1701ddf9b2d32f8d601fbbd23fec35c0cf86c5 100644 (file)
@@ -453,6 +453,17 @@ module Engines
       \return an information about the given object.
     */
     string getObjectInfo(in long studyId, in string entry);
+
+    //! Get version of the component
+    /*!
+      This method is supposed to be implemented in all derived classes; default implementation
+      returns "unknown" string that means that no version information about the component is available.
+      \note The version of the component is stored to the study, as a part of general persistence
+      mechanism; once stored, version information in the study cannot be changed.
+
+      \return string containing component's version, e.g. "1.0"
+    */
+    string getVersion();
   } ;
 
   /*!
index 0bc8d03f15c46a32c258fbc3477b43ae7102206c..6085559b648478ba8fff8627fbe1be904fc11e30 100755 (executable)
@@ -20,9 +20,5 @@
 ADD_SUBDIRECTORY(unix)
 ADD_SUBDIRECTORY(cmake_files)
 
-SET(input ${CMAKE_CURRENT_SOURCE_DIR}/SALOMEconfig.ref.in)
-SET(output ${CMAKE_CURRENT_BINARY_DIR}/SALOMEconfig.h)
-
-MESSAGE(STATUS "Creation of ${output}")
-CONFIGURE_FILE(${input} ${output})
-INSTALL(FILES ${output} DESTINATION ${KERNEL_salomeinclude_HEADERS})
\ No newline at end of file
+SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/SALOMEconfig.ref.in" "${CMAKE_CURRENT_BINARY_DIR}/SALOMEconfig.h" INSTALL ${KERNEL_salomeinclude_HEADERS})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/SALOMEconfig.ref.in DESTINATION salome_adm/unix RENAME SALOMEconfig.h.in)
\ No newline at end of file
index 9266320ac7d263f49e2d8f0b97d9cf0ef35711af..fa06d0ec3b343041ebc5b6d59611342819d5a6e6 100644 (file)
@@ -107,6 +107,10 @@ IF(WINDOWS)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} Ws2_32.lib)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} Userenv.lib) # At least for GEOM suit
 
+  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")          # if platform is Windows 64 bit 
+    SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators  # to be removed
+    SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_SECURE_SCL=0 -D_SECURE_SCL_THROWS=0 -D_HAS_ITERATOR_DEBUGGING=0") # To avoid runtime error during checking iterators 
+  ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
 ELSE(WINDOWS)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
@@ -117,8 +121,13 @@ ELSE(WINDOWS)
   SET(PLATFORM_LIBS ${PLATFORM_LIBS} -ldl)
 ENDIF(WINDOWS)
 
-SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") # to be removed
-SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4")
+SET(SIZE_OF_LONG ${CMAKE_SIZEOF_VOID_P})            # set sizeof(long) the same as size of pointers, because on all memory models (EXCLUDING WINDOWS 64 bit) it is equivalent values
+IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8"  AND WINDOWS) # if it platform Windows 64 bit
+  SET(SIZE_OF_LONG "4")                             # set sizeof(long) to 4 byte
+ENDIF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8"  AND WINDOWS)
+
+SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4") # to be removed
+SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${SIZE_OF_LONG} -DSIZEOF_INT=4")
 
 SET(COMPILATION_WITH_CMAKE ON)
 
index b10f468dbaea3582bddfd17517bea217a37114e7..b96926dff2f05b37bf9613616586c51ec865e1a6 100755 (executable)
@@ -91,7 +91,7 @@ ENDMACRO(PARSE_ARGUMENTS)
 #----------------------------------------------------------------------------
 # SALOME_INSTALL_SCRIPTS is a macro useful for installing scripts.
 #
-# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [DEF_PERMS])
+# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS])
 #
 # ARGUMENTS:
 # file_list: IN : list of files to be installed. This list should be quoted.
@@ -102,13 +102,17 @@ ENDMACRO(PARSE_ARGUMENTS)
 # only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ. 
 #----------------------------------------------------------------------------
 MACRO(SALOME_INSTALL_SCRIPTS file_list path)
-  PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "" "DEF_PERMS" ${ARGN})
-  SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ  WORLD_READ)
+  PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY" "DEF_PERMS" ${ARGN})
+  SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
   IF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
     SET(PERMS ${PERMS} OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
   ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS)
   FOREACH(file ${file_list})
-    INSTALL(FILES ${file} DESTINATION ${path} PERMISSIONS ${PERMS})
+    SET(PREFIX "")
+    IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
+      SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/")
+    ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY)
+    INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS})
     GET_FILENAME_COMPONENT(ext ${file} EXT)
     IF(ext STREQUAL .py)
       INSTALL(CODE "MESSAGE(STATUS \"py compiling ${CMAKE_INSTALL_PREFIX}/${path}/${file}\")")
index 69d723fbc2b79cf3aa79655b7b50d0546e41f58f..afb446bb052ebbb23ffd20b3ad8b60e9da5c7860 100644 (file)
@@ -619,7 +619,7 @@ class CMakeFile(object):
                             INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake)
                             INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
                             INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake)
-                            INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindBLSURF.cmake)
+                            INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCADSURF.cmake)
                             """)
                             pass
                         if self.module in ["ghs3dplugin", "hexoticplugin"]:
@@ -656,6 +656,11 @@ class CMakeFile(object):
                             INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
                             """)
                             pass
+                        if self.module == "jobmanager":
+                            newlines.append("""
+                            INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
+                            """)
+                            pass
                         if self.module == "hxx2salome":
                             newlines.append("""
                             SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
@@ -797,9 +802,10 @@ class CMakeFile(object):
                 pass
             # --
             newlines.append("""
-            set(VERSION 6.5.0)
-            set(SHORT_VERSION 6.5)
-            set(XVERSION 0x060500)
+            set(VERSION 7.0.0)
+            set(SHORT_VERSION 7.0)
+            set(XVERSION 0x070000)
+            set(VERSION_DEV 1)
             """)
             pass
         # --
@@ -1113,7 +1119,7 @@ class CMakeFile(object):
             )
             ''')
             self.files.append("static/header.html.in")
-        elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui':
+        elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui' or operator.contains(self.root, 'doc') and mod in ['pyhello']:
             newlines.append(r'''
             SET(top_builddir
                 ${CMAKE_BINARY_DIR}
@@ -1134,7 +1140,8 @@ class CMakeFile(object):
                 ${datadir}/doc/salome
             )
             ''')
-            self.files.append("static/header.html.in")
+            if mod not in ['blsurfplugin']:
+                self.files.append("static/header.html.in")
             if mod in ['geom', 'smesh', 'visu','netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin',"ghs3dprlplugin"] and self.root[-len(mod):] == upmod:
               self.files.append("static/header_py.html.in")
      
@@ -1213,7 +1220,7 @@ class CMakeFile(object):
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
             )"""%(input, doc_gui_destination, doc_source, doc_gui_destination, head_source, doc_gui_destination))
         from os import path
-        if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc'):
+        if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin','pyhello'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc')  or  mod in ['pyhello'] and operator.contains(self.root, 'doc'):
             ign = r"""'*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*'"""
             if mod in ['geom', 'smesh']:
                 if mod == 'geom':
@@ -1236,19 +1243,20 @@ class CMakeFile(object):
                 VERBATIM 
                 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
                 )"""%(prepare_generating_doc_src, prepare_generating_doc_src, tmp, upmod, tmp, tmp, input, tmp, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination))
+                newlines.append(r"""ADD_DEPENDENCIES(usr_docs html_docs)""")
             else:
                 config_f = ""
                if mod in ['netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin', "ghs3dprlplugin"] :
-                    config_f = "doxyfile_py"
-                else:
-                    config_f = "doxyfile_idl"
-                newlines.append("""\t    ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE} %s
+                    config_f = "${DOXYGEN_EXECUTABLE} doxyfile_py"
+                elif mod not in ['pyhello']:
+                    config_f = "${DOXYGEN_EXECUTABLE} doxyfile_idl"
+                newlines.append("""\t    ADD_CUSTOM_TARGET(usr_docs %s
                 COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
                 COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''',True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''',r'''%s''', ignore=shutil.ignore_patterns(%s)); shutil.copy(r'''%s''',r'''%s''')"
                 VERBATIM 
                 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                 )"""%(config_f, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination))
-        elif mod == 'yacs' and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'):
+        elif mod in ['yacs', 'jobmanager'] and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'):
             from sys import platform
             params = '';
             if platform == "win32":
@@ -1266,21 +1274,19 @@ class CMakeFile(object):
                 params = '-Q';
                 ext = "bat"
                 prf = "call"
+                cmd = "STRING(REPLACE \"/\" \"\\\\\" SCR"
             else:
                 ext = "sh"
                 prf = ". "
+                cmd = "SET(SCR"
             doc_gui_destination = "${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/%s/docutils"%(upmod)
             scr = self.writeEnvScript(upmod)                   
             newlines.append(r"""
-            IF(WINDOWS)
-               STRING(REPLACE "/" "\\" SCR "%s")
-           ELSE(WINDOWS)
-               SET(SCR "%s")
-            ENDIF(WINDOWS)
+            %s "%s")
             FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s "${SCR}")
-            ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -W -b html ${ALLSPHINXOPTS} html
+            ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html
             COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''%s''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''%s''')\"
-            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(scr,scr,ext,prf,ext,params, doc_gui_destination, doc_gui_destination))
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(cmd, scr, ext, prf, ext, params, doc_gui_destination, doc_gui_destination))
 
 
 
@@ -1290,7 +1296,7 @@ class CMakeFile(object):
   # --
   
         upmod = self.module.upper()
-        if mod in ['kernel', 'gui', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui':
+        if mod in ['kernel', 'gui', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui':
             if mod == 'kernel':
                 tmp = """\tADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u
             COMMAND ${DOXYGEN_EXECUTABLE}
@@ -1301,14 +1307,15 @@ class CMakeFile(object):
                 if mod == 'visu':
                     tmp1= r"""\n           COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/visuscreen.png''', r'''%s''')" """%(doc_tui_destination)
                 elif mod == 'smesh':
-                    extra_srcdir = "${CMAKE_CURRENT_SOURCE_DIR}/extra"
-                    tmp1= """\n            COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.pdf''', r'''%s'''); copy(r'''%s/PluginMeshers.html''', r'''%s''')" 
-            COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''%s/AddNetgenInSalome2.ps''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.sxw''', r'''%s''')" """%(doc_tui_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination,extra_srcdir,doc_destination)
+                    tmp1= """\n            COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s''')" """%(doc_tui_destination)
                 else:
                     tmp1=""
             doc_source = "${CMAKE_CURRENT_BINARY_DIR}/%s"%(upmod)
+            inst_head_command=""
+            if mod not in ['blsurfplugin']:
+                inst_head_command = "; shutil.copy(r'''%s''', r'''%s''')"%(head_source, doc_tui_destination)
             newlines.append(tmp + """
-            COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s'''); shutil.copy(r'''%s''', r'''%s''')" """%(doc_tui_destination, doc_source, doc_tui_destination, head_source, doc_tui_destination) + tmp1 + """
+            COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s''')%s" """%(doc_tui_destination, doc_source, doc_tui_destination, inst_head_command) + tmp1 + """
             VERBATIM 
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
             )""")
@@ -1923,7 +1930,7 @@ class CMakeFile(object):
         ENDIF(WINDOWS)
         ''')
         # --
-        if self.module in ["geom", "med", "hexoticplugin"]:
+        if self.module in ["geom", "med", "hexoticplugin", "blsurfplugin"]:
             newlines.append(r'''
             SET(var ${var} -I${CMAKE_CURRENT_SOURCE_DIR})
             SET(var ${var} -I${CMAKE_CURRENT_BINARY_DIR})
@@ -2443,70 +2450,61 @@ class CMakeFile(object):
         f.close()
         return
 
-    def writeEnvScript(self, upmod):
-        from sys import platform, version_info
-        p_version = """%s.%s"""%(version_info[0],version_info[1])
-        python_path ="PYTHONPATH"
-        path = ""
-        begin = ""
-        end = ""
-        delim = ""
-        cmd = ""
-        pdir = ""
-        omni = ""
-       omni_py = ""
-        if platform == "win32" :               
-            path = "PATH"
-            begin = "%"
-            end = "%"
-            delim = ";"
-            cmd = "@SET "
-            omni = "/x86_win32"
-            omni_py = "/python"
-            pdir = "PDIR"
+    def writeEnvScript(self, upmod, buildmod=True):
+        import os, sys
+        p_version = sys.version[:3]
+        python_path = "PYTHONPATH"
+        root_dir    = "%s_ROOT_DIR" % upmod
+        if sys.platform == "win32":
+            script_line = '@SET %(var)s=%(val)s;%%%(var)s%%\n'
+            var_line    = '%%%s%%'
+            lib_path = "PATH"
+            omni = "x86_win32"
+            omni_py = "python"
+            pass
         else:
-            path = "LD_LIBRARY_PATH"
-            begin = "\${"
-            end = "}"
-            delim = ":"
-            cmd = "export "
-            omni_py = "/python" + p_version + "/" + "site-packages"
-            pdir = "INST_ROOT"
-
-            
-        path_ = begin + path + end
-        root_dir_ = begin + upmod + "_ROOT_DIR" + end  
-        python_path_ = begin + python_path + end
-        _python_path_ = delim + python_path_+ "\n"
-        _path_ = delim + path_+ "\n" 
-        _pdir = begin + pdir + end 
-           
-        
-        script = cmd + " " + python_path + "=" + root_dir_+"/lib/python" + p_version \
-        + "/site-packages/salome" + _python_path_ 
-        
-        script = script + cmd + " " + python_path + "=" + root_dir_+"/bin/salome" + \
-        _python_path_
-
-        script = script + cmd + " "+ path + "=" + root_dir_+"/lib/salome"+ _path_
-
+            script_line = 'export %(var)s=%(val)s:\$%(var)s\n'
+            var_line    = '\${%s}'
+            lib_path = "LD_LIBRARY_PATH"
+            omni = ""
+            omni_py = "/".join( ["python%s"%p_version , "site-packages"] )
+            pass
+        #
+        script = ""
+        #
+        if buildmod:
+            script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "python%s"%p_version, "site-packages", "salome"] ) }
+            script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "bin", "salome"] ) }
+            script += script_line % { 'var':lib_path,    'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "salome"] ) }
+            pass
+        else:
+            script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "lib", "python%s"%p_version, "site-packages", "salome"] ) }
+            script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "bin", "salome"] ) }
+            script += script_line % { 'var':lib_path,    'val':"/".join( [var_line % root_dir, "lib", "salome"] ) }
+            pass
+        #
        if upmod == "KERNEL" :
-            script = script + cmd + " " +  python_path + "=" + _pdir + \
-            "/omniORB-4.1.5/lib" + omni + _python_path_
-        
-            script = script + cmd + " " + python_path + "=" + _pdir + \
-            "/omniORB-4.1.5/lib" + omni_py + _python_path_
-        
-            script = script + cmd + " "+ path + "=" + _pdir+ "/omniORB-4.1.5/lib" + \
-            omni + _path_
-
+            script += "\n"
+            if omni:
+                script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) }
+                script += script_line % { 'var':lib_path,    'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) }
+                pass
+            else:
+                script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) }
+                script += script_line % { 'var':lib_path,    'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) }
+                pass
+            script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni_py] ) }
+            pass
+        #
         if upmod == "GEOM" :
-            script = self.writeEnvScript("KERNEL") + script
-            script = self.writeEnvScript("GUI") + script
-
+            script = self.writeEnvScript("KERNEL", False) + "\n" + script
+            script = self.writeEnvScript("GUI",    False) + "\n" + script
+            pass
+        #
         if upmod == "SMESH" :
-            script = self.writeEnvScript("GEOM") + script
-
+            script = self.writeEnvScript("GEOM", False) + "\n" + script
+            pass
+        
         return script    
     pass
 
index fb218237ad7b0a13dba86d588e9da680a080c1b4..8a88fec8105b42cef7a2ee051ca605a1d3aa1ab2 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import sys, re
-outfile = open(sys.argv[1], 'wb')
-isCom = False
-for line in open(sys.argv[2], 'rb').readlines():
-    if re.match('class '+sys.argv[3]+'DC', line): 
+# ...
+# Usage: prepare_generating_doc.py <output_file> <input_file> <myClass>
+# ...
+# 1. myClassDC is replaced by myClass
+# 2. all methods of myClassDC become global methods of Python package
+# ...
+# myClass is passed as command line argument
+# ...
+
+import os, sys, re
+
+# check command line
+if len( sys.argv ) < 4:
+    sys.exit("Usage: %s <output_file> <input_file> <myClass>" % os.path.basename(sys.argv[0]))
+
+# open input file
+try:
+    infile = open(sys.argv[2], 'rb')
+except:
+    sys.exit("File %s is not found" % sys.argv[2])
+    pass
+
+# open output file
+try:
+    outfile = open(sys.argv[1], 'wb')
+except:
+    sys.exit("File %s cannot be opened for write" % sys.argv[1])
+    pass
+
+# parse input file
+
+isCom   = False
+isShift = False
+
+for line in infile.readlines():
+    dc_class    = sys.argv[3]    
+    dc_class_dc = dc_class+'DC'
+
+    if isShift and ( re.match('^class\s+', line) or re.match('^def\s+', line) ):
+        # stop shifting lines as soon as myClassDC definition is over
+        isShift = False
+        pass
+    if re.match('class\s+%s' % dc_class_dc, line):
+        # start shifting lines
+        isShift = True
+        # omit this line (to remove myClassDC from the package)
         continue
+    
+    # process documentation
     n = line.find('"""')
     n1 = line[(n+2):].find('"""')
     if (n > -1) and (n1 > -1):
@@ -31,13 +74,26 @@ for line in open(sys.argv[2], 'rb').readlines():
     if isCom:
         if n > -1:
             isCom = False
+            pass
         continue
     else:
         if n > -1:
             isCom = True
-            continue       
-    line = re.sub(r'^\s+#', '#', line) 
-    line = re.sub(r'^\s+def', 'def', line) 
-    line = re.sub(sys.argv[3]+'DC', sys.argv[3], line)
+            continue
+        pass
+
+    # replacements
+    if isShift:
+        line = re.sub(r'^\s+#', '#', line) 
+        line = re.sub(r'^\s+def', 'def', line)
+        pass
+    line = re.sub(dc_class_dc, dc_class, line)
+
+    # write resulting line
     outfile.write(line)
-outfile.close()
\ No newline at end of file
+
+    pass # end of for
+
+# close input and output files
+infile.close()
+outfile.close()
diff --git a/salome_adm/unix/CMakeLists.txt b/salome_adm/unix/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..a0b5ec4
--- /dev/null
@@ -0,0 +1,35 @@
+# Copyright (C) 2012  CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
+\r
+ADD_SUBDIRECTORY(config_files)\r
+\r
+SET(DEPRECATED_FILES\r
+  DEPRECATED/F77config.h.in\r
+  DEPRECATED/sstream.in\r
+  DEPRECATED/envScript.in\r
+  DEPRECATED/depend.in\r
+  DEPRECATED/make_commence.in\r
+  DEPRECATED/make_conclude.in\r
+  DEPRECATED/make_module.in\r
+  DEPRECATED/make_omniorb.in\r
+)\r
+\r
+# The deprecated files are deprecated for the KERNEL but not for the\r
+# related modules (GUI, MED, ...), for now. Some files have to be installed.\r
+INSTALL(FILES ${DEPRECATED_FILES} DESTINATION salome_adm/unix)\r
diff --git a/salome_adm/unix/config_files/CMakeLists.txt b/salome_adm/unix/config_files/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..e7add33
--- /dev/null
@@ -0,0 +1,84 @@
+# Copyright (C) 2012  CEA/DEN, EDF R&D, OPEN CASCADE\r
+#\r
+# This library is free software; you can redistribute it and/or\r
+# modify it under the terms of the GNU Lesser General Public\r
+# License as published by the Free Software Foundation; either\r
+# version 2.1 of the License.\r
+#\r
+# This library is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+# Lesser General Public License for more details.\r
+#\r
+# You should have received a copy of the GNU Lesser General Public\r
+# License along with this library; if not, write to the Free Software\r
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA\r
+#\r
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
+#\r
\r
+# The deprecated files are deprecated for the KERNEL but not for the\r
+# related modules (GUI, MED, ...). Some files have to be installed.\r
+SET(DEPRECATED_FILES\r
+  DEPRECATED/ac_cc_warnings.m4\r
+  DEPRECATED/ac_cxx_bool.m4\r
+  DEPRECATED/ac_cxx_mutable.m4\r
+  DEPRECATED/ac_cxx_partial_specialization.m4\r
+  DEPRECATED/ac_cxx_typename.m4\r
+  DEPRECATED/check_mico.m4\r
+  DEPRECATED/check_pthreads.m4\r
+  DEPRECATED/config.sub\r
+  DEPRECATED/config.guess\r
+  DEPRECATED/install-sh\r
+  DEPRECATED/libtool.m4\r
+  DEPRECATED/ltconfig\r
+  DEPRECATED/ltmain.sh\r
+  DEPRECATED/check_Salome.m4\r
+  DEPRECATED/check_java.m4\r
+  DEPRECATED/missing\r
+  DEPRECATED/mkinstalldirs\r
+)\r
+\r
+SET(m4_DATA\r
+  ac_cxx_depend_flag.m4\r
+  ac_cxx_have_sstream.m4\r
+  ac_cxx_namespaces.m4\r
+  ac_cxx_option.m4\r
+  ac_cxx_template_options.m4\r
+  ac_cxx_use_std_iostream.m4\r
+  ac_cxx_warnings.m4\r
+  ac_linker_options.m4\r
+  ac_check_sizeof_fortran.m4\r
+  acx_pthread.m4\r
+  check_Kernel.m4\r
+  check_boost.m4\r
+  check_cas.m4\r
+  check_corba.m4\r
+  check_cppunit.m4\r
+  check_f77.m4\r
+  check_calcium.m4\r
+  check_hdf5.m4\r
+  check_htmlgen.m4\r
+  check_sphinx.m4\r
+  check_lam.m4\r
+  check_libbatch.m4\r
+  check_mpi.m4\r
+  check_openmpi.m4\r
+  check_mpich.m4\r
+  check_omniorb.m4\r
+  check_sockets.m4\r
+  check_swig.m4\r
+  check_vtk.m4\r
+  check_withihm.m4\r
+  enable_pthreads.m4\r
+  production.m4\r
+  pyembed.m4\r
+  python.m4\r
+  check_libxml.m4\r
+  check_paco++.m4\r
+  local_install.m4\r
+  hack_libtool.m4\r
+  check_tbb.m4\r
+)\r
+INSTALL(FILES ${DEPRECATED_FILES} DESTINATION salome_adm/unix/config_files/DEPRECATED)\r
+INSTALL(FILES ${m4_DATA} DESTINATION salome_adm/unix/config_files)\r
index 7646fd377d561ac27ae894d1df570b6303d9f0ae..98fa0bc5d4f92346edaf6279dd8f334d66d71b38 100644 (file)
@@ -240,11 +240,11 @@ else
   CAS_OCAF="$CAS_LDPATH -lPTKernel -lTKernel -lTKCDF -lTKLCAF -lTKPCAF -lTKStdSchema"
   CAS_OCAFVIS="$CAS_LDPATH -lTKCAF -lTKPLCAF -lTKPShape -lTKStdLSchema -lTKShapeSchema"
 
-  if test -f $CASROOT/$casdir/lib/libStdPlugin.so ; then
+  if test -f ${CAS_LIBDIR}/libStdPlugin.so ; then
     # standard plugin library libStdPlugin has been added in CASCADE 5.2.3
     CAS_STDPLUGIN="StdPlugin"
     CAS_OCAFVIS="$CAS_OCAFVIS -lStdPlugin -lStdLPlugin"
-  elif test -f $CASROOT/$casdir/lib/libTKStdSchema.so ; then
+  elif test -f ${CAS_LIBDIR}/libTKStdSchema.so ; then
     # standard plugin has been renamed in CASCADE 6.5
     CAS_STDPLUGIN=TKStdSchema
     CAS_OCAFVIS="$CAS_OCAFVIS -lTKStdSchema -lTKStdLSchema"
index 3e77256aa25fa7c1023bd741dde2b2d727c3eecf..ed5b16b6db2df507561088e32aee722f824e36e3 100644 (file)
@@ -1105,3 +1105,20 @@ void Engines_Component_i::setContainerName()
     name[slash]='_';
   _containerName=name;
 }
+
+//=============================================================================
+/*!
+  \brief Get version of the component
+
+  This method is supposed to be implemented in all derived classes; default implementation
+  returns empty string that means that no version information about the component is available.
+
+  \note The version of the component is stored to the study, as a part of general persistence
+  mechanism; once stored, version information in the study cannot be changed.
+  
+  \return string containing component's version, e.g. "1.0"
+*/
+char* Engines_Component_i::getVersion()
+{
+  return CORBA::string_dup( "" );
+}
index 55ec0ff55f1941947372e880726c61dee1cb564d..66c9de6344fd56018de913aa2d6a98a960c3099f 100755 (executable)
@@ -314,3 +314,9 @@ class SALOME_ComponentPy_i (Engines__POA.EngineComponent):
     def getObjectInfo(self, studyId, entry):
         return ""
 
+    #-------------------------------------------------------------------------    
+
+    def getVersion(self):
+        return "" # empty string means "unknown" version
+
+    pass # end of SALOME_ComponentPy_i
index 94fd62ce8824d3c147ec9947b47672dc6033e77d..3581cd9d24facd62af396c96417f9bd9c7daaccd 100644 (file)
@@ -120,6 +120,9 @@ public:
   virtual bool hasObjectInfo() { return false; }
   virtual char* getObjectInfo(CORBA::Long studyId, const char* entry) { return CORBA::string_dup(""); }
   
+  // Version information
+  virtual char* getVersion();
+  
   // --- local C++ methods
 
   PortableServer::ObjectId * getId(); 
index a513af413c8cd3e596b4054ab29a951dfac8b221..3a6cebdf786e5d30a2066f21041844c147752644 100644 (file)
@@ -36,6 +36,9 @@
 #include <sstream>
 #include <string>
 
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(SALOME_Session)
+
 #ifdef WNT
 #include <process.h>
 #define getpid _getpid
@@ -187,6 +190,17 @@ void SALOME_ContainerManager::Shutdown()
 void SALOME_ContainerManager::ShutdownContainers()
 {
   MESSAGE("ShutdownContainers");
+
+  SALOME::Session_var session = SALOME::Session::_nil();
+  CORBA::Long pid = 0;
+  CORBA::Object_var objS = _NS->Resolve("/Kernel/Session");
+  if (!CORBA::is_nil(objS))
+  {
+    session = SALOME::Session::_narrow(objS);
+    if (!CORBA::is_nil(session))
+      pid = session->getPID();
+  }
+
   bool isOK;
   isOK = _NS->Change_Directory("/Containers");
   if( isOK ){
@@ -199,7 +213,7 @@ void SALOME_ContainerManager::ShutdownContainers()
         try
           {
             Engines::Container_var cont=Engines::Container::_narrow(obj);
-            if(!CORBA::is_nil(cont))
+            if(!CORBA::is_nil(cont) && pid != cont->getPID())
               lstCont.push_back((*iter));
           }
         catch(const CORBA::Exception& e)
index 29a74ffab310a17d54f5e4cb627b76de6499338d..5e7e7de737def20f724c8d21472df083f7201cfb 100644 (file)
@@ -888,6 +888,7 @@ int  cp_cd(Superv_Component_i *component,char *instanceName);
 int cp_een(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,int    *eval);
 int cp_edb(Superv_Component_i *component,int dep,double t,int n,char *nom,int nval,double *eval);
 int cp_ere(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,float  *eval);
+int cp_erd(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,float  *eval);
 int cp_ecp(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,float  *ecpval);
 int cp_elo(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,int    *eval);
 int cp_ech(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nval,char** eval,int strSize);
@@ -898,6 +899,7 @@ int cp_eln(Superv_Component_i *component,int dep,float  t,int n,char *nom,int nv
 int cp_len(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,int    *lval);
 int cp_ldb(Superv_Component_i *component,int dep,double *ti,double *tf,int *niter,char *nom,int nmax,int *nval,double *lval);
 int cp_lre(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,float  *lval);
+int cp_lrd(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,float  *lval);
 int cp_lcp(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,float  *lcpval);
 int cp_llo(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,int    *lval);
 int cp_lch(Superv_Component_i *component,int dep,float  *ti,float  *tf,int *niter,char *nom,int nmax,int *nval,char** lval,int strSize);
index 24a766e733cbe3635502204215b34c4beecff965..105c2a93b2ac5864e3cfec0b8b3d2deb9aa7fc1a 100644 (file)
@@ -120,12 +120,16 @@ void ecp_lch_free (char* * data) {                              \
 /*REVERIFIER MAINTENANT 0 COPY avec int2integer*/
 CALCIUM_EXT_LECT_INTERFACE_C_(len,float,int,int2integer,);
 CALCIUM_EXT_LECT_INTERFACE_C_(lre,float,float,float,);
+/*Permet d'envoyer/recevoir des réels sur un port Double  */
+CALCIUM_EXT_LECT_INTERFACE_C_(lrd,float ,float  ,float2double,);
 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 */
 /**************************************/
@@ -204,7 +208,10 @@ 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,,);
+/*Permet d'envoyer/recevoir des réels sur un port Double  */
+CALCIUM_LECT_INTERFACE_C_(lrd,float ,int,float  ,float2double,,);
 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 *
@@ -222,6 +229,7 @@ CALCIUM_LECT_INTERFACE_C_(lin_fort_,float ,cal_int,int     ,int2integer,,);
 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_(lrd_fort_,float ,cal_int,float   ,float2double,,);
 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,,);
@@ -305,7 +313,10 @@ CALCIUM_ECR_INTERFACE_C_(een,float ,int,int   ,int2integer,,);
   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,,);
+/*Permet d'envoyer/recevoir des réels sur un port Double  */
+CALCIUM_ECR_INTERFACE_C_(erd,float ,int,float ,float2double,,);
 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 );
@@ -321,6 +332,7 @@ CALCIUM_ECR_INTERFACE_C_(een_fort_,float ,cal_int,cal_int,integer,,);
 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_(erd_fort_,float ,cal_int,float ,float2double,,);
 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,,);
index a9974edcf32a69c15f34d3c7a10608575286dd46..107e5f4798d58f9daca7abb2792e68d3bd2ab9cc 100644 (file)
@@ -66,6 +66,9 @@ CALCIUM_C2CPP_INTERFACE_CXX_(long2integer, integer, long,);
 
 CALCIUM_C2CPP_INTERFACE_CXX_(float,float,float, );
 CALCIUM_C2CPP_INTERFACE_CXX_(double,double,double,);
+
+CALCIUM_C2CPP_INTERFACE_CXX_(float2double,double,float, );
+
 /*  Fonnctionne mais essai suivant pour simplification de Calcium.c CALCIUM_C2CPP_INTERFACE_(bool,bool,);*/
 CALCIUM_C2CPP_INTERFACE_CXX_(bool,bool,int,);
 CALCIUM_C2CPP_INTERFACE_CXX_(cplx,cplx,float,);
index e6eca1ae3ba5fed0268664c0b8c22439e1b19bdc..84e117abab5b5ad3af1b1e9fdf87a45d37324617 100644 (file)
@@ -80,6 +80,9 @@ CALCIUM_C2CPP_INTERFACE_HXX_(long2integer,integer, long,);
 
 CALCIUM_C2CPP_INTERFACE_HXX_(float,float,float, );
 CALCIUM_C2CPP_INTERFACE_HXX_(double,double,double,);
+
+CALCIUM_C2CPP_INTERFACE_HXX_(float2double,double,float, );
+
 /*  Fonctionne mais essai suivant pour simplification de Calcium.c CALCIUM_C2CPP_INTERFACE_(bool,bool,);*/
 CALCIUM_C2CPP_INTERFACE_HXX_(bool,bool,int,);
 CALCIUM_C2CPP_INTERFACE_HXX_(cplx,cplx,float,);
index f103fe937216c306fc3c861a77ab86dc80a69485..4a43be266698b480d5955304aebd1843644eafaa 100644 (file)
@@ -169,6 +169,29 @@ extern int      cp_lre(
 #endif
 );
 
+extern int      cp_lrd(
+/*              ------                                          */
+#if CPNeedPrototype
+        void * component /* Pointeur de type Superv_Component_i* sur le */
+                         /* composant SALOME Supervisable  */,
+        int     /* E   Type de dependance ou de lecture         */
+                /*     CP_TEMPS, CP_ITERATION, CP_SEQUENTIEL    */,
+        float * /* E/S Borne inf de l'intervalle de lecture     */
+                /*     Retourne le pas lu dans le cas de        */
+                /*     lecture sequentielle                     */,
+        float * /* E   Borne Sup de l'intervalle de lecture     */,
+        int   * /* E/S Pas d'iteration a lire                   */
+                /*     Retourne le pas lu dans le cas de        */
+                /*     lecture sequentielle                     */,
+        char  * /* E   Nom de la variable a lire                */,
+        int     /* E   Nombre max de valeurs a lire             */,
+        int   * /* S   Nombre de valeurs rellement lues         */,
+        float * /* S   Tableau de flottants pour stocker les    */
+                /*     valeurs lues                             */
+#endif
+);
+
+
 extern int      cp_ldb(
 /*              ------                                          */
 #if CPNeedPrototype
@@ -470,6 +493,22 @@ extern int      cp_ere(
 #endif
 );
 
+extern int      cp_erd(
+/*              ------                                          */
+#if CPNeedPrototype
+        void * component /* Pointeur de type Superv_Component_i* sur le */
+                         /* composant SALOME Supervisable  */,
+        int     /* E   Type de dependance                       */
+                /*     CP_TEMPS, CP_ITERATION                   */,
+        float   /* E   Pas de temps a ecrire                    */,
+        int     /* E   Pas d'iteration a ecrire                 */,
+        char  * /* E   Nom de la variable a ecrire              */,
+        int     /* E   Nombre de valeurs a ecrire               */,
+        float * /* E   Tableau de flottants a ecrire            */
+#endif
+);
+
+
 extern int      cp_edb(
 /*              ------                                          */
 #if CPNeedPrototype
index 5b63bb3e287f804c069186805a5c1d30b49c2521..e01915c73d2a88a7912dbca0523d2ced803b15cd 100644 (file)
@@ -155,6 +155,8 @@ void F_FUNC(cpldb,CPLDB)(long *compo,cal_int *dep,double *ti,double *tf,cal_int
             cal_int *max,cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cplre,CPLRE)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
             cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cplrd,CPLRD)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cplcp,CPLCP)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
             cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cplch,CPLCH)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
@@ -241,6 +243,14 @@ void F_FUNC(cplre,CPLRE)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *i
   free_str1(cnom);
 }
 
+void F_FUNC(cplrd,CPLRD)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
+            cal_int *max,cal_int *n, double *tab,cal_int *err STR_PLEN(nom))
+{
+  char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+  *err=cp_lrd_fort_((void *)*compo,*dep,ti,tf,iter,cnom,*max,n,(float *)tab);
+  free_str1(cnom);
+}
+
 void F_FUNC(cplcp,CPLCP)(long *compo,cal_int *dep,float *ti,float *tf,cal_int *iter,STR_PSTR(nom),
             cal_int *max,cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
@@ -289,6 +299,7 @@ void F_FUNC(cpech,CPECH)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
                          STR_PLEN(nom) STR_PLEN(tab));
 void F_FUNC(cpedb,CPEDB)(long *compo,cal_int *dep,double *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
+void F_FUNC(cperd,CPERD)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cpein,CPEIN)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, int *tab,cal_int *err STR_PLEN(nom));
 void F_FUNC(cpelg,CPELG)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, long *tab,cal_int *err STR_PLEN(nom));
@@ -347,6 +358,15 @@ void F_FUNC(cpere,CPERE)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PS
   free_str1(cnom);
 }
 
+void F_FUNC(cperd,CPERD)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, double *tab,cal_int *err STR_PLEN(nom))
+{
+  float tti=0.;
+  if(*dep == CP_TEMPS)tti=*ti;
+  char* cnom=fstr1(STR_PTR(nom),STR_LEN(nom));
+  *err=cp_erd_fort_((void *)*compo,*dep,tti,*iter,cnom,*n,(float *)tab);
+  free_str1(cnom);
+}
+
 void F_FUNC(cpecp,CPECP)(long *compo,cal_int *dep,float *ti,cal_int *iter,STR_PSTR(nom),cal_int *n, float *tab,cal_int *err STR_PLEN(nom))
 {
   float tti=0.;
index da9574643ed4dd68385c0cd16cc17c8964442614..07f1101372b77e610b51b091eb42794fce303c9f 100644 (file)
@@ -47,6 +47,7 @@ CALCIUM_ECR_INTERFACE_C_H(elg_fort_,float ,cal_int,long   ,long2integer,,);
 CALCIUM_ECR_INTERFACE_C_H(eln_fort_,float ,cal_int,long   ,long,,);
 CALCIUM_ECR_INTERFACE_C_H(ein_fort_,float ,cal_int,int    ,int2integer,,);
 CALCIUM_ECR_INTERFACE_C_H(ere_fort_,float ,cal_int,float ,float,,);
+CALCIUM_ECR_INTERFACE_C_H(erd_fort_,float ,cal_int,float ,float2double,,);
 CALCIUM_ECR_INTERFACE_C_H(edb_fort_,double,cal_int,double,double,,);
 CALCIUM_ECR_INTERFACE_C_H(elo_fort_,float ,cal_int,int   ,bool,,);  /*int pour bool ou cal_int */
 CALCIUM_ECR_INTERFACE_C_H(ecp_fort_,float ,cal_int,float ,cplx,,);
@@ -69,6 +70,7 @@ CALCIUM_LECT_INTERFACE_C_H(llg_fort_,float ,cal_int,long    ,long2integer,,);
 CALCIUM_LECT_INTERFACE_C_H(lln_fort_,float ,cal_int,long    ,long,,);
 CALCIUM_LECT_INTERFACE_C_H(lin_fort_,float ,cal_int,int     ,int2integer,,);
 CALCIUM_LECT_INTERFACE_C_H(lre_fort_,float ,cal_int,float   ,float,,);
+CALCIUM_LECT_INTERFACE_C_H(lrd_fort_,float ,cal_int,float   ,float2double,,);
 CALCIUM_LECT_INTERFACE_C_H(ldb_fort_,double,cal_int,double  ,double,,);
 CALCIUM_LECT_INTERFACE_C_H(llo_fort_,float ,cal_int,int     ,bool,,);   /*int pour bool ou cal_int */
 CALCIUM_LECT_INTERFACE_C_H(lcp_fort_,float ,cal_int,float   ,cplx,,);
index 5de40bc3a3d4e10b8b2b8bf3c286313b54c3f5cb..f6ebc622a71d825535007ce684fae80ea641b6e2 100644 (file)
@@ -227,6 +227,27 @@ def CheckCopyPaste(theSO, theInfo ,theComponentPaste):
     
     #--------------------------------------------------------------------------
 
+def GetComponentVersion(theComponent, all_versions = False):
+    # returns the document list tree (as list)
+    props = myStudy.GetProperties()
+    stored_components = props.GetStoredComponents()
+    version = "no component data" # vsr: better raise an exception in this case?
+    if theComponent in stored_components:
+      if all_versions:
+        version = props.GetComponentVersions(theComponent)
+        for i in range(len(version)):
+          if not version[i]: version[i] = "unknown"
+          pass
+        pass
+      else:
+        version = props.GetComponentVersion(theComponent)
+        if not version: version = "unknown"
+        pass
+      pass
+    return version
+    
+    #--------------------------------------------------------------------------
+
 def FindFileInDataDir(filename):
     import os
     datadir = os.getenv("DATA_DIR")
index 37076b0fb61880a32d252c6f490b3c805951290c..d765f51e8c1ababac7f863f833d791167a235697 100644 (file)
@@ -478,6 +478,8 @@ BatchTest::test_jobsubmit_mpi()
     mpiImpl = new MpiImpl_MPICH2();
   else if(mpi_type == "openmpi")
     mpiImpl = new MpiImpl_OPENMPI();
+  else if(mpi_type == "ompi")
+    mpiImpl = new MpiImpl_OMPI();
   else if(mpi_type == "slurmmpi")
     mpiImpl = new MpiImpl_SLURM();
   else
index 62bfe647bfbcf7a1941b03d091ecda1bfa79a30a..d749f82587af34507f38d211575416211076af4a 100644 (file)
@@ -403,6 +403,9 @@ Launcher_cpp::FactoryBatchManager(ParserResourcesType& params)
     case openmpi:
       mpi = "openmpi";
       break;
+    case ompi:
+      mpi = "ompi";
+      break;
     case slurmmpi:
       mpi = "slurmmpi";
       break;
index f325898ed5b2bdf5187ee71cdcdd9173d18dedca..6f2fecebd12f2d2769d892b5718d45292d5631ab 100644 (file)
@@ -20,6 +20,7 @@
 // Author: André RIBES - EDF R&D
 //
 #include "Launcher_Job_Command.hxx"
+#include "Basics_DirUtils.hxx"
 
 #ifdef WITH_LIBBATCH
 #include <Batch/Batch_Constants.hxx>
@@ -54,7 +55,7 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l
 
   // File name
   std::string launch_date_port_file = launch_date;
-  std::string launch_script = "/tmp/runCommand_" + _job_file_name + "_" + launch_date + ".sh";
+  std::string launch_script = Kernel_Utils::GetTmpDir() + "runCommand_" + _job_file_name + "_" + launch_date + ".sh";
   std::ofstream launch_script_stream;
   launch_script_stream.open(launch_script.c_str(), std::ofstream::out);
    
index b0c70f5b575aa7193047a980d0130976cfe44390..85f6e1015eb2f6bae1e7b20c983252c3c94f5eae 100644 (file)
@@ -20,6 +20,7 @@
 // Author: André RIBES - EDF R&D
 //
 #include "Launcher_Job_SALOME.hxx"
+#include "Basics_DirUtils.hxx"
 
 #ifdef WITH_LIBBATCH
 #include <Batch/Batch_Constants.hxx>
@@ -64,7 +65,7 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params)
   // parameters
   std::string work_directory = params[Batch::WORKDIR].str();
 
-  std::string launch_script = "/tmp/runSalome_" + _job_file_name + "_" + _launch_date + ".sh";
+  std::string launch_script = Kernel_Utils::GetTmpDir() + "runSalome_" + _job_file_name + "_" + _launch_date + ".sh";
   std::ofstream launch_script_stream;
   launch_script_stream.open(launch_script.c_str(), 
                             std::ofstream::out
index 2afca3b7f4efe1a69ded3a74b3be8f59e249f54f..afd7e6f6315a921882ed94678b39af9c6d247922 100644 (file)
@@ -550,6 +550,7 @@ void SALOME_LifeCycleCORBA::shutdownServers()
     if (!CORBA::is_nil(session))
     {
       pid = session->getPID();
+      session->Shutdown();
     }
   }
 
@@ -644,6 +645,7 @@ void SALOME_LifeCycleCORBA::shutdownServers()
        // ignore and continue
     }
 
+  /*
   // 6) Session
   if ( !CORBA::is_nil( session ) ) {
     try
@@ -655,6 +657,7 @@ void SALOME_LifeCycleCORBA::shutdownServers()
       // ignore and continue
     }
   }
+  */
 
   // 7) Logger
   int argc = 0;
index f65db96c038e02206a098dba67123dff16560971..ae42569dd2c2ee34aa32563a28ce15cc295ee5ae 100755 (executable)
@@ -248,6 +248,8 @@ SALOME_ResourcesCatalog_Handler::ProcessCluster(xmlNodePtr cluster_descr, Parser
       resource.mpi = mpich2;
     else if (anMpi == "openmpi")
       resource.mpi = openmpi;
+    else if (anMpi == "ompi")
+      resource.mpi = ompi;
     else if  (anMpi == "slurmmpi")
       resource.mpi = slurmmpi;
     else if  (anMpi == "prun")
@@ -543,6 +545,8 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser
       resource.mpi = mpich2;
     else if (anMpi == "openmpi")
       resource.mpi = openmpi;
+    else if (anMpi == "ompi")
+      resource.mpi = ompi;
     else if  (anMpi == "slurmmpi")
       resource.mpi = slurmmpi;
     else if  (anMpi == "prun")
@@ -768,6 +772,9 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc)
       case openmpi:
         xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "openmpi");
         break;
+      case ompi:
+        xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "ompi");
+        break;
       case slurmmpi:
         xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurmmpi");
         break;
index 50360f72f0eabd2c8169ef2e97d7208422535397..9cf3cfa99d6e7a9065e19150c9f076dd84969036 100644 (file)
@@ -263,6 +263,8 @@ ParserResourcesType::PrintMpiImplType() const
     return "mpich2";
   else if (mpi == openmpi)
     return "openmpi";
+  else if (mpi == ompi)
+    return "ompi";
   else if (mpi == slurmmpi)
     return "slurmmpi";
   else
index 20a390db1f239a37b39a5df7a9fb6f7b3b2d421b..1ac87b3400ea9e38b298dab2945c4a9835b0cd43 100755 (executable)
@@ -47,7 +47,7 @@ enum AccessModeType {interactive, batch};
 
 enum BatchType {none, pbs, lsf, sge, ssh_batch, ccc, ll, slurm, vishnu};
 
-enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurmmpi, prun};
+enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, ompi, slurmmpi, prun};
 
 class RESOURCESMANAGER_EXPORT ResourceDataToSort
   {
index eb932fdc84dbbd98adae1909b161e91b26f2dadc..30a1c1b44eadfb65d220409d7d1aad8dc4a3e868 100644 (file)
@@ -237,6 +237,8 @@ SALOME_ResourcesManager::GetResourceDefinition(const char * name)
     p_ptr->mpiImpl = "mpich2";
   else if( resource.mpi == openmpi )
     p_ptr->mpiImpl = "openmpi";
+  else if( resource.mpi == ompi )
+    p_ptr->mpiImpl = "ompi";
   else if( resource.mpi == slurmmpi )
     p_ptr->mpiImpl = "slurmmpi";
   else if( resource.mpi == prun )
@@ -315,6 +317,8 @@ SALOME_ResourcesManager::AddResource(const Engines::ResourceDefinition& new_reso
     resource.mpi = mpich2;
   else if (anMpi == "openmpi")
     resource.mpi = openmpi;
+  else if (anMpi == "ompi")
+    resource.mpi = ompi;
   else if  (anMpi == "slurmmpi")
     resource.mpi = slurmmpi;
   else if  (anMpi == "prun")
@@ -499,7 +503,7 @@ SALOME_ResourcesManager::getMachineFile(std::string resource_name,
           cluster_it++;
         }
       }
-      else if (resource.mpi == openmpi)
+      else if ((resource.mpi == openmpi) || (resource.mpi == ompi))
       {
         // Creating machine file
         machine_file_name = tmpnam(NULL);
index bfc45db68d97599f59c01003927db2bad5c971d3..e064be0493015d0700612edc313e35ae4863229c 100644 (file)
@@ -75,7 +75,6 @@ COMMON_CPPFLAGS=\
 
 # This local variable defines the list of dependant libraries common to all target in this package.
 COMMON_LIBS =\
-       ../TOOLSDS/libTOOLSDS.la \
        ../NamingService/libSalomeNS.la \
        ../Utils/libOpUtil.la \
        ../SALOMELocalTrace/libSALOMELocalTrace.la \
index af20553fa6aa63ed704ec1f44d4e8662e52efa2c..bdb5760d79c25f9ab00f4459864a0e50a0c394b4 100644 (file)
@@ -319,3 +319,49 @@ std::string SALOMEDS_AttributeStudyProperties::GetUnits()
     anUnits = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetUnits();
   return anUnits;
 }
+
+std::vector<std::string> SALOMEDS_AttributeStudyProperties::GetStoredComponents()
+{
+  std::vector<std::string> aComponents;
+  if (_isLocal) {
+    SALOMEDS::Locker lock;
+    aComponents = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetStoredComponents();
+  }
+  else {
+    SALOMEDS::StringSeq_var components = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetStoredComponents();
+    int length = components->length();
+    for (int i = 0; i < length; i++) {
+      aComponents.push_back(components[i].in());
+    }
+  }
+  return aComponents;
+}
+
+std::string SALOMEDS_AttributeStudyProperties::GetComponentVersion( const std::string& theComponent )
+{
+  std::string aVersion;
+  if (_isLocal) {
+    SALOMEDS::Locker lock;
+    aVersion = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetComponentVersion(theComponent);
+  }
+  else 
+    aVersion = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetComponentVersion(theComponent.c_str());
+  return aVersion;
+}
+
+std::vector<std::string> SALOMEDS_AttributeStudyProperties::GetComponentVersions( const std::string& theComponent )
+{
+  std::vector<std::string> aVersions;
+  if (_isLocal) {
+    SALOMEDS::Locker lock;
+    aVersions = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_local_impl)->GetComponentVersions(theComponent);
+  }
+  else {
+    SALOMEDS::StringSeq_var versions = ((SALOMEDS::AttributeStudyProperties_var)SALOMEDS::AttributeStudyProperties::_narrow(_corba_impl))->GetComponentVersions(theComponent.c_str());
+    int length = versions->length();
+    for (int i = 0; i < length; i++) {
+      aVersions.push_back(versions[i].in());
+    }
+  }
+  return aVersions;
+}
index 4ebd180bda4274fc7960a89972d4774aa6ce809c..b02e0fbff1663fba426a72422ceb1b21b658343a 100644 (file)
@@ -82,7 +82,9 @@ public:
   virtual void SetComment(const std::string& theComment);
   virtual std::string GetComment();
 
-
+  virtual std::vector<std::string> GetStoredComponents();
+  virtual std::string GetComponentVersion( const std::string& theComponent );
+  virtual std::vector<std::string> GetComponentVersions( const std::string& theComponent );
 };
 
 
index a6bd88294a1b68e919c509a0ea1cbd7a5fd3c83d..3c02784deba87b89d11ddad8268d0b38cbd83d4c 100644 (file)
@@ -218,3 +218,34 @@ char* SALOMEDS_AttributeStudyProperties_i::GetUnits()
   return c_s._retn();
 }
 
+SALOMEDS::StringSeq* SALOMEDS_AttributeStudyProperties_i::GetStoredComponents()
+{
+  SALOMEDS::Locker lock;
+  std::vector<std::string> components = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetStoredComponents();
+  SALOMEDS::StringSeq_var c_components = new SALOMEDS::StringSeq();
+  c_components->length(components.size());
+  for (int i = 0; i < components.size(); i++) {
+    c_components[i] = CORBA::string_dup(components[i].c_str());
+  }
+  return c_components._retn();
+}
+
+char* SALOMEDS_AttributeStudyProperties_i::GetComponentVersion(const char* theComponent)
+{
+  SALOMEDS::Locker lock;
+  std::string version = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetComponentVersion(theComponent);
+  CORBA::String_var c_version = CORBA::string_dup(version.c_str());
+  return c_version._retn();
+}
+
+SALOMEDS::StringSeq* SALOMEDS_AttributeStudyProperties_i::GetComponentVersions(const char* theComponent)
+{
+  SALOMEDS::Locker lock;
+  std::vector<std::string> versions = dynamic_cast<SALOMEDSImpl_AttributeStudyProperties*>(_impl)->GetComponentVersions(theComponent);
+  SALOMEDS::StringSeq_var c_versions = new SALOMEDS::StringSeq();
+  c_versions->length(versions.size());
+  for (int i = 0; i < versions.size(); i++) {
+    c_versions[i] = CORBA::string_dup(versions[i].c_str());
+  }
+  return c_versions._retn();
+}
index 7c6198ee1fe43ece3e807225c7858623581959b1..ead14d9e8207dccfe6d0366d3edbfeceb0b6f406 100644 (file)
@@ -73,6 +73,10 @@ public:
 
   virtual void SetUnits(const char* theUnits);
   virtual char* GetUnits();
+
+  virtual SALOMEDS::StringSeq* GetStoredComponents();
+  virtual char* GetComponentVersion(const char* theComponent);
+  virtual SALOMEDS::StringSeq* GetComponentVersions(const char* theComponent);
 };
 
 
index 87bdec277349f2cf3fca8e2fa92301ddf64da393..ae2db2077fcfb73511880303cbb5026d424f4459 100644 (file)
 #include "SALOMEDS.hxx"
 #include <stdlib.h>
 
-SALOMEDS_Driver_i::SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB) 
+SALOMEDS_Driver_i::SALOMEDS_Driver_i(Engines::EngineComponent_ptr theEngine, CORBA::ORB_ptr theORB) 
 {
+  // engine should not be null - component is supposed to be inherited from Engines::EngineComponent
+  _engine = Engines::EngineComponent::_duplicate(theEngine);
+  // driver can be null - if component interface does not inherit SALOMEDS::Driver
+  _driver = SALOMEDS::Driver::_narrow(theEngine);
+  _orb = CORBA::ORB::_duplicate(theORB);        
+}
+
+SALOMEDS_Driver_i::SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB)
+{
+  // driver can be null - if component interface does not inherit SALOMEDS::Driver
   _driver = SALOMEDS::Driver::_duplicate(theDriver);
+  // engine can be null - since it is narrowed from SALOMEDS::Driver ptr which can be null
+  _engine = Engines::EngineComponent::_narrow(theDriver);
   _orb = CORBA::ORB::_duplicate(theORB);        
 }
 
@@ -42,8 +54,8 @@ SALOMEDS_Driver_i::~SALOMEDS_Driver_i()
 std::string SALOMEDS_Driver_i::GetIOR() 
 {
   std::string ior = "";
-  if ( !CORBA::is_nil(_driver) ) {
-    CORBA::String_var cior = _orb->object_to_string(_driver);
+  if ( !CORBA::is_nil(_engine) ) {
+    CORBA::String_var cior = _orb->object_to_string(_engine);
     ior = cior;
   }
   return ior;
@@ -163,6 +175,11 @@ std::string SALOMEDS_Driver_i::ComponentDataType()
   return dtype;
 }
 
+std::string SALOMEDS_Driver_i::Version()
+{
+  return !CORBA::is_nil( _engine ) ? _engine->getVersion() : std::string("");
+}
+
 std::string SALOMEDS_Driver_i::IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
                                                      const std::string& IORString,
                                                      bool isMultiFile,
@@ -298,9 +315,8 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy
   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);
+  if ( !CORBA::is_nil( _engine ) )
+    aStream = _engine->DumpPython(st.in(), isPublished, isMultiFile, aValidScript);
 
   SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
   theStreamLength = aTMPFile->Size();
@@ -344,8 +360,8 @@ SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByType(const std::string
   }
 
   if (!CORBA::is_nil(obj)) {
-    SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
-    return new SALOMEDS_Driver_i(aDriver, _orb);
+    Engines::EngineComponent_var anEngine = Engines::EngineComponent::_narrow(obj);
+    return new SALOMEDS_Driver_i(anEngine, _orb);
   }
 
   return NULL;
@@ -357,8 +373,8 @@ SALOMEDSImpl_Driver* SALOMEDS_DriverFactory_i::GetDriverByIOR(const std::string&
   obj = _orb->string_to_object(theIOR.c_str());
  
   if (!CORBA::is_nil(obj)) {
-    SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
-    return new SALOMEDS_Driver_i(aDriver, _orb);
+    Engines::EngineComponent_var anEngine = Engines::EngineComponent::_narrow(obj);
+    return new SALOMEDS_Driver_i(anEngine, _orb);
   }
 
   return NULL;
index a17b9b8464c478aa77ca1e6ec25283b5756c215d..e4de665be123d505ad93b23a948d91b5ad511ef3 100644 (file)
@@ -37,12 +37,12 @@ class Standard_EXPORT SALOMEDS_Driver_i :  public virtual SALOMEDSImpl_Driver
 {
 protected:
   SALOMEDS::Driver_var _driver;
+  Engines::EngineComponent_var _engine;
   CORBA::ORB_var _orb;
 
 public:
-
+  SALOMEDS_Driver_i(Engines::EngineComponent_ptr theEngine, CORBA::ORB_ptr theORB);
   SALOMEDS_Driver_i(SALOMEDS::Driver_ptr theDriver, CORBA::ORB_ptr theORB);
-
   ~SALOMEDS_Driver_i();
 
   virtual std::string GetIOR();
@@ -73,6 +73,8 @@ public:
  
   virtual std::string ComponentDataType();
 
+  virtual std::string Version();
+
   virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
                                              const std::string& IORString,
                                              bool isMultiFile,
index 5e54ef02e2280a8eb5177db9f73a55af3d28cbb4..fb6ee94c03224079cf3493a776a0eca6f88b3b17 100644 (file)
@@ -194,12 +194,13 @@ void SALOMEDS_StudyBuilder::LoadWith(const _PTR(SComponent)& theSCO, const std::
 
   SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
   CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
+  Engines::EngineComponent_var anEngine = Engines::EngineComponent::_narrow(obj);
   SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj);
   
   if (_isLocal) {
     SALOMEDS::Locker lock;
 
-    SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(aDriver, _orb);    
+    SALOMEDS_Driver_i* drv = new SALOMEDS_Driver_i(anEngine, _orb);    
     SALOMEDSImpl_SComponent aSCO_impl = *(dynamic_cast<SALOMEDSImpl_SComponent*>(aSCO->GetLocalImpl()));
     bool isDone = _local_impl->LoadWith(aSCO_impl, drv);
     delete drv;
index 813d0820e89192f559314464c1e7c3addbb28b09..814f58bc30a55a2b7a03ea86a53343138e029d2a 100644 (file)
@@ -317,7 +317,7 @@ SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_p
     std::string IOREngine = aSCO.GetIOR();
     if(!IOREngine.empty()) {
       CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
-      SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
+      Engines::EngineComponent_var Engine = Engines::EngineComponent::_narrow(obj) ;
       driver = new SALOMEDS_Driver_i(Engine, orb);
     }
   }
index c26919c8e064900b6bae25a062fea87ac34fdd10..9ba8b7e71fb18de21b455d6af3f5541834b122bd 100644 (file)
@@ -451,7 +451,7 @@ SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_p
     std::string IOREngine = aSCO.GetIOR();
     if(!IOREngine.empty()) {
       CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
-      SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;
+      Engines::EngineComponent_var Engine = Engines::EngineComponent::_narrow(obj) ;
       driver = new SALOMEDS_Driver_i(Engine, orb);
     }
   }
index 7e820dd2752411a23c404366e3463e3504e8e8ae..e879aeb6931efd09beffa1ef3f5e7e1e4e1113ad 100644 (file)
@@ -46,6 +46,12 @@ class SALOME_DriverPy_i(SALOMEDS__POA.Driver):
     def ComponentDataType(self):
         return self._ComponentDataType
 
+    def Version(self):
+        try:
+            return self.getVersion()
+        except:
+            return ""
+
     def Save(self, theComponent, theURL, isMultiFile):
         return ""
 
index de3f9a5cbd70c3b926b69523c31559e6bb074292..41284ca6eae887bdd0b9d2d0886158b5173325a3 100644 (file)
@@ -67,7 +67,9 @@ public:
   virtual void SetComment(const std::string& theComment) = 0;
   virtual std::string GetComment() = 0;
 
-
+  virtual std::vector<std::string> GetStoredComponents() = 0;
+  virtual std::string GetComponentVersion( const std::string& theComponent ) = 0;
+  virtual std::vector<std::string> GetComponentVersions( const std::string& theComponent ) = 0;
 };
 
 
index 60e44a608adbcf72066230cc498dd21d65cd4ff2..b48581b993f97aeef630b9e28177db0abcb2ef59 100644 (file)
@@ -60,6 +60,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Init()
   myMonth.clear();
   myYear.clear();
   myMode = 0; // none
+  myComponentVersions.clear();
 }
 
 void SALOMEDSImpl_AttributeStudyProperties::SetModification(const std::string& theUserName,
@@ -102,9 +103,7 @@ void SALOMEDSImpl_AttributeStudyProperties::GetModifications
 
 std::string SALOMEDSImpl_AttributeStudyProperties::GetCreatorName() const
 {
-  if (myUserName.size() == 0)
-    return std::string("");
-  return myUserName[0];
+  return myUserName.empty() ? std::string("") : myUserName[0];
 }
 
 bool SALOMEDSImpl_AttributeStudyProperties::GetCreationDate
@@ -136,6 +135,7 @@ void SALOMEDSImpl_AttributeStudyProperties::ChangeCreatorName(const std::string&
 
 void SALOMEDSImpl_AttributeStudyProperties::SetCreationMode(const int theMode)
 {
+  if (theMode == myMode) return;
   CheckLocked();
   Backup();
   myMode = theMode;
@@ -175,7 +175,8 @@ bool SALOMEDSImpl_AttributeStudyProperties::IsLocked() const
   return myLocked;
 }
 
-bool SALOMEDSImpl_AttributeStudyProperties::IsLockChanged(const bool theErase) {
+bool SALOMEDSImpl_AttributeStudyProperties::IsLockChanged(const bool theErase)
+{
   if (!myLockChanged) return false;
   if (theErase) myLockChanged = false;
   return true;
@@ -204,6 +205,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Restore(DF_Attribute* with)
     myYear.push_back(aYears[i]);
   }
   myMode = aProp->GetCreationMode();
+  myComponentVersions = aProp->GetComponentsVersions();
 //  myModified = aProp->GetModified();
 //  myLocked = aProp->IsLocked();
 }
@@ -227,6 +229,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Paste(DF_Attribute* into)
   }
 
   aProp->SetCreationMode(myMode);
+  aProp->SetComponentsVersions( myComponentVersions );
 //  aProp->SetModified(myModified);
 //  aProp->SetLocked(myLocked);
 }
@@ -244,11 +247,26 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save()
 
   std::string units = GetUnits();
   std::string comment = GetComment();
+
+  int aLength1 = 0;
+  std::map<std::string, std::string> versions;
+  versionMap::const_iterator it;
+  for (aLength1 = 0, it = myComponentVersions.begin(); it != myComponentVersions.end(); ++it ) {
+    std::string vlist = "";
+    versionList vl = it->second;
+    versionList::const_iterator vlit;
+    for ( vlit = vl.begin(); vlit != vl.end(); ++vlit ) {
+      if ( vlist != "" ) vlist += ";";
+      vlist += *vlit;
+    }
+    versions[ it->first ] = vlist;
+    aLength1 += it->first.size() + vlist.size() + 2;
+  }
   
   unitsSize = units.size();
   commentSize = comment.size();
 
-  char* aProperty = new char[3 + aLength + 12 * aNames.size() + 1 + unitsSize + 1 + commentSize];
+  char* aProperty = new char[3 + aLength + 12 * aNames.size() + 1 + unitsSize + 1 + commentSize + 1 + aLength1 ];
 
   char crMode = (char)GetCreationMode();
 
@@ -283,9 +301,19 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save()
   if(comment.size() > 0) {
     sprintf(&(aProperty[a]),"%s",comment.c_str());
     a = strlen(aProperty);
-    a++;
   }
   
+  aProperty[a++] = 30; //delimeter of the component versions
+
+  std::map<std::string, std::string>::const_iterator versionsIt;
+  for ( versionsIt = versions.begin(); versionsIt != versions.end(); ++versionsIt ) {
+    sprintf(&(aProperty[a]),"%s=%s",
+            (char*)(versionsIt->first.c_str()),
+           (char*)(versionsIt->second.c_str()));
+    a = strlen(aProperty);
+    aProperty[a++] = 1;
+  }
+
   aProperty[a] = 0;
   std::string prop(aProperty);
   delete aProperty;
@@ -293,26 +321,81 @@ std::string SALOMEDSImpl_AttributeStudyProperties::Save()
   return prop;
 }
 
-void SALOMEDSImpl_AttributeStudyProperties::SetUnits(const std::string& theUnits) {
+void SALOMEDSImpl_AttributeStudyProperties::SetUnits(const std::string& theUnits)
+{
   if(myUnits == theUnits)
     return;
+
+  CheckLocked();
+  Backup();
+
   myUnits = theUnits;
 }
 
-std::string SALOMEDSImpl_AttributeStudyProperties::GetUnits() {
+std::string SALOMEDSImpl_AttributeStudyProperties::GetUnits() const
+{
   return myUnits;
 }
 
-void SALOMEDSImpl_AttributeStudyProperties::SetComment(const std::string& theComment) {
+void SALOMEDSImpl_AttributeStudyProperties::SetComment(const std::string& theComment)
+{
   if(myComment == theComment)
     return;
+
+  CheckLocked();
+  Backup();
+
   myComment = theComment;
 }
 
-std::string SALOMEDSImpl_AttributeStudyProperties::GetComment() {
+std::string SALOMEDSImpl_AttributeStudyProperties::GetComment() const 
+{
   return myComment;
 }
 
+void SALOMEDSImpl_AttributeStudyProperties::SetComponentVersion(const std::string& theComponent, const std::string& theVersion)
+{
+  if (!theComponent.empty()) {
+    CheckLocked();
+    Backup();
+    if (myComponentVersions.find(theComponent) == myComponentVersions.end()) myComponentVersions[theComponent] = versionList();
+    if (myComponentVersions[theComponent].empty() || myComponentVersions[theComponent].back() != theVersion)
+      myComponentVersions[theComponent].push_back(theVersion);
+  }
+}
+
+std::vector<std::string> SALOMEDSImpl_AttributeStudyProperties::GetStoredComponents() const
+{
+  std::vector<std::string> components;
+  versionMap::const_iterator it;  
+  for (it = myComponentVersions.begin(); it != myComponentVersions.end(); ++it)
+    components.push_back(it->first);
+  return components;
+}
+
+std::string SALOMEDSImpl_AttributeStudyProperties::GetComponentVersion(const std::string& theComponent) const
+{
+  versionList versions = GetComponentVersions(theComponent);
+  return versions.size() > 0 ? versions[0] : std::string("");
+}
+
+std::vector<std::string> SALOMEDSImpl_AttributeStudyProperties::GetComponentVersions(const std::string& theComponent) const
+{
+  versionList versions;
+  versionMap::const_iterator it = myComponentVersions.find(theComponent);
+  if ( it != myComponentVersions.end() ) versions = it->second;
+  return versions;
+}
+
+std::map< std::string, std::vector<std::string> > SALOMEDSImpl_AttributeStudyProperties::GetComponentsVersions() const
+{
+  return myComponentVersions;
+}
+
+void SALOMEDSImpl_AttributeStudyProperties::SetComponentsVersions( const std::map< std::string, std::vector<std::string> >& theVersions )
+{
+  myComponentVersions = theVersions;
+}
 
 void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
 {
@@ -322,7 +405,16 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
   SetCreationMode(crMode);
 
   int anIndex;
-  for (anIndex = 2; anIndex + 2 < value.size() ;) {
+  // number 13 below is minimal size of modification data record, which has form:
+  // mmhhddMMyyyyname1, where
+  // - mm:   minute = 2 bytes
+  // - hh:   hour   = 2 bytes
+  // - dd:   day    = 2 bytes
+  // - MM:   month  = 2 bytes
+  // - yyyy: year   = 4 bytes
+  // - name: user's name = arbitrary value, minimal length is 0 bytes
+  // - 1   : records delimiter = 1 byte  
+  for (anIndex = 2; anIndex + 13 < value.size() ;) {
     char str[10];
     int aMinute, aHour, aDay, aMonth, aYear;
     str[0] = aCopy[anIndex++];
@@ -359,7 +451,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
       break;
   }
   
-  //Case then study contains units and comment properties
+  //Case when study contains units and comment properties
   if( anIndex < value.size() ) {
     anIndex++; //skip the delimeter of the sections: char(30)
     int unitsSize;
@@ -375,7 +467,7 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
     anIndex += unitsSize + 1;
 
     int commentSize;
-    for(commentSize = 0; aCopy[anIndex+commentSize] != 0; commentSize++);
+    for(commentSize = 0; aCopy[anIndex+commentSize] != 0 && aCopy[anIndex+commentSize] != 30; commentSize++);
 
     if(commentSize > 0) {
       char *aComment = new char[commentSize+1];
@@ -384,7 +476,40 @@ void SALOMEDSImpl_AttributeStudyProperties::Load(const std::string& value)
       SetComment(aComment);
       delete [] (aComment);
     }
-    anIndex += commentSize;
+    anIndex += commentSize + 1;
+  }
+
+  //Case when study contains components versions
+  if( anIndex < value.size() ) {
+    while ( anIndex < value.size() && aCopy[anIndex] != 0 ) {
+      int modSize;
+      for(modSize = 0; aCopy[anIndex+modSize] != '='; modSize++);
+      int verSize;
+      for(verSize = 0; aCopy[anIndex+modSize+1+verSize] != 1; verSize++);
+
+      if(modSize > 0) {
+       char *aModule = new char[modSize+1];
+       strncpy(aModule, &(aCopy[anIndex]), modSize);
+       aModule[modSize] = 0;
+       char *aVersions = new char[verSize+1];
+       if ( verSize > 0 )
+         strncpy(aVersions, &(aCopy[anIndex+modSize+1]), verSize);
+       aVersions[verSize] = 0;
+       
+       std::string mVersions = aVersions;
+       int start = 0, idx = mVersions.find( ';', start );
+       while ( idx != std::string::npos ) {
+         SetComponentVersion( aModule, mVersions.substr( start, idx-start ) );
+         start = idx + 1;
+         idx = mVersions.find( ';', start );
+       }
+       SetComponentVersion( aModule, mVersions.substr( start ) );
+
+       delete [] (aModule);
+       delete [] (aVersions);
+       anIndex += modSize + 1 + verSize + 1;
+      }
+    }
   }
   
   if (aCopy[1] == 'l') {
index 4be09cd2728c8144c769055771e9223d1e090a31..8cb4b69bbe2b06c5ccc58361a229afedc707f9c3 100644 (file)
@@ -32,6 +32,7 @@
 #include "DF_Label.hxx"
 #include <string>
 #include <vector>
+#include <map>
 #include "SALOMEDSImpl_GenericAttribute.hxx"
 
 class SALOMEDSIMPL_EXPORT SALOMEDSImpl_AttributeStudyProperties : public SALOMEDSImpl_GenericAttribute
@@ -73,10 +74,10 @@ public:
   void ChangeCreatorName(const std::string& theUserName);
 
   void SetUnits(const std::string& theUnits);
-  std::string GetUnits();
+  std::string GetUnits() const;
 
   void SetComment(const std::string& theComment);
-  std::string GetComment();
+  std::string GetComment() const;
 
   void SetCreationMode(const int theMode);
   int GetCreationMode() const;
@@ -89,11 +90,20 @@ public:
   bool IsLocked() const;
   bool IsLockChanged(const bool theErase);
 
+  void SetComponentsVersions( const std::map< std::string, std::vector<std::string> >& theVersions );
+  void SetComponentVersion(const std::string& theComponent, const std::string& theVersion);
+  std::vector<std::string> GetStoredComponents() const;
+  std::string GetComponentVersion(const std::string& theComponent) const;
+  std::vector<std::string> GetComponentVersions(const std::string& theComponent) const;
+  std::map< std::string, std::vector<std::string> > GetComponentsVersions() const;
+
   void Restore(DF_Attribute* with);
   DF_Attribute* NewEmpty() const;
   void Paste(DF_Attribute* into);
 
 private:
+  typedef std::vector<std::string> versionList;
+  typedef std::map<std::string, versionList> versionMap;
 
   std::vector<std::string> myUserName;
   std::vector<int> myMinute;
@@ -103,11 +113,11 @@ private:
   std::vector<int> myYear;
   std::string      myUnits;
   std::string      myComment;
-  int myMode;
-  int myModified;
-  bool myLocked;
-  bool myLockChanged;
-
+  int              myMode;
+  int              myModified;
+  bool             myLocked;
+  bool             myLockChanged;
+  versionMap       myComponentVersions;
 };
 
 #endif
index 84be82bcb6162030721502faec065b9352392149..b204337bb336ca862dc0a060a535c7fdcf31a37f 100644 (file)
@@ -62,6 +62,7 @@ public:
 
   virtual std::string ComponentDataType() = 0;
 
+  virtual std::string Version() = 0;
 
   virtual std::string IORToLocalPersistentID(const SALOMEDSImpl_SObject& theSObject,
     const std::string& IORString,
index d52b629ebdb8fd43272d80e2b0e16d6979bb1f5d..cae31faee05287967a9ab8fd1c67cd6f630d52f8 100644 (file)
@@ -40,6 +40,7 @@
 #include "SALOMEDSImpl_SComponent.hxx"
 #include "SALOMEDSImpl_GenericAttribute.hxx"
 #include "SALOMEDSImpl_ScalarVariable.hxx"
+#include "SALOMEDSImpl_IParameters.hxx"
 #include <map>
 
 #include "HDFOI.hxx"
@@ -56,6 +57,42 @@ static void Translate_IOR_to_persistentID (const SALOMEDSImpl_SObject&,
                                            SALOMEDSImpl_Driver*, bool isMultiFile, bool isASCII);
 static void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup);
 
+namespace {
+  class StudyUnlocker
+  {
+  public:
+    StudyUnlocker( SALOMEDSImpl_Study* study ): myStudy( study ), myLocked( false )
+    {
+      myPrevLocked = myStudy->GetProperties()->IsLocked();
+      resume();
+    }
+    ~StudyUnlocker()
+    {
+      suspend();
+    }
+    void suspend()
+    {
+      if (myLocked) {
+       myStudy->GetProperties()->SetLocked(true);
+       myPrevLocked = myLocked;
+       myLocked = false;
+      }
+    }
+    void resume()
+    {
+      if (myPrevLocked) { 
+       myStudy->GetProperties()->SetLocked(false);
+       myLocked = myPrevLocked;
+       myPrevLocked = false;
+      }
+    }
+  private:
+    SALOMEDSImpl_Study* myStudy;
+    bool myLocked;
+    bool myPrevLocked;
+  };
+}
+
 //============================================================================
 /*! Function : SALOMEDSImpl_StudyManager
  *  Purpose  : SALOMEDSImpl_StudyManager constructor
@@ -209,6 +246,20 @@ SALOMEDSImpl_Study* SALOMEDSImpl_StudyManager::Open(const std::string& aUrl)
 
   delete hdf_file; // all related hdf objects will be deleted
 
+  // unlock study if it is locked, to set components versions
+  StudyUnlocker unlock(Study);
+
+  //For old studies we have to add "unknown" version tag for all stored components
+  SALOMEDSImpl_SComponentIterator itcomponent = Study->NewComponentIterator();
+  for (; itcomponent.More(); itcomponent.Next())
+  {
+    SALOMEDSImpl_SComponent sco = itcomponent.Value();
+    std::string aCompType = sco.GetComment();
+    if ( aCompType == SALOMEDSImpl_IParameters::getDefaultVisualComponent() ) continue;
+    if ( Study->GetProperties()->GetComponentVersions( aCompType ).empty() )
+      Study->GetProperties()->SetComponentVersion( aCompType, "" ); // empty version means "unknown"
+  }
+
   return Study;
 }
 
@@ -398,15 +449,17 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy,
 
   // add modifications list (user and date of save)
   SALOMEDSImpl_AttributeStudyProperties* aProp = aStudy->GetProperties();
-  int aLocked = aProp->IsLocked();
-  if (aLocked) aProp->SetLocked(false);
 
+  // unlock study if it is locked, to set modification date
+  StudyUnlocker unlock(aStudy);
+  
   int month=0,day=0,year=0,hh=0,mn=0,ss=0;
   SALOMEDSImpl_Tool::GetSystemDate(year, month, day, hh, mn, ss);
   aProp->SetModification(SALOMEDSImpl_Tool::GetUserName(),
-                         mn, hh, day, month, year);
-
-  if (aLocked) aProp->SetLocked(true);
+                        mn, hh, day, month, year);
+  
+  // lock study back if it was locked initially, to write correct value of Locked flag
+  unlock.suspend();
 
   std::vector<std::string> aNames;
   std::vector<int> aMinutes, aHours, aDays, aMonths, aYears;
@@ -416,10 +469,27 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy,
   std::string units = aProp->GetUnits();
   std::string comment = aProp->GetComment();
 
-  int aLength = 0, anIndex, i, unitsSize = 0, commentSize = 0;
+  std::map< std::string, std::vector<std::string> > allVersions = aProp->GetComponentsVersions();
+  std::map<std::string, std::string> versions;
+
+  int aLength = 0, aLength1 = 0, anIndex, i, unitsSize = 0, commentSize = 0;
+
   for(i=1; i<=aNames.size(); i++)
     aLength += aNames[i-1].size() + 1;
-  
+
+  std::map< std::string, std::vector<std::string> >::const_iterator it;
+  for (it = allVersions.begin(); it != allVersions.end(); ++it ) {
+    std::string vlist = "";
+    std::vector<std::string> vl = it->second;
+    std::vector<std::string>::const_iterator vlit;
+    for ( vlit = vl.begin(); vlit != vl.end(); ++vlit ) {
+      if ( vlist != "" ) vlist += ";";
+      vlist += *vlit;
+    }
+    versions[ it->first ] = vlist;
+    aLength1 += it->first.size() + vlist.size() + 2;
+  }
+
   unitsSize = units.size();
   commentSize = comment.size();
 
@@ -431,13 +501,16 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy,
   //.....................................................,
   //.....................................................,
   //minutes, hours, day, months, year, user name, char(1), char(30) <- !!!! used to define end of section with modifications !!!!
-  //units, char(1), comment, char(0)
+  //units, char(1), comment, char(30) <- !!!! used to define start of section with components' versions !!!!
+  //component=versions, char(1), 
+  //component=versions, char(1), 
+  //...........................,
+  //component=versions, char(1), char(0)
 
   //string length: 1 byte = locked flag, 1 byte = modified flag, (12 + name length + 1) for each name and date, 1 byte (char(30) section delimeter)
   // unit length + 1, comment length, "zero" byte
   
-  char* aProperty = new char[3 + aLength + 12 * aNames.size() + 1 + unitsSize + 1 + commentSize ];
-
+  char* aProperty = new char[3 + aLength + 12 * aNames.size() + 1 + unitsSize + 1 + commentSize + 1 + aLength1 ];
 
   sprintf(aProperty,"%c%c", (char)aProp->GetCreationMode(),  (aProp->IsLocked())?'l':'u');
 
@@ -470,11 +543,21 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveProperties(SALOMEDSImpl_Study* aStudy,
   if(comment.size() > 0) {
     sprintf(&(aProperty[a]),"%s",comment.c_str());
     a = strlen(aProperty);
-    a++;
+  }
+  
+  aProperty[a++] = 30; //delimeter of the component versions
+
+  std::map<std::string, std::string>::const_iterator versionsIt;
+  for ( versionsIt = versions.begin(); versionsIt != versions.end(); ++versionsIt ) {
+    sprintf(&(aProperty[a]),"%s=%s",
+            (char*)(versionsIt->first.c_str()),
+           (char*)(versionsIt->second.c_str()));
+    a = a + versionsIt->first.size() + versionsIt->second.size() + 1;
+    aProperty[a++] = 1;
   }
 
   aProperty[a] = 0;
-  
+
   name_len = (hdf_int32) a;
   size[0] = name_len + 1 ;
   hdf_dataset = new HDFdataset("AttributeStudyProperties",hdf_group,HDF_STRING,size,1);
@@ -531,11 +614,14 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
   // Store previous URL
   std::string anOldName = aStudy->Name();
 
+  // Map to store components' versions
+  std::map<std::string, std::string> componentVersions;
+
   //Create a temporary url to which the study is saved 
   std::string aUrl = SALOMEDSImpl_Tool::GetTmpDir() + SALOMEDSImpl_Tool::GetNameFromPath(aStudyUrl);
 
-  int aLocked = aStudy->GetProperties()->IsLocked();
-  if (aLocked) aStudy->GetProperties()->SetLocked(false);
+  // unlock study if it is locked, as some attributes need to be modified
+  StudyUnlocker unlock(aStudy);
 
   SALOMEDSImpl_StudyBuilder* SB= aStudy->NewBuilder();
   std::map<std::string, SALOMEDSImpl_Driver*> aMapTypeDriver;
@@ -543,19 +629,19 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
   try
     {
       // mpv 15.12.2003: for saving components we have to load all data from all modules
-      SALOMEDSImpl_SComponentIterator itcomponent1 = aStudy->NewComponentIterator();
-      for (; itcomponent1.More(); itcomponent1.Next())
+      SALOMEDSImpl_SComponentIterator itcomponent = aStudy->NewComponentIterator();
+      for (; itcomponent.More(); itcomponent.Next())
         {
-          SALOMEDSImpl_SComponent sco = itcomponent1.Value();
+          SALOMEDSImpl_SComponent sco = itcomponent.Value();
           // if there is an associated Engine call its method for saving
           std::string IOREngine;
           try {
+           SALOMEDSImpl_Driver* aDriver = NULL;
+           std::string aCompType = sco.GetComment();
             if (!sco.ComponentIOR(IOREngine)) {
-              std::string aCompType = sco.GetComment();
               if (!aCompType.empty()) {
 
-                SALOMEDSImpl_Driver* aDriver = aFactory->GetDriverByType(aCompType);
-                aMapTypeDriver[aCompType] = aDriver;
+                aDriver = aFactory->GetDriverByType(aCompType);
 
                 if (aDriver != NULL) {
                   if(!SB->LoadWith(sco, aDriver)) {
@@ -565,6 +651,10 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
                 }
               }
             }
+           else {
+             aDriver = aFactory->GetDriverByIOR(IOREngine);
+           }
+           aMapTypeDriver[aCompType] = aDriver;
           } catch(...) {
             _errorCode = "Can not restore information to resave it";
             return false;
@@ -586,9 +676,7 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
       hdf_group_datacomponent = new HDFgroup("DATACOMPONENT",hdf_file);
       hdf_group_datacomponent->CreateOnDisk();
 
-      SALOMEDSImpl_SComponentIterator itcomponent = aStudy->NewComponentIterator();
-
-      for (; itcomponent.More(); itcomponent.Next())
+      for (itcomponent.Init(); itcomponent.More(); itcomponent.Next())
         {
           SALOMEDSImpl_SComponent sco = itcomponent.Value();
 
@@ -600,20 +688,15 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
           std::string IOREngine;
           if (sco.ComponentIOR(IOREngine))
             {
-              SALOMEDSImpl_Driver* Engine = NULL;
-              if(aMapTypeDriver.find(componentDataType) != aMapTypeDriver.end()) {
-                // we have found the associated engine to write the data
-                Engine = aMapTypeDriver[componentDataType];
-              }
-              else {
-                Engine = aFactory->GetDriverByIOR(IOREngine);
-              }
-
+             // Engine should be already in the map as it was to added before
+             SALOMEDSImpl_Driver* Engine = aMapTypeDriver[componentDataType];
               if (Engine != NULL)
                 {
                   SALOMEDSImpl_TMPFile* aStream = NULL;
                   long length = 0;
 
+                 componentVersions[ componentDataType ] = Engine->Version();
+
                   if (theASCII) aStream = Engine->SaveASCII(sco,
                                                             SALOMEDSImpl_Tool::GetDirFromPath(aUrl),
                                                             length,
@@ -666,10 +749,9 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
       hdf_group_study_structure = new HDFgroup("STUDY_STRUCTURE",hdf_file);
       hdf_group_study_structure->CreateOnDisk();
       // save component attributes
-      SALOMEDSImpl_SComponentIterator itcomp = aStudy->NewComponentIterator();
-      for (; itcomp.More(); itcomp.Next())
+      for (itcomponent.Init(); itcomponent.More(); itcomponent.Next())
         {
-          SALOMEDSImpl_SComponent SC = itcomp.Value();
+          SALOMEDSImpl_SComponent SC = itcomponent.Value();
           std::string scid = SC.GetID();
           hdf_sco_group2 = new HDFgroup((char*)scid.c_str(), hdf_group_study_structure);
           hdf_sco_group2->CreateOnDisk();
@@ -752,8 +834,15 @@ bool SALOMEDSImpl_StudyManager::Impl_SaveAs(const std::string& aStudyUrl,
       }
       hdf_notebook_vars->CloseOnDisk();
       hdf_notebook_vars = 0; //will be deleted by hdf_sco_group destructor
-        
-      if (aLocked) aStudy->GetProperties()->SetLocked(true);
+
+      // record component versions
+      std::map<std::string, std::string>::const_iterator itVersions;
+      for ( itVersions = componentVersions.begin(); itVersions != componentVersions.end(); ++itVersions )
+       aStudy->GetProperties()->SetComponentVersion( itVersions->first, itVersions->second );
+      
+      // lock study back if it was locked initially, to write correct value of Locked flag
+      unlock.suspend();
+
       //-----------------------------------------------------------------------
       //6 - Write the Study Properties
       //-----------------------------------------------------------------------