1 # Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 FlowGraph = Graph( 'FlowGraph' )
25 Add = FlowGraph.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
27 Sub = FlowGraph.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
28 Addz = Add.GetOutStreamPort( 'z' )
30 print "Error : GetOutStreamPort of a FlowPort in a FlowGraph"
34 Addz = Add.Port( 'z' )
36 Suby = FlowGraph.StreamLink( Addz , Sub.Port( 'y' ) )
37 print "Error : creation of a StreamLink in a FlowGraph"
41 links = FlowGraph.StreamLinks()
43 print "Error : StreamLinks in a FlowGraph"
45 ports = FlowGraph.StreamPorts()
46 if len( ports ) != 0 :
47 print "Error : StreamPorts in a FlowGraph"
49 links = Add.StreamLinks()
51 print "Error : StreamLinks in a FlowNode"
53 ports = Add.StreamPorts()
54 if len( ports ) != 0 :
55 print "Error : StreamPorts in a FlowNode"
58 FlowGraph.SetStreamParams( 100 , SUPERV.WithoutTrace , 10. )
60 print "No SetStreamParams Ok"
63 Timeout,DataStreamTrace,DeltaTime = FlowGraph.StreamParams()
65 print "No StreamParams Ok"
72 anXmlFile = os.getenv('DATA_DIR') + '/Superv/Graphs/GraphStreams.xml'
73 GraphStreams = StreamGraph( anXmlFile )
75 GraphStreams.PrintPorts()
76 GraphStreams.PrintLinks()
78 exec GraphStreams.ListNodes()
85 exec EndLoop.ListPorts()
95 exec Add_1.ListPorts()
96 exec Sub_1.ListPorts()
97 exec Mul_1.ListPorts()
98 exec Div_1.ListPorts()
100 LLoopIndexAddx.Print()
102 LDiv_1ostreamAddistream.Print()
103 LAddOStreamSubIstream.Print()
106 GraphStreams.IsExecutable()
110 GraphStreams.PrintPorts()
114 subgraphs = GraphStreams.SubGraphsNumber()
116 while i <= subgraphs :
117 nodes = GraphStreams.SubGraphsNodes( i )
119 while j < len(nodes) :
120 print 'SubGraph',i,nodes[j].Name()
125 substreamgraphs = GraphStreams.SubStreamGraphsNumber()
127 while i <= substreamgraphs :
128 nodes = GraphStreams.SubStreamGraphsNodes( i )
130 while j < len(nodes) :
131 print 'SubStreamGraph',i,nodes[j].Name()