2 # Generated python file of Graph GraphBadOutputOfLoop
6 # Graph creation of GraphBadOutputOfLoop
7 def DefGraphBadOutputOfLoop() :
8 GraphBadOutputOfLoop = Graph( 'GraphBadOutputOfLoop' )
9 GraphBadOutputOfLoop.SetName( 'GraphBadOutputOfLoop' )
10 GraphBadOutputOfLoop.SetAuthor( '' )
11 GraphBadOutputOfLoop.SetComment( '' )
12 GraphBadOutputOfLoop.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 PyIsOdd.append( 'from time import * ' )
19 PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
20 PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a ' )
23 IsOdd = GraphBadOutputOfLoop.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 397 , 1 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
30 IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
31 IIsOddGate = IsOdd.GetInPort( 'Gate' )
32 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
33 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
35 PyBadOutputOfLoop = []
36 PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
37 PyBadOutputOfLoop.append( ' return 1 ' )
38 PyBadOutputOfLoop.append( '' )
39 BadOutputOfLoop = GraphBadOutputOfLoop.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
40 BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
41 BadOutputOfLoop.SetAuthor( '' )
42 BadOutputOfLoop.SetComment( 'Compute Node' )
43 BadOutputOfLoop.Coords( 768 , 323 )
44 IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
45 IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
46 OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
48 # Creation of Loop Nodes
51 PyMoreInitLoop.append( '' )
53 PyNextInitLoop.append( '' )
54 InitLoop,EndOfInitLoop = GraphBadOutputOfLoop.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
55 EndOfInitLoop.SetName( 'EndOfInitLoop' )
56 EndOfInitLoop.SetAuthor( '' )
57 EndOfInitLoop.SetComment( 'Compute Node' )
58 EndOfInitLoop.Coords( 767 , 102 )
60 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
61 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
62 PyEndOfInitLoop.append( ' if Index <= Max : ' )
63 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
64 PyEndOfInitLoop.append( ' else : ' )
65 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
66 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
67 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
68 IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
69 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
70 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
71 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
72 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
73 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
74 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
75 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
76 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
77 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
78 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
79 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
80 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
81 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
82 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
83 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
84 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
85 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
86 InitLoop.SetName( 'InitLoop' )
87 InitLoop.SetAuthor( '' )
88 InitLoop.SetComment( 'Compute Node' )
89 InitLoop.Coords( 10 , 108 )
91 # Creation of Switch Nodes
93 PySwitch.append( 'from time import * ' )
94 PySwitch.append( 'def Switch(a) : ' )
95 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
96 PySwitch.append( ' sleep(1) ' )
97 PySwitch.append( ' return a & 1,1-(a&1),a ' )
98 Switch,EndSwitch = GraphBadOutputOfLoop.SNode( 'Switch' , PySwitch )
99 EndSwitch.SetName( 'EndSwitch' )
100 EndSwitch.SetAuthor( '' )
101 EndSwitch.SetComment( 'Compute Node' )
102 EndSwitch.Coords( 587 , 103 )
104 PyEndSwitch.append( 'def EndSwitch(a) : ' )
105 PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
106 PyEndSwitch.append( ' sleep(1) ' )
107 PyEndSwitch.append( ' return a ' )
108 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
109 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
110 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
111 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
112 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
113 Switch.SetName( 'Switch' )
114 Switch.SetAuthor( '' )
115 Switch.SetComment( 'Compute Node' )
116 Switch.Coords( 194 , 109 )
117 ISwitcha = Switch.InPort( 'a' , 'long' )
118 ISwitchGate = Switch.GetInPort( 'Gate' )
119 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
120 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
121 OSwitcha = Switch.OutPort( 'a' , 'int' )
122 OSwitchDefault = Switch.GetOutPort( 'Default' )
125 LIsOddaEndSwitcha = GraphBadOutputOfLoop.Link( OIsOdda , IEndSwitcha )
126 LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
127 LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
129 LInitLoopIndexSwitcha = GraphBadOutputOfLoop.Link( OInitLoopIndex , ISwitcha )
131 LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop.Link( OInitLoopMin , IEndOfInitLoopMin )
133 LSwitchOddIsOddGate = GraphBadOutputOfLoop.Link( OSwitchOdd , IIsOddGate )
135 LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop.Link( OSwitchEven , IEndSwitchDefault )
137 LSwitchEvenIsOddEven = GraphBadOutputOfLoop.Link( OSwitchEven , IIsOddEven )
138 LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
139 LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
141 LSwitchaIsOdda = GraphBadOutputOfLoop.Link( OSwitcha , IIsOdda )
142 LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
143 LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
145 LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop.Link( OEndSwitcha , IEndOfInitLoopIndex )
147 LEndSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop.Link( OEndSwitcha , IBadOutputOfLoopOutputOfLoop )
150 IIsOddInputInLoop.Input( 136306160 )
151 IInitLoopIndex.Input( 0 )
152 IInitLoopMin.Input( 0 )
153 IInitLoopMax.Input( 100 )
154 IEndOfInitLoopMax.Input( 136221856 )
156 # Output Ports of the graph
157 #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
158 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
159 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
160 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
161 return GraphBadOutputOfLoop
164 GraphBadOutputOfLoop = DefGraphBadOutputOfLoop()