Salome HOME
407e7c30c55546bed3f5a1cf91a83deca166d360
[samples/datafiles.git] / Superv / Python / GraphStreams.py
1 # Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # Generated python file of Graph GraphStreams
24 #
25 from SuperV import *
26 # Graph creation 
27 GraphStreams = StreamGraph( 'GraphStreams' )
28 GraphStreams.SetStreamParams( 1000 , SUPERV.SummaryTrace , 1.5 )
29 GraphStreams.SetName( 'GraphStreams' )
30 GraphStreams.SetAuthor( 'JR' )
31 GraphStreams.SetComment( 'Graph with DataStreamPorts CEA/EDF : Calcium' )
32 GraphStreams.Coords( 0 , 0 )
33
34 # Creation of Factory Nodes
35
36 Add = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Add' )
37 Add.SetName( 'Add' )
38 Add.SetAuthor( '' )
39 Add.SetContainer( 'FactoryServer' )
40 Add.SetComment( 'Add from DataStreamFactory' )
41 Add.Coords( 255 , 171 )
42 IAddx = Add.GetInPort( 'x' )
43 IAddy = Add.GetInPort( 'y' )
44 IAddGate = Add.GetInPort( 'Gate' )
45 OAddz = Add.GetOutPort( 'z' )
46 OAddGate = Add.GetOutPort( 'Gate' )
47 IAddistream = Add.GetInStreamPort( 'istream' )
48 IAddistream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
49 OAddostream = Add.GetOutStreamPort( 'ostream' )
50 OAddostream.SetNumberOfValues( 0 )
51 OAddOStream = Add.GetOutStreamPort( 'OStream' )
52 OAddOStream.SetNumberOfValues( 10 )
53
54 Sub = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Sub' )
55 Sub.SetName( 'Sub' )
56 Sub.SetAuthor( '' )
57 Sub.SetContainer( 'FactoryServer' )
58 Sub.SetComment( 'Sub from DataStreamFactory' )
59 Sub.Coords( 519 , 48 )
60 ISubx = Sub.GetInPort( 'x' )
61 ISuby = Sub.GetInPort( 'y' )
62 ISubGate = Sub.GetInPort( 'Gate' )
63 OSubz = Sub.GetOutPort( 'z' )
64 OSubGate = Sub.GetOutPort( 'Gate' )
65 ISubistream = Sub.GetInStreamPort( 'istream' )
66 ISubistream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
67 ISubIstream = Sub.GetInStreamPort( 'Istream' )
68 ISubIstream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
69
70 Mul = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Mul' )
71 Mul.SetName( 'Mul' )
72 Mul.SetAuthor( '' )
73 Mul.SetContainer( 'FactoryServer' )
74 Mul.SetComment( 'Mul from DataStreamFactory' )
75 Mul.Coords( 724 , 142 )
76 IMulx = Mul.GetInPort( 'x' )
77 IMuly = Mul.GetInPort( 'y' )
78 IMulGate = Mul.GetInPort( 'Gate' )
79 OMulz = Mul.GetOutPort( 'z' )
80 OMulGate = Mul.GetOutPort( 'Gate' )
81
82 Div = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Div' )
83 Div.SetName( 'Div' )
84 Div.SetAuthor( '' )
85 Div.SetContainer( 'FactoryServer' )
86 Div.SetComment( 'Div from DataStreamFactory' )
87 Div.Coords( 935 , 48 )
88 IDivx = Div.GetInPort( 'x' )
89 IDivy = Div.GetInPort( 'y' )
90 IDivGate = Div.GetInPort( 'Gate' )
91 ODivz = Div.GetOutPort( 'z' )
92 ODivGate = Div.GetOutPort( 'Gate' )
93 ODivostream = Div.GetOutStreamPort( 'ostream' )
94 ODivostream.SetNumberOfValues( 0 )
95
96 Add_1 = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Add' )
97 Add_1.SetName( 'Add_1' )
98 Add_1.SetAuthor( '' )
99 Add_1.SetContainer( 'localhost/FactoryServer' )
100 Add_1.SetComment( 'Add from DataStreamFactory' )
101 Add_1.Coords( 252 , 499 )
102 IAdd_1x = Add_1.GetInPort( 'x' )
103 IAdd_1y = Add_1.GetInPort( 'y' )
104 IAdd_1Gate = Add_1.GetInPort( 'Gate' )
105 OAdd_1z = Add_1.GetOutPort( 'z' )
106 OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
107 IAdd_1istream = Add_1.GetInStreamPort( 'istream' )
108 IAdd_1istream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
109 OAdd_1ostream = Add_1.GetOutStreamPort( 'ostream' )
110 OAdd_1ostream.SetNumberOfValues( 0 )
111 OAdd_1OStream = Add_1.GetOutStreamPort( 'OStream' )
112 OAdd_1OStream.SetNumberOfValues( 0 )
113
114 Sub_1 = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Sub' )
115 Sub_1.SetName( 'Sub_1' )
116 Sub_1.SetAuthor( '' )
117 Sub_1.SetContainer( 'localhost/FactoryServer' )
118 Sub_1.SetComment( 'Sub from DataStreamFactory' )
119 Sub_1.Coords( 516 , 385 )
120 ISub_1x = Sub_1.GetInPort( 'x' )
121 ISub_1y = Sub_1.GetInPort( 'y' )
122 ISub_1Gate = Sub_1.GetInPort( 'Gate' )
123 OSub_1z = Sub_1.GetOutPort( 'z' )
124 OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
125 ISub_1istream = Sub_1.GetInStreamPort( 'istream' )
126 ISub_1istream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
127 ISub_1Istream = Sub_1.GetInStreamPort( 'Istream' )
128 ISub_1Istream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL )
129
130 Mul_1 = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Mul' )
131 Mul_1.SetName( 'Mul_1' )
132 Mul_1.SetAuthor( '' )
133 Mul_1.SetContainer( 'localhost/FactoryServer' )
134 Mul_1.SetComment( 'Mul from DataStreamFactory' )
135 Mul_1.Coords( 731 , 487 )
136 IMul_1x = Mul_1.GetInPort( 'x' )
137 IMul_1y = Mul_1.GetInPort( 'y' )
138 IMul_1Gate = Mul_1.GetInPort( 'Gate' )
139 OMul_1z = Mul_1.GetOutPort( 'z' )
140 OMul_1Gate = Mul_1.GetOutPort( 'Gate' )
141
142 Div_1 = GraphStreams.FNode( 'DataStreamFactory' , 'DataStreamFactory' , 'Div' )
143 Div_1.SetName( 'Div_1' )
144 Div_1.SetAuthor( '' )
145 Div_1.SetContainer( 'localhost/FactoryServer' )
146 Div_1.SetComment( 'Div from DataStreamFactory' )
147 Div_1.Coords( 931 , 385 )
148 IDiv_1x = Div_1.GetInPort( 'x' )
149 IDiv_1y = Div_1.GetInPort( 'y' )
150 IDiv_1Gate = Div_1.GetInPort( 'Gate' )
151 ODiv_1z = Div_1.GetOutPort( 'z' )
152 ODiv_1Gate = Div_1.GetOutPort( 'Gate' )
153 ODiv_1ostream = Div_1.GetOutStreamPort( 'ostream' )
154 ODiv_1ostream.SetNumberOfValues( 0 )
155
156 # Creation of Loop Nodes
157 PyLoop = []
158 PyLoop.append( 'import time ' )
159 PyLoop.append( 'def Init(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) :   ' )
160 PyLoop.append( '    if Min <= Max :   ' )
161 PyLoop.append( '        Index = Min   ' )
162 PyLoop.append( '    else :   ' )
163 PyLoop.append( '        Index = Max   ' )
164 PyLoop.append( '    time.sleep( 1 ) ' )
165 PyLoop.append( '    return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' )
166 PyMoreLoop = []
167 PyMoreLoop.append( 'import time ' )
168 PyMoreLoop.append( 'def More(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) :   ' )
169 PyMoreLoop.append( '    if Index < Max :   ' )
170 PyMoreLoop.append( '        DoLoop = 1   ' )
171 PyMoreLoop.append( '    else :   ' )
172 PyMoreLoop.append( '        DoLoop = 0   ' )
173 PyMoreLoop.append( '    time.sleep( 1 ) ' )
174 PyMoreLoop.append( '    return DoLoop,Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' )
175 PyNextLoop = []
176 PyNextLoop.append( 'import time ' )
177 PyNextLoop.append( 'def Next(Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub) :   ' )
178 PyNextLoop.append( '    Index = Index + Incr   ' )
179 PyNextLoop.append( '    time.sleep( 1 ) ' )
180 PyNextLoop.append( '    return Index,Min,Max,Incr,Z_Div,Z_Div_1,y_Add,x_Sub ' )
181 Loop,EndLoop = GraphStreams.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop )
182 EndLoop.SetName( 'EndLoop' )
183 EndLoop.SetAuthor( '' )
184 EndLoop.SetComment( '' )
185 EndLoop.Coords( 1158 , 393 )
186 PyEndLoop = []
187 EndLoop.SetPyFunction( 'EndInit' , PyEndLoop )
188 ILoopInitLoop = Loop.GetInPort( 'DoLoop' )
189 ILoopIndex = Loop.InPort( 'Index' , 'long' )
190 ILoopMin = Loop.InPort( 'Min' , 'long' )
191 ILoopMax = Loop.InPort( 'Max' , 'long' )
192 ILoopIncr = Loop.InPort( 'Incr' , 'long' )
193 ILoopz_Div = Loop.InPort( 'z_Div' , 'double' )
194 ILoopz_Div_1 = Loop.InPort( 'z_Div_1' , 'double' )
195 ILoopy_Add = Loop.InPort( 'y_Add' , 'double' )
196 ILoopx_Sub = Loop.InPort( 'x_Sub' , 'double' )
197 ILoopGate = Loop.GetInPort( 'Gate' )
198 OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
199 OLoopIndex = Loop.GetOutPort( 'Index' )
200 OLoopMin = Loop.GetOutPort( 'Min' )
201 OLoopMax = Loop.GetOutPort( 'Max' )
202 OLoopIncr = Loop.GetOutPort( 'Incr' )
203 OLoopz_Div = Loop.GetOutPort( 'z_Div' )
204 OLoopz_Div_1 = Loop.GetOutPort( 'z_Div_1' )
205 OLoopy_Add = Loop.GetOutPort( 'y_Add' )
206 OLoopx_Sub = Loop.GetOutPort( 'x_Sub' )
207 IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
208 IEndLoopIndex = EndLoop.GetInPort( 'Index' )
209 IEndLoopMin = EndLoop.GetInPort( 'Min' )
210 IEndLoopMax = EndLoop.GetInPort( 'Max' )
211 IEndLoopIncr = EndLoop.GetInPort( 'Incr' )
212 IEndLoopz_Div = EndLoop.GetInPort( 'z_Div' )
213 IEndLoopz_Div_1 = EndLoop.GetInPort( 'z_Div_1' )
214 IEndLoopy_Add = EndLoop.GetInPort( 'y_Add' )
215 IEndLoopx_Sub = EndLoop.GetInPort( 'x_Sub' )
216 IEndLoopGate = EndLoop.GetInPort( 'Gate' )
217 OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
218 OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
219 OEndLoopMin = EndLoop.GetOutPort( 'Min' )
220 OEndLoopMax = EndLoop.GetOutPort( 'Max' )
221 OEndLoopIncr = EndLoop.GetOutPort( 'Incr' )
222 OEndLoopz_Div = EndLoop.GetOutPort( 'z_Div' )
223 OEndLoopz_Div_1 = EndLoop.GetOutPort( 'z_Div_1' )
224 OEndLoopy_Add = EndLoop.GetOutPort( 'y_Add' )
225 OEndLoopx_Sub = EndLoop.GetOutPort( 'x_Sub' )
226 Loop.SetName( 'Loop' )
227 Loop.SetAuthor( '' )
228 Loop.SetComment( '' )
229 Loop.Coords( 5 , 391 )
230
231 # Creation of Links
232 LAddzSuby = GraphStreams.Link( OAddz , ISuby )
233 LAddzSuby.AddCoord( 1 , 448 , 143 )
234 LAddzSuby.AddCoord( 2 , 449 , 237 )
235
236 LAddzMuly = GraphStreams.Link( OAddz , IMuly )
237 LAddzMuly.AddCoord( 1 , 708 , 237 )
238 LAddzMuly.AddCoord( 2 , 708 , 270 )
239 LAddzMuly.AddCoord( 3 , 449 , 270 )
240 LAddzMuly.AddCoord( 4 , 448 , 238 )
241
242 LAddostreamSubistream = GraphStreams.StreamLink( OAddostream , ISubistream )
243 LAddostreamSubistream.AddCoord( 1 , 474 , 175 )
244 LAddostreamSubistream.AddCoord( 2 , 474 , 297 )
245
246 LAddOStreamSubIstream = GraphStreams.StreamLink( OAddOStream , ISubIstream )
247 LAddOStreamSubIstream.AddCoord( 1 , 497 , 207 )
248 LAddOStreamSubIstream.AddCoord( 2 , 498 , 328 )
249
250 LSubzMulx = GraphStreams.Link( OSubz , IMulx )
251 LSubzMulx.AddCoord( 1 , 706 , 207 )
252 LSubzMulx.AddCoord( 2 , 706 , 114 )
253
254 LSubzDivx = GraphStreams.Link( OSubz , IDivx )
255
256 LMulzDivy = GraphStreams.Link( OMulz , IDivy )
257 LMulzDivy.AddCoord( 1 , 912 , 143 )
258 LMulzDivy.AddCoord( 2 , 911 , 208 )
259
260 LDivzEndLoopz_Div = GraphStreams.Link( ODivz , IEndLoopz_Div )
261 LDivzEndLoopz_Div.AddCoord( 1 , 1147 , 537 )
262 LDivzEndLoopz_Div.AddCoord( 2 , 1148 , 113 )
263
264 LDivostreamAdd_1istream = GraphStreams.StreamLink( ODivostream , IAdd_1istream )
265 LDivostreamAdd_1istream.AddCoord( 1 , 233 , 626 )
266 LDivostreamAdd_1istream.AddCoord( 2 , 232 , 763 )
267 LDivostreamAdd_1istream.AddCoord( 3 , 1126 , 763 )
268 LDivostreamAdd_1istream.AddCoord( 4 , 1125 , 175 )
269
270 LAdd_1zSub_1y = GraphStreams.Link( OAdd_1z , ISub_1y )
271 LAdd_1zSub_1y.AddCoord( 1 , 445 , 478 )
272 LAdd_1zSub_1y.AddCoord( 2 , 444 , 566 )
273
274 LAdd_1zMul_1y = GraphStreams.Link( OAdd_1z , IMul_1y )
275 LAdd_1zMul_1y.AddCoord( 1 , 703 , 582 )
276 LAdd_1zMul_1y.AddCoord( 2 , 703 , 677 )
277 LAdd_1zMul_1y.AddCoord( 3 , 445 , 678 )
278 LAdd_1zMul_1y.AddCoord( 4 , 444 , 567 )
279
280 LAdd_1ostreamSub_1istream = GraphStreams.StreamLink( OAdd_1ostream , ISub_1istream )
281 LAdd_1ostreamSub_1istream.AddCoord( 1 , 473 , 511 )
282 LAdd_1ostreamSub_1istream.AddCoord( 2 , 473 , 627 )
283
284 LAdd_1OStreamSub_1Istream = GraphStreams.StreamLink( OAdd_1OStream , ISub_1Istream )
285 LAdd_1OStreamSub_1Istream.AddCoord( 1 , 498 , 543 )
286 LAdd_1OStreamSub_1Istream.AddCoord( 2 , 497 , 658 )
287
288 LSub_1zMul_1x = GraphStreams.Link( OSub_1z , IMul_1x )
289 LSub_1zMul_1x.AddCoord( 1 , 708 , 552 )
290 LSub_1zMul_1x.AddCoord( 2 , 707 , 450 )
291
292 LSub_1zDiv_1x = GraphStreams.Link( OSub_1z , IDiv_1x )
293
294 LMul_1zDiv_1y = GraphStreams.Link( OMul_1z , IDiv_1y )
295 LMul_1zDiv_1y.AddCoord( 1 , 913 , 479 )
296 LMul_1zDiv_1y.AddCoord( 2 , 913 , 551 )
297
298 LDiv_1zEndLoopz_Div_1 = GraphStreams.Link( ODiv_1z , IEndLoopz_Div_1 )
299 LDiv_1zEndLoopz_Div_1.AddCoord( 1 , 1138 , 567 )
300 LDiv_1zEndLoopz_Div_1.AddCoord( 2 , 1138 , 449 )
301
302 LDiv_1ostreamAddistream = GraphStreams.StreamLink( ODiv_1ostream , IAddistream )
303 LDiv_1ostreamAddistream.AddCoord( 1 , 229 , 297 )
304 LDiv_1ostreamAddistream.AddCoord( 2 , 229 , 426 )
305 LDiv_1ostreamAddistream.AddCoord( 3 , 475 , 425 )
306 LDiv_1ostreamAddistream.AddCoord( 4 , 475 , 352 )
307 LDiv_1ostreamAddistream.AddCoord( 5 , 1110 , 352 )
308 LDiv_1ostreamAddistream.AddCoord( 6 , 1111 , 512 )
309
310 LLoopIndexEndLoopIndex = GraphStreams.Link( OLoopIndex , IEndLoopIndex )
311
312 LLoopIndexAddx = GraphStreams.Link( OLoopIndex , IAddx )
313 LLoopIndexAddx.AddCoord( 1 , 201 , 236 )
314 LLoopIndexAddx.AddCoord( 2 , 202 , 420 )
315
316 LLoopIndexAdd_1x = GraphStreams.Link( OLoopIndex , IAdd_1x )
317 LLoopIndexAdd_1x.AddCoord( 1 , 201 , 562 )
318 LLoopIndexAdd_1x.AddCoord( 2 , 202 , 422 )
319
320 LLoopMinEndLoopMin = GraphStreams.Link( OLoopMin , IEndLoopMin )
321
322 LLoopMaxEndLoopMax = GraphStreams.Link( OLoopMax , IEndLoopMax )
323
324 LLoopIncrEndLoopIncr = GraphStreams.Link( OLoopIncr , IEndLoopIncr )
325
326 LLoopy_AddEndLoopy_Add = GraphStreams.Link( OLoopy_Add , IEndLoopy_Add )
327
328 LLoopy_AddAddy = GraphStreams.Link( OLoopy_Add , IAddy )
329 LLoopy_AddAddy.AddCoord( 1 , 183 , 266 )
330 LLoopy_AddAddy.AddCoord( 2 , 182 , 593 )
331
332 LLoopy_AddAdd_1y = GraphStreams.Link( OLoopy_Add , IAdd_1y )
333
334 LLoopx_SubEndLoopx_Sub = GraphStreams.Link( OLoopx_Sub , IEndLoopx_Sub )
335
336 LLoopx_SubSubx = GraphStreams.Link( OLoopx_Sub , ISubx )
337 LLoopx_SubSubx.AddCoord( 1 , 167 , 113 )
338 LLoopx_SubSubx.AddCoord( 2 , 167 , 625 )
339
340 LLoopx_SubSub_1x = GraphStreams.Link( OLoopx_Sub , ISub_1x )
341 LLoopx_SubSub_1x.AddCoord( 1 , 167 , 450 )
342 LLoopx_SubSub_1x.AddCoord( 2 , 168 , 624 )
343
344 # Input datas
345 ILoopIndex.Input( 0 )
346 ILoopMin.Input( 1 )
347 ILoopMax.Input( 10 )
348 ILoopIncr.Input( 1 )
349 ILoopz_Div.Input( 0 )
350 ILoopz_Div_1.Input( 0 )
351 ILoopy_Add.Input( 4.5 )
352 ILoopx_Sub.Input( 1.5 )
353
354 # Output Ports of the graph
355 #OLoopz_Div = Loop.GetOutPort( 'z_Div' )
356 #OLoopz_Div_1 = Loop.GetOutPort( 'z_Div_1' )
357 #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
358 #OEndLoopMin = EndLoop.GetOutPort( 'Min' )
359 #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
360 #OEndLoopIncr = EndLoop.GetOutPort( 'Incr' )
361 #OEndLoopz_Div = EndLoop.GetOutPort( 'z_Div' )
362 #OEndLoopz_Div_1 = EndLoop.GetOutPort( 'z_Div_1' )
363 #OEndLoopy_Add = EndLoop.GetOutPort( 'y_Add' )
364 #OEndLoopx_Sub = EndLoop.GetOutPort( 'x_Sub' )
365
366
367 GraphStreams.Run()
368 GraphStreams.DoneW()
369 GraphStreams.State()
370
371 GraphStreams.PrintPorts()
372
373 subgraphs = GraphStreams.SubGraphsNumber()
374 i = 1
375 while i <= subgraphs :
376     nodes = GraphStreams.SubGraphsNodes( i )
377     j = 0
378     while j < len(nodes) :
379         print 'SubGraph',i,nodes[j].Name()
380         j = j + 1
381     i = i + 1
382
383
384 substreamgraphs = GraphStreams.SubStreamGraphsNumber()
385 i = 1
386 while i <= substreamgraphs :
387     nodes = GraphStreams.SubStreamGraphsNodes( i )
388     j = 0
389     while j < len(nodes) :
390         print 'SubStreamGraph',i,nodes[j].Name()
391         j = j + 1
392     i = i + 1
393
394
395 GraphStreams.Export('/tmp/GraphStreams.xml')
396
397 GraphStreams = StreamGraph( '/tmp/GraphStreams.xml' )
398 GraphStreams.Run()
399 GraphStreams.DoneW()
400 GraphStreams.PrintPorts()
401 print GraphStreams.State()
402
403 GraphStreams.IsExecutable()
404
405 subgraphs = GraphStreams.SubGraphsNumber()
406 i = 1
407 while i <= subgraphs :
408     nodes = GraphStreams.SubGraphsNodes( i )
409     j = 0
410     while j < len(nodes) :
411         print 'SubGraph',i,nodes[j].Name()
412         j = j + 1
413     i = i + 1
414
415
416 substreamgraphs = GraphStreams.SubStreamGraphsNumber()
417 i = 1
418 while i <= substreamgraphs :
419     nodes = GraphStreams.SubStreamGraphsNodes( i )
420     j = 0
421     while j < len(nodes) :
422         print 'SubStreamGraph',i,nodes[j].Name()
423         j = j + 1
424     i = i + 1
425