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 GraphLoop1
26 # Graph creation of GraphLoop1
28 GraphLoop1 = Graph( 'GraphLoop1' )
29 GraphLoop1.SetName( 'GraphLoop1' )
30 GraphLoop1.SetAuthor( '' )
31 GraphLoop1.SetComment( '' )
32 GraphLoop1.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 # Creation of InLine Nodes
38 NodeIndex = GraphLoop1.INode( '' , PyNodeIndex )
39 NodeIndex.SetName( 'NodeIndex' )
40 NodeIndex.SetAuthor( '' )
41 NodeIndex.SetComment( 'Compute Node' )
42 NodeIndex.Coords( 281 , 215 )
43 INodeIndexIndex = NodeIndex.InPort( 'Index' , 'long' )
44 INodeIndexGate = NodeIndex.GetInPort( 'Gate' )
45 ONodeIndexIndex = NodeIndex.OutPort( 'Index' , 'long' )
46 ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' )
49 NodeIncr = GraphLoop1.INode( '' , PyNodeIncr )
50 NodeIncr.SetName( 'NodeIncr' )
51 NodeIncr.SetAuthor( '' )
52 NodeIncr.SetComment( 'Compute Node' )
53 NodeIncr.Coords( 278 , 372 )
54 INodeIncrIncr = NodeIncr.InPort( 'Incr' , 'long' )
55 INodeIncrGate = NodeIncr.GetInPort( 'Gate' )
56 ONodeIncrIncr = NodeIncr.OutPort( 'Incr' , 'long' )
57 ONodeIncrGate = NodeIncr.GetOutPort( 'Gate' )
59 # Creation of Loop Nodes
61 PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
62 PyInit.append( ' if Min <= Max : ' )
63 PyInit.append( ' Index = Min ' )
64 PyInit.append( ' else : ' )
65 PyInit.append( ' Index = Max ' )
66 PyInit.append( ' return Index,Min,Max,Incr ' )
68 PyMoreInit.append( 'import time ' )
69 PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
70 PyMoreInit.append( ' time.sleep(2) ' )
71 PyMoreInit.append( ' if Index < Max : ' )
72 PyMoreInit.append( ' DoLoop = 1 ' )
73 PyMoreInit.append( ' else : ' )
74 PyMoreInit.append( ' DoLoop = 0 ' )
75 PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
77 PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
78 PyNextInit.append( ' Index = Index + Incr ' )
79 PyNextInit.append( ' return Index,Min,Max,Incr ' )
80 Init,EndInit = GraphLoop1.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
81 EndInit.SetName( 'EndInit' )
82 EndInit.SetAuthor( '' )
83 EndInit.SetComment( 'Compute Node' )
84 EndInit.Coords( 555 , 255 )
86 EndInit.SetPyFunction( '' , PyEndInit )
87 IInitDoLoop = Init.GetInPort( 'DoLoop' )
88 IInitIndex = Init.InPort( 'Index' , 'long' )
89 IInitMin = Init.InPort( 'Min' , 'long' )
90 IInitMax = Init.InPort( 'Max' , 'long' )
91 IInitIncr = Init.InPort( 'Incr' , 'long' )
92 IInitGate = Init.GetInPort( 'Gate' )
93 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
94 OInitIndex = Init.GetOutPort( 'Index' )
95 OInitMin = Init.GetOutPort( 'Min' )
96 OInitMax = Init.GetOutPort( 'Max' )
97 OInitIncr = Init.GetOutPort( 'Incr' )
98 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
99 IEndInitIndex = EndInit.GetInPort( 'Index' )
100 IEndInitMin = EndInit.GetInPort( 'Min' )
101 IEndInitMax = EndInit.GetInPort( 'Max' )
102 IEndInitIncr = EndInit.GetInPort( 'Incr' )
103 IEndInitGate = EndInit.GetInPort( 'Gate' )
104 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
105 OEndInitIndex = EndInit.GetOutPort( 'Index' )
106 OEndInitMin = EndInit.GetOutPort( 'Min' )
107 OEndInitMax = EndInit.GetOutPort( 'Max' )
108 OEndInitIncr = EndInit.GetOutPort( 'Incr' )
109 OEndInitGate = EndInit.GetOutPort( 'Gate' )
110 Init.SetName( 'Init' )
112 Init.SetComment( 'Compute Node' )
113 Init.Coords( 17 , 257 )
116 LInitIndexNodeIndexIndex = GraphLoop1.Link( OInitIndex , INodeIndexIndex )
118 LInitMinEndInitMin = GraphLoop1.Link( OInitMin , IEndInitMin )
120 LInitMaxEndInitMax = GraphLoop1.Link( OInitMax , IEndInitMax )
122 LInitIncrNodeIncrIncr = GraphLoop1.Link( OInitIncr , INodeIncrIncr )
124 LNodeIndexIndexEndInitIndex = GraphLoop1.Link( ONodeIndexIndex , IEndInitIndex )
126 LNodeIncrIncrEndInitIncr = GraphLoop1.Link( ONodeIncrIncr , IEndInitIncr )
129 IInitIndex.Input( 0 )
134 # Output Ports of the graph
135 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
136 #OEndInitMin = EndInit.GetOutPort( 'Min' )
137 #OEndInitMax = EndInit.GetOutPort( 'Max' )
138 #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
142 GraphLoop1 = DefGraphLoop1()