#!/bin/bash
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 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
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Date : 10/10/2002
#
+# $Id$
+#
+
ORIG_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
ABS_CONF_DIR=`pwd`
mkdir -p salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
-#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
-
cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
-#cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
-
-# remove KERNEL deprecated configure files
-#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
-# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
-# check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
-# do
-# rm -f salome_adm/unix/config_files/${deprecated}
-# done
-
# ____________________________________________________________________
# aclocal creates the aclocal.m4 file from the standard macro and the
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
- -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
-
-# ____________________________________________________________________
-# libtoolize creates some configuration files (ltmain.sh,
-# config.guess and config.sub). It only depends on the libtool
-# version. The files are created in the directory specified with the
-# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
-# output:
-# salome_adm/unix/config_files/config.guess
-# salome_adm/unix/config_files/config.sub
-# salome_adm/unix/config_files/ltmain.sh
-#echo "====================================================== libtoolize"
-
-libtoolize --force --copy --automake || exit 1
+ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
# ____________________________________________________________________
# autoconf creates the configure script from the file configure.ac (or
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 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
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# PLEASE DO NOT MODIFY configure.in FILE
-# ALL CHANGES WILL BE DISCARDED BY THE NEXT
-# build_configure COMMAND
-# CHANGES MUST BE MADE IN configure.in.base FILE
# Author : Marc Tajchman (CEA)
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Marc Tajchman (CEA)
-# Created from configure.in.base
+# $Id$
#
-AC_INIT([Salome2 Project GENERICSOLVER module], [5.1.3], [webmaster.salome@opencascade.com], [SalomeGENERICSOLVER])
+
+AC_INIT([Salome GENERICSOLVER module],[5.1.3],[webmaster.salome@opencascade.com],[SalomeGENERICSOLVER])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CHECK_PROG(SHELL,sh)
AC_SUBST(SHELL)
-if test -z "$AR"; then
- AC_CHECK_PROGS(AR,ar xar,:,$PATH)
-fi
-AC_SUBST(AR)
-
-dnl Export the AR macro so that it will be placed in the libtool file
-dnl correctly.
-export AR
-
echo
echo ---------------------------------------------
echo testing make
AC_PROG_MAKE_SET
AC_PROG_INSTALL
-dnl
-dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
AC_ENABLE_DEBUG(yes)
AC_DISABLE_PRODUCTION
-echo ---------------------------------------------
-echo testing libtool
-echo ---------------------------------------------
-
-dnl first, we set static to no!
-dnl if we want it, use --enable-static
-AC_ENABLE_STATIC(no)
-
-AC_LIBTOOL_DLOPEN
-AC_PROG_LIBTOOL
-
dnl Fix up the INSTALL macro if it s a relative path. We want the
dnl full-path to the binary instead.
case "$INSTALL" in
echo ---------------------------------------------
echo
-AC_OUTPUT_COMMANDS([ \
+AC_CONFIG_COMMANDS([default-1],[[ \
chmod +x ./bin/*; \
-])
+]],[[]])
# This list is initiated using autoscan and must be updated manually
# when adding a new file <filename>.in to manage. When you execute
# autoscan, the Makefile list is generated in the output file configure.scan.
-# This could be helpfull to update de configuration.
-AC_OUTPUT([ \
+# This could be helpful to update de configuration.
+AC_CONFIG_FILES([ \
salome_adm/unix/SALOMEconfig.h \
adm_local/Makefile \
adm_local/unix/Makefile \
idl/Makefile \
Makefile \
])
+AC_OUTPUT
#
import traceback
+
+import salome
import GENERICSOLVER_ORB__POA
import SALOME_ComponentPy
import SALOME_DriverPy
-from omniORB import CORBA
-from SALOME_NamingServicePy import *
-from LifeCycleCORBA import *
-import SALOMEDS
-import SALOMEDS_Attributes_idl
-
VARIABLE_ID = 1030
-################################################
-
-# init ORB
-orb = CORBA.ORB_init( [''], CORBA.ORB_ID )
-
-# create naming service instance
-naming_service = SALOME_NamingServicePy_i( orb )
-
-# create life cycle CORBA instance
-lcc = LifeCycleCORBA( orb )
-
-# get study manager
-obj = naming_service.Resolve( '/myStudyManager' )
-studyManager = obj._narrow( SALOMEDS.StudyManager )
-
-################################################
-###
-# get active study
-###
-def getStudy( studyId ):
- #studyId = getStudyId()
- study = studyManager.GetStudyByID( studyId )
- return study
-
###
# Retrieve data from selected case
###
def GetDataFromCase( studyId, caseEntry ):
theCase = {}
- study = getStudy( studyId )
+ study = salome.myStudyManager.GetStudyByID( studyId )
case = study.FindObjectID( caseEntry )
builder = study.NewBuilder()
# Get the values of the variables and make them a list
# Add some variable to the case
###
def AddDataToCase( studyId, caseEntry, varName, varValue ):
- study = getStudy( studyId )
+ study = salome.myStudyManager.GetStudyByID( studyId )
case = study.FindObjectID( caseEntry )
builder = study.NewBuilder()
var = addObjectInStudy( builder, case, varName, VARIABLE_ID )
def getSubSObjectByName( studyId, sobjFather, childName ):
print "GENERICSOLVER.getSubSObjectByName Looking for sobjet named", childName
- study = getStudy( studyId )
+ study = salome.myStudyManager.GetStudyByID( studyId )
iter = study.NewChildIterator( sobjFather )
#builder = study.NewBuilder()
while iter.More():
################################################
class GENERICSOLVER(GENERICSOLVER_ORB__POA.GENERICSOLVER_Gen,
- SALOME_ComponentPy.SALOME_ComponentPy_i,
- SALOME_DriverPy.SALOME_DriverPy_i):
+ SALOME_ComponentPy.SALOME_ComponentPy_i,
+ SALOME_DriverPy.SALOME_DriverPy_i):
"""
Pour etre un composant SALOME cette classe Python
doit avoir le nom du composant et heriter de la
print "GENERICSOLVER.Init : enter"
print "GENERICSOLVER.Init : studyId = %d - caseEntry = %s - wrapperDescription = %s" % ( studyId, caseEntry, wrapperDescription )
self.wrapperDescription = wrapperDescription
+ salome.salome_init()
try:
self.case = GetDataFromCase( studyId, caseEntry )
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2010 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
# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
# ---
#
+# $Id$
+#
+
import traceback
import os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
-from omniORB import CORBA
-from SALOME_NamingServicePy import *
-from LifeCycleCORBA import *
+import salome
import SALOMEDS
-import SALOMEDS_Attributes_idl
-
import GENERICSOLVER_ORB
+salome.salome_init()
+
################################################
# GUI context class
# Used to store actions, menus, toolbars, etc...
import libSALOME_Swig
sg = libSALOME_Swig.SALOMEGUI_Swig()
-################################################
-
-# init ORB
-orb = CORBA.ORB_init( [''], CORBA.ORB_ID )
-
-# create naming service instance
-naming_service = SALOME_NamingServicePy_i( orb )
-
-# create life cycle CORBA instance
-lcc = LifeCycleCORBA( orb )
-
-# get study manager
-obj = naming_service.Resolve( '/myStudyManager' )
-studyManager = obj._narrow( SALOMEDS.StudyManager )
-
################################################
# Internal methods
################################################
# get GENERICSOLVER engine
###
def getEngine():
- engine = lcc.FindOrLoadComponent( "FactoryServerPy", GUIcontext.MODULE_NAME )
+ engine = salome.lcc.FindOrLoadComponent( "FactoryServerPy", GUIcontext.MODULE_NAME )
return engine
###
###
def getStudy():
studyId = getStudyId()
- study = studyManager.GetStudyByID( studyId )
+ study = salome.myStudyManager.GetStudyByID( studyId )
return study
###
getEngine().Init( getStudyId(), case, "" )
inPoint = GetDataFromCase( case )[:2]
- outPoint = [0, 0]
print "GENERICSOLVERGUI.RunSOLVER (1): inPoint = ", inPoint
- print "GENERICSOLVERGUI.RunSOLVER (1): outPoint = ", outPoint
- (ok,outPoint) = getEngine().Exec( inPoint, outPoint )
+ (ok, outPoint) = getEngine().Exec(inPoint)
print "GENERICSOLVERGUI.RunSOLVER (2): inPoint = ", inPoint
print "GENERICSOLVERGUI.RunSOLVER (2): outPoint = ", outPoint
AddDataToCase( case, "Deviation", outPoint[0] )