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