Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphEmbeddedComponents.py
1
2 # Generated python file of Graph GraphEmbeddedComponents
3
4 from SuperV import *
5
6 # Graph creation of GraphEmbeddedComponents
7 def DefGraphEmbeddedComponents() :
8     GraphEmbeddedComponents = Graph( 'GraphEmbeddedComponents' )
9     GraphEmbeddedComponents.SetName( 'GraphEmbeddedComponents' )
10     GraphEmbeddedComponents.SetAuthor( '' )
11     GraphEmbeddedComponents.SetComment( '' )
12     GraphEmbeddedComponents.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     Add = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
17     Add.SetName( 'Add' )
18     Add.SetAuthor( '' )
19     Add.SetContainer( 'localhost/SuperVisionContainer' )
20     Add.SetComment( 'Add from AddComponent' )
21     Add.Coords( 1 , 152 )
22     IAddx = Add.GetInPort( 'x' )
23     IAddy = Add.GetInPort( 'y' )
24     IAddGate = Add.GetInPort( 'Gate' )
25     OAddFuncValue = Add.GetOutPort( 'FuncValue' )
26     OAddz = Add.GetOutPort( 'z' )
27     OAddGate = Add.GetOutPort( 'Gate' )
28     
29     Sub = GraphEmbeddedComponents.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
30     Sub.SetName( 'Sub' )
31     Sub.SetAuthor( '' )
32     Sub.SetContainer( 'localhost/SuperVisionContainer' )
33     Sub.SetComment( 'Sub from SubComponent' )
34     Sub.Coords( 412 , 377 )
35     ISubx = Sub.GetInPort( 'x' )
36     ISuby = Sub.GetInPort( 'y' )
37     ISubGate = Sub.GetInPort( 'Gate' )
38     OSubz = Sub.GetOutPort( 'z' )
39     OSubGate = Sub.GetOutPort( 'Gate' )
40     
41     Mul = GraphEmbeddedComponents.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
42     Mul.SetName( 'Mul' )
43     Mul.SetAuthor( '' )
44     Mul.SetContainer( 'localhost/SuperVisionContainer' )
45     Mul.SetComment( 'Mul from MulComponent' )
46     Mul.Coords( 412 , 152 )
47     IMulx = Mul.GetInPort( 'x' )
48     IMuly = Mul.GetInPort( 'y' )
49     IMulGate = Mul.GetInPort( 'Gate' )
50     OMulz = Mul.GetOutPort( 'z' )
51     OMulGate = Mul.GetOutPort( 'Gate' )
52     
53     Div = GraphEmbeddedComponents.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
54     Div.SetName( 'Div' )
55     Div.SetAuthor( '' )
56     Div.SetContainer( 'localhost/SuperVisionContainer' )
57     Div.SetComment( 'Div from DivComponent' )
58     Div.Coords( 622 , 124 )
59     IDivx = Div.GetInPort( 'x' )
60     IDivy = Div.GetInPort( 'y' )
61     IDivGate = Div.GetInPort( 'Gate' )
62     ODivz = Div.GetOutPort( 'z' )
63     ODivGate = Div.GetOutPort( 'Gate' )
64     
65     Addition = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
66     Addition.SetName( 'Addition' )
67     Addition.SetAuthor( '' )
68     Addition.SetContainer( 'localhost/AdditionServer' )
69     Addition.SetComment( 'Addition from AddComponent' )
70     Addition.Coords( 0 , 0 )
71     IAdditionGate = Addition.GetInPort( 'Gate' )
72     OAdditionAdder = Addition.GetOutPort( 'Adder' )
73     OAdditionGate = Addition.GetOutPort( 'Gate' )
74     
75     Addition_1 = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
76     Addition_1.SetName( 'Addition_1' )
77     Addition_1.SetAuthor( '' )
78     Addition_1.SetContainer( 'localhost/Addition_1Server' )
79     Addition_1.SetComment( 'Addition from AddComponent' )
80     Addition_1.Coords( 4 , 327 )
81     IAddition_1Gate = Addition_1.GetInPort( 'Gate' )
82     OAddition_1Adder = Addition_1.GetOutPort( 'Adder' )
83     OAddition_1Gate = Addition_1.GetOutPort( 'Gate' )
84     
85     # Creation of Computing Nodes
86     AddAndCompare_ServiceinParameter = []
87     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
88     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
89     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
90     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
91     AddAndCompare_ServiceoutParameter = []
92     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
93     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
94     AddAndCompare_ServiceinStreamParameter = []
95     AddAndCompare_ServiceoutStreamParameter = []
96     AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
97     AddAndCompare = GraphEmbeddedComponents.CNode( AddAndCompare_Service )
98     AddAndCompare.SetName( 'AddAndCompare' )
99     AddAndCompare.SetAuthor( '' )
100     AddAndCompare.SetComment( 'Python function' )
101     AddAndCompare.Coords( 233 , 0 )
102     IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' )
103     IAddAndComparex = AddAndCompare.GetInPort( 'x' )
104     IAddAndComparey = AddAndCompare.GetInPort( 'y' )
105     IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' )
106     IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' )
107     OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
108     OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
109     OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' )
110     
111     # Creation of Links
112     LAddFuncValueMulx = GraphEmbeddedComponents.Link( OAddFuncValue , IMulx )
113     
114     LAddFuncValueAddAndComparex = GraphEmbeddedComponents.Link( OAddFuncValue , IAddAndComparex )
115     LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 )
116     LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 )
117     
118     LAddzSubx = GraphEmbeddedComponents.Link( OAddz , ISubx )
119     LAddzSubx.AddCoord( 1 , 187 , 459 )
120     LAddzSubx.AddCoord( 2 , 186 , 262 )
121     
122     LAddzAddAndComparey = GraphEmbeddedComponents.Link( OAddz , IAddAndComparey )
123     LAddzAddAndComparey.AddCoord( 1 , 187 , 139 )
124     LAddzAddAndComparey.AddCoord( 2 , 186 , 261 )
125     
126     LSubzDivx = GraphEmbeddedComponents.Link( OSubz , IDivx )
127     LSubzDivx.AddCoord( 1 , 598 , 203 )
128     LSubzDivx.AddCoord( 2 , 598 , 457 )
129     
130     LMulzDivy = GraphEmbeddedComponents.Link( OMulz , IDivy )
131     
132     LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponents.Link( OAdditionAdder , IAddAndCompareAdder )
133     
134     LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponents.Link( OAddition_1Adder , IAddAndCompareanOtherAdder )
135     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
136     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
137     
138     # Input datas
139     IAddx.Input( 1 )
140     IAddy.Input( 2 )
141     ISuby.Input( 3 )
142     IMuly.Input( 4 )
143     
144     # Output Ports of the graph
145     #ODivz = Div.GetOutPort( 'z' )
146     #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
147     #OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
148     return GraphEmbeddedComponents
149
150
151 GraphEmbeddedComponents = DefGraphEmbeddedComponents()
152
153 GraphEmbeddedComponents.Run()
154 GraphEmbeddedComponents.DoneW()
155 GraphEmbeddedComponents.PrintPorts()
156