Salome HOME
daea19869fb007d47c5613bb6e688d4daaf32d6f
[samples/datafiles.git] / Superv / Python / GraphConvertObjRefCheck.py
1 # Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
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.
10 #
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.
15 #
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
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # Generated python file of Graph GraphConvertObjRefCheck
24 #
25 from SuperV import *
26
27 # Graph creation of GraphConvertObjRefCheck
28 def DefGraphConvertObjRefCheck() :
29     GraphConvertObjRefCheck = Graph( 'GraphConvertObjRefCheck' )
30     GraphConvertObjRefCheck.SetName( 'GraphConvertObjRefCheck' )
31     GraphConvertObjRefCheck.SetAuthor( 'JR' )
32     GraphConvertObjRefCheck.SetComment( 'Check conversions of ObjRef' )
33     GraphConvertObjRefCheck.Coords( 0 , 0 )
34     
35     # Creation of Factory Nodes
36     
37     MiscTypes = GraphConvertObjRefCheck.FNode( 'TypesCheck' , 'TypesCheck' , 'MiscTypes' )
38     MiscTypes.SetName( 'MiscTypes' )
39     MiscTypes.SetAuthor( '' )
40     MiscTypes.SetContainer( 'localhost/FactoryServer' )
41     MiscTypes.SetComment( 'MiscTypes from TypesCheck' )
42     MiscTypes.Coords( 284 , 28 )
43     IMiscTypesInString = MiscTypes.GetInPort( 'InString' )
44     IMiscTypesInBool = MiscTypes.GetInPort( 'InBool' )
45     IMiscTypesInChar = MiscTypes.GetInPort( 'InChar' )
46     IMiscTypesInShort = MiscTypes.GetInPort( 'InShort' )
47     IMiscTypesInLong = MiscTypes.GetInPort( 'InLong' )
48     IMiscTypesInFloat = MiscTypes.GetInPort( 'InFloat' )
49     IMiscTypesInDouble = MiscTypes.GetInPort( 'InDouble' )
50     IMiscTypesInObjRef = MiscTypes.GetInPort( 'InObjRef' )
51     IMiscTypesGate = MiscTypes.GetInPort( 'Gate' )
52     OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' )
53     OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' )
54     OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' )
55     OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' )
56     OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' )
57     OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' )
58     OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' )
59     OMiscTypesOutObjRef = MiscTypes.GetOutPort( 'OutObjRef' )
60     OMiscTypesGate = MiscTypes.GetOutPort( 'Gate' )
61     
62     # Creation of InLine Nodes
63     PySyrComponent = []
64     PySyrComponent.append( 'from LifeCycleCORBA import *     ' )
65     PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) :     ' )
66     PySyrComponent.append( '    print "SyrComponent(",aContainer,",",aComponent,")"     ' )
67     PySyrComponent.append( '    orb = CORBA.ORB_init([], CORBA.ORB_ID)     ' )
68     PySyrComponent.append( '    print "SyrComponent orb",orb   ' )
69     PySyrComponent.append( '    lcc = LifeCycleCORBA(orb)     ' )
70     PySyrComponent.append( '    print "SyrComponent lcc",lcc   ' )
71     PySyrComponent.append( '    print "SyrComponent(",aContainer,",",aComponent,")"     ' )
72     PySyrComponent.append( '    ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent )     ' )
73     PySyrComponent.append( '    print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef     ' )
74     PySyrComponent.append( '    return ComponentRef    ' )
75     PySyrComponent.append( '' )
76     SyrComponent = GraphConvertObjRefCheck.INode( 'SyrComponent' , PySyrComponent )
77     SyrComponent.SetName( 'SyrComponent' )
78     SyrComponent.SetAuthor( 'JR' )
79     SyrComponent.SetComment( 'InLine Node' )
80     SyrComponent.Coords( 14 , 114 )
81     ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' )
82     ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' )
83     ISyrComponentGate = SyrComponent.GetInPort( 'Gate' )
84     OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' )
85     OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' )
86     
87     PyObjRefToInline = []
88     PyObjRefToInline.append( 'def ObjRefToInline(objRef): ' )
89     PyObjRefToInline.append( '    return objRef ' )
90     ObjRefToInline = GraphConvertObjRefCheck.INode( 'ObjRefToInline' , PyObjRefToInline )
91     ObjRefToInline.SetName( 'ObjRefToInline' )
92     ObjRefToInline.SetAuthor( '' )
93     ObjRefToInline.SetComment( 'Compute Node' )
94     ObjRefToInline.Coords( 496 , 168 )
95     IObjRefToInlinetoInLine = ObjRefToInline.InPort( 'toInLine' , 'int' )
96     IObjRefToInlineGate = ObjRefToInline.GetInPort( 'Gate' )
97     OObjRefToInlineGate = ObjRefToInline.GetOutPort( 'Gate' )
98     
99     # Creation of Links
100     LSyrComponentanObjRefMiscTypesInObjRef = GraphConvertObjRefCheck.Link( OSyrComponentanObjRef , IMiscTypesInObjRef )
101     
102     LSyrComponentanObjRefMiscTypesInString = GraphConvertObjRefCheck.Link( OSyrComponentanObjRef , IMiscTypesInString )
103     
104     LMiscTypesOutObjRefObjRefToInlinetoInLine = GraphConvertObjRefCheck.Link( OMiscTypesOutObjRef , IObjRefToInlinetoInLine )
105     
106     # Input datas
107     ISyrComponentaContainer.Input( 'FactoryServerPy' )
108     ISyrComponentaComponent.Input( 'SyrControlComponent' )
109     IMiscTypesInBool.Input( 138492744 )
110     IMiscTypesInChar.Input( 135402800 )
111     IMiscTypesInShort.Input( 135448464 )
112     IMiscTypesInLong.Input( 135469224 )
113     IMiscTypesInFloat.Input( 65.6954 )
114     IMiscTypesInDouble.Input( 65.6954 )
115     
116     # Output Ports of the graph
117     #OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' )
118     #OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' )
119     #OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' )
120     #OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' )
121     #OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' )
122     #OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' )
123     #OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' )
124     return GraphConvertObjRefCheck
125
126
127 GraphConvertObjRefCheck = DefGraphConvertObjRefCheck()
128
129 GraphConvertObjRefCheck.Run()
130 GraphConvertObjRefCheck.DoneW()
131 GraphConvertObjRefCheck.PrintPorts()