1 # Copyright (C) 2007-2015 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, or (at your option) any later version.
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
23 # Generated python file of Graph GraphSwitchBugDefault
27 # Graph creation of GraphSwitchBugDefault
28 def DefGraphSwitchBugDefault() :
29 GraphSwitchBugDefault = Graph( 'GraphSwitchBugDefault' )
30 GraphSwitchBugDefault.SetName( 'GraphSwitchBugDefault' )
31 GraphSwitchBugDefault.SetAuthor( 'JR' )
32 GraphSwitchBugDefault.SetComment( '' )
33 GraphSwitchBugDefault.Coords( 0 , 0 )
35 # Creation of Factory Nodes
37 # Creation of InLine Nodes
39 PyIsOdd.append( 'from time import * ' )
40 PyIsOdd.append( 'def IsOdd(a) : ' )
41 PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
42 PyIsOdd.append( ' sleep( 1 ) ' )
43 PyIsOdd.append( ' return a ' )
44 IsOdd = GraphSwitchBugDefault.INode( 'IsOdd' , PyIsOdd )
45 IsOdd.SetName( 'IsOdd' )
47 IsOdd.SetComment( 'Python function' )
48 IsOdd.Coords( 389 , 65 )
49 IIsOdda = IsOdd.InPort( 'a' , 'long' )
50 IIsOddGate = IsOdd.GetInPort( 'Gate' )
51 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
52 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
54 # Creation of Loop Nodes
56 PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
57 PyInitLoopSwitch.append( ' Index = Min ' )
58 PyInitLoopSwitch.append( ' return Index,Min,Max ' )
59 PyMoreInitLoopSwitch = []
60 PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
61 PyMoreInitLoopSwitch.append( ' if Index <= Max : ' )
62 PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
63 PyMoreInitLoopSwitch.append( ' else : ' )
64 PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
65 PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
66 PyNextInitLoopSwitch = []
67 PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
68 PyNextInitLoopSwitch.append( ' Index = Index + 1 ' )
69 PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
70 InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchBugDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
71 EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
72 EndOfInitLoopSwitch.SetAuthor( '' )
73 EndOfInitLoopSwitch.SetComment( 'Compute Node' )
74 EndOfInitLoopSwitch.Coords( 772 , 132 )
75 PyEndOfInitLoopSwitch = []
76 EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
77 IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
78 IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
79 IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
80 IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
81 IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
82 OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
83 OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
84 OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
85 OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
86 IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
87 IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
88 IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
89 IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
90 IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
91 OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
92 OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
93 OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
94 OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
95 OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
96 InitLoopSwitch.SetName( 'InitLoopSwitch' )
97 InitLoopSwitch.SetAuthor( '' )
98 InitLoopSwitch.SetComment( 'Compute Node' )
99 InitLoopSwitch.Coords( 10 , 129 )
101 # Creation of Switch Nodes
103 PySwitch.append( 'from time import * ' )
104 PySwitch.append( 'def Switch(a) : ' )
105 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
106 PySwitch.append( ' sleep(1) ' )
107 PySwitch.append( ' return a & 1,1-(a&1),a,a ' )
108 Switch,EndOfSwitch = GraphSwitchBugDefault.SNode( 'Switch' , PySwitch )
109 EndOfSwitch.SetName( 'EndOfSwitch' )
110 EndOfSwitch.SetAuthor( '' )
111 EndOfSwitch.SetComment( 'Compute Node' )
112 EndOfSwitch.Coords( 581 , 132 )
114 PyEndOfSwitch.append( 'def EndOfSwitch(a,Even,k) : ' )
115 PyEndOfSwitch.append( ' return a ' )
116 EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
117 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
118 IEndOfSwitchEven = EndOfSwitch.InPort( 'Even' , 'long' )
119 IEndOfSwitchk = EndOfSwitch.InPort( 'k' , 'long' )
120 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
121 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
122 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
123 Switch.SetName( 'Switch' )
124 Switch.SetAuthor( '' )
125 Switch.SetComment( 'Compute Node' )
126 Switch.Coords( 194 , 129 )
127 ISwitcha = Switch.InPort( 'a' , 'long' )
128 ISwitchGate = Switch.GetInPort( 'Gate' )
129 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
130 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
131 OSwitcha = Switch.OutPort( 'a' , 'int' )
132 OSwitchn = Switch.OutPort( 'n' , 'int' )
133 OSwitchDefault = Switch.GetOutPort( 'Default' )
136 LIsOddaEndOfSwitcha = GraphSwitchBugDefault.Link( OIsOdda , IEndOfSwitcha )
138 LInitLoopSwitchIndexSwitcha = GraphSwitchBugDefault.Link( OInitLoopSwitchIndex , ISwitcha )
140 LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchBugDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
142 LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchBugDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
144 LSwitchOddIsOddGate = GraphSwitchBugDefault.Link( OSwitchOdd , IIsOddGate )
146 LSwitchaIsOdda = GraphSwitchBugDefault.Link( OSwitcha , IIsOdda )
148 LSwitchnEndOfSwitchk = GraphSwitchBugDefault.Link( OSwitchn , IEndOfSwitchk )
150 LSwitchDefaultEndOfSwitchDefault = GraphSwitchBugDefault.Link( OSwitchDefault , IEndOfSwitchDefault )
152 LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchBugDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
155 IInitLoopSwitchIndex.Input( 0 )
156 IInitLoopSwitchMin.Input( 1 )
157 IInitLoopSwitchMax.Input( 20 )
159 # Input Ports of the graph
160 #IEndOfSwitchEven = EndOfSwitch.GetInPort( 'Even' )
162 # Output Ports of the graph
163 #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
164 #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
165 #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
166 #OSwitchEven = Switch.GetOutPort( 'Even' )
167 return GraphSwitchBugDefault
170 GraphSwitchBugDefault = DefGraphSwitchBugDefault()