1 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # Generated python file of Graph GraphBadOutputOfLoop2
26 # Graph creation of GraphBadOutputOfLoop2
27 def DefGraphBadOutputOfLoop2() :
28 GraphBadOutputOfLoop2 = Graph( 'GraphBadOutputOfLoop2' )
29 GraphBadOutputOfLoop2.SetName( 'GraphBadOutputOfLoop2' )
30 GraphBadOutputOfLoop2.SetAuthor( '' )
31 GraphBadOutputOfLoop2.SetComment( '' )
32 GraphBadOutputOfLoop2.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of InLine Nodes
38 PyIsOdd.append( 'from time import * ' )
39 PyIsOdd.append( 'def IsOdd(a) : ' )
40 PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
41 PyIsOdd.append( ' sleep( 1 ) ' )
42 PyIsOdd.append( ' return a ' )
43 IsOdd = GraphBadOutputOfLoop2.INode( 'IsOdd' , PyIsOdd )
44 IsOdd.SetName( 'IsOdd' )
46 IsOdd.SetComment( 'Python function' )
47 IsOdd.Coords( 397 , 1 )
48 IIsOdda = IsOdd.InPort( 'a' , 'long' )
49 IIsOddGate = IsOdd.GetInPort( 'Gate' )
50 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
51 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
53 PyBadOutputOfLoop = []
54 PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
55 PyBadOutputOfLoop.append( ' return 1 ' )
56 PyBadOutputOfLoop.append( '' )
57 BadOutputOfLoop = GraphBadOutputOfLoop2.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
58 BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
59 BadOutputOfLoop.SetAuthor( '' )
60 BadOutputOfLoop.SetComment( 'Compute Node' )
61 BadOutputOfLoop.Coords( 503 , 338 )
62 IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
63 IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
64 OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
66 # Creation of Loop Nodes
69 PyMoreInitLoop.append( '' )
71 PyNextInitLoop.append( '' )
72 InitLoop,EndOfInitLoop = GraphBadOutputOfLoop2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
73 EndOfInitLoop.SetName( 'EndOfInitLoop' )
74 EndOfInitLoop.SetAuthor( '' )
75 EndOfInitLoop.SetComment( 'Compute Node' )
76 EndOfInitLoop.Coords( 767 , 102 )
78 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
79 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
80 PyEndOfInitLoop.append( ' if Index <= Max : ' )
81 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
82 PyEndOfInitLoop.append( ' else : ' )
83 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
84 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
85 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
86 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
87 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
88 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
89 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
90 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
91 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
92 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
93 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
94 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
95 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
96 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
97 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
98 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
99 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
100 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
101 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
102 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
103 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
104 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
105 InitLoop.SetName( 'InitLoop' )
106 InitLoop.SetAuthor( '' )
107 InitLoop.SetComment( 'Compute Node' )
108 InitLoop.Coords( 10 , 108 )
110 # Creation of Switch Nodes
112 PySwitch.append( 'from time import * ' )
113 PySwitch.append( 'def Switch(a) : ' )
114 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
115 PySwitch.append( ' sleep(1) ' )
116 PySwitch.append( ' return a & 1,1-(a&1),a ' )
117 Switch,EndSwitch = GraphBadOutputOfLoop2.SNode( 'Switch' , PySwitch )
118 EndSwitch.SetName( 'EndSwitch' )
119 EndSwitch.SetAuthor( '' )
120 EndSwitch.SetComment( 'Compute Node' )
121 EndSwitch.Coords( 587 , 103 )
123 PyEndSwitch.append( 'def EndSwitch(a) : ' )
124 PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
125 PyEndSwitch.append( ' sleep(1) ' )
126 PyEndSwitch.append( ' return a ' )
127 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
128 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
129 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
130 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
131 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
132 Switch.SetName( 'Switch' )
133 Switch.SetAuthor( '' )
134 Switch.SetComment( 'Compute Node' )
135 Switch.Coords( 194 , 109 )
136 ISwitcha = Switch.InPort( 'a' , 'long' )
137 ISwitchGate = Switch.GetInPort( 'Gate' )
138 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
139 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
140 OSwitcha = Switch.OutPort( 'a' , 'int' )
141 OSwitchDefault = Switch.GetOutPort( 'Default' )
144 LIsOddaEndSwitcha = GraphBadOutputOfLoop2.Link( OIsOdda , IEndSwitcha )
146 LInitLoopIndexSwitcha = GraphBadOutputOfLoop2.Link( OInitLoopIndex , ISwitcha )
148 LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop2.Link( OInitLoopMin , IEndOfInitLoopMin )
150 LSwitchOddIsOddGate = GraphBadOutputOfLoop2.Link( OSwitchOdd , IIsOddGate )
152 LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop2.Link( OSwitchEven , IEndSwitchDefault )
154 LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop )
156 LSwitchaIsOdda = GraphBadOutputOfLoop2.Link( OSwitcha , IIsOdda )
158 LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex )
161 IInitLoopIndex.Input( 0 )
162 IInitLoopMin.Input( 0 )
163 IInitLoopMax.Input( 100 )
165 # Output Ports of the graph
166 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
167 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
168 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
169 return GraphBadOutputOfLoop2
172 GraphBadOutputOfLoop2 = DefGraphBadOutputOfLoop2()