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 GraphBadInputInLoop3
26 # Graph creation of GraphBadInputInLoop3
27 def DefGraphBadInputInLoop3() :
28 GraphBadInputInLoop3 = Graph( 'GraphBadInputInLoop3' )
29 GraphBadInputInLoop3.SetName( 'GraphBadInputInLoop3' )
30 GraphBadInputInLoop3.SetAuthor( '' )
31 GraphBadInputInLoop3.SetComment( '' )
32 GraphBadInputInLoop3.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,InputInLoop) : ' )
40 PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
41 PyIsOdd.append( ' sleep( 1 ) ' )
42 PyIsOdd.append( ' return a ' )
43 IsOdd = GraphBadInputInLoop3.INode( 'IsOdd' , PyIsOdd )
44 IsOdd.SetName( 'IsOdd' )
46 IsOdd.SetComment( 'Python function' )
47 IsOdd.Coords( 397 , 1 )
48 IIsOdda = IsOdd.InPort( 'a' , 'long' )
49 IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
50 IIsOddGate = IsOdd.GetInPort( 'Gate' )
51 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
52 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
55 PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
56 PyBadInputOfLoop.append( ' return 1 ' )
57 PyBadInputOfLoop.append( '' )
58 BadInputOfLoop = GraphBadInputInLoop3.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
59 BadInputOfLoop.SetName( 'BadInputOfLoop' )
60 BadInputOfLoop.SetAuthor( '' )
61 BadInputOfLoop.SetComment( 'Compute Node' )
62 BadInputOfLoop.Coords( 359 , 318 )
63 IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
64 OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
65 OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
67 # Creation of Loop Nodes
70 PyMoreInitLoop.append( '' )
72 PyNextInitLoop.append( '' )
73 InitLoop,EndOfInitLoop = GraphBadInputInLoop3.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
74 EndOfInitLoop.SetName( 'EndOfInitLoop' )
75 EndOfInitLoop.SetAuthor( '' )
76 EndOfInitLoop.SetComment( 'Compute Node' )
77 EndOfInitLoop.Coords( 767 , 102 )
79 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
80 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
81 PyEndOfInitLoop.append( ' if Index <= Max : ' )
82 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
83 PyEndOfInitLoop.append( ' else : ' )
84 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
85 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
86 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
87 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
88 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
89 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
90 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
91 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
92 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
93 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
94 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
95 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
96 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
97 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
98 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
99 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
100 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
101 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
102 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
103 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
104 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
105 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
106 InitLoop.SetName( 'InitLoop' )
107 InitLoop.SetAuthor( '' )
108 InitLoop.SetComment( 'Compute Node' )
109 InitLoop.Coords( 10 , 108 )
111 # Creation of Switch Nodes
113 PySwitch.append( 'from time import * ' )
114 PySwitch.append( 'def Switch(a) : ' )
115 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
116 PySwitch.append( ' sleep(1) ' )
117 PySwitch.append( ' return a & 1,1-(a&1),a ' )
118 Switch,EndSwitch = GraphBadInputInLoop3.SNode( 'Switch' , PySwitch )
119 EndSwitch.SetName( 'EndSwitch' )
120 EndSwitch.SetAuthor( '' )
121 EndSwitch.SetComment( 'Compute Node' )
122 EndSwitch.Coords( 587 , 103 )
124 PyEndSwitch.append( 'def EndSwitch(a) : ' )
125 PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
126 PyEndSwitch.append( ' sleep(1) ' )
127 PyEndSwitch.append( ' return a ' )
128 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
129 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
130 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
131 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
132 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
133 Switch.SetName( 'Switch' )
134 Switch.SetAuthor( '' )
135 Switch.SetComment( 'Compute Node' )
136 Switch.Coords( 194 , 109 )
137 ISwitcha = Switch.InPort( 'a' , 'long' )
138 ISwitchGate = Switch.GetInPort( 'Gate' )
139 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
140 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
141 OSwitcha = Switch.OutPort( 'a' , 'int' )
142 OSwitchDefault = Switch.GetOutPort( 'Default' )
145 LIsOddaEndSwitcha = GraphBadInputInLoop3.Link( OIsOdda , IEndSwitcha )
147 LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha )
149 LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop3.Link( OInitLoopMin , IEndOfInitLoopMin )
151 LSwitchOddIsOddGate = GraphBadInputInLoop3.Link( OSwitchOdd , IIsOddGate )
153 LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault )
155 LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda )
157 LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex )
159 LBadInputOfLoopGateEndOfInitLoopGate = GraphBadInputInLoop3.Link( OBadInputOfLoopGate , IEndOfInitLoopGate )
162 IInitLoopIndex.Input( 0 )
163 IInitLoopMin.Input( 0 )
164 IInitLoopMax.Input( 100 )
166 # Input Ports of the graph
167 #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' )
169 # Output Ports of the graph
170 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
171 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
172 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
173 #OBadInputOfLoopInputInLoop = BadInputOfLoop.GetOutPort( 'InputInLoop' )
174 return GraphBadInputInLoop3
177 GraphBadInputInLoop3 = DefGraphBadInputInLoop3()