]> SALOME platform Git repositories - samples/datafiles.git/blob - Superv/Python/GraphInLinesUnValid.py
Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/datafiles.git] / Superv / Python / GraphInLinesUnValid.py
1 #  Copyright (C) 2007-2011  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 GraphInLinesUnValid
23 #
24 from SuperV import *
25 # Graph creation 
26 GraphInLinesUnValid = Graph( 'GraphInLinesUnValid' )
27 GraphInLinesUnValid.SetName( 'GraphInLinesUnValid' )
28 GraphInLinesUnValid.SetAuthor( '' )
29 GraphInLinesUnValid.SetComment( '' )
30 GraphInLinesUnValid.Coords( 0 , 0 )
31
32 # Creation of Factory Nodes
33
34 # Creation of InLine Nodes
35 PyAdd = []
36 PyAdd.append( 'def Add(a,b) :  ' )
37 PyAdd.append( '    return a+b  ' )
38 PyAdd.append( '' )
39 Add = GraphInLinesUnValid.INode( 'Add' , PyAdd )
40 Add.InPort( 'a' , 'long' )
41 Add.InPort( 'b' , 'long' )
42 Add.OutPort( 'f' , 'long' )
43 Add.SetName( 'Add' )
44 Add.SetAuthor( '' )
45 Add.SetComment( 'Python function' )
46 Add.Coords( 257 , 13 )
47
48 PySub = []
49 PySub.append( 'def Sub(a,b) : ' )
50 PySub.append( '    return a-b ' )
51 PySub.append( '' )
52 Sub = GraphInLinesUnValid.INode( 'Sub' , PySub )
53 Sub.InPort( 'a' , 'long' )
54 Sub.InPort( 'b' , 'long' )
55 Sub.OutPort( 'f' , 'long' )
56 Sub.SetName( 'Sub' )
57 Sub.SetAuthor( '' )
58 Sub.SetComment( 'Python function' )
59 Sub.Coords( 20 , 152 )
60
61 PyMul = []
62 PyMul.append( 'def Mul(a,b) : ' )
63 PyMul.append( '    return a*b ' )
64 Mul = GraphInLinesUnValid.INode( 'Mul' , PyMul )
65 Mul.InPort( 'a' , 'long' )
66 Mul.InPort( 'b' , 'long' )
67 Mul.OutPort( 'Result' , 'long' )
68 Mul.SetName( 'Mul' )
69 Mul.SetAuthor( '' )
70 Mul.SetComment( 'Python function' )
71 Mul.Coords( 469 , 125 )
72
73 # Creation of Links
74 Addf = Add.Port( 'f' )
75 Mula = GraphInLinesUnValid.Link( Addf , Mul.Port( 'a' ) )
76 Mula.AddCoord( 1 , 451 , 205 )
77 Mula.AddCoord( 2 , 450 , 93 )
78
79 Subf = Sub.Port( 'f' )
80 Mulb = GraphInLinesUnValid.Link( Subf , Mul.Port( 'b' ) )
81
82 Addb = GraphInLinesUnValid.Link( Subf , Add.Port( 'b' ) )
83 Addb.AddCoord( 1 , 235 , 122 )
84 Addb.AddCoord( 2 , 236 , 232 )
85
86 MulResult = Mul.Port( 'Result' )
87 Adda = GraphInLinesUnValid.Link( MulResult , Add.Port( 'a' ) )
88 Adda.AddCoord( 1 , 8 , 92 )
89 Adda.AddCoord( 2 , 7 , 332 )
90 Adda.AddCoord( 3 , 645 , 334 )
91 Adda.AddCoord( 4 , 645 , 204 )
92
93 statexec = GraphInLinesUnValid.IsExecutable()
94 if statexec != 0 :
95     print "ERROR : GraphInLinesUnValid should not be executable"
96 else :
97     print "Ok : GraphInLinesUnValid is not executable"
98
99 # Creation of Output variables
100 statrun = GraphInLinesUnValid.Run()
101 if statrun != 0 :
102     print "ERROR : GraphInLinesUnValid should not run"
103 else :
104     print "Ok : GraphInLinesUnValid does not run"
105
106
107