Salome HOME
Copyrights update 2015.
[samples/datafiles.git] / Superv / Python / GraphTestMacroNodes.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 from SuperV import *
23
24 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/GraphEssai.xml'
25 GraphMacroNodes = Graph( anXmlFile )
26
27 GraphMacroNodes.PrintLinks()
28
29 GraphMacroNodes.SetName('GraphMacroNodes')
30
31 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/SyrStruct.xml'
32 Macro_SyrStruct = GraphMacroNodes.MNode( anXmlFile )
33
34 Macro_SyrStruct.PrintPorts()
35
36 GraphMacroNodes.PrintPorts()
37
38 GraphMacroNodes.PrintLinks()
39
40 GraphMacroNodes.Print()
41
42 Macro_SyrStruct.Print()
43
44 exec GraphMacroNodes.ListNodes('GraphMacroNodes')
45
46 Macro_SyrStruct.Print()
47
48 Macro_SyrStruct.IsMacro()
49 Macro_SyrStruct.IsFlowMacro()
50 Macro_SyrStruct.IsStreamMacro()
51
52 SyrStruct = Macro_SyrStruct.FlowObjRef()
53
54 SyrStruct.Print()
55
56 SyrStruct.PrintPorts()
57
58 SyrStruct.PrintLinks()
59
60 SyrStruct.IsValid()
61 SyrStruct.IsExecutable()
62
63 exec SyrStruct.ListNodes('SyrStruct')
64
65 m3incr.Print()
66
67 m3incr.PrintPorts()
68
69 m3incr.PrintLinks()
70
71 EndOffori.Print()
72
73 EndOffori.PrintPorts()
74
75 EndOffori.PrintLinks()
76
77 EndOfwhileEven.Print()
78
79 EndOfwhileEven.PrintPorts()
80
81 EndOfwhileEven.PrintLinks()
82
83 MSyrStruct = SyrStruct.FlowObjRef()
84
85 MSyrStruct.Print()
86
87 MSyrStruct.PrintPorts()
88
89 GraphMacroNodes.IsValid()
90 GraphMacroNodes.IsExecutable()
91
92 GraphMacroNodes.PrintPorts()
93
94 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/SyrStruct.xml'
95 Macro_SyrStruct_1 = GraphMacroNodes.MNode( anXmlFile )
96
97 Macro_SyrStruct_1.Print()
98
99 Macro_SyrStruct_1.IsMacro()
100 Macro_SyrStruct_1.IsFlowMacro()
101 Macro_SyrStruct_1.IsStreamMacro()
102
103 SyrStruct_1 = Macro_SyrStruct_1.FlowObjRef()
104
105 SyrStruct_1.Print()
106
107 GraphMacroNodes.IsValid()
108 GraphMacroNodes.IsExecutable()
109
110 GraphMacroNodes.PrintPorts()
111
112 MSyrStruct_1 = SyrStruct_1.FlowObjRef()
113
114 MSyrStruct_1.Print()
115
116 MSyrStruct_1.PrintPorts()
117
118
119 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/GraphMacroNodes.xml'
120 GraphMacroNodes.Export( anXmlFile )
121
122 SyrStruct.Name()
123 SyrStruct_1.Name()
124
125 GraphMacroNodes.Run()
126
127 GraphMacroNodes.DoneW()
128
129 GraphMacroNodes.State()
130
131 Macro_SyrStruct.State()
132
133 Macro_SyrStruct_1.State()
134
135
136
137
138
139 from SuperV import *
140
141 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/GraphMacroNodes.xml'
142 GraphMacroNodes = Graph( anXmlFile )
143
144 GraphMacroNodes.Name()
145
146 GraphMacroNodes.Export( '/tmp/GraphMacroNodes.xml' )
147
148 exec GraphMacroNodes.ListNodes('GraphMacroNodes')
149
150 GraphMacroNodes.PrintPorts()
151
152 GraphMacroNodes.PrintLinks()
153
154 Macro_SyrStruct.IsMacro()
155 Macro_SyrStruct.IsFlowMacro()
156 Macro_SyrStruct.IsStreamMacro()
157
158 Macro_SyrStruct.Print()
159
160 SyrStruct = Macro_SyrStruct.FlowObjRef()
161
162 SyrStruct.Print()
163
164 SyrStruct.PrintPorts()
165
166 SyrStruct.PrintLinks()
167
168 exec SyrStruct.ListNodes('SyrStruct')
169
170 Macro_SyrStruct.IsMacro()
171 Macro_SyrStruct.IsFlowMacro()
172 Macro_SyrStruct.IsStreamMacro()
173
174 Macro_SyrStruct.IsValid()
175
176 Macro_SyrStruct.IsExecutable()
177
178 Macro_SyrStruct_1.Print()
179
180 SyrStruct_1 = Macro_SyrStruct_1.FlowObjRef()
181
182 SyrStruct_1.Print()
183
184 SyrStruct_1.PrintPorts()
185
186 SyrStruct_1.PrintLinks()
187
188 exec SyrStruct_1.ListNodes('SyrStruct_1')
189
190 MSyrStruct = SyrStruct.FlowObjRef()
191
192 MSyrStruct.Print()
193
194 MSyrStruct_1 = SyrStruct_1.FlowObjRef()
195
196 MSyrStruct_1.Print()
197
198 GraphMacroNodes.Run()
199
200 GraphMacroNodes.DoneW()
201
202 GraphMacroNodes.State()
203
204 Macro_SyrStruct.State()
205
206 Macro_SyrStruct_1.State()
207
208
209
210
211 from SuperV import *
212
213 from GraphMacroNodes import *
214
215 GraphMacroNodes.IsExecutable()
216
217 GraphMacroNodes.Run()
218
219 exec GraphMacroNodes.ListNodes('GraphMacroNodes')
220
221 SyrStruct = Macro_SyrStruct.FlowObjRef()
222
223 SyrStruct.IsExecutable()
224
225 GraphMacroNodes.DoneW()
226
227 GraphMacroNodes.State()
228
229 Macro_SyrStruct.State()
230
231 Macro_SyrStruct_1.State()
232
233 SyrStruct = Macro_SyrStruct.FlowObjRef()
234
235 exec SyrStruct.ListNodes('SyrStruct')
236
237 EndOfforN.State()
238
239 SyrStruct.DoneW()
240
241 SyrStruct.State()
242
243 SyrStruct_1 = Macro_SyrStruct_1.FlowObjRef()
244
245 exec SyrStruct_1.ListNodes('SyrStruct')
246
247 EndOfforN.State()
248
249 SyrStruct_1.DoneW()
250
251 SyrStruct_1.State()
252
253 SyrStruct.PrintPorts()
254
255 Macro_SyrStruct.PrintPorts()
256
257 GraphMacroNodes.PrintPorts()
258
259 GraphMacroNodes.Run()
260
261 GraphMacroNodes.DoneW()
262
263 GraphMacroNodes.State()
264
265 Macro_SyrStruct.State()
266
267 Macro_SyrStruct_1.State()
268
269
270
271
272 SyrStruct.Export('/tmp/SubSyrStruct.xml')
273
274
275 SubSyrStruct = Graph('/tmp/SubSyrStruct.xml')
276
277 SubSyrStruct.IsValid()
278
279 SubSyrStruct.IsExecutable()
280
281 SubSyrStruct.Run()
282
283 SubSyrStruct.DoneW()
284
285 SubSyrStruct.State()
286
287 SubSyrStruct.PrintPorts()
288
289
290
291
292
293 from SuperV import *
294
295 from GraphMacroNodes import *
296
297 exec GraphMacroNodes.ListNodes('GraphMacroNodes')
298
299 SyrStruct = Macro_SyrStruct.FlowObjRef()
300
301 exec SyrStruct.ListNodes('SyrStruct')
302
303 Unused = SyrComponent.InPort('Unused','long')
304
305 SyrComponent.PrintPorts()
306
307 SyrComponent.Print()
308
309 SyrStruct.IsValid()
310
311 SyrStruct.PrintPorts()
312
313 Macro_SyrStruct.PrintPorts()
314
315 GraphMacroNodes.PrintPorts()
316
317 Unused.Destroy()
318
319 GraphMacroNodes.PrintPorts()
320
321 Macro_SyrStruct.PrintPorts()
322
323 SyrStruct.PrintPorts()
324
325 GraphMacroNodes.Run()
326
327 GraphMacroNodes.DoneW()
328
329 GraphMacroNodes.State()
330
331 Macro_SyrStruct.State()
332
333 Macro_SyrStruct_1.State()