2 # Generated python file of Graph GraphObjRef
6 # Graph creation of GraphObjRef
8 GraphObjRef = Graph( 'GraphObjRef' )
9 GraphObjRef.SetName( 'GraphObjRef' )
10 GraphObjRef.SetAuthor( '' )
11 GraphObjRef.SetComment( '' )
12 GraphObjRef.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 Addition = GraphObjRef.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
17 Addition.SetName( 'Addition' )
18 Addition.SetAuthor( '' )
19 Addition.SetContainer( 'localhost/AdditionServer' )
20 Addition.SetComment( 'Addition from AddComponent' )
21 Addition.Coords( 10 , 15 )
22 IAdditionGate = Addition.GetInPort( 'Gate' )
23 OAdditionAdder = Addition.GetOutPort( 'Adder' )
24 OAdditionGate = Addition.GetOutPort( 'Gate' )
26 # Creation of InLine Nodes
28 PySyrComponent.append( 'from LifeCycleCORBA import * ' )
29 PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' )
30 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
31 PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' )
32 PySyrComponent.append( ' print "SyrComponent orb",orb ' )
33 PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' )
34 PySyrComponent.append( ' print "SyrComponent lcc",lcc ' )
35 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
36 PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' )
37 PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' )
38 PySyrComponent.append( ' return ComponentRef ' )
39 PySyrComponent.append( '' )
40 SyrComponent = GraphObjRef.INode( 'SyrComponent' , PySyrComponent )
41 SyrComponent.SetName( 'SyrComponent' )
42 SyrComponent.SetAuthor( '' )
43 SyrComponent.SetComment( 'Compute Node' )
44 SyrComponent.Coords( 26 , 209 )
45 ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' )
46 ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' )
47 ISyrComponentGate = SyrComponent.GetInPort( 'Gate' )
48 OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' )
49 OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' )
51 # Creation of Loop Nodes
53 PyInit.append( 'from time import * ' )
54 PyInit.append( 'def Init( Adder , anObjRef , Index ) : ' )
55 PyInit.append( ' sleep( 1 ) ' )
56 PyInit.append( ' return Adder,anObjRef,0 ' )
59 PyMoreInit.append( 'def More( Adder , anObjRef , Index ) : ' )
60 PyMoreInit.append( ' OutLoop = 0 ' )
61 PyMoreInit.append( ' if 10 > Index : ' )
62 PyMoreInit.append( ' OutLoop = 1 ' )
63 PyMoreInit.append( ' return OutLoop,Adder,anObjRef,Index ' )
64 PyMoreInit.append( ' ' )
66 PyNextInit.append( 'def Nextfori( Adder , anObjRef , Index ) : ' )
67 PyNextInit.append( ' Index = Index + 1 ' )
68 PyNextInit.append( ' return Adder,anObjRef,Index ' )
69 PyNextInit.append( ' ' )
70 Init,EndInit = GraphObjRef.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Nextfori' , PyNextInit )
71 EndInit.SetName( 'EndInit' )
72 EndInit.SetAuthor( '' )
73 EndInit.SetComment( 'Compute Node' )
74 EndInit.Coords( 449 , 165 )
76 EndInit.SetPyFunction( '' , PyEndInit )
77 IInitDoLoop = Init.GetInPort( 'DoLoop' )
78 IInitAddder = Init.InPort( 'Addder' , 'objref' )
79 IInitanObjRef = Init.InPort( 'anObjRef' , 'objref' )
80 IInitIndex = Init.InPort( 'Index' , 'long' )
81 IInitGate = Init.GetInPort( 'Gate' )
82 OInitDoLoop = Init.GetOutPort( 'DoLoop' )
83 OInitAddder = Init.GetOutPort( 'Addder' )
84 OInitanObjRef = Init.GetOutPort( 'anObjRef' )
85 OInitIndex = Init.GetOutPort( 'Index' )
86 IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
87 IEndInitAddder = EndInit.GetInPort( 'Addder' )
88 IEndInitanObjRef = EndInit.GetInPort( 'anObjRef' )
89 IEndInitIndex = EndInit.GetInPort( 'Index' )
90 IEndInitGate = EndInit.GetInPort( 'Gate' )
91 OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
92 OEndInitAddder = EndInit.GetOutPort( 'Addder' )
93 OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' )
94 OEndInitIndex = EndInit.GetOutPort( 'Index' )
95 OEndInitGate = EndInit.GetOutPort( 'Gate' )
96 Init.SetName( 'Init' )
98 Init.SetComment( 'Compute Node' )
99 Init.Coords( 236 , 161 )
102 LAdditionAdderInitAddder = GraphObjRef.Link( OAdditionAdder , IInitAddder )
103 LAdditionAdderInitAddder.AddCoord( 1 , 202 , 194 )
104 LAdditionAdderInitAddder.AddCoord( 2 , 201 , 95 )
106 LSyrComponentanObjRefInitanObjRef = GraphObjRef.Link( OSyrComponentanObjRef , IInitanObjRef )
107 LSyrComponentanObjRefInitanObjRef.AddCoord( 1 , 209 , 224 )
108 LSyrComponentanObjRefInitanObjRef.AddCoord( 2 , 208 , 289 )
110 LInitAddderEndInitAddder = GraphObjRef.Link( OInitAddder , IEndInitAddder )
112 LInitanObjRefEndInitanObjRef = GraphObjRef.Link( OInitanObjRef , IEndInitanObjRef )
114 LInitIndexEndInitIndex = GraphObjRef.Link( OInitIndex , IEndInitIndex )
117 ISyrComponentaContainer.Input( 'FactoryServer' )
118 ISyrComponentaComponent.Input( 'SyrComponent' )
119 IInitIndex.Input( 0 )
121 # Output Ports of the graph
122 #OEndInitAddder = EndInit.GetOutPort( 'Addder' )
123 #OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' )
124 #OEndInitIndex = EndInit.GetOutPort( 'Index' )
128 GraphObjRef = DefGraphObjRef()