From: ribes Date: Wed, 18 May 2011 15:05:43 +0000 (+0000) Subject: Example types1 with parametric parameters X-Git-Tag: V6_3_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_Dev_For_6_3_1;p=tools%2Fyacsgen.git Example types1 with parametric parameters --- diff --git a/Examples/types1/components.py b/Examples/types1/components.py index bd32a9a..696a288 100644 --- a/Examples/types1/components.py +++ b/Examples/types1/components.py @@ -60,26 +60,45 @@ defs=""" body=""" //inputs //Parameter +std::cerr << "Parameter:" << std::endl; std::cerr << "a: " << a.name << "=" << a.value << std::endl; +std::cerr << "" << std::endl; //ParameterList +std::cerr << "ParameterList:" << std::endl; for(CORBA::ULong i = 0;iname << "=" << aa->value << std::endl; //ParameterList ab=new SALOME_TYPES::ParameterList; -ac= new SALOME_TYPES::Value; -ad= new SALOME_TYPES::VarList; -ae= new SALOME_TYPES::ValueList; +ac= new SALOME_TYPES::Variable; +ad= new SALOME_TYPES::VariableSequence; +ad2= new SALOME_TYPES::StateSequence; +ad3= new SALOME_TYPES::TimeSequence; +ae= new SALOME_TYPES::VarList; af= new SALOME_TYPES::ParametricInput; ag= new SALOME_TYPES::ParametricOutput; """ @@ -121,14 +144,24 @@ a->Register(); """ c1=CPPComponent("compo1",services=[ - Service("s1",inport=[("a","SALOME_TYPES/Parameter"),("b","SALOME_TYPES/ParameterList"),("c","SALOME_TYPES/Value"), - ("d","SALOME_TYPES/VarList"),("e","SALOME_TYPES/ValueList"),("f","SALOME_TYPES/ParametricInput"), + Service("s1",inport=[("a","SALOME_TYPES/Parameter"), + ("b","SALOME_TYPES/ParameterList"), + ("c","SALOME_TYPES/Variable"), + ("d","SALOME_TYPES/VariableSequence"), + ("d2","SALOME_TYPES/StateSequence"), + ("d3","SALOME_TYPES/TimeSequence"), + ("e","SALOME_TYPES/VarList"), + ("f","SALOME_TYPES/ParametricInput"), ("g","SALOME_TYPES/ParametricOutput"), ], outport=[("aa","SALOME_TYPES/Parameter"), ("ab","SALOME_TYPES/ParameterList"), - ("ac","SALOME_TYPES/Value"), - ("ad","SALOME_TYPES/VarList"),("ae","SALOME_TYPES/ValueList"),("af","SALOME_TYPES/ParametricInput"), + ("ac","SALOME_TYPES/Variable"), + ("ad","SALOME_TYPES/VariableSequence"), + ("ad2","SALOME_TYPES/StateSequence"), + ("ad3","SALOME_TYPES/TimeSequence"), + ("ae","SALOME_TYPES/VarList"), + ("af","SALOME_TYPES/ParametricInput"), ("ag","SALOME_TYPES/ParametricOutput"), ], defs=defs,body=body, @@ -140,15 +173,17 @@ c1=CPPComponent("compo1",services=[ pydefs="""import SALOME_TYPES""" pybody=""" -print a,b,c,d,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]] -ad=["aaa","bbb"] -ae=[[[1,2,3]]] -af=SALOME_TYPES.ParametricInput(inputVarList=ad,outputVarList=ad, inputValues=[[[1,2,3]]],specificParameters=[]) -ag=SALOME_TYPES.ParametricOutput(outputValues=[[[1,2,3]]], specificOutputInfos=[], returnCode=1, errorMessage="error") -print aa,ab,ac,ad,ae,af,ag +ac=[1,2,3] +ad=[[1,2,3]] +ad2=[[[1,2,3]]] +ad3=[[[[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 """ s2pybody=""" @@ -158,14 +193,24 @@ a.Register() """ c2=PYComponent("compo2",services=[ - Service("s1",inport=[("a","SALOME_TYPES/Parameter"),("b","SALOME_TYPES/ParameterList"),("c","SALOME_TYPES/Value"), - ("d","SALOME_TYPES/VarList"),("e","SALOME_TYPES/ValueList"),("f","SALOME_TYPES/ParametricInput"), + Service("s1",inport=[("a","SALOME_TYPES/Parameter"), + ("b","SALOME_TYPES/ParameterList"), + ("c","SALOME_TYPES/Variable"), + ("d","SALOME_TYPES/VariableSequence"), + ("d2","SALOME_TYPES/StateSequence"), + ("d3","SALOME_TYPES/TimeSequence"), + ("e","SALOME_TYPES/VarList"), + ("f","SALOME_TYPES/ParametricInput"), ("g","SALOME_TYPES/ParametricOutput"), ], outport=[("aa","SALOME_TYPES/Parameter"), ("ab","SALOME_TYPES/ParameterList"), - ("ac","SALOME_TYPES/Value"), - ("ad","SALOME_TYPES/VarList"),("ae","SALOME_TYPES/ValueList"),("af","SALOME_TYPES/ParametricInput"), + ("ac","SALOME_TYPES/Variable"), + ("ad","SALOME_TYPES/VariableSequence"), + ("ad2","SALOME_TYPES/StateSequence"), + ("ad3","SALOME_TYPES/TimeSequence"), + ("ae","SALOME_TYPES/VarList"), + ("af","SALOME_TYPES/ParametricInput"), ("ag","SALOME_TYPES/ParametricOutput"), ], body=pybody,defs=pydefs, diff --git a/Examples/types1/coupling.xml b/Examples/types1/coupling.xml index a850548..fcf1918 100644 --- a/Examples/types1/coupling.xml +++ b/Examples/types1/coupling.xml @@ -1,7 +1,6 @@ - + - @@ -13,18 +12,19 @@ - - - + + + + - + - + @@ -36,329 +36,399 @@ - - - - - + compo1 - + s1 - - - + + + + + - - - + + + + + - + + compo2 + + s1 + + + + + + + + + + + + + + + + + + + + + compo1 + + s1 + + + + + + + + + + + + + + + + + + + + + compo2 + + s1 + + + + + + + + + + + + + + + + + + + + - + + + + - - + - + + + + - - - compo2 - - s1 - - - - - - - - - - - - - - - - - compo1 - - s1 - - - - - - - - - - - - - - - - + - + + + + - - - compo2 - - s1 - - - - - - - - - - - - - - - - s10 s13 - s10 PyScript0 - PyScript1 s10 - PyScript1 s11 - s11 PyScript00 - s11 s12 - - s10 aa - s13 a + s12 s11 + s12 PyScript0005 + s13 s10 + s13 PyScript006 + PyScript1154 s12 + PyScript1154 s13 + + s12 aa + s11 a - s10 aa - PyScript0 i1 + s12 aa + PyScript0005 i1 - s10 ab - PyScript0 i2 + s12 ab + s11 b - s10 ab - s13 b + s12 ab + PyScript0005 i2 - s10 ac - s13 c + s12 ac + s11 c - s10 ac - PyScript0 i3 + s12 ac + PyScript0005 i3 - s10 ad - s13 d + s12 ad + s11 d - s10 ad - PyScript0 i5 + s12 ad + PyScript0005 i4 - s10 ae - PyScript0 i4 + s12 ad2 + s11 d2 - s10 ae - s13 e + s12 ad2 + PyScript0005 i8 - s10 af - s13 f + s12 ad3 + s11 d3 - s10 af - PyScript0 i6 + s12 ad3 + PyScript0005 i9 - s10 ag - s13 g + s12 ae + PyScript0005 i5 + + + s12 ae + s11 e - s10 ag - PyScript0 i7 + s12 af + PyScript0005 i6 - PyScript1 o2 - s11 a + s12 af + s11 f - PyScript1 o2 + s12 ag + PyScript0005 i7 + + + s12 ag + s11 g + + + s13 aa s10 a - PyScript1 o3 - s11 b + s13 aa + PyScript006 i1 - PyScript1 o3 + s13 ab s10 b - PyScript1 o4 - s11 c + s13 ab + PyScript006 i2 - PyScript1 o4 + s13 ac s10 c - PyScript1 o5 + s13 ac + PyScript006 i3 + + + s13 ad s10 d - PyScript1 o5 - s11 d + s13 ad + PyScript006 i4 - PyScript1 o6 - s11 e + s13 ad2 + s10 d2 + + + s13 ad2 + PyScript006 i8 + + + s13 ad3 + s10 d3 + + + s13 ad3 + PyScript006 i9 - PyScript1 o6 + s13 ae s10 e - PyScript1 o7 - s10 f + s13 ae + PyScript006 i5 - PyScript1 o7 - s11 f + s13 af + s10 f - PyScript1 o8 - s11 g + s13 af + PyScript006 i6 - PyScript1 o8 + s13 ag s10 g - s11 aa - s12 a + s13 ag + PyScript006 i7 - s11 aa - PyScript00 i1 + PyScript1154 o2 + s12 a - s11 ab - PyScript00 i2 + PyScript1154 o2 + s13 a - s11 ab + PyScript1154 o3 s12 b - s11 ac + PyScript1154 o3 + s13 b + + + PyScript1154 o16 s12 c - s11 ac - PyScript00 i3 + PyScript1154 o16 + s13 c - s11 ad + PyScript1154 o17 s12 d - s11 ad - PyScript00 i5 + PyScript1154 o17 + s13 d + + + PyScript1154 o18 + s12 d2 + + + PyScript1154 o18 + s13 d2 + + + PyScript1154 o19 + s12 d3 + + + PyScript1154 o19 + s13 d3 - s11 ae + PyScript1154 o5 s12 e - s11 ae - PyScript00 i4 + PyScript1154 o5 + s13 e - s11 af + PyScript1154 o7 s12 f - s11 af - PyScript00 i6 + PyScript1154 o7 + s13 f - s11 ag + PyScript1154 o8 s12 g - s11 ag - PyScript00 i7 + PyScript1154 o8 + s13 g - - - - - - - - + + + + + + + +