2 # Generated python file of Graph LoopGraph
6 LoopGraph = Graph( 'LoopGraph' )
7 LoopGraph.SetName( 'LoopGraph' )
8 LoopGraph.SetAuthor( '' )
9 LoopGraph.SetComment( '' )
10 LoopGraph.Coords( 0 , 0 )
12 # Creation of Factory Nodes
14 Mul = LoopGraph.FNode( 'Calculator' , 'Calculator' , 'Mul' )
17 Mul.SetContainer( 'localhost/FactoryServer' )
18 Mul.SetComment( 'Multiply a field by a constant' )
19 Mul.Coords( 429 , 46 )
21 # Creation of InLine Nodes
23 PyInitDisplay.append( 'from VISU import * ' )
24 PyInitDisplay.append( 'import SALOMEDS ' )
25 PyInitDisplay.append( 'from LifeCycleCORBA import * ' )
26 PyInitDisplay.append( 'from SALOME_NamingServicePy import * ' )
27 PyInitDisplay.append( 'def InitDisplay(): ' )
28 PyInitDisplay.append( ' # initialize the ORB ' )
29 PyInitDisplay.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' )
30 PyInitDisplay.append( ' # create an LifeCycleCORBA instance ' )
31 PyInitDisplay.append( ' lcc = LifeCycleCORBA(orb) ' )
32 PyInitDisplay.append( ' # ----------------------------------------- ' )
33 PyInitDisplay.append( ' # Visualization parameters ' )
34 PyInitDisplay.append( ' #create a naming service instance ' )
35 PyInitDisplay.append( ' naming_service = SALOME_NamingServicePy_i(orb) ' )
36 PyInitDisplay.append( ' # get Study Manager reference ' )
37 PyInitDisplay.append( ' obj = naming_service.Resolve("myStudyManager") ' )
38 PyInitDisplay.append( ' myStudyManager = obj._narrow(SALOMEDS.StudyManager) ' )
39 PyInitDisplay.append( ' myStudy = myStudyManager.GetStudyByID(1) ' )
40 PyInitDisplay.append( ' aVisu = lcc.FindOrLoadComponent("FactoryServer", "Visu") ' )
41 PyInitDisplay.append( ' print "InitDisplay --> aVisu = ",aVisu ' )
42 PyInitDisplay.append( ' aVisu.SetCurrentStudy(myStudy); ' )
43 PyInitDisplay.append( ' aViewManager = aVisu.GetViewManager() ' )
44 PyInitDisplay.append( ' print "InitDisplay --> aViewManager = ",aViewManager ' )
45 PyInitDisplay.append( ' aView = aViewManager.Create3DView() ' )
46 PyInitDisplay.append( ' print "InitDisplay --> aView = ",aView ' )
47 PyInitDisplay.append( ' return aVisu,aView ' )
48 InitDisplay = LoopGraph.INode( 'InitDisplay' , PyInitDisplay )
49 InitDisplay.OutPort( 'aVisu' , 'objref' )
50 InitDisplay.OutPort( 'aView' , 'objref' )
51 InitDisplay.SetName( 'InitDisplay' )
52 InitDisplay.SetAuthor( '' )
53 InitDisplay.SetComment( 'Compute Node' )
54 InitDisplay.Coords( 1 , 105 )
56 # Creation of Loop Nodes
58 PyInit.append( 'def Init(index,min,max,medfield,x1,aVisu,aView): ' )
59 PyInit.append( ' if max >= min : ' )
60 PyInit.append( ' index = min ' )
61 PyInit.append( ' else : ' )
62 PyInit.append( ' index = max ' )
63 PyInit.append( ' print "Init --> index = ",index ' )
64 PyInit.append( ' print " min = ",min ' )
65 PyInit.append( ' print " max = ",max ' )
66 PyInit.append( ' print " medfield = ",medfield ' )
67 PyInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' )
69 PyMoreInit.append( 'def More(index,min,max,medfield,x1,aVisu,aView): ' )
70 PyMoreInit.append( ' if max >= index : ' )
71 PyMoreInit.append( ' DoLoop = 1 ' )
72 PyMoreInit.append( ' else : ' )
73 PyMoreInit.append( ' DoLoop = 0 ' )
74 PyMoreInit.append( ' print "More --> DoLoop = ",DoLoop ' )
75 PyMoreInit.append( ' print " index = ",index ' )
76 PyMoreInit.append( ' print " min = ",min ' )
77 PyMoreInit.append( ' print " max = ",max ' )
78 PyMoreInit.append( ' print " medfield = ",medfield ' )
79 PyMoreInit.append( ' return DoLoop,index,min,max,medfield,x1,aVisu,aView ' )
81 PyNextInit.append( 'def Next(index,min,max,medfield,x1,aVisu,aView): ' )
82 PyNextInit.append( ' index = index + 1 ' )
83 PyNextInit.append( ' print "Next --> index = ",index ' )
84 PyNextInit.append( ' print " min = ",min ' )
85 PyNextInit.append( ' print " max = ",max ' )
86 PyNextInit.append( ' print " medfield = ",medfield ' )
87 PyNextInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' )
88 Init,EndInit = LoopGraph.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
89 EndInit.SetName( 'EndInit' )
90 EndInit.SetAuthor( 'LD' )
91 EndInit.SetComment( 'no comment' )
92 EndInit.Coords( 631 , 5 )
93 Init.InPort( 'index' , 'long' )
94 Init.InPort( 'min' , 'long' )
95 Init.InPort( 'max' , 'long' )
96 Init.InPort( 'medfield' , 'objref' )
97 Init.InPort( 'x1' , 'double' )
98 Init.InPort( 'aVisu' , 'objref' )
99 Init.InPort( 'aView' , 'objref' )
100 Init.OutPort( 'index' , 'long' )
101 Init.OutPort( 'min' , 'long' )
102 Init.OutPort( 'max' , 'long' )
103 Init.OutPort( 'medfield' , 'objref' )
104 Init.OutPort( 'x1' , 'double' )
105 Init.OutPort( 'aVisu' , 'objref' )
106 Init.OutPort( 'aView' , 'objref' )
107 Init.SetName( 'Init' )
108 Init.SetAuthor( 'LD' )
109 Init.SetComment( 'no comment' )
110 Init.Coords( 216 , 5 )
113 InitDisplayaVisu = InitDisplay.Port( 'aVisu' )
114 InitaVisu = LoopGraph.Link( InitDisplayaVisu , Init.Port( 'aVisu' ) )
116 InitDisplayaView = InitDisplay.Port( 'aView' )
117 InitaView = LoopGraph.Link( InitDisplayaView , Init.Port( 'aView' ) )
119 Initindex = Init.Port( 'index' )
120 EndInitindex = LoopGraph.Link( Initindex , EndInit.Port( 'index' ) )
122 Initmin = Init.Port( 'min' )
123 EndInitmin = LoopGraph.Link( Initmin , EndInit.Port( 'min' ) )
125 Initmax = Init.Port( 'max' )
126 EndInitmax = LoopGraph.Link( Initmax , EndInit.Port( 'max' ) )
128 Initmedfield = Init.Port( 'medfield' )
129 Mulfield1 = LoopGraph.Link( Initmedfield , Mul.Port( 'field1' ) )
131 Initx1 = Init.Port( 'x1' )
132 EndInitx1 = LoopGraph.Link( Initx1 , EndInit.Port( 'x1' ) )
134 Mulx1 = LoopGraph.Link( Initx1 , Mul.Port( 'x1' ) )
136 InitaVisu = Init.Port( 'aVisu' )
137 EndInitaVisu = LoopGraph.Link( InitaVisu , EndInit.Port( 'aVisu' ) )
139 InitaView = Init.Port( 'aView' )
140 EndInitaView = LoopGraph.Link( InitaView , EndInit.Port( 'aView' ) )
142 Mulreturn = Mul.Port( 'return' )
143 EndInitmedfield = LoopGraph.Link( Mulreturn , EndInit.Port( 'medfield' ) )
145 # Creation of Input datas
146 Initindex = Init.Input( 'index' , 0)
147 Initmin = Init.Input( 'min' , 0)
148 Initmax = Init.Input( 'max' , 55)
149 Initmedfield = Init.Input( 'medfield' , 'IOR:010000001f00000049444c3a53414c4f4d455f4d45442f4649454c44444f55424c453a312e300000010000000000000026000000010100000a0000003132372e302e302e3100ead00e000000fe1948673f000058e60000000021')
150 Initx1 = Init.Input( 'x1' , 2)
152 # Creation of Output variables
153 EndInitindex = EndInit.Port( 'index' )
154 EndInitmin = EndInit.Port( 'min' )
155 EndInitmax = EndInit.Port( 'max' )
156 EndInitmedfield = EndInit.Port( 'medfield' )
157 EndInitx1 = EndInit.Port( 'x1' )
158 EndInitaVisu = EndInit.Port( 'aVisu' )
159 EndInitaView = EndInit.Port( 'aView' )