1 # Copyright (C) 2007-2008 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 GraphObjRef
26 # Graph creation of GraphObjRef
27 def DefGraphObjRef() :
28 GraphObjRef = Graph( 'GraphObjRef' )
29 GraphObjRef.SetName( 'GraphObjRef' )
30 GraphObjRef.SetAuthor( '' )
31 GraphObjRef.SetComment( '' )
32 GraphObjRef.Coords( 0 , 0 )
34 # Creation of Factory Nodes
36 Addition = GraphObjRef.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
37 Addition.SetName( 'Addition' )
38 Addition.SetAuthor( '' )
39 Addition.SetContainer( 'localhost/AdditionServer' )
40 Addition.SetComment( 'Addition from AddComponent' )
41 Addition.Coords( 10 , 15 )
42 IAdditionGate = Addition.GetInPort( 'Gate' )
43 OAdditionAdder = Addition.GetOutPort( 'Adder' )
44 OAdditionGate = Addition.GetOutPort( 'Gate' )
46 # Creation of InLine Nodes
48 PySyrComponent.append( 'from LifeCycleCORBA import * ' )
49 PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' )
50 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
51 PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' )
52 PySyrComponent.append( ' print "SyrComponent orb",orb ' )
53 PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' )
54 PySyrComponent.append( ' print "SyrComponent lcc",lcc ' )
55 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
56 PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' )
57 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' )
58 PySyrComponent.append( ' return ComponentRef ' )
59 PySyrComponent.append( '' )
60 SyrComponent = GraphObjRef.INode( 'SyrComponent' , PySyrComponent )
61 SyrComponent.SetName( 'SyrComponent' )
62 SyrComponent.SetAuthor( '' )
63 SyrComponent.SetComment( 'Compute Node' )
64 SyrComponent.Coords( 26 , 209 )
65 ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' )
66 ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' )
67 ISyrComponentGate = SyrComponent.GetInPort( 'Gate' )
68 OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' )
69 OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' )
71 # Creation of Loop Nodes
73 PyInit.append( 'from time import * ' )
74 PyInit.append( 'def Init( Adder , anObjRef , Index ) : ' )
75 PyInit.append( ' sleep( 1 ) ' )
76 PyInit.append( ' return Adder,anObjRef,0 ' )
79 PyMoreInit.append( 'def More( Adder , anObjRef , Index ) : ' )
80 PyMoreInit.append( ' OutLoop = 0 ' )
81 PyMoreInit.append( ' if 10 > Index : ' )
82 PyMoreInit.append( ' OutLoop = 1 ' )
83 PyMoreInit.append( ' return OutLoop,Adder,anObjRef,Index ' )
84 PyMoreInit.append( ' ' )
86 PyNextInit.append( 'def Nextfori( Adder , anObjRef , Index ) : ' )
87 PyNextInit.append( ' Index = Index + 1 ' )
88 PyNextInit.append( ' return Adder,anObjRef,Index ' )
89 PyNextInit.append( ' ' )
90 Init,EndInit = GraphObjRef.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Nextfori' , PyNextInit )
91 EndInit.SetName( 'EndInit' )
92 EndInit.SetAuthor( '' )
93 EndInit.SetComment( 'Compute Node' )
94 EndInit.Coords( 449 , 165 )
96 EndInit.SetPyFunction( '' , PyEndInit )
97 IInitDoLoop = Init.GetInPort( 'DoLoop' )
98 IInitAddder = Init.InPort( 'Addder' , 'objref' )
99 IInitanObjRef = Init.InPort( 'anObjRef' , 'objref' )
100 IInitIndex = Init.InPort( 'Index' , 'long' )
101 IInitGate = Init.GetInPort( 'Gate' )
102 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
103 OInitAddder = Init.GetOutPort( 'Addder' )
104 OInitanObjRef = Init.GetOutPort( 'anObjRef' )
105 OInitIndex = Init.GetOutPort( 'Index' )
106 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
107 IEndInitAddder = EndInit.GetInPort( 'Addder' )
108 IEndInitanObjRef = EndInit.GetInPort( 'anObjRef' )
109 IEndInitIndex = EndInit.GetInPort( 'Index' )
110 IEndInitGate = EndInit.GetInPort( 'Gate' )
111 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
112 OEndInitAddder = EndInit.GetOutPort( 'Addder' )
113 OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' )
114 OEndInitIndex = EndInit.GetOutPort( 'Index' )
115 OEndInitGate = EndInit.GetOutPort( 'Gate' )
116 Init.SetName( 'Init' )
118 Init.SetComment( 'Compute Node' )
119 Init.Coords( 236 , 161 )
122 LAdditionAdderInitAddder = GraphObjRef.Link( OAdditionAdder , IInitAddder )
123 LAdditionAdderInitAddder.AddCoord( 1 , 202 , 194 )
124 LAdditionAdderInitAddder.AddCoord( 2 , 201 , 95 )
126 LSyrComponentanObjRefInitanObjRef = GraphObjRef.Link( OSyrComponentanObjRef , IInitanObjRef )
127 LSyrComponentanObjRefInitanObjRef.AddCoord( 1 , 209 , 224 )
128 LSyrComponentanObjRefInitanObjRef.AddCoord( 2 , 208 , 289 )
130 LInitAddderEndInitAddder = GraphObjRef.Link( OInitAddder , IEndInitAddder )
132 LInitanObjRefEndInitanObjRef = GraphObjRef.Link( OInitanObjRef , IEndInitanObjRef )
134 LInitIndexEndInitIndex = GraphObjRef.Link( OInitIndex , IEndInitIndex )
137 ISyrComponentaContainer.Input( 'FactoryServer' )
138 ISyrComponentaComponent.Input( 'SyrComponent' )
139 IInitIndex.Input( 0 )
141 # Output Ports of the graph
142 #OEndInitAddder = EndInit.GetOutPort( 'Addder' )
143 #OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' )
144 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
148 GraphObjRef = DefGraphObjRef()