Salome HOME
Merge from BR_V5_DEV 17Feb09
[samples/datafiles.git] / Superv / Python / GraphBugEditor.py
1 #  Copyright (C) 2007-2008  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.
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 # Generated python file of Graph GraphBugEditor
23 #
24 from SuperV import *
25
26 # Graph creation of GraphBugEditor
27 def DefGraphBugEditor() :
28     GraphBugEditor = Graph( 'GraphBugEditor' )
29     GraphBugEditor.SetName( 'GraphBugEditor' )
30     GraphBugEditor.SetAuthor( 'Nicolas Crouzet & JR' )
31     GraphBugEditor.SetComment( '' )
32     GraphBugEditor.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     # Creation of InLine Nodes
37     Pycompute_power_1 = []
38     Pycompute_power_1.append( 'def compute_power(nitermax,eosflux,espeigenval) : ' )
39     Pycompute_power_1.append( '    return 1 ' )
40     compute_power_1 = GraphBugEditor.INode( 'compute_power' , Pycompute_power_1 )
41     compute_power_1.SetName( 'compute_power_1' )
42     compute_power_1.SetAuthor( '' )
43     compute_power_1.SetComment( 'Compute Node' )
44     compute_power_1.Coords( 226 , 103 )
45     Icompute_power_1nitermax = compute_power_1.InPort( 'nitermax' , 'long' )
46     Icompute_power_1epsflux = compute_power_1.InPort( 'epsflux' , 'long' )
47     Icompute_power_1espeigenval = compute_power_1.InPort( 'espeigenval' , 'long' )
48     Icompute_power_1Gate = compute_power_1.GetInPort( 'Gate' )
49     Ocompute_power_1return = compute_power_1.OutPort( 'return' , 'long' )
50     Ocompute_power_1Gate = compute_power_1.GetOutPort( 'Gate' )
51     
52     # Creation of Loop Nodes
53     PyLoop = []
54     PyLoop.append( 'def Loop(it,itMax):         ' )
55     PyLoop.append( '    return it,itMax           ' )
56     PyMoreLoop = []
57     PyMoreLoop.append( 'def More(it,itMax): ' )
58     PyMoreLoop.append( '    if it<=itMax : ' )
59     PyMoreLoop.append( '        DoLoop=1 ' )
60     PyMoreLoop.append( '    else: ' )
61     PyMoreLoop.append( '        DoLoop=0         ' )
62     PyMoreLoop.append( '    return DoLoop,it,itMax           ' )
63     PyNextLoop = []
64     PyNextLoop.append( 'def Next(it,itMax): ' )
65     PyNextLoop.append( '    it+=1         ' )
66     PyNextLoop.append( '    return it,itMax           ' )
67     Loop,EndLoop = GraphBugEditor.LNode( 'Loop' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop )
68     EndLoop.SetName( 'EndLoop' )
69     EndLoop.SetAuthor( '' )
70     EndLoop.SetComment( 'Compute Node' )
71     EndLoop.Coords( 426 , 161 )
72     PyEndLoop = []
73     EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
74     ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
75     ILoopit = Loop.InPort( 'it' , 'int' )
76     ILoopitMax = Loop.InPort( 'itMax' , 'int' )
77     ILoopGate = Loop.GetInPort( 'Gate' )
78     OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
79     OLoopit = Loop.GetOutPort( 'it' )
80     OLoopitMax = Loop.GetOutPort( 'itMax' )
81     IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
82     IEndLoopit = EndLoop.GetInPort( 'it' )
83     IEndLoopitMax = EndLoop.GetInPort( 'itMax' )
84     IEndLoopGate = EndLoop.GetInPort( 'Gate' )
85     OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
86     OEndLoopit = EndLoop.GetOutPort( 'it' )
87     OEndLoopitMax = EndLoop.GetOutPort( 'itMax' )
88     OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
89     Loop.SetName( 'Loop' )
90     Loop.SetAuthor( '' )
91     Loop.SetComment( 'Compute Node' )
92     Loop.Coords( 21 , 161 )
93     
94     # Creation of Links
95     LLoopitEndLoopit = GraphBugEditor.Link( OLoopit , IEndLoopit )
96     
97     LLoopitMaxEndLoopitMax = GraphBugEditor.Link( OLoopitMax , IEndLoopitMax )
98     
99     LLoopGatecompute_power_1Gate = GraphBugEditor.Link( OLoopGate , Icompute_power_1Gate )
100     
101     # Input datas
102     ILoopit.Input( 1 )
103     ILoopitMax.Input( 5 )
104     
105     # Input Ports of the graph
106     #Icompute_power_1nitermax = compute_power_1.GetInPort( 'nitermax' )
107     #Icompute_power_1epsflux = compute_power_1.GetInPort( 'epsflux' )
108     #Icompute_power_1espeigenval = compute_power_1.GetInPort( 'espeigenval' )
109     
110     # Output Ports of the graph
111     #OEndLoopit = EndLoop.GetOutPort( 'it' )
112     #OEndLoopitMax = EndLoop.GetOutPort( 'itMax' )
113     #Ocompute_power_1return = compute_power_1.GetOutPort( 'return' )
114     return GraphBugEditor
115
116
117 GraphBugEditor = DefGraphBugEditor()