body="""
#b1
info,name= calcium.cp_cd(component)
-print "name=",name
-print "info=",info
+print ("name=",name)
+print ("info=",info)
dep=calcium.CP_ITERATION
val[0]=7.7
val[5]=a*b
nval=10
-print "--------> Appel calcium.cp_edb",val
+print ("--------> Appel calcium.cp_edb",val)
info=calcium.cp_edb(component, dep, 0., 1, "ba", nval,val)
info=calcium.cp_edb(component, dep, 0., 2, "ba", nval,val)
info=calcium.cp_edb(component, dep, 0., 3, "ba", nval,val)
val[0]="coucouc"
val[1]="bonjour"
val[2]="salut"
-print "--------> Appel calcium.cp_ech",val
+print ("--------> Appel calcium.cp_ech",val)
info=calcium.cp_ech(component, dep, 0., 1, "bb", 3,val)
#int
val=numpy.zeros(10,'i')
val[0]=1
val[1]=3
-print "--------> Appel calcium.cp_een",val
+print ("--------> Appel calcium.cp_een",val)
info=calcium.cp_een(component, dep, 0., 1, "bc", 3,val)
val=numpy.zeros(10,'F')
val[0]=1+2j
val[1]=3+2j
-print "--------> Appel calcium.cp_ecp",val
+print ("--------> Appel calcium.cp_ecp",val)
info=calcium.cp_ecp(component, dep, 0., 1, "bd", 3,val)
val=numpy.zeros(10,'f')
val[0]=1.3
val[1]=3.2
-print "--------> Appel calcium.cp_ere",val
+print ("--------> Appel calcium.cp_ere",val)
info=calcium.cp_ere(component, dep, 0., 1, "be", 3,val)
val=numpy.zeros(10,'i')
val[0]=True
val[1]=False
val[2]=False
-print "--------> Appel calcium.cp_elo",val
+print ("--------> Appel calcium.cp_elo",val)
info=calcium.cp_elo(component, dep, 0., 1, "bf", 3,val)
val=numpy.zeros(10,'l')
val[0]=1
val[1]=3
val[2]=333
-print "--------> Appel calcium.cp_eln",val
+print ("--------> Appel calcium.cp_eln",val)
info=calcium.cp_eln(component, dep, 0., 1, "bg", 3,val)
val=numpy.zeros(10,'i')
val[0]=1
val[1]=3
val[2]=4
-print "--------> Appel calcium.cp_een",val
+print ("--------> Appel calcium.cp_een",val)
info=calcium.cp_een(component, dep, 0., 1, "bh", 3,val)
val=numpy.zeros(10,'l')
val[0]=1
val[1]=3
val[2]=333
-print "--------> Appel calcium.cp_elg",val
+print ("--------> Appel calcium.cp_elg",val)
info=calcium.cp_elg(component, dep, 0., 1, "bi", 3,val)
-print "info=",info
+print ("info=",info)
#read
val=numpy.zeros(10,'d')
-print "--------> Appel calcium.cp_ldb"
+print ("--------> Appel calcium.cp_ldb")
info,tt,ii,mval=calcium.cp_ldb(component, dep, 0.,1., 1, "aa", 3,val)
-print mval,val
+print (mval,val)
val=numpy.array(["","","",], dtype='S13')
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val.dtype
+print (mval,val)
+print (val.dtype)
val=numpy.array([" "," "," ",], dtype='S13')
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val.dtype
+print (mval,val)
+print (val.dtype)
val=calcium.stringArray(3,8)
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val[0]
-print val[1]
-print val[2]
+print (mval,val)
+print (val[0])
+print (val[1])
+print (val[2])
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_len"
+print ("--------> Appel calcium.cp_len")
info,tt,ii,mval=calcium.cp_len(component, dep, 0.,1., 1, "ac", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'F')
-print "--------> Appel calcium.cp_lcp"
+print ("--------> Appel calcium.cp_lcp")
info,tt,ii,mval=calcium.cp_lcp(component, dep, 0.,1., 1, "ad", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'f')
-print "--------> Appel calcium.cp_lre"
+print ("--------> Appel calcium.cp_lre")
info,tt,ii,mval=calcium.cp_lre(component, dep, 0.,1., 1, "ae", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_llo"
+print ("--------> Appel calcium.cp_llo")
info,tt,ii,mval=calcium.cp_llo(component, dep, 0.,1., 1, "af", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'l')
-print "--------> Appel calcium.cp_lln"
+print ("--------> Appel calcium.cp_lln")
info,tt,ii,mval=calcium.cp_lln(component, dep, 0.,1., 1, "ag", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_len"
+print ("--------> Appel calcium.cp_len")
info,tt,ii,mval=calcium.cp_len(component, dep, 0.,1., 1, "ah", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'l')
-print "--------> Appel calcium.cp_llg"
+print ("--------> Appel calcium.cp_llg")
info,tt,ii,mval=calcium.cp_llg(component, dep, 0.,1., 1, "ai", 3,val)
-print "info=",info
-print mval,val
+print ("info=",info)
+print (mval,val)
info=calcium.cp_fini(component,"aa",1)
-print "info=",info
+print ("info=",info)
info=calcium.cp_effi(component,"aa",3)
-print "info=",info
+print ("info=",info)
import time
time.sleep(15)
c=a+b
d=a-b
err=calcium.cp_fin(component,calcium.CP_ARRET)
-print "err=",err
+print ("err=",err)
"""
c2=PYComponent("compo2",services=[
Service("s1",inport=[("a","double"),("b","double")],
body="""
#b1
info,name= calcium.cp_cd(component)
-print "name=",name
-print "info=",info
+print ("name=",name)
+print ("info=",info)
dep=calcium.CP_TEMPS
#double
val[0]=7.7
val[5]=a*b
nval=10
-print "--------> Appel calcium.cp_edb",val
+print ("--------> Appel calcium.cp_edb",val)
info=calcium.cp_edb(component, dep, 0., 1, "ba", nval,val)
info=calcium.cp_edb(component, dep, 1., 2, "ba", nval,val)
info=calcium.cp_edb(component, dep, 2., 3, "ba", nval,val)
val[0]="coucouc"
val[1]="bonjour"
val[2]="salut"
-print "--------> Appel calcium.cp_ech",val
+print ("--------> Appel calcium.cp_ech",val)
info=calcium.cp_ech(component, dep, 0., 1, "bb", 3,val)
#int
val=numpy.zeros(10,'i')
val[0]=1
val[1]=3
-print "--------> Appel calcium.cp_een",val
+print ("--------> Appel calcium.cp_een",val)
info=calcium.cp_een(component, dep, 0., 1, "bc", 3,val)
val=numpy.zeros(10,'F')
val[0]=1+2j
val[1]=3+2j
-print "--------> Appel calcium.cp_ecp",val
+print ("--------> Appel calcium.cp_ecp",val)
info=calcium.cp_ecp(component, dep, 0., 1, "bd", 3,val)
val=numpy.zeros(10,'f')
val[0]=1.3
val[1]=3.2
-print "--------> Appel calcium.cp_ere",val
+print ("--------> Appel calcium.cp_ere",val)
info=calcium.cp_ere(component, dep, 0., 1, "be", 3,val)
val=numpy.zeros(10,'i')
val[0]=True
val[1]=False
val[2]=False
-print "--------> Appel calcium.cp_elo",val
+print ("--------> Appel calcium.cp_elo",val)
info=calcium.cp_elo(component, dep, 0., 1, "bf", 3,val)
val=numpy.zeros(10,'l')
val[0]=1
val[1]=3
val[2]=333
-print "--------> Appel calcium.cp_eln",val
+print ("--------> Appel calcium.cp_eln",val)
info=calcium.cp_eln(component, dep, 0., 1, "bg", 3,val)
val=numpy.zeros(10,'i')
val[0]=1
val[1]=3
val[2]=4
-print "--------> Appel calcium.cp_een",val
+print ("--------> Appel calcium.cp_een",val)
info=calcium.cp_een(component, dep, 0., 1, "bh", 3,val)
val=numpy.zeros(10,'l')
val[0]=1
val[1]=3
val[2]=333
-print "--------> Appel calcium.cp_elg",val
+print ("--------> Appel calcium.cp_elg",val)
info=calcium.cp_elg(component, dep, 0., 1, "bi", 3,val)
-print "info=",info
+print ("info=",info)
#read
val=numpy.zeros(10,'d')
-print "--------> Appel calcium.cp_ldb"
+print ("--------> Appel calcium.cp_ldb")
info,tt,ii,mval=calcium.cp_ldb(component, dep, 0.,1., 1, "aa", 3,val)
-print mval,val
+print (mval,val)
val=numpy.array(["","","",], dtype='S13')
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val.dtype
+print (mval,val)
+print (val.dtype)
val=numpy.array([" "," "," ",], dtype='S13')
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val.dtype
+print (mval,val)
+print (val.dtype)
val=calcium.stringArray(3,8)
-print "--------> Appel calcium.cp_lch"
+print ("--------> Appel calcium.cp_lch")
info,tt,ii,mval=calcium.cp_lch(component, dep, 0.,1., 1, "ab", 3,val)
-print mval,val
-print val[0]
-print val[1]
-print val[2]
+print (mval,val)
+print (val[0])
+print (val[1])
+print (val[2])
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_len"
+print ("--------> Appel calcium.cp_len")
info,tt,ii,mval=calcium.cp_len(component, dep, 0.,1., 1, "ac", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'F')
-print "--------> Appel calcium.cp_lcp"
+print ("--------> Appel calcium.cp_lcp")
info,tt,ii,mval=calcium.cp_lcp(component, dep, 0.,1., 1, "ad", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'f')
-print "--------> Appel calcium.cp_lre"
+print ("--------> Appel calcium.cp_lre")
info,tt,ii,mval=calcium.cp_lre(component, dep, 0.,1., 1, "ae", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_llo"
+print ("--------> Appel calcium.cp_llo")
info,tt,ii,mval=calcium.cp_llo(component, dep, 0.,1., 1, "af", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'l')
-print "--------> Appel calcium.cp_lln"
+print ("--------> Appel calcium.cp_lln")
info,tt,ii,mval=calcium.cp_lln(component, dep, 0.,1., 1, "ag", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'i')
-print "--------> Appel calcium.cp_len"
+print ("--------> Appel calcium.cp_len")
info,tt,ii,mval=calcium.cp_len(component, dep, 0.,1., 1, "ah", 3,val)
-print mval,val
+print (mval,val)
val=numpy.zeros(10,'l')
-print "--------> Appel calcium.cp_llg"
+print ("--------> Appel calcium.cp_llg")
info,tt,ii,mval=calcium.cp_llg(component, dep, 0.,1., 1, "ai", 3,val)
-print "info=",info
-print mval,val
+print ("info=",info)
+print (mval,val)
info=calcium.cp_fint(component,"aa",0.5)
-print "info=",info
+print ("info=",info)
info=calcium.cp_efft(component,"aa",1.5)
-print "info=",info
+print ("info=",info)
import time
time.sleep(15)
c=a+b
d=a-b
err=calcium.cp_fin(component,calcium.CP_ARRET)
-print "err=",err
+print ("err=",err)
"""
c2=PYComponent("compo2",services=[
Service("s1",inport=[("a","double"),("b","double")],
virtual bool Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, const char* theURL, bool isMultiFile){return 0;};
virtual bool LoadASCII(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, const char* theURL, bool isMultiFile){return 0;};
virtual void Close(SALOMEDS::SComponent_ptr IORSComponent){};
- virtual char* ComponentDataType(){return "cppcompos";};
+ virtual char* ComponentDataType(){return (char*)"cppcompos";};
virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject, const char* IORString, CORBA::Boolean isMultiFile, CORBA::Boolean isASCII){return 0;};
virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, const char* aLocalPersistentID, CORBA::Boolean isMultiFile,
CORBA::Boolean isASCII){return 0;};
virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR){return 0;};
- virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,SALOMEDS::SObject_ptr theSObject,CORBA::Object_ptr theObject,
+ virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject,CORBA::Object_ptr theObject,
const char* theName){return 0;};
virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject){return 0;};
virtual SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID){return 0;};
#include <SUIT_Study.h>
#include <SalomeApp_Application.h>
#include <SALOME_LifeCycleCORBA.hxx>
+#include <SALOME_KernelServices.hxx>
#include <SALOMEconfig.h>
#include CORBA_CLIENT_HEADER(cppcompos)
setMenuShown( true );
setToolShown( true );
- SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
- CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject);
- SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(theStudy->id());
+ SALOMEDS::Study_var aDSStudy = KERNEL::getStudyServant();
SALOMEDS::SComponent_var aFather = aDSStudy->FindComponent("cppcompos");
if (aFather->_is_nil())
aStudyBuilder->DefineComponentInstance(aFather, engine);
}
CORBA::Boolean valid;
- engine->DumpPython(aDSStudy,1,0,valid);
+ engine->DumpPython(1,0,valid);
return bOk;
}
com=$*
# Modify to your SALOME installation
-export SALOME_DIR=/local00/home/I35256/salome/install/V7_main_git
+export SALOME_DIR=/home/I35256/salome/C9
source $SALOME_DIR/salome_prerequisites.sh
source $SALOME_DIR/salome_modules.sh
+source $SALOME_DIR/modules/build/YACS_master/.yamm/env_build.sh
echo execution: $com
$com
def createObject( self, study, name ):
"Create object. "
try:
- print study,name
+ print (study,name)
builder = study.NewBuilder()
father = study.FindComponent( "pycompos" )
if father is None:
val=numpy.zeros(10,'d')
val[5]=a*b
nval=10
- print "--------> Appel calcium.cp_edb"
+ print ("--------> Appel calcium.cp_edb")
info=calcium.cp_edb(component, dep, 0., 1, "ba", nval,val)
val=numpy.zeros(10,'d')
info,tt,ii,mval=calcium.cp_ldb(component, dep, 0.,1., 1, "aa", nval,val)
- print mval,val
+ print (mval,val)
bidul.f()
c=a+b
d=a-b
val=numpy.zeros(10,'d')
val[5]=a*b
nval=10
- print "--------> Appel calcium.cp_edb"
+ print ("--------> Appel calcium.cp_edb")
info=calcium.cp_edb(component, dep, 0., 1, "ba", nval,val)
val=numpy.zeros(10,'d')
info,tt,ii,mval=calcium.cp_ldb(component, dep, 0.,1., 1, "aa", nval,val)
- print mval,val
+ print (mval,val)
c=a+b
d=a-b
err=calcium.cp_fin(component,calcium.CP_ARRET)
pydefs="""import SALOME_TYPES"""
pybody="""
-print a,b,c,d,d2,d3,e,f,g
+print (a,b,c,d,d2,d3,e,f,g)
aa=SALOME_TYPES.Parameter(name="a",value="45.")
ab=[]
ac=[1,2,3]
ae=["aaa","bbb"]
af=SALOME_TYPES.ParametricInput(inputVarList=ae,outputVarList=ae, inputValues=[[[[1,2,3]]]],specificParameters=[])
ag=SALOME_TYPES.ParametricOutput(outputValues=[[[[1,2,3]]]], specificOutputInfos=[], returnCode=1, errorMessage="error")
-print aa,ab,ac,ad,ad2,ad3,ae,af,ag
+print (aa,ab,ac,ad,ad2,ad3,ae,af,ag)
"""
s2pybody="""
-print "service s2 python component"
+print ("service s2 python component")
aa=a
a.Register()
"""