From e342637f578a33102ea2f76d8be329d12af3d56e Mon Sep 17 00:00:00 2001 From: smh Date: Tue, 19 Oct 2004 11:56:45 +0000 Subject: [PATCH] Integration of PAL/SALOME V2.1.0c from OCC --- INSTALL | 4 +- bin/VERSION | 2 +- doc/salome/tui/SUPERV/HTML/SUPERV.html | 240 +++- doc/salome/tui/SUPERV/doxyfile | 2 +- doc/salome/tui/SUPERV/sources/static/tree.js | 2 +- examples/GeomGraph.py | 290 ++-- examples/GeomGraph.py_old | 106 ++ examples/GeomGraph.xml | 1199 ++++++++--------- examples/GeomGraph.xml_old | 651 +++++++++ examples/GraphGeomEssai.xml | 605 +++++---- examples/GraphGeomEssai.xml_old | 318 +++++ examples/MacroWithGeom.xml | 589 ++++---- examples/MacroWithGeom.xml_old | 639 +++++++++ examples/NewGraphGeomEssai.py | 201 +-- examples/NewGraphGeomEssai.py_old | 84 ++ examples/NewGraphGeomEssai.xml | 654 +++++---- examples/NewGraphGeomEssai.xml_old | 332 +++++ src/GraphBase/DataFlowBase_Base.hxx | 7 +- src/GraphBase/DataFlowBase_ComputingNode.cxx | 72 +- src/GraphBase/DataFlowBase_ComputingNode.hxx | 16 +- src/GraphBase/DataFlowBase_GOTONode.cxx | 32 +- src/GraphBase/DataFlowBase_Graph.cxx | 50 +- src/GraphBase/DataFlowBase_Graph.hxx | 18 +- src/GraphBase/DataFlowBase_OutPort.cxx | 2 +- src/GraphBase/DataFlowBase_StreamNode.cxx | 5 +- src/GraphBase/DataFlowBase_StreamNode.hxx | 30 +- src/GraphBase/Makefile.in | 2 +- src/GraphEditor/DataFlowEditor_DataFlow.cxx | 19 - src/GraphEditor/DataFlowEditor_DataFlow.hxx | 11 +- src/GraphEditor/DataFlowEditor_DataFlow.lxx | 25 +- src/GraphEditor/DataFlowEditor_InNode.hxx | 6 +- src/GraphEditor/DataFlowEditor_OutNode.cxx | 88 +- src/GraphEditor/DataFlowEditor_OutNode.hxx | 15 +- src/GraphEditor/Makefile.in | 4 +- .../DataFlowExecutor_DataFlow.cxx | 103 +- .../DataFlowExecutor_DataFlow.hxx | 3 +- .../DataFlowExecutor_FiniteStateMachine.cxx | 3 +- .../DataFlowExecutor_FiniteStateMachine.hxx | 9 +- src/GraphExecutor/DataFlowExecutor_InNode.cxx | 13 +- src/GraphExecutor/DataFlowExecutor_InNode.hxx | 6 +- .../DataFlowExecutor_InNodeThreads.cxx | 20 +- .../DataFlowExecutor_OutNode.cxx | 120 +- .../DataFlowExecutor_OutNode.hxx | 4 + src/GraphExecutor/Makefile.in | 4 +- src/Makefile.in | 2 +- src/SUPERVGUI/SUPERVGUI.cxx | 24 +- src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx | 1 - src/SUPERVGUI/SUPERVGUI_Canvas.cxx | 11 +- src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx | 6 +- src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx | 25 +- src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx | 10 +- src/SUPERVGUI/SUPERVGUI_CanvasView.cxx | 8 +- src/SUPERVGUI/SUPERVGUI_Main.cxx | 22 +- src/SUPERVGUI/SUPERVGUI_Node.cxx | 1 - src/SUPERVGUI/SUPERVGUI_Service.cxx | 2 +- src/SUPERVGUI/SUPERV_msg_en.po | 3 - src/Supervision/CNode_Impl.cxx | 699 +++++----- src/Supervision/CNode_Impl.hxx | 65 +- src/Supervision/GNode_Impl.cxx | 37 +- src/Supervision/GNode_Impl.hxx | 7 - src/Supervision/Graph_Impl.cxx | 614 +++++---- src/Supervision/Graph_Impl.hxx | 21 +- src/Supervision/INode_Impl.cxx | 25 - src/Supervision/INode_Impl.hxx | 7 - src/Supervision/Makefile.in | 2 +- src/Supervision/Port_Impl.cxx | 17 +- src/Supervision/SuperV_Impl.cxx | 12 +- src/Supervision/Value_Impl.cxx | 2 + src/Supervision/batchmode_SuperV.py | 15 +- 69 files changed, 5416 insertions(+), 2827 deletions(-) create mode 100644 examples/GeomGraph.py_old create mode 100644 examples/GeomGraph.xml_old create mode 100644 examples/GraphGeomEssai.xml_old create mode 100755 examples/MacroWithGeom.xml_old create mode 100644 examples/NewGraphGeomEssai.py_old create mode 100644 examples/NewGraphGeomEssai.xml_old diff --git a/INSTALL b/INSTALL index 7a1e231..e3237d6 100644 --- a/INSTALL +++ b/INSTALL @@ -1,3 +1,3 @@ -This is the version 2.0.0 of SUPERV +This is the version 2.1.0 of SUPERV Compatible with : - - KERNEL 2.0.0 + - KERNEL 2.1.0 diff --git a/bin/VERSION b/bin/VERSION index b1f9379..eb95961 100755 --- a/bin/VERSION +++ b/bin/VERSION @@ -1 +1 @@ -THIS IS SALOME - SUPERV VERSION: 2.0.0 +THIS IS SALOME - SUPERV VERSION: 2.1.0 diff --git a/doc/salome/tui/SUPERV/HTML/SUPERV.html b/doc/salome/tui/SUPERV/HTML/SUPERV.html index a191eaa..de4c8ab 100644 --- a/doc/salome/tui/SUPERV/HTML/SUPERV.html +++ b/doc/salome/tui/SUPERV/HTML/SUPERV.html @@ -15,6 +15,14 @@
return_value = GraphE ( aGraph )
+
StreamGraph StreamGraph ( in string aGraph )
+
return_value = StreamGraph ( aGraph )
+ + +
StreamGraph StreamGraphE ( in string aGraph )
+
return_value = StreamGraphE ( aGraph )
+ +
Value StringValue ( in string aString )
return_value = StringValue ( aString )
@@ -26,6 +34,10 @@
Graph getGraph ( in string ior )
return_value = getGraph ( ior )
+ +
StreamGraph getStreamGraph ( in string ior )
+
return_value = getStreamGraph ( ior )
+
@@ -83,6 +95,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -91,14 +123,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -135,6 +199,10 @@ + + + + @@ -219,10 +287,6 @@ - - - - @@ -310,6 +374,14 @@ + + + + + + + +
return_value = Port ( aParameterName )
Port GetInPort ( in string aParameterName )
return_value = GetInPort ( aParameterName )
Port GetOutPort ( in string aParameterName )
return_value = GetOutPort ( aParameterName )
StreamPort GetInStreamPort ( in string aParameterName )
return_value = GetInStreamPort ( aParameterName )
StreamPort GetOutStreamPort ( in string aParameterName )
return_value = GetOutStreamPort ( aParameterName )
boolean HasStreamPort ( )
return_value = HasStreamPort ( )
Port Input ( in string InputParameterName, in Value aValue )
return_value = Input ( InputParameterName, aValue )
return_value = Ports ( )
ListOfStreamPorts StreamPorts ( )
return_value = StreamPorts ( )
ListOfLinks Links ( )
return_value = Links ( )
ListOfStreamLinks StreamLinks ( )
return_value = StreamLinks ( )
boolean IsStreamGraph ( )
return_value = IsStreamGraph ( )
boolean IsGraph ( )
return_value = IsGraph ( )
boolean IsMacro ( )
return_value = IsMacro ( )
boolean IsFlowMacro ( )
return_value = IsFlowMacro ( )
boolean IsStreamMacro ( )
return_value = IsStreamMacro ( )
boolean IsHeadGraph ( )
return_value = IsHeadGraph ( )
long GraphLevel ( )
return_value = GraphLevel ( )
boolean IsComputing ( )
return_value = IsComputing ( )
return_value = SubGraph ( )
long SubStreamGraph ( )
return_value = SubStreamGraph ( )
long Thread ( )
return_value = Thread ( )
return_value = ReStartAt ( aNodeName )
AutomatonState AutoState ( )
return_value = AutoState ( )
ControlState Control ( )
return_value = Control ( )
Port OutPort ( in string aParameterName, in string aParameterType )
return_value = OutPort ( aParameterName, aParameterType )
StreamPort InStreamPort ( in string aParameterName, in DataStreamType aParameterType, in DataStreamDependency aDependency )
return_value = InStreamPort ( aParameterName, aParameterType, aDependency )
StreamPort OutStreamPort ( in string aParameterName, in DataStreamType aParameterType, in DataStreamDependency aDependency )
return_value = OutStreamPort ( aParameterName, aParameterType, aDependency )

@@ -335,8 +407,8 @@ - - + + @@ -427,6 +499,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -463,6 +555,10 @@ + + + + @@ -475,10 +571,6 @@ - - - - @@ -495,10 +587,6 @@ - - - - @@ -519,6 +607,10 @@ + + + + @@ -535,8 +627,64 @@ - - + + + + + + + +
Python
void SetPyInit ( in string MoreName, in ListOfStrings aPyMoreFunction )
SetPyInit ( MoreName, aPyMoreFunction )
void SetPyInit ( in string InitName, in ListOfStrings aPyInitFunction )
SetPyInit ( InitName, aPyInitFunction )
ListOfStrings PyInit ( )
[ return_value, anEndOfSwitch ] = SNode ( FuncName, aPythonFunction )
Graph MNode ( in string aXmlFileName )
return_value = MNode ( aXmlFileName )
Graph GraphMNode ( in Graph aGraph )
return_value = GraphMNode ( aGraph )
Graph FlowObjRef ( )
return_value = FlowObjRef ( )
StreamGraph StreamObjRef ( )
return_value = StreamObjRef ( )
CNode Node ( in string aNodeName )
return_value = Node ( aNodeName )
Component ComponentRef ( in string aComputerContainer, in string aComponentName )
return_value = ComponentRef ( aComputerContainer, aComponentName )
[ return_value, aNode, anEvent, aState ] = EventW ( )
long EventQSize ( )
return_value = EventQSize ( )
long LevelMax ( )
return_value = LevelMax ( )
return_value = ThreadsMax ( )
long GraphsNumber ( )
return_value = GraphsNumber ( )
long Threads ( )
return_value = Threads ( )
return_value = IsExecutable ( )
boolean IsDataFlow ( )
return_value = IsDataFlow ( )
boolean IsEditing ( )
return_value = IsEditing ( )
return_value = Copy ( )
StreamGraph ToStreamGraph ( )
return_value = ToStreamGraph ( )
boolean Merge ( in Graph aGraph )
return_value = Merge ( aGraph )
return_value = getIOR ( )
ListOfGraphs Graphs ( )
return_value = Graphs ( )
long SubGraphsNumber ( )
return_value = SubGraphsNumber ( )
ListOfNodes SubGraphsNodes ( in long SubGraphNumber )
return_value = SubGraphsNodes ( SubGraphNumber )

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
interface StreamGraph
IDL file
Python
StreamGraph StreamCopy ( )
return_value = StreamCopy ( )
StreamGraph StreamMNode ( in string aXmlFileName )
return_value = StreamMNode ( aXmlFileName )
StreamGraph StreamGraphMNode ( in StreamGraph aStreamGraph )
return_value = StreamGraphMNode ( aStreamGraph )
StreamLink StreamLink ( in StreamPort OutputPort, in StreamPort InputPort )
return_value = StreamLink ( OutputPort, InputPort )
ListOfStreamLinks GStreamLinks ( )
return_value = GStreamLinks ( )
boolean SetStreamParams ( in long Timeout, in KindOfDataStreamTrace DataStreamTrace, in double DeltaTime )
return_value = SetStreamParams ( Timeout, DataStreamTrace, DeltaTime )
void StreamParams ( out long Timeout, out KindOfDataStreamTrace DataStreamTrace, out double DeltaTime )
[ Timeout, DataStreamTrace, DeltaTime ] = StreamParams ( )
long SubStreamGraphsNumber ( )
return_value = SubStreamGraphsNumber ( )
ListOfNodes SubStreamGraphsNodes ( in long SubStreamGraphNumber )
return_value = SubStreamGraphsNodes ( SubStreamGraphNumber )
Graph ToFlowGraph ( )
return_value = ToFlowGraph ( )
boolean StreamMerge ( in StreamGraph aStreamGraph )
return_value = StreamMerge ( aStreamGraph )

@@ -577,6 +725,22 @@

+ + + + + + + + + + + + + +
interface StreamLink
IDL file
Python
StreamPort OutStreamPort ( )
return_value = OutStreamPort ( )
StreamPort InStreamPort ( )
return_value = InStreamPort ( )

+ + @@ -671,6 +835,10 @@ + + + + @@ -678,5 +846,45 @@ + + + + +
interface Value
IDL file
return_value = IsEndSwitch ( )
boolean IsDataStream ( )
return_value = IsDataStream ( )
GraphState State ( )
return_value = State ( )
boolean IsDone ( )
return_value = IsDone ( )
void Remove ( )
Remove ( )

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
interface StreamPort
IDL file
Python
StreamLink StreamLink ( )
return_value = StreamLink ( )
DataStreamDependency Dependency ( )
return_value = Dependency ( )
boolean SetDependency ( in DataStreamDependency aDependency )
return_value = SetDependency ( aDependency )
boolean SetParams ( in KindOfSchema aKindOfSchema, in KindOfInterpolation aKindOfInterpolation, in KindOfExtrapolation aKindOfExtrapolation )
return_value = SetParams ( aKindOfSchema, aKindOfInterpolation, aKindOfExtrapolation )
boolean Params ( out KindOfSchema aKindOfSchema, out KindOfInterpolation aKindOfInterpolation, out KindOfExtrapolation aKindOfExtrapolation )
[ return_value, aKindOfSchema, aKindOfInterpolation, aKindOfExtrapolation ] = Params ( )
boolean SetNumberOfValues ( in long aNumberOfValues )
return_value = SetNumberOfValues ( aNumberOfValues )
long NumberOfValues ( )
return_value = NumberOfValues ( )

diff --git a/doc/salome/tui/SUPERV/doxyfile b/doc/salome/tui/SUPERV/doxyfile index 4413e11..1f8b634 100755 --- a/doc/salome/tui/SUPERV/doxyfile +++ b/doc/salome/tui/SUPERV/doxyfile @@ -3,7 +3,7 @@ #--------------------------------------------------------------------------- # General configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "SALOME - SUPERV - v.2.0.0" +PROJECT_NAME = "SALOME - SUPERV - v.2.1.0" PROJECT_NUMBER = id#1.0 OUTPUT_DIRECTORY = ../ OUTPUT_LANGUAGE = English diff --git a/doc/salome/tui/SUPERV/sources/static/tree.js b/doc/salome/tui/SUPERV/sources/static/tree.js index 25dc87a..d01e7c2 100755 --- a/doc/salome/tui/SUPERV/sources/static/tree.js +++ b/doc/salome/tui/SUPERV/sources/static/tree.js @@ -1,4 +1,4 @@ -foldersTree = gFld("SALOME v.2.0.0 ", "", "") +foldersTree = gFld("SALOME v.2.1.0 ", "", "") insDoc(foldersTree, gLnk("Main Page", "", "main.html")) aux1 = insFld(foldersTree, gFld("TUI Reference Guide", "")) diff --git a/examples/GeomGraph.py b/examples/GeomGraph.py index 0597429..9f68efe 100644 --- a/examples/GeomGraph.py +++ b/examples/GeomGraph.py @@ -1,106 +1,196 @@ -# Generated python file of Graph GeomGraph +# Generated python file of Graph aNewDataFlow_1_4_2_1_1_2_2_1 from SuperV import * -# Graph creation -GeomGraph = Graph( 'GeomGraph' ) -GeomGraph.SetName( 'GeomGraph' ) -GeomGraph.SetAuthor( '' ) -GeomGraph.SetComment( '' ) -GeomGraph.Coords( 0 , 0 ) -# Creation of Factory Nodes -MakeBox = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeBox' ) -MakeBox.SetName( 'MakeBox' ) -MakeBox.SetAuthor( '' ) -MakeBox.SetContainer( 'localhost/FactoryServer' ) -MakeBox.SetComment( 'MakeBox from Geometry' ) -MakeBox.Coords( 5 , 101 ) -MakeCopy = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeCopy' ) -MakeCopy.SetName( 'MakeCopy' ) -MakeCopy.SetAuthor( '' ) -MakeCopy.SetContainer( 'localhost/FactoryServer' ) -MakeCopy.SetComment( 'MakeCopy from Geometry' ) -MakeCopy.Coords( 235 , 77 ) -MakeCopy_1 = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeCopy' ) -MakeCopy_1.SetName( 'MakeCopy_1' ) -MakeCopy_1.SetAuthor( '' ) -MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) -MakeCopy_1.SetComment( 'MakeCopy from Geometry' ) -MakeCopy_1.Coords( 232 , 332 ) -MakeTranslation = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeTranslation' ) -MakeTranslation.SetName( 'MakeTranslation' ) -MakeTranslation.SetAuthor( '' ) -MakeTranslation.SetContainer( 'localhost/FactoryServer' ) -MakeTranslation.SetComment( 'MakeTranslation from Geometry' ) -MakeTranslation.Coords( 449 , 86 ) -MakeFuse = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeFuse' ) -MakeFuse.SetName( 'MakeFuse' ) -MakeFuse.SetAuthor( '' ) -MakeFuse.SetContainer( 'localhost/FactoryServer' ) -MakeFuse.SetComment( 'MakeFuse from Geometry' ) -MakeFuse.Coords( 678 , 224 ) -MakeFuse_1 = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeFuse' ) -MakeFuse_1.SetName( 'MakeFuse_1' ) -MakeFuse_1.SetAuthor( '' ) -MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) -MakeFuse_1.SetComment( 'MakeFuse from Geometry' ) -MakeFuse_1.Coords( 909 , 340 ) -MakeSphere = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeSphere' ) -MakeSphere.SetName( 'MakeSphere' ) -MakeSphere.SetAuthor( '' ) -MakeSphere.SetContainer( 'localhost/FactoryServer' ) -MakeSphere.SetComment( 'MakeSphere from Geometry' ) -MakeSphere.Coords( 5 , 449 ) +# Graph creation of aNewDataFlow_1_4_2_1_1_2_2_1 +def DefaNewDataFlow_1_4_2_1_1_2_2_1() : + aNewDataFlow_1_4_2_1_1_2_2_1 = Graph( 'aNewDataFlow_1_4_2_1_1_2_2_1' ) + aNewDataFlow_1_4_2_1_1_2_2_1.SetName( 'aNewDataFlow_1_4_2_1_1_2_2_1' ) + aNewDataFlow_1_4_2_1_1_2_2_1.SetAuthor( '' ) + aNewDataFlow_1_4_2_1_1_2_2_1.SetComment( '' ) + aNewDataFlow_1_4_2_1_1_2_2_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + Pygag = [] + Pygag.append( 'from batchmode_geompy import * ' ) + Pygag.append( 'def gag(): ' ) + Pygag.append( ' # This is a gag ' ) + Pygag.append( ' return 1 ' ) + gag = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'gag' , Pygag ) + gag.SetName( 'gag' ) + gag.SetAuthor( '' ) + gag.SetComment( 'Compute Node' ) + gag.Coords( 0 , 123 ) + IgagGate = gag.GetInPort( 'Gate' ) + OgagGate = gag.GetOutPort( 'Gate' ) + + PyMakeBox1 = [] + PyMakeBox1.append( 'def MakeBox1(x1,y1,z1,x2,y2,z2): ' ) + PyMakeBox1.append( ' aBox = MakeBox(x1,y1,z1,x2,y2,z2) ' ) + PyMakeBox1.append( ' return aBox ' ) + MakeBox1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeBox1' , PyMakeBox1 ) + MakeBox1.SetName( 'MakeBox1' ) + MakeBox1.SetAuthor( '' ) + MakeBox1.SetComment( 'Compute Node' ) + MakeBox1.Coords( 194 , 3 ) + IMakeBox1x1 = MakeBox1.InPort( 'x1' , 'double' ) + IMakeBox1y1 = MakeBox1.InPort( 'y1' , 'double' ) + IMakeBox1z1 = MakeBox1.InPort( 'z1' , 'double' ) + IMakeBox1x2 = MakeBox1.InPort( 'x2' , 'double' ) + IMakeBox1y2 = MakeBox1.InPort( 'y2' , 'double' ) + IMakeBox1z2 = MakeBox1.InPort( 'z2' , 'double' ) + IMakeBox1Gate = MakeBox1.GetInPort( 'Gate' ) + OMakeBox1shape = MakeBox1.OutPort( 'shape' , 'objref' ) + OMakeBox1Gate = MakeBox1.GetOutPort( 'Gate' ) + + PyMakeCopy_1 = [] + PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' ) + PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' ) + PyMakeCopy_1.append( ' return shape ' ) + MakeCopy_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeCopy_1' , PyMakeCopy_1 ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetComment( 'Compute Node' ) + MakeCopy_1.Coords( 389 , 3 ) + IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' ) + IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' ) + OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' ) + OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) + + PyMakeCopy_2 = [] + PyMakeCopy_2.append( 'def MakeCopy_2(shape1): ' ) + PyMakeCopy_2.append( ' shape=MakeCopy(shape1) ' ) + PyMakeCopy_2.append( ' return shape ' ) + MakeCopy_2 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeCopy_2' , PyMakeCopy_2 ) + MakeCopy_2.SetName( 'MakeCopy_2' ) + MakeCopy_2.SetAuthor( '' ) + MakeCopy_2.SetComment( 'Compute Node' ) + MakeCopy_2.Coords( 389 , 136 ) + IMakeCopy_2shape1 = MakeCopy_2.InPort( 'shape1' , 'objref' ) + IMakeCopy_2Gate = MakeCopy_2.GetInPort( 'Gate' ) + OMakeCopy_2shape = MakeCopy_2.OutPort( 'shape' , 'objref' ) + OMakeCopy_2Gate = MakeCopy_2.GetOutPort( 'Gate' ) + + PyMakeSphere_1 = [] + PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' ) + PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' ) + PyMakeSphere_1.append( ' shape=MakeSphere(apoint,radius) ' ) + PyMakeSphere_1.append( ' return shape ' ) + MakeSphere_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 ) + MakeSphere_1.SetName( 'MakeSphere_1' ) + MakeSphere_1.SetAuthor( '' ) + MakeSphere_1.SetComment( 'Compute Node' ) + MakeSphere_1.Coords( 203 , 315 ) + IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' ) + IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' ) + IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' ) + IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' ) + IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' ) + OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' ) + OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) + + PyMakeTranslation_1 = [] + PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' ) + PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' ) + PyMakeTranslation_1.append( ' return shape ' ) + MakeTranslation_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 ) + MakeTranslation_1.SetName( 'MakeTranslation_1' ) + MakeTranslation_1.SetAuthor( '' ) + MakeTranslation_1.SetComment( 'Compute Node' ) + MakeTranslation_1.Coords( 596 , 3 ) + IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' ) + IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' ) + IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' ) + IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' ) + IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' ) + OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' ) + OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' ) + + PyMakeFuse_1 = [] + PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' ) + PyMakeFuse_1.append( ' # fuse operation 3 ' ) + PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' ) + PyMakeFuse_1.append( ' return shape ' ) + MakeFuse_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeFuse_1' , PyMakeFuse_1 ) + MakeFuse_1.SetName( 'MakeFuse_1' ) + MakeFuse_1.SetAuthor( '' ) + MakeFuse_1.SetComment( 'Compute Node' ) + MakeFuse_1.Coords( 823 , 116 ) + IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' ) + IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' ) + IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' ) + OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' ) + OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) + + PyMakeFuse_2 = [] + PyMakeFuse_2.append( 'def MakeFuse_2(shape1,shape2): ' ) + PyMakeFuse_2.append( ' # fuse operation 3 ' ) + PyMakeFuse_2.append( ' shape = MakeBoolean(shape1,shape2,3) ' ) + PyMakeFuse_2.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' ) + PyMakeFuse_2.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' ) + PyMakeFuse_2.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' ) + PyMakeFuse_2.append( ' aStudyId = aSession.GetActiveStudyId() ' ) + PyMakeFuse_2.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' ) + PyMakeFuse_2.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' ) + PyMakeFuse_2.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' ) + PyMakeFuse_2.append( ' return shape ' ) + MakeFuse_2 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeFuse_2' , PyMakeFuse_2 ) + MakeFuse_2.SetName( 'MakeFuse_2' ) + MakeFuse_2.SetAuthor( '' ) + MakeFuse_2.SetComment( 'Compute Node' ) + MakeFuse_2.Coords( 1049 , 295 ) + IMakeFuse_2shape1 = MakeFuse_2.InPort( 'shape1' , 'objref' ) + IMakeFuse_2shape2 = MakeFuse_2.InPort( 'shape2' , 'objref' ) + IMakeFuse_2Gate = MakeFuse_2.GetInPort( 'Gate' ) + OMakeFuse_2shape = MakeFuse_2.OutPort( 'shape' , 'objref' ) + OMakeFuse_2Gate = MakeFuse_2.GetOutPort( 'Gate' ) + + # Creation of Links + LgagGateMakeBox1Gate = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OgagGate , IMakeBox1Gate ) + + LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OgagGate , IMakeSphere_1Gate ) + LgagGateMakeSphere_1Gate.AddCoord( 1 , 164 , 470 ) + LgagGateMakeSphere_1Gate.AddCoord( 2 , 164 , 265 ) + + LMakeBox1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeBox1shape , IMakeCopy_1shape1 ) + + LMakeBox1shapeMakeCopy_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeBox1shape , IMakeCopy_2shape1 ) + LMakeBox1shapeMakeCopy_2shape1.AddCoord( 1 , 384 , 207 ) + + LMakeCopy_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 ) + + LMakeCopy_2shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 ) + LMakeCopy_2shapeMakeFuse_1shape2.AddCoord( 1 , 674 , 207 ) + + LMakeSphere_1shapeMakeFuse_2shape2 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeSphere_1shape , IMakeFuse_2shape2 ) + + LMakeTranslation_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 ) + + LMakeFuse_1shapeMakeFuse_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeFuse_1shape , IMakeFuse_2shape1 ) + LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 1 , 1017 , 366 ) + LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 2 , 1017 , 187 ) + + # Input datas + IMakeBox1x1.Input( 0 ) + IMakeBox1y1.Input( 0 ) + IMakeBox1z1.Input( 0 ) + IMakeBox1x2.Input( 50 ) + IMakeBox1y2.Input( 50 ) + IMakeBox1z2.Input( 50 ) + IMakeSphere_1x1.Input( 0 ) + IMakeSphere_1y1.Input( 0 ) + IMakeSphere_1z1.Input( 0 ) + IMakeSphere_1radius.Input( 12 ) + IMakeTranslation_1x1.Input( 25 ) + IMakeTranslation_1y1.Input( 25 ) + IMakeTranslation_1z1.Input( 25 ) + + # Output Ports of the graph + #OMakeFuse_2shape = MakeFuse_2.GetOutPort( 'shape' ) + return aNewDataFlow_1_4_2_1_1_2_2_1 -# Creation of intermediate Output variables and of Control Links -MakeBoxshape = MakeBox.Port( 'shape' ) -MakeCopyshape1 = GeomGraph.Link( MakeBoxshape , MakeCopy.Port( 'shape1' ) ) -MakeCopyshape1.AddCoord( 1 , 198 , 184 ) -MakeCopyshape1.AddCoord( 2 , 199 , 209 ) -MakeCopy_1shape1 = GeomGraph.Link( MakeBoxshape , MakeCopy_1.Port( 'shape1' ) ) -MakeCopy_1shape1.AddCoord( 1 , 198 , 441 ) -MakeCopy_1shape1.AddCoord( 2 , 198 , 209 ) -MakeCopyshape = MakeCopy.Port( 'shape' ) -MakeTranslationshape1 = GeomGraph.Link( MakeCopyshape , MakeTranslation.Port( 'shape1' ) ) -MakeCopy_1shape = MakeCopy_1.Port( 'shape' ) -MakeFuseshape2 = GeomGraph.Link( MakeCopy_1shape , MakeFuse.Port( 'shape2' ) ) -MakeFuseshape2.AddCoord( 1 , 642 , 362 ) -MakeFuseshape2.AddCoord( 2 , 642 , 442 ) -MakeTranslationshape = MakeTranslation.Port( 'shape' ) -MakeFuseshape1 = GeomGraph.Link( MakeTranslationshape , MakeFuse.Port( 'shape1' ) ) -MakeFuseshape1.AddCoord( 1 , 643 , 330 ) -MakeFuseshape1.AddCoord( 2 , 644 , 195 ) -MakeFuseshape = MakeFuse.Port( 'shape' ) -MakeFuse_1shape1 = GeomGraph.Link( MakeFuseshape , MakeFuse_1.Port( 'shape1' ) ) -MakeFuse_1shape1.AddCoord( 1 , 872 , 445 ) -MakeFuse_1shape1.AddCoord( 2 , 874 , 333 ) -MakeSphereshape = MakeSphere.Port( 'shape' ) -MakeFuse_1shape2 = GeomGraph.Link( MakeSphereshape , MakeFuse_1.Port( 'shape2' ) ) -MakeFuse_1shape2.AddCoord( 1 , 872 , 474 ) -MakeFuse_1shape2.AddCoord( 2 , 871 , 552 ) - -# Creation of Input datas -MakeBoxx1 = MakeBox.Input( 'x1' , 0) -MakeBoxy1 = MakeBox.Input( 'y1' , 0) -MakeBoxz1 = MakeBox.Input( 'z1' , 0) -MakeBoxx2 = MakeBox.Input( 'x2' , 50) -MakeBoxy2 = MakeBox.Input( 'y2' , 50) -MakeBoxz2 = MakeBox.Input( 'z2' , 50) -MakeTranslationx1 = MakeTranslation.Input( 'x1' , 25) -MakeTranslationy1 = MakeTranslation.Input( 'y1' , 25) -MakeTranslationz1 = MakeTranslation.Input( 'z1' , 25) -MakeSpherex1 = MakeSphere.Input( 'x1' , 0) -MakeSpherey1 = MakeSphere.Input( 'y1' , 0) -MakeSpherez1 = MakeSphere.Input( 'z1' , 0) -MakeSphereradius = MakeSphere.Input( 'radius' , 12) - -# Creation of Output variables -MakeFuse_1shape = MakeFuse_1.Port( 'shape' ) - -GeomGraph.Run() - -GeomGraph.DoneW() - -GeomGraph.PrintPorts() +aNewDataFlow_1_4_2_1_1_2_2_1 = DefaNewDataFlow_1_4_2_1_1_2_2_1() diff --git a/examples/GeomGraph.py_old b/examples/GeomGraph.py_old new file mode 100644 index 0000000..0597429 --- /dev/null +++ b/examples/GeomGraph.py_old @@ -0,0 +1,106 @@ + +# Generated python file of Graph GeomGraph + +from SuperV import * +# Graph creation +GeomGraph = Graph( 'GeomGraph' ) +GeomGraph.SetName( 'GeomGraph' ) +GeomGraph.SetAuthor( '' ) +GeomGraph.SetComment( '' ) +GeomGraph.Coords( 0 , 0 ) + +# Creation of Factory Nodes +MakeBox = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeBox' ) +MakeBox.SetName( 'MakeBox' ) +MakeBox.SetAuthor( '' ) +MakeBox.SetContainer( 'localhost/FactoryServer' ) +MakeBox.SetComment( 'MakeBox from Geometry' ) +MakeBox.Coords( 5 , 101 ) +MakeCopy = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeCopy' ) +MakeCopy.SetName( 'MakeCopy' ) +MakeCopy.SetAuthor( '' ) +MakeCopy.SetContainer( 'localhost/FactoryServer' ) +MakeCopy.SetComment( 'MakeCopy from Geometry' ) +MakeCopy.Coords( 235 , 77 ) +MakeCopy_1 = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeCopy' ) +MakeCopy_1.SetName( 'MakeCopy_1' ) +MakeCopy_1.SetAuthor( '' ) +MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) +MakeCopy_1.SetComment( 'MakeCopy from Geometry' ) +MakeCopy_1.Coords( 232 , 332 ) +MakeTranslation = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeTranslation' ) +MakeTranslation.SetName( 'MakeTranslation' ) +MakeTranslation.SetAuthor( '' ) +MakeTranslation.SetContainer( 'localhost/FactoryServer' ) +MakeTranslation.SetComment( 'MakeTranslation from Geometry' ) +MakeTranslation.Coords( 449 , 86 ) +MakeFuse = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeFuse' ) +MakeFuse.SetName( 'MakeFuse' ) +MakeFuse.SetAuthor( '' ) +MakeFuse.SetContainer( 'localhost/FactoryServer' ) +MakeFuse.SetComment( 'MakeFuse from Geometry' ) +MakeFuse.Coords( 678 , 224 ) +MakeFuse_1 = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeFuse' ) +MakeFuse_1.SetName( 'MakeFuse_1' ) +MakeFuse_1.SetAuthor( '' ) +MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) +MakeFuse_1.SetComment( 'MakeFuse from Geometry' ) +MakeFuse_1.Coords( 909 , 340 ) +MakeSphere = GeomGraph.FNode( 'GEOM' , 'GEOM' , 'MakeSphere' ) +MakeSphere.SetName( 'MakeSphere' ) +MakeSphere.SetAuthor( '' ) +MakeSphere.SetContainer( 'localhost/FactoryServer' ) +MakeSphere.SetComment( 'MakeSphere from Geometry' ) +MakeSphere.Coords( 5 , 449 ) + +# Creation of intermediate Output variables and of Control Links +MakeBoxshape = MakeBox.Port( 'shape' ) +MakeCopyshape1 = GeomGraph.Link( MakeBoxshape , MakeCopy.Port( 'shape1' ) ) +MakeCopyshape1.AddCoord( 1 , 198 , 184 ) +MakeCopyshape1.AddCoord( 2 , 199 , 209 ) +MakeCopy_1shape1 = GeomGraph.Link( MakeBoxshape , MakeCopy_1.Port( 'shape1' ) ) +MakeCopy_1shape1.AddCoord( 1 , 198 , 441 ) +MakeCopy_1shape1.AddCoord( 2 , 198 , 209 ) +MakeCopyshape = MakeCopy.Port( 'shape' ) +MakeTranslationshape1 = GeomGraph.Link( MakeCopyshape , MakeTranslation.Port( 'shape1' ) ) +MakeCopy_1shape = MakeCopy_1.Port( 'shape' ) +MakeFuseshape2 = GeomGraph.Link( MakeCopy_1shape , MakeFuse.Port( 'shape2' ) ) +MakeFuseshape2.AddCoord( 1 , 642 , 362 ) +MakeFuseshape2.AddCoord( 2 , 642 , 442 ) +MakeTranslationshape = MakeTranslation.Port( 'shape' ) +MakeFuseshape1 = GeomGraph.Link( MakeTranslationshape , MakeFuse.Port( 'shape1' ) ) +MakeFuseshape1.AddCoord( 1 , 643 , 330 ) +MakeFuseshape1.AddCoord( 2 , 644 , 195 ) +MakeFuseshape = MakeFuse.Port( 'shape' ) +MakeFuse_1shape1 = GeomGraph.Link( MakeFuseshape , MakeFuse_1.Port( 'shape1' ) ) +MakeFuse_1shape1.AddCoord( 1 , 872 , 445 ) +MakeFuse_1shape1.AddCoord( 2 , 874 , 333 ) +MakeSphereshape = MakeSphere.Port( 'shape' ) +MakeFuse_1shape2 = GeomGraph.Link( MakeSphereshape , MakeFuse_1.Port( 'shape2' ) ) +MakeFuse_1shape2.AddCoord( 1 , 872 , 474 ) +MakeFuse_1shape2.AddCoord( 2 , 871 , 552 ) + +# Creation of Input datas +MakeBoxx1 = MakeBox.Input( 'x1' , 0) +MakeBoxy1 = MakeBox.Input( 'y1' , 0) +MakeBoxz1 = MakeBox.Input( 'z1' , 0) +MakeBoxx2 = MakeBox.Input( 'x2' , 50) +MakeBoxy2 = MakeBox.Input( 'y2' , 50) +MakeBoxz2 = MakeBox.Input( 'z2' , 50) +MakeTranslationx1 = MakeTranslation.Input( 'x1' , 25) +MakeTranslationy1 = MakeTranslation.Input( 'y1' , 25) +MakeTranslationz1 = MakeTranslation.Input( 'z1' , 25) +MakeSpherex1 = MakeSphere.Input( 'x1' , 0) +MakeSpherey1 = MakeSphere.Input( 'y1' , 0) +MakeSpherez1 = MakeSphere.Input( 'z1' , 0) +MakeSphereradius = MakeSphere.Input( 'radius' , 12) + +# Creation of Output variables +MakeFuse_1shape = MakeFuse_1.Port( 'shape' ) + +GeomGraph.Run() + +GeomGraph.DoneW() + +GeomGraph.PrintPorts() + diff --git a/examples/GeomGraph.xml b/examples/GeomGraph.xml index 8da148d..eb77edc 100644 --- a/examples/GeomGraph.xml +++ b/examples/GeomGraph.xml @@ -1,651 +1,550 @@ - - - - - + + - - - ? - ? - GeomGraph - 1 - ? - - GeomGraph - - - double - MakeBox\x1 - - - double - MakeBox\y1 - - - double - MakeBox\z1 - - - double - MakeBox\x2 - - - double - MakeBox\y2 - - - double - MakeBox\z2 - - - double - MakeTranslation\x1 - - - double - MakeTranslation\y1 - - - double - MakeTranslation\z1 - - - double - MakeSphere\x1 - - - double - MakeSphere\y1 - - - double - MakeSphere\z1 - - - double - MakeSphere\radius - - - - - GEOM_Shape - MakeFuse_1\shape - - - - - - - - 13/3/2003 - 11:46:34 - 13/3/2003 - 13:49:29 - 1.04 - ? - ? - ? - 0 - 0 - - - - - - GEOM - GEOM - MakeBox - 0 - ? - - MakeBox - - - double - x1 - - - double - y1 - - - double - z1 - - - double - x2 - - - double - y2 - - - double - z2 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:45 - 13/3/2003 - 11:46:45 - 1.04 - ? - localhost/FactoryServer - MakeBox from Geometry - 5 - 101 - - - GEOM - GEOM - MakeCopy - 0 - ? - - MakeCopy - - - GEOM_Shape - shape1 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:48 - 13/3/2003 - 11:46:48 - 1.04 - ? - localhost/FactoryServer - MakeCopy from Geometry - 235 - 77 - - - GEOM - GEOM - MakeCopy_1 - 0 - ? - - MakeCopy - - - GEOM_Shape - shape1 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:49 - 13/3/2003 - 11:46:49 - 1.04 - ? - localhost/FactoryServer - MakeCopy from Geometry - 232 - 332 - - - GEOM - GEOM - MakeTranslation - 0 - ? - - MakeTranslation - - - GEOM_Shape - shape1 - - - double - x1 - - - double - y1 - - - double - z1 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:51 - 13/3/2003 - 11:46:51 - 1.04 - ? - localhost/FactoryServer - MakeTranslation from Geometry - 449 - 86 - - - GEOM - GEOM - MakeFuse - 0 - ? - - MakeFuse - - - GEOM_Shape - shape1 - - - GEOM_Shape - shape2 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:55 - 13/3/2003 - 11:46:55 - 1.04 - ? - localhost/FactoryServer - MakeFuse from Geometry - 678 - 224 - - - GEOM - GEOM - MakeFuse_1 - 0 - ? - - MakeFuse - - - GEOM_Shape - shape1 - - - GEOM_Shape - shape2 - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:46:58 - 13/3/2003 - 11:46:58 - 1.04 - ? - localhost/FactoryServer - MakeFuse from Geometry - 909 - 340 - - - GEOM - GEOM - MakeSphere - 0 - ? - - MakeSphere - - - double - x1 - - - double - y1 - - - double - z1 - - - double - radius - - - - - GEOM_Shape - shape - - - - - - - - 13/3/2003 - 11:47:0 - 13/3/2003 - 11:47:0 - 1.04 - ? - localhost/FactoryServer - MakeSphere from Geometry - 5 - 449 - - - - - - MakeBox - shape - MakeCopy - shape1 - - - 198 - 184 - - - 199 - 209 - - - - - MakeBox - shape - MakeCopy_1 - shape1 - - - 198 - 441 - - - 198 - 209 - - - - - MakeCopy - shape - MakeTranslation - shape1 - - - - - MakeCopy_1 - shape - MakeFuse - shape2 - - - 642 - 362 - - - 642 - 442 - - - - - MakeTranslation - shape - MakeFuse - shape1 - - - 643 - 330 - - - 644 - 195 - - - - - MakeFuse - shape - MakeFuse_1 - shape1 - - - 872 - 445 - - - 874 - 333 - - - - - MakeSphere - shape - MakeFuse_1 - shape2 - - - 872 - 474 - - - 871 - 552 - - - - - - - - GeomGraph - MakeBox\x1 - MakeBox - x1 - - 3 - 0 - - - - - - GeomGraph - MakeBox\y1 - MakeBox - y1 - - 3 - 0 - - - - - - GeomGraph - MakeBox\z1 - MakeBox - z1 - - 3 - 0 - - - - - - GeomGraph - MakeBox\x2 - MakeBox - x2 - - 3 - 50 - - - - - - GeomGraph - MakeBox\y2 - MakeBox - y2 - - 3 - 50 - - - - - - GeomGraph - MakeBox\z2 - MakeBox - z2 - - 3 - 50 - - - - - - GeomGraph - MakeTranslation\x1 - MakeTranslation - x1 - - 3 - 25 - - - - - - GeomGraph - MakeTranslation\y1 - MakeTranslation - y1 - - 3 - 25 - - - - - - GeomGraph - MakeTranslation\z1 - MakeTranslation - z1 - - 3 - 25 - - - - - - GeomGraph - MakeSphere\x1 - MakeSphere - x1 - - 3 - 0 - - - - - - GeomGraph - MakeSphere\y1 - MakeSphere - y1 - - 3 - 0 - - - - - - GeomGraph - MakeSphere\z1 - MakeSphere - z1 - - 3 - 0 - - - - - - GeomGraph - MakeSphere\radius - MakeSphere - radius - - 3 - 12 - - - - - - - + + +? + ? + aNewDataFlow_1_4_2_1_1_2_2_1 + 1 + ? + +aNewDataFlow_1_4_2_1_1_2_2_1 + + +double + MakeBox1__x1 + +double + MakeBox1__y1 + +double + MakeBox1__z1 + +double + MakeBox1__x2 + +double + MakeBox1__y2 + +double + MakeBox1__z2 + +double + MakeSphere_1__x1 + +double + MakeSphere_1__y1 + +double + MakeSphere_1__z1 + +double + MakeSphere_1__radius + +double + MakeTranslation_1__x1 + +double + MakeTranslation_1__y1 + +double + MakeTranslation_1__z1 + + +objref + MakeFuse_2__shape + + + 25/8/2004 - 16:28:50 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeBox1 + 3 + ? + +MakeBox1 + + +double + x1 + +double + y1 + +double + z1 + +double + x2 + +double + y2 + +double + z2 + + +objref + shape + + + +MakeBox1 + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 194 + 3 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 389 + 3 + +? + ? + MakeCopy_2 + 3 + ? + +MakeCopy_2 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_2 + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 389 + 136 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 203 + 315 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 596 + 3 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 823 + 116 + +? + ? + MakeFuse_2 + 3 + ? + +MakeFuse_2 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_2 + + + + + + + + + + + + 30/8/2004 - 9:41:28 + 30/8/2004 - 9:41:28 + 2.0 + ? + ? + Compute Node + 1049 + 295 + + +gag + Gate + MakeBox1 + Gate + + +gag + Gate + MakeSphere_1 + Gate + + +164 + 470 + +164 + 265 + +MakeBox1 + shape + MakeCopy_1 + shape1 + + +MakeBox1 + shape + MakeCopy_2 + shape1 + + +384 + 207 + +MakeCopy_1 + shape + MakeTranslation_1 + shape1 + + +MakeCopy_2 + shape + MakeFuse_1 + shape2 + + +674 + 207 + +MakeSphere_1 + shape + MakeFuse_2 + shape2 + + +MakeTranslation_1 + shape + MakeFuse_1 + shape1 + + +MakeFuse_1 + shape + MakeFuse_2 + shape1 + + +1017 + 366 + +1017 + 187 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__x1 + MakeBox1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__y1 + MakeBox1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__z1 + MakeBox1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__x2 + MakeBox1 + x2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__y2 + MakeBox1 + y2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeBox1__z2 + MakeBox1 + z2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeSphere_1__radius + MakeSphere_1 + radius + +7 + 12 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + +7 + 25 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeTranslation_1__y1 + MakeTranslation_1 + y1 + +7 + 25 + + +aNewDataFlow_1_4_2_1_1_2_2_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + +7 + 25 + diff --git a/examples/GeomGraph.xml_old b/examples/GeomGraph.xml_old new file mode 100644 index 0000000..8da148d --- /dev/null +++ b/examples/GeomGraph.xml_old @@ -0,0 +1,651 @@ + + + + + + + + + ? + ? + GeomGraph + 1 + ? + + GeomGraph + + + double + MakeBox\x1 + + + double + MakeBox\y1 + + + double + MakeBox\z1 + + + double + MakeBox\x2 + + + double + MakeBox\y2 + + + double + MakeBox\z2 + + + double + MakeTranslation\x1 + + + double + MakeTranslation\y1 + + + double + MakeTranslation\z1 + + + double + MakeSphere\x1 + + + double + MakeSphere\y1 + + + double + MakeSphere\z1 + + + double + MakeSphere\radius + + + + + GEOM_Shape + MakeFuse_1\shape + + + + + + + + 13/3/2003 - 11:46:34 + 13/3/2003 - 13:49:29 + 1.04 + ? + ? + ? + 0 + 0 + + + + + + GEOM + GEOM + MakeBox + 0 + ? + + MakeBox + + + double + x1 + + + double + y1 + + + double + z1 + + + double + x2 + + + double + y2 + + + double + z2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:45 + 13/3/2003 - 11:46:45 + 1.04 + ? + localhost/FactoryServer + MakeBox from Geometry + 5 + 101 + + + GEOM + GEOM + MakeCopy + 0 + ? + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:48 + 13/3/2003 - 11:46:48 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 235 + 77 + + + GEOM + GEOM + MakeCopy_1 + 0 + ? + + MakeCopy + + + GEOM_Shape + shape1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:49 + 13/3/2003 - 11:46:49 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 232 + 332 + + + GEOM + GEOM + MakeTranslation + 0 + ? + + MakeTranslation + + + GEOM_Shape + shape1 + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:51 + 13/3/2003 - 11:46:51 + 1.04 + ? + localhost/FactoryServer + MakeTranslation from Geometry + 449 + 86 + + + GEOM + GEOM + MakeFuse + 0 + ? + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:55 + 13/3/2003 - 11:46:55 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 678 + 224 + + + GEOM + GEOM + MakeFuse_1 + 0 + ? + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:46:58 + 13/3/2003 - 11:46:58 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 909 + 340 + + + GEOM + GEOM + MakeSphere + 0 + ? + + MakeSphere + + + double + x1 + + + double + y1 + + + double + z1 + + + double + radius + + + + + GEOM_Shape + shape + + + + + + + + 13/3/2003 - 11:47:0 + 13/3/2003 - 11:47:0 + 1.04 + ? + localhost/FactoryServer + MakeSphere from Geometry + 5 + 449 + + + + + + MakeBox + shape + MakeCopy + shape1 + + + 198 + 184 + + + 199 + 209 + + + + + MakeBox + shape + MakeCopy_1 + shape1 + + + 198 + 441 + + + 198 + 209 + + + + + MakeCopy + shape + MakeTranslation + shape1 + + + + + MakeCopy_1 + shape + MakeFuse + shape2 + + + 642 + 362 + + + 642 + 442 + + + + + MakeTranslation + shape + MakeFuse + shape1 + + + 643 + 330 + + + 644 + 195 + + + + + MakeFuse + shape + MakeFuse_1 + shape1 + + + 872 + 445 + + + 874 + 333 + + + + + MakeSphere + shape + MakeFuse_1 + shape2 + + + 872 + 474 + + + 871 + 552 + + + + + + + + GeomGraph + MakeBox\x1 + MakeBox + x1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\y1 + MakeBox + y1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\z1 + MakeBox + z1 + + 3 + 0 + + + + + + GeomGraph + MakeBox\x2 + MakeBox + x2 + + 3 + 50 + + + + + + GeomGraph + MakeBox\y2 + MakeBox + y2 + + 3 + 50 + + + + + + GeomGraph + MakeBox\z2 + MakeBox + z2 + + 3 + 50 + + + + + + GeomGraph + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 25 + + + + + + GeomGraph + MakeTranslation\y1 + MakeTranslation + y1 + + 3 + 25 + + + + + + GeomGraph + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + 25 + + + + + + GeomGraph + MakeSphere\x1 + MakeSphere + x1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\y1 + MakeSphere + y1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\z1 + MakeSphere + z1 + + 3 + 0 + + + + + + GeomGraph + MakeSphere\radius + MakeSphere + radius + + 3 + 12 + + + + + + + diff --git a/examples/GraphGeomEssai.xml b/examples/GraphGeomEssai.xml index 766f59c..ff75b20 100644 --- a/examples/GraphGeomEssai.xml +++ b/examples/GraphGeomEssai.xml @@ -1,318 +1,361 @@ - + + ? - ? - GraphGeomEssai - 1 - ? - -GraphGeomEssai - + ? + GraphGeomEssai_1_1_1 + 1 + ? + +GraphGeomEssai_1_1_1 + double - MakeSphere\x1 - + MakeSphere_1__x1 + double - MakeSphere\y1 - + MakeSphere_1__y1 + double - MakeSphere\z1 - + MakeSphere_1__z1 + double - MakeSphere\radius - + MakeSphere_1__radius + double - MakeTranslation\x1 - + MakeTranslation_1__x1 + double - MakeTranslation\y1 - + MakeTranslation_1__y1 + double - MakeTranslation\z1 - + MakeTranslation_1__z1 + -GEOM_Shape - MakeFuse\shape - - - 10/7/2002 - 14:53:2 - 24/9/2003 - 16:13:48 - 1.03 - ? - ? - ? - 0 - 0 - +objref + MakeFuse_1__shape + + + 10/7/2002 - 14:53:2 + 30/8/2004 - 10:8:1 + 1.03 + ? + ? + ? + 0 + 0 + -GEOM - GEOM - MakeCopy - 0 - ? - -MakeCopy - - -GEOM_Shape - shape1 - - -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeCopy from GEOM - 269 - 85 - -GEOM - GEOM - MakeFuse - 0 - ? - -MakeFuse - - -GEOM_Shape - shape1 - -GEOM_Shape - shape2 - - -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeFuse from GEOM - 725 - 179 - -GEOM - GEOM - MakeSphere - 0 - ? - -MakeSphere - +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 0 + 166 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + double - x1 - + x1 + double - y1 - + y1 + double - z1 - + z1 + double - radius - + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 181 + 86 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeSphere from GEOM - 28 - 188 - -GEOM - GEOM - MakeTranslation - 0 - ? - -MakeTranslation - +objref + shape + + + +MakeCopy_1 + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 386 + 2 + +? + ? + MakeCopy_2 + 3 + ? + +MakeCopy_2 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_2 + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 388 + 181 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + -GEOM_Shape - shape1 - double - x1 - + x1 + double - y1 - + y1 + double - z1 - + z1 + +objref + shape1 + -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeTranslation from GEOM - 493 - 85 - -GEOM - GEOM - MakeCopy_1 - 0 - ? - -MakeCopy - +objref + shape + + + +MakeTranslation_1 + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 581 + 1 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + -GEOM_Shape - shape1 - +objref + shape1 + +objref + shape2 + -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeCopy from GEOM - 283 - 391 - +objref + shape + + + +MakeFuse_1 + + + + + + + + + + + + 30/8/2004 - 10:8:1 + 30/8/2004 - 10:8:1 + 2.0 + ? + ? + Compute Node + 779 + 161 + -MakeCopy - shape - MakeTranslation - shape1 - - -MakeSphere - shape - MakeCopy - shape1 - - -225 - 165 - -224 - 269 - -MakeSphere - shape - MakeCopy_1 - shape1 - - -223 - 472 - -224 - 270 - -MakeTranslation - shape - MakeFuse - shape1 - - -688 - 259 - -687 - 165 - +gag + Gate + MakeSphere_1 + Gate + + +MakeSphere_1 + shape + MakeCopy_1 + shape1 + + +MakeSphere_1 + shape + MakeCopy_2 + shape1 + + MakeCopy_1 - shape - MakeFuse - shape2 - - -689 - 289 - -690 - 471 - + shape + MakeTranslation_1 + shape1 + + +MakeCopy_2 + shape + MakeFuse_1 + shape2 + + +MakeTranslation_1 + shape + MakeFuse_1 + shape1 + + -GraphGeomEssai - MakeSphere\x1 - MakeSphere - x1 - +GraphGeomEssai_1_1_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + 7 - 0 - - -GraphGeomEssai - MakeSphere\y1 - MakeSphere - y1 - + 0 + + +GraphGeomEssai_1_1_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + 7 - 0 - - -GraphGeomEssai - MakeSphere\z1 - MakeSphere - z1 - + 0 + + +GraphGeomEssai_1_1_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + 7 - 0 - - -GraphGeomEssai - MakeSphere\radius - MakeSphere - radius - + 0 + + +GraphGeomEssai_1_1_1 + MakeSphere_1__radius + MakeSphere_1 + radius + 7 - 20 - - -GraphGeomEssai - MakeTranslation\x1 - MakeTranslation - x1 - + 20 + + +GraphGeomEssai_1_1_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + 7 - 10 - - -GraphGeomEssai - MakeTranslation\y1 - MakeTranslation - y1 - + 10 + + +GraphGeomEssai_1_1_1 + MakeTranslation_1__y1 + MakeTranslation_1 + y1 + 7 - 10 - - -GraphGeomEssai - MakeTranslation\z1 - MakeTranslation - z1 - + 10 + + +GraphGeomEssai_1_1_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + 7 - 10 - + 10 + diff --git a/examples/GraphGeomEssai.xml_old b/examples/GraphGeomEssai.xml_old new file mode 100644 index 0000000..766f59c --- /dev/null +++ b/examples/GraphGeomEssai.xml_old @@ -0,0 +1,318 @@ + + + + +? + ? + GraphGeomEssai + 1 + ? + +GraphGeomEssai + + +double + MakeSphere\x1 + +double + MakeSphere\y1 + +double + MakeSphere\z1 + +double + MakeSphere\radius + +double + MakeTranslation\x1 + +double + MakeTranslation\y1 + +double + MakeTranslation\z1 + + +GEOM_Shape + MakeFuse\shape + + + 10/7/2002 - 14:53:2 + 24/9/2003 - 16:13:48 + 1.03 + ? + ? + ? + 0 + 0 + + +GEOM + GEOM + MakeCopy + 0 + ? + +MakeCopy + + +GEOM_Shape + shape1 + + +GEOM_Shape + shape + + + 24/9/2003 - 16:13:48 + 24/9/2003 - 16:13:48 + 1.03 + ? + localhost/FactoryServer + MakeCopy from GEOM + 269 + 85 + +GEOM + GEOM + MakeFuse + 0 + ? + +MakeFuse + + +GEOM_Shape + shape1 + +GEOM_Shape + shape2 + + +GEOM_Shape + shape + + + 24/9/2003 - 16:13:48 + 24/9/2003 - 16:13:48 + 1.03 + ? + localhost/FactoryServer + MakeFuse from GEOM + 725 + 179 + +GEOM + GEOM + MakeSphere + 0 + ? + +MakeSphere + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +GEOM_Shape + shape + + + 24/9/2003 - 16:13:48 + 24/9/2003 - 16:13:48 + 1.03 + ? + localhost/FactoryServer + MakeSphere from GEOM + 28 + 188 + +GEOM + GEOM + MakeTranslation + 0 + ? + +MakeTranslation + + +GEOM_Shape + shape1 + +double + x1 + +double + y1 + +double + z1 + + +GEOM_Shape + shape + + + 24/9/2003 - 16:13:48 + 24/9/2003 - 16:13:48 + 1.03 + ? + localhost/FactoryServer + MakeTranslation from GEOM + 493 + 85 + +GEOM + GEOM + MakeCopy_1 + 0 + ? + +MakeCopy + + +GEOM_Shape + shape1 + + +GEOM_Shape + shape + + + 24/9/2003 - 16:13:48 + 24/9/2003 - 16:13:48 + 1.03 + ? + localhost/FactoryServer + MakeCopy from GEOM + 283 + 391 + + +MakeCopy + shape + MakeTranslation + shape1 + + +MakeSphere + shape + MakeCopy + shape1 + + +225 + 165 + +224 + 269 + +MakeSphere + shape + MakeCopy_1 + shape1 + + +223 + 472 + +224 + 270 + +MakeTranslation + shape + MakeFuse + shape1 + + +688 + 259 + +687 + 165 + +MakeCopy_1 + shape + MakeFuse + shape2 + + +689 + 289 + +690 + 471 + + +GraphGeomEssai + MakeSphere\x1 + MakeSphere + x1 + +7 + 0 + + +GraphGeomEssai + MakeSphere\y1 + MakeSphere + y1 + +7 + 0 + + +GraphGeomEssai + MakeSphere\z1 + MakeSphere + z1 + +7 + 0 + + +GraphGeomEssai + MakeSphere\radius + MakeSphere + radius + +7 + 20 + + +GraphGeomEssai + MakeTranslation\x1 + MakeTranslation + x1 + +7 + 10 + + +GraphGeomEssai + MakeTranslation\y1 + MakeTranslation + y1 + +7 + 10 + + +GraphGeomEssai + MakeTranslation\z1 + MakeTranslation + z1 + +7 + 10 + diff --git a/examples/MacroWithGeom.xml b/examples/MacroWithGeom.xml index ff3ad12..0191126 100755 --- a/examples/MacroWithGeom.xml +++ b/examples/MacroWithGeom.xml @@ -5,63 +5,63 @@ ? ? - GeomGraph_3 + aNewDataFlow_1_4_1_1_1_1 1 ? -GeomGraph_3 +aNewDataFlow_1_4_1_1_1_1 double - MakeBox__x1 + MakeBox1__x1 double - MakeBox__y1 + MakeBox1__y1 double - MakeBox__z1 + MakeBox1__z1 double - MakeBox__x2 + MakeBox1__x2 double - MakeBox__y2 + MakeBox1__y2 double - MakeBox__z2 + MakeBox1__z2 double - MakeTranslation__x1 + MakeSphere_1__x1 double - MakeTranslation__z1 + MakeSphere_1__y1 double - MakeSphere__x1 + MakeSphere_1__z1 double - MakeSphere__y1 + MakeSphere_1__radius double - MakeSphere__z1 + MakeTranslation_1__x1 double - MakeSphere__radius + MakeTranslation_1__z1 -long - Macro_aNewDataFlow_1_5_1__sum__a +double + Macro_aNewDataFlow_1_5_1_1__sum__a -long - Macro_aNewDataFlow_1_5_1__sum__b +double + Macro_aNewDataFlow_1_5_1_1__sum__b -GEOM_Shape - MakeFuse_1__shape +objref + MakeFuse_2__shape - 13/3/2003 - 11:46:34 - 2/7/2004 - 11:13:17 - 1.04 + 25/8/2004 - 16:28:50 + 30/8/2004 - 10:16:9 + 2.0 ? ? ? @@ -69,13 +69,39 @@ 0 -GEOM - GEOM - MakeBox - 0 +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeBox1 + 3 ? -MakeBox +MakeBox1 double @@ -97,83 +123,95 @@ z2 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeBox1 + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeBox from Geometry - 5 - 101 + ? + Compute Node + 194 + 3 -GEOM - GEOM - MakeCopy - 0 +? + ? + MakeCopy_1 + 3 ? -MakeCopy +MakeCopy_1 -GEOM_Shape +objref shape1 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeCopy_1 + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeCopy from Geometry - 235 - 77 + ? + Compute Node + 389 + 3 -GEOM - GEOM - MakeCopy_1 - 0 +? + ? + MakeCopy_2 + 3 ? -MakeCopy +MakeCopy_2 -GEOM_Shape +objref shape1 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeCopy_2 + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeCopy from Geometry - 249 - 371 + ? + Compute Node + 391 + 264 -GEOM - GEOM - MakeTranslation - 0 +? + ? + MakeSphere_1 + 3 ? -MakeTranslation +MakeSphere_1 -GEOM_Shape - shape1 - double x1 @@ -181,128 +219,161 @@ y1 double - z1 + z1 + +double + radius -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeSphere_1 + + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeTranslation from Geometry - 449 - 86 + ? + Compute Node + 203 + 315 -GEOM - GEOM - MakeFuse - 0 +? + ? + MakeTranslation_1 + 3 ? -MakeFuse +MakeTranslation_1 -GEOM_Shape +objref shape1 -GEOM_Shape - shape2 +double + x1 + +objref + y1 + +double + z1 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeTranslation_1 + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeFuse from Geometry - 678 - 224 + ? + Compute Node + 596 + 3 -GEOM - GEOM +? + ? MakeFuse_1 - 0 + 3 ? -MakeFuse +MakeFuse_1 -GEOM_Shape +objref shape1 -GEOM_Shape +objref shape2 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeFuse_1 + + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeFuse from Geometry - 909 - 340 + ? + Compute Node + 823 + 116 -GEOM - GEOM - MakeSphere - 0 +? + ? + MakeFuse_2 + 3 ? -MakeSphere +MakeFuse_2 -double - x1 - -double - y1 - -double - z1 +objref + shape1 -double - radius +objref + shape2 -GEOM_Shape +objref shape - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +MakeFuse_2 + + + + + + + + + + + + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 + 2.0 ? - localhost/FactoryServer - MakeSphere from Geometry - 5 - 449 + ? + Compute Node + 1049 + 295 ? ? - Macro_aNewDataFlow_1_5_1 + Macro_aNewDataFlow_1_5_1_1 10 - aNewDataFlow_1_5_1 + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 -aNewDataFlow_1_5_1 +aNewDataFlow_1_5_1_1 -long +double sum__a -long +double sum__b @@ -313,242 +384,218 @@ ? - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 + 30/8/2004 - 10:16:9 + 30/8/2004 - 10:16:9 2.0 ? ? Macro Node - 237 - 215 + 391 + 121 -MakeBox - shape - MakeCopy - shape1 +gag + Gate + MakeBox1 + Gate + + +gag + Gate + MakeSphere_1 + Gate -198 - 184 +175 + 470 -199 - 209 +175 + 198 -MakeBox +MakeBox1 shape MakeCopy_1 shape1 + + +MakeBox1 + shape + MakeCopy_2 + shape1 -198 - 441 - -198 - 209 +373 + 211 -MakeCopy +MakeCopy_1 shape - MakeTranslation + MakeTranslation_1 shape1 -MakeCopy_1 +MakeCopy_2 shape - MakeFuse + MakeFuse_1 shape2 -642 - 362 - -642 - 442 +674 + 207 -MakeTranslation +MakeSphere_1 shape - MakeFuse - shape1 - - -643 - 330 - -644 - 195 + MakeFuse_2 + shape2 + -MakeFuse +MakeTranslation_1 shape MakeFuse_1 shape1 - - -872 - 445 - -874 - 333 + -MakeSphere +MakeFuse_1 shape - MakeFuse_1 - shape2 + MakeFuse_2 + shape1 -872 - 474 +1017 + 366 -871 - 552 +1017 + 187 -Macro_aNewDataFlow_1_5_1 +Macro_aNewDataFlow_1_5_1_1 Mult__b - MakeTranslation + MakeTranslation_1 y1 -GeomGraph_3 - MakeBox__x1 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__x1 + MakeBox1 x1 7 0 -GeomGraph_3 - MakeBox__y1 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__y1 + MakeBox1 y1 7 0 -GeomGraph_3 - MakeBox__z1 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__z1 + MakeBox1 z1 7 0 -GeomGraph_3 - MakeBox__x2 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__x2 + MakeBox1 x2 7 50 -GeomGraph_3 - MakeBox__y2 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__y2 + MakeBox1 y2 7 50 -GeomGraph_3 - MakeBox__z2 - MakeBox +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__z2 + MakeBox1 z2 7 50 -GeomGraph_3 - MakeTranslation__x1 - MakeTranslation - x1 - -7 - 25 - - -GeomGraph_3 - MakeTranslation__z1 - MakeTranslation - z1 - -7 - 25 - - -GeomGraph_3 - MakeSphere__x1 - MakeSphere +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__x1 + MakeSphere_1 x1 7 0 -GeomGraph_3 - MakeSphere__y1 - MakeSphere +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__y1 + MakeSphere_1 y1 7 0 -GeomGraph_3 - MakeSphere__z1 - MakeSphere +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__z1 + MakeSphere_1 z1 7 0 -GeomGraph_3 - MakeSphere__radius - MakeSphere +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__radius + MakeSphere_1 radius 7 12 -GeomGraph_3 - Macro_aNewDataFlow_1_5_1__sum__a - Macro_aNewDataFlow_1_5_1 - sum__a +aNewDataFlow_1_4_1_1_1_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 -3 - 3 +7 + 25 -GeomGraph_3 - Macro_aNewDataFlow_1_5_1__sum__b - Macro_aNewDataFlow_1_5_1 - sum__b +aNewDataFlow_1_4_1_1_1_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 -3 - 7 +7 + 25 ? ? - aNewDataFlow_1_5_1 + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 1 ? -aNewDataFlow_1_5_1 +aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 -long +double sum__a -long +double sum__b @@ -557,7 +604,7 @@ 25/6/2004 - 17:42:12 - 2/7/2004 - 11:11:42 + 30/8/2004 - 10:16:10 2.0 ? ? @@ -575,10 +622,10 @@ sum -long +double a -long +double b @@ -590,8 +637,8 @@ sum - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 + 30/8/2004 - 10:16:10 + 30/8/2004 - 10:16:10 2.0 ? ? @@ -621,8 +668,8 @@ - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 + 30/8/2004 - 10:16:10 + 30/8/2004 - 10:16:10 2.0 ? ? diff --git a/examples/MacroWithGeom.xml_old b/examples/MacroWithGeom.xml_old new file mode 100755 index 0000000..ff3ad12 --- /dev/null +++ b/examples/MacroWithGeom.xml_old @@ -0,0 +1,639 @@ + + + + + +? + ? + GeomGraph_3 + 1 + ? + +GeomGraph_3 + + +double + MakeBox__x1 + +double + MakeBox__y1 + +double + MakeBox__z1 + +double + MakeBox__x2 + +double + MakeBox__y2 + +double + MakeBox__z2 + +double + MakeTranslation__x1 + +double + MakeTranslation__z1 + +double + MakeSphere__x1 + +double + MakeSphere__y1 + +double + MakeSphere__z1 + +double + MakeSphere__radius + +long + Macro_aNewDataFlow_1_5_1__sum__a + +long + Macro_aNewDataFlow_1_5_1__sum__b + + +GEOM_Shape + MakeFuse_1__shape + + + 13/3/2003 - 11:46:34 + 2/7/2004 - 11:13:17 + 1.04 + ? + ? + ? + 0 + 0 + + +GEOM + GEOM + MakeBox + 0 + ? + +MakeBox + + +double + x1 + +double + y1 + +double + z1 + +double + x2 + +double + y2 + +double + z2 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeBox from Geometry + 5 + 101 + +GEOM + GEOM + MakeCopy + 0 + ? + +MakeCopy + + +GEOM_Shape + shape1 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 235 + 77 + +GEOM + GEOM + MakeCopy_1 + 0 + ? + +MakeCopy + + +GEOM_Shape + shape1 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeCopy from Geometry + 249 + 371 + +GEOM + GEOM + MakeTranslation + 0 + ? + +MakeTranslation + + +GEOM_Shape + shape1 + +double + x1 + +double + y1 + +double + z1 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeTranslation from Geometry + 449 + 86 + +GEOM + GEOM + MakeFuse + 0 + ? + +MakeFuse + + +GEOM_Shape + shape1 + +GEOM_Shape + shape2 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 678 + 224 + +GEOM + GEOM + MakeFuse_1 + 0 + ? + +MakeFuse + + +GEOM_Shape + shape1 + +GEOM_Shape + shape2 + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeFuse from Geometry + 909 + 340 + +GEOM + GEOM + MakeSphere + 0 + ? + +MakeSphere + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +GEOM_Shape + shape + + + 2/7/2004 - 11:10:39 + 2/7/2004 - 11:10:39 + 1.04 + ? + localhost/FactoryServer + MakeSphere from Geometry + 5 + 449 + +? + ? + Macro_aNewDataFlow_1_5_1 + 10 + aNewDataFlow_1_5_1 + +aNewDataFlow_1_5_1 + + +long + sum__a + +long + sum__b + + +int + Mult__b + + + +? + + 2/7/2004 - 11:11:42 + 2/7/2004 - 11:11:42 + 2.0 + ? + ? + Macro Node + 237 + 215 + + +MakeBox + shape + MakeCopy + shape1 + + +198 + 184 + +199 + 209 + +MakeBox + shape + MakeCopy_1 + shape1 + + +198 + 441 + +198 + 209 + +MakeCopy + shape + MakeTranslation + shape1 + + +MakeCopy_1 + shape + MakeFuse + shape2 + + +642 + 362 + +642 + 442 + +MakeTranslation + shape + MakeFuse + shape1 + + +643 + 330 + +644 + 195 + +MakeFuse + shape + MakeFuse_1 + shape1 + + +872 + 445 + +874 + 333 + +MakeSphere + shape + MakeFuse_1 + shape2 + + +872 + 474 + +871 + 552 + +Macro_aNewDataFlow_1_5_1 + Mult__b + MakeTranslation + y1 + + + +GeomGraph_3 + MakeBox__x1 + MakeBox + x1 + +7 + 0 + + +GeomGraph_3 + MakeBox__y1 + MakeBox + y1 + +7 + 0 + + +GeomGraph_3 + MakeBox__z1 + MakeBox + z1 + +7 + 0 + + +GeomGraph_3 + MakeBox__x2 + MakeBox + x2 + +7 + 50 + + +GeomGraph_3 + MakeBox__y2 + MakeBox + y2 + +7 + 50 + + +GeomGraph_3 + MakeBox__z2 + MakeBox + z2 + +7 + 50 + + +GeomGraph_3 + MakeTranslation__x1 + MakeTranslation + x1 + +7 + 25 + + +GeomGraph_3 + MakeTranslation__z1 + MakeTranslation + z1 + +7 + 25 + + +GeomGraph_3 + MakeSphere__x1 + MakeSphere + x1 + +7 + 0 + + +GeomGraph_3 + MakeSphere__y1 + MakeSphere + y1 + +7 + 0 + + +GeomGraph_3 + MakeSphere__z1 + MakeSphere + z1 + +7 + 0 + + +GeomGraph_3 + MakeSphere__radius + MakeSphere + radius + +7 + 12 + + +GeomGraph_3 + Macro_aNewDataFlow_1_5_1__sum__a + Macro_aNewDataFlow_1_5_1 + sum__a + +3 + 3 + + +GeomGraph_3 + Macro_aNewDataFlow_1_5_1__sum__b + Macro_aNewDataFlow_1_5_1 + sum__b + +3 + 7 + + + + +? + ? + aNewDataFlow_1_5_1 + 1 + ? + +aNewDataFlow_1_5_1 + + +long + sum__a + +long + sum__b + + +int + Mult__b + + + 25/6/2004 - 17:42:12 + 2/7/2004 - 11:11:42 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + sum + 3 + ? + +sum + + +long + a + +long + b + + +long + s + + + +sum + + + 2/7/2004 - 11:11:42 + 2/7/2004 - 11:11:42 + 2.0 + ? + ? + Compute Node + 52 + 80 + +? + ? + Mult + 3 + ? + +Mult + + +int + a + + +int + b + + + +Mult + + + + 2/7/2004 - 11:11:42 + 2/7/2004 - 11:11:42 + 2.0 + ? + ? + Compute Node + 298 + 72 + + +sum + s + Mult + a + + diff --git a/examples/NewGraphGeomEssai.py b/examples/NewGraphGeomEssai.py index ca8ef7a..461035f 100644 --- a/examples/NewGraphGeomEssai.py +++ b/examples/NewGraphGeomEssai.py @@ -1,84 +1,127 @@ -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -# -# -# -# File : NewGraphGeomEssai.py -# Module : SuperVisionTest -from SuperV import * -# Graph creation -NewGraphGeomEssai = Graph( 'NewGraphGeomEssai' ) -print NewGraphGeomEssai.SetAuthor( '' ) -print NewGraphGeomEssai.SetComment( '' ) -NewGraphGeomEssai.Coords( 0 , 0 ) - -# Creation of Nodes -MakeSphere = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeSphere' ) -print MakeSphere.SetAuthor( '' ) -print MakeSphere.SetContainer( 'FactoryServer' ) -print MakeSphere.SetComment( '' ) -MakeSphere.Coords( 17 , 75 ) -MakeCopy = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeCopy' ) -print MakeCopy.SetAuthor( '' ) -print MakeCopy.SetContainer( 'FactoryServer' ) -print MakeCopy.SetComment( '' ) -MakeCopy.Coords( 219 , 12 ) -MakeTranslation = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeTranslation' ) -print MakeTranslation.SetAuthor( '' ) -print MakeTranslation.SetContainer( 'FactoryServer' ) -print MakeTranslation.SetComment( '' ) -MakeTranslation.Coords( 221 , 209 ) -MakeFuse = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeFuse' ) -print MakeFuse.SetAuthor( '' ) -print MakeFuse.SetContainer( 'FactoryServer' ) -print MakeFuse.SetComment( '' ) -MakeFuse.Coords( 465 , 106 ) - -# Creation of intermediate Output variables and of links -MakeSpheresphere = MakeSphere.Port( 'shape' ) -MakeCopyshape = NewGraphGeomEssai.Link( MakeSpheresphere , MakeCopy.Port( 'shape1' ) ) -MakeTranslationshape = NewGraphGeomEssai.Link( MakeSpheresphere , MakeTranslation.Port( 'shape1' ) ) -MakeCopycopy = MakeCopy.Port( 'shape' ) -MakeFuseshape1 = NewGraphGeomEssai.Link( MakeCopycopy , MakeFuse.Port( 'shape1' ) ) -MakeTranslationtranslation = MakeTranslation.Port( 'shape' ) -MakeFuseshape2 = NewGraphGeomEssai.Link( MakeTranslationtranslation , MakeFuse.Port( 'shape2' ) ) - -# Creation of Input datas -MakeSpherex1 = MakeSphere.Input( 'x1' , 0) -MakeSpherey1 = MakeSphere.Input( 'y1' , 0) -MakeSpherez1 = MakeSphere.Input( 'z1' , 0) -MakeSphereradius = MakeSphere.Input( 'radius' , 50) -MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80) -MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0) -MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0) +# Generated python file of Graph aNewDataFlow_1_4_2_1 -# Missing Input datas - -# Creation of Output variables -MakeFuseresult = MakeFuse.Port( 'shape' ) - -NewGraphGeomEssai.Run() - -NewGraphGeomEssai.DoneW() +from SuperV import * -NewGraphGeomEssai.State() +# Graph creation of aNewDataFlow_1_4_2_1 +def DefaNewDataFlow_1_4_2_1() : + aNewDataFlow_1_4_2_1 = Graph( 'aNewDataFlow_1_4_2_1' ) + aNewDataFlow_1_4_2_1.SetName( 'aNewDataFlow_1_4_2_1' ) + aNewDataFlow_1_4_2_1.SetAuthor( '' ) + aNewDataFlow_1_4_2_1.SetComment( '' ) + aNewDataFlow_1_4_2_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + Pygag = [] + Pygag.append( 'from batchmode_geompy import * ' ) + Pygag.append( 'def gag(): ' ) + Pygag.append( ' # This is a gag ' ) + Pygag.append( ' return 1 ' ) + gag = aNewDataFlow_1_4_2_1.INode( 'gag' , Pygag ) + gag.SetName( 'gag' ) + gag.SetAuthor( '' ) + gag.SetComment( 'Compute Node' ) + gag.Coords( 0 , 123 ) + IgagGate = gag.GetInPort( 'Gate' ) + OgagGate = gag.GetOutPort( 'Gate' ) + + PyMakeCopy_1 = [] + PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' ) + PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' ) + PyMakeCopy_1.append( ' return shape ' ) + MakeCopy_1 = aNewDataFlow_1_4_2_1.INode( 'MakeCopy_1' , PyMakeCopy_1 ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetComment( 'Compute Node' ) + MakeCopy_1.Coords( 385 , 3 ) + IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' ) + IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' ) + OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' ) + OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) + + PyMakeSphere_1 = [] + PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' ) + PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' ) + PyMakeSphere_1.append( ' shape=MakeSphere(apoint,radius) ' ) + PyMakeSphere_1.append( ' return shape ' ) + MakeSphere_1 = aNewDataFlow_1_4_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 ) + MakeSphere_1.SetName( 'MakeSphere_1' ) + MakeSphere_1.SetAuthor( '' ) + MakeSphere_1.SetComment( 'Compute Node' ) + MakeSphere_1.Coords( 193 , 67 ) + IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' ) + IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' ) + IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' ) + IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' ) + IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' ) + OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' ) + OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) + + PyMakeTranslation_1 = [] + PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' ) + PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' ) + PyMakeTranslation_1.append( ' return shape ' ) + MakeTranslation_1 = aNewDataFlow_1_4_2_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 ) + MakeTranslation_1.SetName( 'MakeTranslation_1' ) + MakeTranslation_1.SetAuthor( '' ) + MakeTranslation_1.SetComment( 'Compute Node' ) + MakeTranslation_1.Coords( 388 , 146 ) + IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' ) + IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' ) + IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' ) + IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' ) + IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' ) + OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' ) + OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' ) + + PyMakeFuse_1 = [] + PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' ) + PyMakeFuse_1.append( ' # fuse operation 3 ' ) + PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' ) + PyMakeFuse_1.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' ) + PyMakeFuse_1.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' ) + PyMakeFuse_1.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' ) + PyMakeFuse_1.append( ' aStudyId = aSession.GetActiveStudyId() ' ) + PyMakeFuse_1.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' ) + PyMakeFuse_1.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' ) + PyMakeFuse_1.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' ) + PyMakeFuse_1.append( ' return shape ' ) + MakeFuse_1 = aNewDataFlow_1_4_2_1.INode( 'MakeFuse_1' , PyMakeFuse_1 ) + MakeFuse_1.SetName( 'MakeFuse_1' ) + MakeFuse_1.SetAuthor( '' ) + MakeFuse_1.SetComment( 'Compute Node' ) + MakeFuse_1.Coords( 618 , 64 ) + IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' ) + IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' ) + IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' ) + OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' ) + OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) + + # Creation of Links + LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1.Link( OgagGate , IMakeSphere_1Gate ) + + LMakeCopy_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeCopy_1shape , IMakeFuse_1shape1 ) + + LMakeSphere_1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 ) + + LMakeSphere_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeTranslation_1shape1 ) + + LMakeTranslation_1shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape2 ) + + # Input datas + IMakeSphere_1x1.Input( 0 ) + IMakeSphere_1y1.Input( 0 ) + IMakeSphere_1z1.Input( 0 ) + IMakeSphere_1radius.Input( 50 ) + IMakeTranslation_1x1.Input( 80 ) + IMakeTranslation_1y1.Input( 0 ) + IMakeTranslation_1z1.Input( 0 ) + + # Output Ports of the graph + #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' ) + return aNewDataFlow_1_4_2_1 -NewGraphGeomEssai.PrintPorts() +aNewDataFlow_1_4_2_1 = DefaNewDataFlow_1_4_2_1() diff --git a/examples/NewGraphGeomEssai.py_old b/examples/NewGraphGeomEssai.py_old new file mode 100644 index 0000000..ca8ef7a --- /dev/null +++ b/examples/NewGraphGeomEssai.py_old @@ -0,0 +1,84 @@ +# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +# +# +# +# File : NewGraphGeomEssai.py +# Module : SuperVisionTest + +from SuperV import * +# Graph creation +NewGraphGeomEssai = Graph( 'NewGraphGeomEssai' ) +print NewGraphGeomEssai.SetAuthor( '' ) +print NewGraphGeomEssai.SetComment( '' ) +NewGraphGeomEssai.Coords( 0 , 0 ) + +# Creation of Nodes +MakeSphere = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeSphere' ) +print MakeSphere.SetAuthor( '' ) +print MakeSphere.SetContainer( 'FactoryServer' ) +print MakeSphere.SetComment( '' ) +MakeSphere.Coords( 17 , 75 ) +MakeCopy = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeCopy' ) +print MakeCopy.SetAuthor( '' ) +print MakeCopy.SetContainer( 'FactoryServer' ) +print MakeCopy.SetComment( '' ) +MakeCopy.Coords( 219 , 12 ) +MakeTranslation = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeTranslation' ) +print MakeTranslation.SetAuthor( '' ) +print MakeTranslation.SetContainer( 'FactoryServer' ) +print MakeTranslation.SetComment( '' ) +MakeTranslation.Coords( 221 , 209 ) +MakeFuse = NewGraphGeomEssai.Node( 'GEOM' , 'GEOM' , 'MakeFuse' ) +print MakeFuse.SetAuthor( '' ) +print MakeFuse.SetContainer( 'FactoryServer' ) +print MakeFuse.SetComment( '' ) +MakeFuse.Coords( 465 , 106 ) + +# Creation of intermediate Output variables and of links +MakeSpheresphere = MakeSphere.Port( 'shape' ) +MakeCopyshape = NewGraphGeomEssai.Link( MakeSpheresphere , MakeCopy.Port( 'shape1' ) ) +MakeTranslationshape = NewGraphGeomEssai.Link( MakeSpheresphere , MakeTranslation.Port( 'shape1' ) ) +MakeCopycopy = MakeCopy.Port( 'shape' ) +MakeFuseshape1 = NewGraphGeomEssai.Link( MakeCopycopy , MakeFuse.Port( 'shape1' ) ) +MakeTranslationtranslation = MakeTranslation.Port( 'shape' ) +MakeFuseshape2 = NewGraphGeomEssai.Link( MakeTranslationtranslation , MakeFuse.Port( 'shape2' ) ) + +# Creation of Input datas +MakeSpherex1 = MakeSphere.Input( 'x1' , 0) +MakeSpherey1 = MakeSphere.Input( 'y1' , 0) +MakeSpherez1 = MakeSphere.Input( 'z1' , 0) +MakeSphereradius = MakeSphere.Input( 'radius' , 50) +MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80) +MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0) +MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0) + +# Missing Input datas + +# Creation of Output variables +MakeFuseresult = MakeFuse.Port( 'shape' ) + +NewGraphGeomEssai.Run() + +NewGraphGeomEssai.DoneW() + +NewGraphGeomEssai.State() + +NewGraphGeomEssai.PrintPorts() + diff --git a/examples/NewGraphGeomEssai.xml b/examples/NewGraphGeomEssai.xml index f0c5583..4f6b8b5 100644 --- a/examples/NewGraphGeomEssai.xml +++ b/examples/NewGraphGeomEssai.xml @@ -1,332 +1,324 @@ - - - - - + + - - - NewGraphGeomEssai - NewGraphGeomEssai - NewGraphGeomEssai - 1 - - NewGraphGeomEssai - - - double - MakeSphere\x1 - - - double - MakeSphere\y1 - - - double - MakeSphere\z1 - - - double - MakeSphere\radius - - - double - MakeTranslation\x1 - - - double - MakeTranslation\y1 - - - double - MakeTranslation\z1 - - - - - GEOM_Shape - MakeFuse\result - - - - 12/12/2001 - 15:57:26 - 28/3/2002 - 15:32:51 - 1.00 - ? - FactoryServer - ? - 0 - 0 - - - - - - GEOM - GEOM - MakeSphere - 0 - - MakeSphere - - - double - x1 - - - double - y1 - - - double - z1 - - - double - radius - - - - - GEOM_Shape - sphere - - - - 28/3/2002 - 15:32:51 - 28/3/2002 - 15:32:51 - 1.00 - ? - FactoryServer - ? - 17 - 75 - - - GEOM - GEOM - MakeCopy - 0 - - MakeCopy - - - GEOM_Shape - shape - - - - - GEOM_Shape - copy - - - - 28/3/2002 - 15:32:51 - 28/3/2002 - 15:32:51 - 1.00 - ? - FactoryServer - ? - 219 - 12 - - - GEOM - GEOM - MakeTranslation - 0 - - MakeTranslation - - - GEOM_Shape - shape - - - double - x1 - - - double - y1 - - - double - z1 - - - - - GEOM_Shape - translation - - - - 28/3/2002 - 15:32:51 - 28/3/2002 - 15:32:51 - 1.00 - ? - FactoryServer - ? - 221 - 209 - - - GEOM - GEOM - MakeFuse - 0 - - MakeFuse - - - GEOM_Shape - shape1 - - - GEOM_Shape - shape2 - - - - - GEOM_Shape - result - - - - 28/3/2002 - 15:32:51 - 28/3/2002 - 15:32:51 - 1.00 - ? - FactoryServer - ? - 465 - 106 - - - - - - MakeSphere - sphere - MakeCopy - shape - - - - - MakeSphere - sphere - MakeTranslation - shape - - - - - MakeCopy - copy - MakeFuse - shape1 - - - - - MakeTranslation - translation - MakeFuse - shape2 - - - - - - - - NewGraphGeomEssai - MakeSphere\x1 - MakeSphere - x1 - - 3 - 0 - - - - - - NewGraphGeomEssai - MakeSphere\y1 - MakeSphere - y1 - - 3 - 0 - - - - - - NewGraphGeomEssai - MakeSphere\z1 - MakeSphere - z1 - - 3 - 0 - - - - - - NewGraphGeomEssai - MakeSphere\radius - MakeSphere - radius - - 3 - 50 - - - - - - NewGraphGeomEssai - MakeTranslation\x1 - MakeTranslation - x1 - - 3 - 80 - - - - - - NewGraphGeomEssai - MakeTranslation\y1 - MakeTranslation - y1 - - 3 - 0 - - - - - - NewGraphGeomEssai - MakeTranslation\z1 - MakeTranslation - z1 - - 3 - 0 - - - - - - - + + +? + ? + aNewDataFlow_1_4_2_1 + 1 + ? + +aNewDataFlow_1_4_2_1 + + +double + MakeSphere_1__x1 + +double + MakeSphere_1__y1 + +double + MakeSphere_1__z1 + +double + MakeSphere_1__radius + +double + MakeTranslation_1__x1 + +double + MakeTranslation_1__y1 + +double + MakeTranslation_1__z1 + + +objref + MakeFuse_1__shape + + + 25/8/2004 - 16:28:50 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 30/8/2004 - 10:10:8 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 30/8/2004 - 10:10:8 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + Compute Node + 385 + 3 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 30/8/2004 - 10:10:8 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + Compute Node + 193 + 67 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 30/8/2004 - 10:10:8 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + Compute Node + 388 + 146 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + + + + + + + + 30/8/2004 - 10:10:8 + 30/8/2004 - 10:10:8 + 2.0 + ? + ? + Compute Node + 618 + 64 + + +gag + Gate + MakeSphere_1 + Gate + + +MakeCopy_1 + shape + MakeFuse_1 + shape1 + + +MakeSphere_1 + shape + MakeCopy_1 + shape1 + + +MakeSphere_1 + shape + MakeTranslation_1 + shape1 + + +MakeTranslation_1 + shape + MakeFuse_1 + shape2 + + + +aNewDataFlow_1_4_2_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_2_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_2_1 + MakeSphere_1__radius + MakeSphere_1 + radius + +7 + 50 + + +aNewDataFlow_1_4_2_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + +7 + 80 + + +aNewDataFlow_1_4_2_1 + MakeTranslation_1__y1 + MakeTranslation_1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + +7 + 0 + diff --git a/examples/NewGraphGeomEssai.xml_old b/examples/NewGraphGeomEssai.xml_old new file mode 100644 index 0000000..f0c5583 --- /dev/null +++ b/examples/NewGraphGeomEssai.xml_old @@ -0,0 +1,332 @@ + + + + + + + + + NewGraphGeomEssai + NewGraphGeomEssai + NewGraphGeomEssai + 1 + + NewGraphGeomEssai + + + double + MakeSphere\x1 + + + double + MakeSphere\y1 + + + double + MakeSphere\z1 + + + double + MakeSphere\radius + + + double + MakeTranslation\x1 + + + double + MakeTranslation\y1 + + + double + MakeTranslation\z1 + + + + + GEOM_Shape + MakeFuse\result + + + + 12/12/2001 - 15:57:26 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 0 + 0 + + + + + + GEOM + GEOM + MakeSphere + 0 + + MakeSphere + + + double + x1 + + + double + y1 + + + double + z1 + + + double + radius + + + + + GEOM_Shape + sphere + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 17 + 75 + + + GEOM + GEOM + MakeCopy + 0 + + MakeCopy + + + GEOM_Shape + shape + + + + + GEOM_Shape + copy + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 219 + 12 + + + GEOM + GEOM + MakeTranslation + 0 + + MakeTranslation + + + GEOM_Shape + shape + + + double + x1 + + + double + y1 + + + double + z1 + + + + + GEOM_Shape + translation + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 221 + 209 + + + GEOM + GEOM + MakeFuse + 0 + + MakeFuse + + + GEOM_Shape + shape1 + + + GEOM_Shape + shape2 + + + + + GEOM_Shape + result + + + + 28/3/2002 - 15:32:51 + 28/3/2002 - 15:32:51 + 1.00 + ? + FactoryServer + ? + 465 + 106 + + + + + + MakeSphere + sphere + MakeCopy + shape + + + + + MakeSphere + sphere + MakeTranslation + shape + + + + + MakeCopy + copy + MakeFuse + shape1 + + + + + MakeTranslation + translation + MakeFuse + shape2 + + + + + + + + NewGraphGeomEssai + MakeSphere\x1 + MakeSphere + x1 + + 3 + 0 + + + + + + NewGraphGeomEssai + MakeSphere\y1 + MakeSphere + y1 + + 3 + 0 + + + + + + NewGraphGeomEssai + MakeSphere\z1 + MakeSphere + z1 + + 3 + 0 + + + + + + NewGraphGeomEssai + MakeSphere\radius + MakeSphere + radius + + 3 + 50 + + + + + + NewGraphGeomEssai + MakeTranslation\x1 + MakeTranslation + x1 + + 3 + 80 + + + + + + NewGraphGeomEssai + MakeTranslation\y1 + MakeTranslation + y1 + + 3 + 0 + + + + + + NewGraphGeomEssai + MakeTranslation\z1 + MakeTranslation + z1 + + 3 + 0 + + + + + + + diff --git a/src/GraphBase/DataFlowBase_Base.hxx b/src/GraphBase/DataFlowBase_Base.hxx index ebd1646..495d795 100644 --- a/src/GraphBase/DataFlowBase_Base.hxx +++ b/src/GraphBase/DataFlowBase_Base.hxx @@ -200,14 +200,11 @@ namespace GraphBase { CORBA::Object_ptr StringToObject(char * obj ) const ; } ; -# ifdef _DEBUG_ -// *GraphBase::Base::_fdebug << " " /*<< setw(3*(*GraphBase::Base::_prof_debug)) */<< " " +# ifdef _DEBUG_ # define cdebug if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << " " - # define cdebug_in if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "-->" << " " - # define cdebug_out if ( GraphBase::Base::_fdebug ) *GraphBase::Base::_fdebug << endl << "<--" << " " # else @@ -217,7 +214,7 @@ namespace GraphBase { # define cdebug_out cdebug # define debugFile(x) -# endif +#endif } ; diff --git a/src/GraphBase/DataFlowBase_ComputingNode.cxx b/src/GraphBase/DataFlowBase_ComputingNode.cxx index 1cce3b2..71ffd00 100644 --- a/src/GraphBase/DataFlowBase_ComputingNode.cxx +++ b/src/GraphBase/DataFlowBase_ComputingNode.cxx @@ -82,7 +82,8 @@ GraphBase::ComputingNode::ComputingNode() : //_SubGraphNumber ) ; Kind( SUPERV::DataFlowGraph ) ; _NamingService = NULL ; - _Node = SUPERV::CNode::_nil() ; + _Node_var = SUPERV::CNode::_nil() ; + _Node_Impl = NULL ; _InNode = NULL ; _ThreadNo = pthread_self() ; cdebug << "GraphBase::Node::Node " << this << " " << endl ; @@ -119,7 +120,8 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB , Kind( DataFlowkind ) ; _ORB = CORBA::ORB::_duplicate( ORB ) ; _NamingService = ptrNamingService ; - _Node = SUPERV::CNode::_nil() ; + _Node_var = SUPERV::CNode::_nil() ; + _Node_Impl = NULL ; _InNode = NULL ; _ThreadNo = pthread_self() ; @@ -159,7 +161,8 @@ GraphBase::ComputingNode::ComputingNode( CORBA::ORB_ptr ORB , _ORB = CORBA::ORB::_duplicate( ORB ) ; _NamingService = ptrNamingService ; - _Node = SUPERV::CNode::_nil() ; + _Node_var = SUPERV::CNode::_nil() ; + _Node_Impl = NULL ; _InNode = NULL ; _ThreadNo = pthread_self() ; @@ -348,12 +351,6 @@ bool GraphBase::ComputingNode::IsLinked(const char * ToServiceParameterName ) { bool GraphBase::ComputingNode::HasInput(const char * ToServiceParameterName ) { bool RetVal = false ; const GraphBase::InPort * theInPort = GetInPort( ToServiceParameterName ) ; -#if 0 - if ( IsDataFlowNode() && theInPort ) { - RetVal = true ; - } - else -#endif if ( theInPort ) { // cout << "GraphBase::ComputingNode::HasInput theInPort " << theInPort << " " << theInPort->PortName() << " of " // << theInPort->NodeName() << " IsDataConnected " << theInPort->IsDataConnected() << " OutPort " @@ -534,7 +531,55 @@ void GraphBase::ComputingNode::UpdateMacroPorts( GraphBase::Graph * aGraph ) { } } } - cdebug_out << "GraphBase::ComputingNode::UpdateMacroPorts" << endl; + bool ErrPort = false ; + if ( aGraph->GetNodeInPortsSize() != GetNodeInPortsSize() || + aGraph->GetNodeOutPortsSize() != GetNodeOutPortsSize() ) { + ErrPort = true ; + } + for ( i = 0 ; i < aGraph->GetNodeInPortsSize() && i < GetNodeInPortsSize() ; i++ ) { + if ( !strcmp( aGraph->GetNodeInPort( i )->PortName() , GetNodeInPort( i )->PortName() ) ) { + ErrPort = true ; + } + } + for ( i = 0 ; i < aGraph->GetNodeOutPortsSize() && i < GetNodeOutPortsSize() ; i++ ) { + if ( !strcmp( aGraph->GetNodeOutPort( i )->PortName() , GetNodeOutPort( i )->PortName() ) ) { + ErrPort = true ; + } + } + if ( ErrPort ) { + for ( i = 0 ; i < aGraph->GetNodeInPortsSize() || i < GetNodeInPortsSize() ; i++ ) { + if ( i < aGraph->GetNodeInPortsSize() && i < GetNodeInPortsSize() ) { + cdebug << "ComputingNode::UpdateMacroPorts In" << i << " " << aGraph->GetNodeInPort( i )->PortName() + << " " << GetNodeInPort( i )->PortName() << endl ; + } + else if ( i >= GetNodeInPortsSize() ) { + cdebug << "ComputingNode::UpdateMacroPorts In" << i << " " << aGraph->GetNodeInPort( i )->PortName() + << endl ; + } + else { + cdebug << "ComputingNode::UpdateMacroPorts In" << i << " " << GetNodeInPort( i )->PortName() + << endl ; + } + } + for ( i = 0 ; i < aGraph->GetNodeOutPortsSize() || i < GetNodeOutPortsSize() ; i++ ) { + if ( i < aGraph->GetNodeOutPortsSize() && i < GetNodeOutPortsSize() ) { + cdebug << "ComputingNode::UpdateMacroPorts Out" << i << " " << aGraph->GetNodeOutPort( i )->PortName() + << " != " << GetNodeOutPort( i )->PortName() << endl ; + } + else if ( i >= GetNodeOutPortsSize() ) { + cdebug << "ComputingNode::UpdateMacroPorts Out" << i << " " << aGraph->GetNodeOutPort( i )->PortName() + << endl ; + } + else { + cdebug << "ComputingNode::UpdateMacroPorts Out" << i << " " << GetNodeOutPort( i )->PortName() + << endl ; + } + } + } + cdebug_out << "GraphBase::ComputingNode::UpdateMacroPorts" + << aGraph->Name() << " InPorts(" << aGraph->GetNodeInPortsSize() << ") OutPorts(" + << aGraph->GetNodeOutPortsSize() << ") to MacroNode " << Name() << " InPorts(" + << GetNodeInPortsSize() << ") OutPorts(" << GetNodeOutPortsSize() << ")" << endl; } void GraphBase::ComputingNode::SetMacroDatas( GraphBase::Graph * aGraph , @@ -1100,7 +1145,11 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName , // JR : the bug was at line 927 : && HasDataStream() != 0 was missing if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) { f << " " << Name() << " = Graph( '" << Name() << "' )" << endl ; - } + if ( GraphMacroLevel() ) { + f << " " << Name() << ".SetCoupledName( '" + << ((GraphBase::GOTONode * ) this)->CoupledNodeName() << "' )" << endl ; + } + } else if ( IsDataStreamNode() && HasDataStream() != 0 ) { f << " " << Name() << " = StreamGraph( '" << Name() << "' )" << endl ; long Timeout ; @@ -1189,6 +1238,7 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName , else { f << " " << Name() << " = " << aGraphName << ".GraphMNode( ? )" << endl ; } + f << " " << Name() << ".SetCoupledName( '" << aCoupledNode->Name() << "' )" << endl ; } else { // char * EndName = NULL ; diff --git a/src/GraphBase/DataFlowBase_ComputingNode.hxx b/src/GraphBase/DataFlowBase_ComputingNode.hxx index 65e3848..f11309c 100644 --- a/src/GraphBase/DataFlowBase_ComputingNode.hxx +++ b/src/GraphBase/DataFlowBase_ComputingNode.hxx @@ -16,6 +16,8 @@ #include "DataFlowBase_StreamNode.hxx" +class CNode_Impl ; + namespace GraphBase { class Graph ; @@ -30,7 +32,8 @@ namespace GraphBase { SALOME_NamingService * _NamingService ; //->StreamNode int * _Graph_prof_debug ; //->StreamNode ofstream * _Graph_fdebug ; - SUPERV::CNode_var _Node ; + SUPERV::CNode_var _Node_var ; + CNode_Impl * _Node_Impl ; void * _InNode ; // From GraphExecutor:: or GraphEditor:: bool _ObjInterface ; @@ -117,8 +120,8 @@ namespace GraphBase { // } // } // cdebug << _NodeName << " " << Name() << endl ; - return _Node ; } ; - void SetObjRef(SUPERV::CNode_var aNode) { + return _Node_var ; } ; + void SetObjRef( SUPERV::CNode_var aNode_var ) { // char * _NodeName ; // if ( CORBA::is_nil( _Node ) ) { // _NodeName = "NilRef" ; @@ -128,9 +131,14 @@ namespace GraphBase { // } // cdebug << "ComputingNode::SetObjRef( " << _Node << " " // << _NodeName << " ) " << Name() << " --> " ; - _Node = aNode ; + _Node_var = aNode_var ; // cdebug << _Node << " " << _Node->Name() << " ) " << Name() << endl ; } ; + + CNode_Impl * ObjImpl() const { return _Node_Impl ; } ; + void SetObjImpl( CNode_Impl * aNode_Impl ) { + _Node_Impl = aNode_Impl ; } ; + void InNode( void * anInNode ) { // cdebug << "GraphBase::ComputingNode::InNode " << Name() << endl ; _InNode = anInNode ; } ; diff --git a/src/GraphBase/DataFlowBase_GOTONode.cxx b/src/GraphBase/DataFlowBase_GOTONode.cxx index 530cd0e..c7e779e 100644 --- a/src/GraphBase/DataFlowBase_GOTONode.cxx +++ b/src/GraphBase/DataFlowBase_GOTONode.cxx @@ -107,26 +107,26 @@ void GraphBase::GOTONode::CoupledNode( GraphBase::InLineNode * aCoupledNode ) { } const GraphBase::InLineNode * GraphBase::GOTONode::CoupledNode() const { - cdebug << this << " " << Name() << " GraphBase::GOTONode::CoupledNode() --> " ; - if ( _CoupledNode ) { - cdebug << _CoupledNode->Name() ; - } - else { - cdebug << "NULL" ; - } - cdebug << endl ; +// cdebug << this << " " << Name() << " GraphBase::GOTONode::CoupledNode() --> " ; +// if ( _CoupledNode ) { +// cdebug << _CoupledNode->Name() ; +// } +// else { +// cdebug << "NULL" ; +// } +// cdebug << endl ; return _CoupledNode ; } GraphBase::InLineNode * GraphBase::GOTONode::CoupledNode() { - cdebug << this << " " << Name() << " GraphBase::GOTONode::CoupledNode() --> " ; - if ( _CoupledNode ) { - cdebug << _CoupledNode->Name() ; - } - else { - cdebug << "NULL" ; - } - cdebug << endl ; +// cdebug << this << " " << Name() << " GraphBase::GOTONode::CoupledNode() --> " ; +// if ( _CoupledNode ) { +// cdebug << _CoupledNode->Name() ; +// } +// else { +// cdebug << "NULL" ; +// } +// cdebug << endl ; return _CoupledNode ; } diff --git a/src/GraphBase/DataFlowBase_Graph.cxx b/src/GraphBase/DataFlowBase_Graph.cxx index 2a15de7..0c6d41a 100644 --- a/src/GraphBase/DataFlowBase_Graph.cxx +++ b/src/GraphBase/DataFlowBase_Graph.cxx @@ -35,7 +35,6 @@ GraphBase::Graph::Graph() : DataNode() { cdebug << "GraphBase::Graph::Graph" << endl ; _GraphNodesSize = 0 ; - _GraphImpl = NULL ; } GraphBase::Graph::Graph( CORBA::ORB_ptr ORB , @@ -47,7 +46,6 @@ GraphBase::Graph::Graph( CORBA::ORB_ptr ORB , // const char * DebugFileName ) : DataNode( ORB ,ptrNamingService , DataFlowName , DataFlowkind , Graph_prof_debug , Graph_fdebug ) { _Orb = CORBA::ORB::_duplicate( ORB ) ; - _GraphImpl = NULL ; Set_prof_debug( Graph_prof_debug , Graph_fdebug ) ; cdebug << "GraphBase::Graph::Graph( " << DataFlowName << ") GraphNodesSize() " << GraphNodesSize() << endl ; _GraphNodesSize = 0 ; @@ -75,7 +73,6 @@ GraphBase::Graph::Graph( CORBA::ORB_ptr ORB , DataFlowEditorRelease , DataFlowAuthor , DataFlowComment ) { _Orb = CORBA::ORB::_duplicate( ORB ) ; _GraphNodesSize = 0 ; - _GraphImpl = NULL ; Set_prof_debug( Graph_prof_debug , Graph_fdebug ) ; cdebug_in << "GraphBase::Graph::Graph" << endl ; DataService( ORB , DataFlowService , Graph_prof_debug , Graph_fdebug ) ; @@ -520,6 +517,7 @@ bool GraphBase::Graph::AddNode( GraphBase::ComputingNode * aNode ) { cdebug << i << ". ERROR" << endl ; } } + aNode->GraphOfNode( this ) ; } cdebug_out << "GraphBase::Graph::AddNode " << _GraphNodesSize << " Nodes. " << aNode->ServiceName() << endl; @@ -576,16 +574,16 @@ bool GraphBase::Graph::ReNameNode( const char* OldNodeName , } } char* OldNodePortName = new char[ strlen( OldNodeName ) + - strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 2 ] ; + strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 3 ] ; char* NewNodePortName = new char[ strlen( NewNodeName ) + - strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 2 ] ; + strlen( aNode->GetChangeNodeInPort( i )->PortName() ) + 3 ] ; strcpy( OldNodePortName , OldNodeName ) ; // strcat( OldNodePortName , "\\" ) ; - strcat( OldNodePortName , "_" ) ; + strcat( OldNodePortName , "__" ) ; strcat( OldNodePortName , aNode->GetChangeNodeInPort( i )->PortName() ) ; strcpy( NewNodePortName , NewNodeName ) ; // strcat( NewNodePortName , "\\" ) ; - strcat( NewNodePortName , "_" ) ; + strcat( NewNodePortName , "__" ) ; strcat( NewNodePortName , aNode->GetChangeNodeInPort( i )->PortName() ) ; RetVal = anOutPort->ReNameInPort( OldNodePortName , NewNodePortName ) ; delete [] OldNodePortName ; @@ -608,7 +606,7 @@ bool GraphBase::Graph::ReNameNode( const char* OldNodeName , RetVal = Name( NewNodeName ) ; } - cdebug_out << "GraphBase::Graph::ReNameNode" << endl; + cdebug_out << "GraphBase::Graph::ReNameNode RetVal " << RetVal << endl; return RetVal ; } @@ -786,7 +784,7 @@ bool GraphBase::Graph::AddLink( const char* FromNodeName , // fromPort->PortStatus( DataConnected ); } - cdebug_out << "GraphBase::Graph::AddLink" << endl; + cdebug_out << "GraphBase::Graph::AddLink " << RetVal << endl; return RetVal ; } @@ -1115,7 +1113,7 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName , break; } cdebug << " ) in Graph " << Name() << endl; - + GraphBase::ComputingNode *toNode ; GraphBase::InPort *toPort ; char *aNodeName ; @@ -1135,10 +1133,10 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName , int i ; for ( i = 0 ; i < GetNodeOutDataNodePortsSize() ; i++ ) { - cdebug "Graph::AddInputData In" << i << " " << *GetNodeOutDataNodePort(i) << endl ; + cdebug << "Graph::AddInputData In" << i << " " << *GetNodeOutDataNodePort(i) << endl ; } for ( i = 0 ; i < GetNodeInDataNodePortsSize() ; i++ ) { - cdebug "Graph::AddInputData Out" << i << " " << *GetNodeInDataNodePort(i) << endl ; + cdebug << "Graph::AddInputData Out" << i << " " << *GetNodeInDataNodePort(i) << endl ; } if ( toNode && toPort ) { @@ -1197,17 +1195,19 @@ bool GraphBase::Graph::ChangeInputData( const char * ToNodeName , cdebug << "(other(tk_string,tk_double,tk_long,tk_objref)) ERROR"; break; } - cdebug << ")" << endl; - - GraphBase::ComputingNode *toNode = GetChangeGraphNode( ToNodeName ) ; - - GraphBase::OutPort *fromPort = NULL ; - GraphBase::InPort *toPort = NULL ; + cdebug << " ) in Graph " << Name() << endl; + GraphBase::ComputingNode * toNode ; + GraphBase::InPort * toPort = NULL ; + char * aNodeName ; + char * aPortName ; + NodePort( ToNodeName , ToServiceParameterName , &aNodeName , &aPortName ) ; + toNode = GetChangeGraphNode( aNodeName ) ; + cdebug << "in Graph " << Name() << " aNodeName " << aNodeName << " aPortName " << aPortName << endl; if ( toNode ) { - toPort = toNode->GetChangeInPort( ToServiceParameterName ) ; - if ( toPort ) { - fromPort = toPort->GetOutPort(); + toPort = toNode->GetChangeInPort( aPortName ) ; + if ( toPort && toPort->IsDataConnected() ) { + GraphBase::OutPort * fromPort = toPort->GetOutPort(); if ( fromPort ) { RetVal = true ; fromPort->Value( aValue ) ; @@ -1313,7 +1313,9 @@ bool GraphBase::Graph::AddOutputData( const char* FromNodeName , anOutPort->State( SUPERV::ReadyState ) ; anOutPort->Done( true ) ; cdebug << *anOutPort ; +#ifdef _DEBUG_ anOutPort->StringValue( *_fdebug ) ; +#endif cdebug << endl ; } else { @@ -1703,7 +1705,11 @@ bool GraphBase::Graph::InLineServices() { cdebug_in << "GraphBase::Graph::InLineServices" << endl; int i , j ; + +#ifdef _DEBUG_ ListPorts( *_Graph_fdebug , 0 ) ; +#endif + GraphBase::InLineNode * aINode ; SALOME_ModuleCatalog::Service aService ; for ( i = 0 ; i < GraphNodesSize() ; i++ ) { @@ -2188,7 +2194,9 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) { // } } +#ifdef _DEBUG_ ListPorts( *_Graph_fdebug , 0 ) ; +#endif cdebug_out << "GraphBase::Graph::Sort" << endl; return true ; diff --git a/src/GraphBase/DataFlowBase_Graph.hxx b/src/GraphBase/DataFlowBase_Graph.hxx index 35c07ad..8035528 100644 --- a/src/GraphBase/DataFlowBase_Graph.hxx +++ b/src/GraphBase/DataFlowBase_Graph.hxx @@ -36,8 +36,6 @@ #include "DataFlowBase_EndOfSwitchNode.hxx" #include "DataFlowBase_DataNode.hxx" -class Graph_Impl ; - namespace GraphBase { class Graph : public DataNode { @@ -47,8 +45,8 @@ namespace GraphBase { // int _Graph_prof_debug; // ofstream * _Graph_fdebug; CORBA::ORB_ptr _Orb ; - SUPERV::Graph_var _Graph ; - Graph_Impl * _GraphImpl ; +// SUPERV::Graph_var _Graph ; +// Graph_Impl * _GraphImpl ; // Map of Nodes of the Graph map< string , int > _MapOfGraphNodes ; @@ -131,12 +129,12 @@ namespace GraphBase { return _prof_debug ; } ; ofstream * Graph_fdebug() { return _fdebug ; } ; - SUPERV::Graph_var ObjRef() const { return _Graph ; } ; - void SetObjRef( SUPERV::Graph_var aGraph ) { - _Graph = aGraph ; } ; - Graph_Impl * ObjImpl() const { return _GraphImpl ; } ; - void SetObjImpl( Graph_Impl * aGraphImpl ) { - _GraphImpl = aGraphImpl ; } ; +// SUPERV::Graph_var ObjRef() const { return _Graph ; } ; +// void SetObjRef( SUPERV::Graph_var aGraph ) { +// _Graph = aGraph ; } ; +// Graph_Impl * ObjImpl() const { return _GraphImpl ; } ; +// void SetObjImpl( Graph_Impl * aGraphImpl ) { +// _GraphImpl = aGraphImpl ; } ; void AddLinkedNode( const char* FromNodeName , GraphBase::ComputingNode * anOutNode ) { GetChangeGraphNode( FromNodeName )->AddLinkedNode( anOutNode ) ; } ; diff --git a/src/GraphBase/DataFlowBase_OutPort.cxx b/src/GraphBase/DataFlowBase_OutPort.cxx index f25acad..61d6cfa 100644 --- a/src/GraphBase/DataFlowBase_OutPort.cxx +++ b/src/GraphBase/DataFlowBase_OutPort.cxx @@ -147,7 +147,7 @@ bool GraphBase::OutPort::ReNameInPort( const char* OldNodePortName , const char* NewNodePortName ) { int index = _MapOfInPorts[ OldNodePortName ] ; if ( index <= 0 || index > _InPortsSize ) { - cdebug << "GraphBase::OutPort::ReNameLink Error " << OldNodePortName + cdebug << "GraphBase::OutPort::ReNameInPort Error " << OldNodePortName << " --> " << NewNodePortName << " index " << index << endl ; return false ; } diff --git a/src/GraphBase/DataFlowBase_StreamNode.cxx b/src/GraphBase/DataFlowBase_StreamNode.cxx index c31485e..9b8c9a4 100644 --- a/src/GraphBase/DataFlowBase_StreamNode.cxx +++ b/src/GraphBase/DataFlowBase_StreamNode.cxx @@ -23,8 +23,8 @@ GraphBase::StreamNode::StreamNode() : _LevelNumber = -1 ; _SortedIndex = -1 ; _GraphEditor = NULL ; - _GraphExecutor = NULL ; _GraphMacroNode = SUPERV::Graph::_nil() ; + _GraphOfNode = NULL ; _GraphMacroLevel = 0 ; _SubGraphNumber = 0 ; _SubStreamGraphNumber = 0 ; @@ -50,8 +50,8 @@ GraphBase::StreamNode::StreamNode( const char * NodeName , _LevelNumber = -1 ; _SortedIndex = -1 ; _GraphEditor = NULL ; - _GraphExecutor = NULL ; _GraphMacroNode = SUPERV::Graph::_nil() ; + _GraphOfNode = NULL ; _GraphMacroLevel = 0 ; _SubGraphNumber = 0 ; _SubStreamGraphNumber = 0 ; @@ -254,4 +254,3 @@ void GraphBase::StreamNode::ReNameStreamLinkedNode( const char* OldNodeName , } cdebug_out << "GraphBase::StreamNode::ReNameStreamLinkedNode" << endl ; } - diff --git a/src/GraphBase/DataFlowBase_StreamNode.hxx b/src/GraphBase/DataFlowBase_StreamNode.hxx index 6b8a8ab..10860c0 100644 --- a/src/GraphBase/DataFlowBase_StreamNode.hxx +++ b/src/GraphBase/DataFlowBase_StreamNode.hxx @@ -20,12 +20,6 @@ namespace GraphEditor { } -namespace GraphExecutor { - - class DataFlow ; - -} - namespace GraphBase { class Graph ; @@ -55,10 +49,10 @@ namespace GraphBase { int _SortedIndex ; GraphEditor::DataFlow * _GraphEditor ; - GraphExecutor::DataFlow * _GraphExecutor ; // If DataFlowGraph/DataStreamGraph in another graph : // the Graph if MacroNode and MacroNode if Graph SUPERV::Graph_var _GraphMacroNode ; + GraphBase::Graph * _GraphOfNode ; int _GraphMacroLevel ; int _SubGraphNumber ; @@ -192,20 +186,13 @@ namespace GraphBase { void SetSubStreamGraph( int SubStreamGraphsNumber , int & RetVal ) ; - void SetGraphEditor( GraphEditor::DataFlow * aGraphEditor ) { - cdebug << "SetGraphEditor this " << this << " " << Name() << " : " << aGraphEditor << endl ; + void GraphEditor( GraphEditor::DataFlow * aGraphEditor ) { + cdebug << "StreamNode::GraphEditor this " << this << " " << Name() << " : _GraphEditor = " << aGraphEditor << endl ; _GraphEditor = aGraphEditor ; } ; GraphEditor::DataFlow * GraphEditor() const { - cdebug << "GraphEditor this " << this << " " << Name() << " : " << _GraphEditor << endl ; + cdebug << "StreamNode::GraphEditor this " << this << " " << Name() << " : " << _GraphEditor << endl ; return _GraphEditor ; } ; - void SetGraphExecutor( GraphExecutor::DataFlow * aGraphExecutor ) { - cdebug << "SetGraphExecutor this " << this << " " << Name() << " : " << aGraphExecutor << endl ; - _GraphExecutor = aGraphExecutor ; } ; - GraphExecutor::DataFlow * GraphExecutor() const { - cdebug << "GraphExecutor this " << this << " " << Name() << " : " << _GraphExecutor << endl ; - return _GraphExecutor ; } ; - void GraphMacroLevel( int aGraphMacroLevel ) { cdebug << "GraphMacroLevel " << Name() << " " << aGraphMacroLevel << endl ; _GraphMacroLevel = aGraphMacroLevel ; } ; @@ -217,6 +204,10 @@ namespace GraphBase { cdebug << "MacroObject GraphMacroNode " << this << " " << Name() << " MacroObject(nil object). Error" << endl ; } + else { + cdebug << "MacroObject GraphMacroNode " << this << " " << Name() + << " MacroObject " << _GraphMacroNode << endl ; + } _GraphMacroNode = aGraphMacroNode ; } ; SUPERV::Graph_var MacroObject() const { if ( CORBA::is_nil( _GraphMacroNode ) ) { @@ -225,6 +216,11 @@ namespace GraphBase { } return _GraphMacroNode ; } ; + void GraphOfNode( GraphBase::Graph * aGraph ) { + _GraphOfNode = aGraph ; } ; + GraphBase::Graph * GraphOfNode() { + return _GraphOfNode ; } ; + int SubGraph() const { return _SubGraphNumber ; } ; void SubGraph( int SubGraphNumber ) { _SubGraphNumber = SubGraphNumber ; } ; diff --git a/src/GraphBase/Makefile.in b/src/GraphBase/Makefile.in index e321f12..1b1c8a6 100644 --- a/src/GraphBase/Makefile.in +++ b/src/GraphBase/Makefile.in @@ -100,7 +100,7 @@ BIN_SERVER_IDL = CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \ -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS+= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ +CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome LDFLAGS= -L../../lib/salome $(CORBA_LIBS) -lSalomeNS -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace \ -lc $(PYTHON_LIBS) $(QT_MT_LIBS) $(OGL_LIBS) \ diff --git a/src/GraphEditor/DataFlowEditor_DataFlow.cxx b/src/GraphEditor/DataFlowEditor_DataFlow.cxx index a02e77d..40d20bd 100644 --- a/src/GraphEditor/DataFlowEditor_DataFlow.cxx +++ b/src/GraphEditor/DataFlowEditor_DataFlow.cxx @@ -103,23 +103,4 @@ GraphEditor::DataFlow::~DataFlow() { // delete _GT ; } -#if 0 -GraphExecutor::DataFlow * GraphEditor::DataFlow::Run() { - cdebug_in << "GraphEditor::DataFlow::Run" << endl; - SUPERV::SGraph * theDataFlow ; - GraphExecutor::DataFlow * aDataFlowExecutor ; - theDataFlow = GetDataFlow() ; - aDataFlowExecutor = new GraphExecutor::DataFlow( NamingService() , - theDataFlow->Info.theName ) ; - if ( aDataFlowExecutor->LoadDataFlow( *theDataFlow ) ) { - aDataFlowExecutor->Run() ; - } - else { - MESSAGE( "GraphEditor::DataFlow::Run error while loading DataFlowExecutor") - delete aDataFlowExecutor ; - } - cdebug_out << "GraphEditor::DataFlow::Run" << endl; - return aDataFlowExecutor ; -} -#endif diff --git a/src/GraphEditor/DataFlowEditor_DataFlow.hxx b/src/GraphEditor/DataFlowEditor_DataFlow.hxx index 5a96b2a..ea8212a 100644 --- a/src/GraphEditor/DataFlowEditor_DataFlow.hxx +++ b/src/GraphEditor/DataFlowEditor_DataFlow.hxx @@ -27,11 +27,14 @@ #ifndef _DATAFLOWEDITOR_DATAFLOW_HXX #define _DATAFLOWEDITOR_DATAFLOW_HXX -//#include "DataFlowExecutor_DataFlow.hxx" - -#include "DataFlowExecutor_DataFlow.hxx" #include "DataFlowEditor_OutNode.hxx" +namespace GraphExecutor { + + class DataFlow; + +} + namespace GraphEditor { class DataFlow : public GraphEditor::OutNode { @@ -210,7 +213,7 @@ namespace GraphEditor { bool IsValid() ; bool IsExecutable() ; - void Executing() ; + void Executing( bool b = true ) ; bool IsExecuting() ; void Editing() ; bool IsEditing() ; diff --git a/src/GraphEditor/DataFlowEditor_DataFlow.lxx b/src/GraphEditor/DataFlowEditor_DataFlow.lxx index 1f82bf0..e4ae58c 100644 --- a/src/GraphEditor/DataFlowEditor_DataFlow.lxx +++ b/src/GraphEditor/DataFlowEditor_DataFlow.lxx @@ -428,40 +428,27 @@ inline bool GraphEditor::DataFlow::IsExecutable() { return GraphEditor::OutNode::IsExecutable() ; } -inline void GraphEditor::DataFlow::Executing() { - cdebug << "Executing _Executing = true " << endl ; - _Executing = true ; +inline void GraphEditor::DataFlow::Executing( bool b ) { + cdebug << "Executing _Executing = " << b << endl ; + _Executing = b ; } inline bool GraphEditor::DataFlow::IsExecuting() { -#if 0 - //cout << " +++++> Old!" << endl; - if ( _DataFlowExecutor ) { - if ( _DataFlowExecutor->IsDone() ) { - _Executing = false ; - } - else { - _Executing = true ; - } - } - else { - _Executing = false ; - } -#endif -// cdebug << "GraphEditor::DataFlow::IsExecuting _Executing " << _Executing << " DataFlowExecutor " << _DataFlowExecutor ; +/* if ( _DataFlowExecutor ) { cdebug << " IsDone " << _DataFlowExecutor->IsDone() << " State " << _DataFlowExecutor->State() ; } cdebug << endl ; -// cout << "+++++++++++++> _Executing = " << _Executing << " _DataFlowExecutor = " << _DataFlowExecutor << endl; if ( _Executing && _DataFlowExecutor ) { if ( _DataFlowExecutor->IsDone() ) { _Executing = false ; } } +*/ return _Executing ; } + inline void GraphEditor::DataFlow::Editing() { cdebug << "Editing _Executing = false " << endl ; _Executing = false ; diff --git a/src/GraphEditor/DataFlowEditor_InNode.hxx b/src/GraphEditor/DataFlowEditor_InNode.hxx index c8d282f..3fbbd72 100644 --- a/src/GraphEditor/DataFlowEditor_InNode.hxx +++ b/src/GraphEditor/DataFlowEditor_InNode.hxx @@ -168,9 +168,9 @@ namespace GraphEditor { void SetObjRef(SUPERV::CNode_var aNode) { _ComputingNode->SetObjRef( aNode ) ; } ; - Graph_Impl * ObjImpl() const { return _GraphMacroNode->ObjImpl() ; } ; - void SetObjImpl( Graph_Impl * aGraph ) { - _GraphMacroNode->SetObjImpl( aGraph ) ; } ; + CNode_Impl * ObjImpl() const { return _ComputingNode->ObjImpl() ; } ; + void SetObjImpl( CNode_Impl * aGraph ) { + _ComputingNode->SetObjImpl( aGraph ) ; } ; const SALOME_ModuleCatalog::Service * GetService() const { return _ComputingNode->GetService() ; } ; diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index 71d4984..8d11d63 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -32,8 +32,8 @@ using namespace std; #include "DataFlowBase_EndOfLoopNode.hxx" #include "DataFlowBase_EndOfSwitchNode.hxx" -#include "DataFlowExecutor_DataFlow.hxx" -extern GraphExecutor::FiniteStateMachine * theAutomaton ; +map< string , GraphBase::Graph * > GraphEditor::OutNode::_MapOfGraphs; +map< string , int > GraphEditor::OutNode::_MapOfGraphNames; // Implementation de la classe GraphEditor::Graph @@ -65,19 +65,16 @@ GraphEditor::OutNode::OutNode( CORBA::ORB_ptr ORB , if ( aKindOfNode == SUPERV::DataFlowGraph ) { _StreamGraph = NULL ; -// _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ; _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , aKindOfNode , - _prof_debug , _fdebug ) ; + _prof_debug , _fdebug ) ; + MapGraph( _Graph , _Graph->Name() ) ; } else if ( aKindOfNode == SUPERV::DataStreamGraph ) { -// _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ;; _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , aKindOfNode , _prof_debug , _fdebug ) ; _Graph = _StreamGraph ; + MapGraph( _Graph , _Graph->Name() ) ; } -// if ( aKindOfNode == SUPERV::DataFlowGraph || aKindOfNode == SUPERV::DataStreamGraph ) { -// theAutomaton->MapGraph( _Graph , _Graph->Name() ) ; -// } _Orb = CORBA::ORB::_duplicate( ORB ) ; _Imported = false ; _Valid = false ; @@ -101,11 +98,6 @@ GraphEditor::OutNode::OutNode( const char * DataFlowComputer , const char * DataFlowComment , const char * DebugFileName ) { -// Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName , -// DataFlowInterfaceName , DataFlowName , DataFlowkind , -// DataFlowFirstCreation , DataFlowLastModification , -// DataFlowEditorRelease , DataFlowAuthor , -// DataFlowComputer , DataFlowComment , DebugFileName ) { _Graph = NULL ; Set_prof_debug( ORB , DebugFileName ) ; @@ -117,7 +109,7 @@ GraphEditor::OutNode::OutNode( DataFlowEditorRelease , DataFlowAuthor , DataFlowComputer , DataFlowComment , _prof_debug , _fdebug ) ; -// DataFlowComputer , DataFlowComment , DebugFileName ) ; + MapGraph( _Graph , _Graph->Name() ) ; } else if ( DataFlowkind == SUPERV::DataStreamGraph ) { _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName , @@ -126,12 +118,9 @@ GraphEditor::OutNode::OutNode( DataFlowEditorRelease , DataFlowAuthor , DataFlowComputer , DataFlowComment , _prof_debug , _fdebug ) ; -// DataFlowComputer , DataFlowComment , DebugFileName ) ; _Graph = _StreamGraph ; + MapGraph( _Graph , _Graph->Name() ) ; } -// if ( DataFlowkind == SUPERV::DataFlowGraph || DataFlowkind == SUPERV::DataStreamGraph ) { -// theAutomaton->MapGraph( _Graph , _Graph->Name() ) ; -// } _Orb = CORBA::ORB::_duplicate( ORB ) ; _Imported = false ; _Valid = false ; @@ -140,7 +129,7 @@ GraphEditor::OutNode::OutNode( } ; GraphEditor::OutNode::~OutNode() { -// theAutomaton->EraseGraph( Graph->Name() ) ; +// EraseGraph( Graph->Name() ) ; // delete _DataFlowNode ; // delete _DataFlowDatas ; // delete _GT ; @@ -148,12 +137,12 @@ GraphEditor::OutNode::~OutNode() { bool GraphEditor::OutNode::Name( const char * aName ) { bool RetVal = false ; - if ( !theAutomaton->GraphName( aName ) ) { + if ( !GraphName( aName ) ) { char * aGraphName = Graph()->Name() ; RetVal = Graph()->Name( aName ) ; if ( RetVal ) { - theAutomaton->EraseGraph( aGraphName ) ; - theAutomaton->MapGraph( Graph() , aName ) ; + EraseGraph( aGraphName ) ; + MapGraph( Graph() , aName ) ; } } return RetVal ; @@ -208,8 +197,8 @@ bool GraphEditor::OutNode::LoadXml( const char* myFileName , GraphBase::ListOfSG cdebug << "GraphEditor::OutNode::LoadXml() No file" << endl; _Imported = true ; char * aDataFlowName = Graph()->Name() ; - Name( theAutomaton->GraphInstanceName( Graph()->Name() ).c_str() ) ; - theAutomaton->MapGraph( Graph() , Graph()->Name() ) ; + Name( GraphInstanceName( Graph()->Name() ).c_str() ) ; + MapGraph( Graph() , Graph()->Name() ) ; cdebug << "GraphEditor::OutNode::LoadXml() " << aDataFlowName << " --> " << Graph()->Name() << endl; RetVal = true ; } @@ -250,8 +239,8 @@ bool GraphEditor::OutNode::LoadInfo(const GraphBase::SNode &aDataFlowInfo ) { // InterfaceName( aDataFlowInfo.theInterfaceName.c_str() ) ; if ( Graph()->IsDataStreamNode() || aDataFlowInfo.theKind == SUPERV::DataFlowGraph ) { char * aDataFlowName = Graph()->Name() ; - Graph()->Name( theAutomaton->GraphInstanceName( aDataFlowInfo.theName.c_str() ).c_str() ) ; - theAutomaton->MapGraph( Graph() , Graph()->Name() ) ; + Graph()->Name( GraphInstanceName( aDataFlowInfo.theName.c_str() ).c_str() ) ; + MapGraph( Graph() , Graph()->Name() ) ; cdebug << "GraphEditor::OutNode::LoadInfo " << aDataFlowName << " --> " << Graph()->Name() << " aDataFlowInfo.Kind " << aDataFlowInfo.theKind << " Kind() " << Graph()->Kind() << endl ; if ( Graph()->IsDataStreamNode() ) { @@ -550,7 +539,7 @@ GraphBase::ListOfSGraphs * GraphEditor::OutNode::GetDataFlows( GraphBase::ListOf for ( i = 0 ; i < (int ) (*aListOfDataFlows)[ index ].Nodes.size() ; i++ ) { if ( Graph()->GetGraphNode( (*aListOfDataFlows)[ index ].Nodes[i].theName.c_str() )->IsMacroNode() ) { string aCoupledNode = (*aListOfDataFlows)[ index ].Nodes[i].theCoupledNode ; - GraphBase::Graph * aGraph = theAutomaton->MapGraph( aCoupledNode.c_str() ) ; + GraphBase::Graph * aGraph = MapGraph( aCoupledNode.c_str() ) ; aGraph->GraphEditor()->GraphEditor::OutNode::GetDataFlows( aListOfDataFlows ) ; } } @@ -694,8 +683,10 @@ GraphEditor::InNode * GraphEditor::OutNode::AddNode( NodeComputer , NodeComment , GeneratedName , NodeX , NodeY , _prof_debug , _fdebug ) ; -// MESSAGE( "GraphEditor::OutNode::AddNode " << hex << (void *) Nd << dec ); -// if ( GraphBase::Graph::AddNode( Nd ) ) { + + // asv: 28.09.04 fix for 6621 + //if ( Nd->IsMacroNode() ) + // MapGraph( Nd->GraphMacroNode(), aNodeName ); if ( Graph()->IsDataStreamNode() && ( Nd->IsComputingNode() || Nd->IsFactoryNode() ) ) { unsigned int i ; @@ -1695,6 +1686,45 @@ ostream & operator<< (ostream &fOut,const SUPERV::SDate &D) return fOut; } +GraphBase::Graph * GraphEditor::OutNode::MapGraph( const char * aGraphName ) { + GraphBase::Graph * aGraph = _MapOfGraphs[ aGraphName ] ; + return aGraph ; +} + +bool GraphEditor::OutNode::MapGraph( GraphBase::Graph * aGraph , const char * aGraphName ) { + if ( MapGraph( aGraphName ) ) { + return false ; + } + _MapOfGraphs[ aGraphName ] = aGraph ; + return true ; +} + +void GraphEditor::OutNode::EraseGraph( const char * aGraphName ) { + _MapOfGraphs.erase( aGraphName ) ; +} + +bool GraphEditor::OutNode::GraphName( const char * aGraphName ) { + return _MapOfGraphNames[ aGraphName ] ; +} + +string GraphEditor::OutNode::GraphInstanceName( const char * aGraphName ) { + int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ; + if ( GraphInstanceNumber ) { + _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; + } + else { + GraphInstanceNumber = 0 ; + _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; + } + string theGraphInstanceName = string( aGraphName ) ; + if ( GraphInstanceNumber ) { + theGraphInstanceName += "_" ; + ostringstream astr ; + astr << GraphInstanceNumber ; + theGraphInstanceName += astr.str() ; + } + return theGraphInstanceName ; +} diff --git a/src/GraphEditor/DataFlowEditor_OutNode.hxx b/src/GraphEditor/DataFlowEditor_OutNode.hxx index 4c14b83..ec96d7f 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.hxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.hxx @@ -33,7 +33,6 @@ namespace GraphEditor { -// class OutNode : public GraphBase::Graph { class OutNode : public GraphBase::Base { private : @@ -79,6 +78,18 @@ namespace GraphEditor { void DateModification() ; + // asv 20.09.04 added from GraphExecutor::FiniteStateMachine class (removed from there) + static map< string , GraphBase::Graph * > _MapOfGraphs ; + static map< string , int > _MapOfGraphNames ; + + GraphBase::Graph * MapGraph( const char * aGraphName ) ; + bool MapGraph( GraphBase::Graph * aGraph , const char * aGraphName ) ; + void EraseGraph( const char * aGraphName ) ; + bool GraphName( const char * aGraphName ) ; + string GraphInstanceName( const char * aGraphName ) ; + // end added from FiniteStateMachine + + public: OutNode(); @@ -103,8 +114,6 @@ namespace GraphEditor { const char * DebugFileName ) ; virtual ~OutNode(); - GraphExecutor::FiniteStateMachine * Automaton() { return theAutomaton ; } ; - bool Name( const char * aName ) ; void Set_prof_debug( CORBA::ORB_ptr ORB , const char * DebugFileName ) ; diff --git a/src/GraphEditor/Makefile.in b/src/GraphEditor/Makefile.in index 056901b..4c991c4 100644 --- a/src/GraphEditor/Makefile.in +++ b/src/GraphEditor/Makefile.in @@ -60,9 +60,9 @@ BIN_SERVER_IDL = CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \ -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS+= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ +CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionExecutor -lOpUtil -lSALOMELocalTrace \ +LDFLAGS+= -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSALOMELocalTrace \ -lc $(QT_MT_LIBS) $(OGL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome #LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS) diff --git a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx index 10d4cdb..f7c89e2 100644 --- a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx +++ b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx @@ -26,6 +26,7 @@ using namespace std; #include "DataFlowExecutor_DataFlow.hxx" +#include "DataFlowEditor_DataFlow.hxx" // Implementation de la classe GraphExecutor::Graph @@ -115,8 +116,9 @@ bool GraphExecutor::DataFlow::ContainerKill( const char *aNodeName ) { } bool GraphExecutor::DataFlow::InputOfAny( const char * ToServiceParameterName , - const CORBA::Any & aValue ) { - cdebug_in "GraphExecutor::DataFlow::InputOfAny" << endl ; + const CORBA::Any & aValue , + bool SomeDataReady ) { + cdebug_in <<"GraphExecutor::DataFlow::InputOfAny" << endl ; bool RetVal = false ; cdebug << pthread_self() << "GraphExecutor::DataFlow::::InputOfAny " << Graph()->Name() << "(" << ToServiceParameterName << ")" << endl ; @@ -124,78 +126,107 @@ bool GraphExecutor::DataFlow::InputOfAny( const char * ToServiceParameterName , GraphBase::OutPort * anOutPort ; anOutPort = Graph()->GetChangeInDataNodePort( ToServiceParameterName ) ; cdebug << pthread_self() << "GraphExecutor::DataFlow::InputOfAny " << Graph()->Name() - << " " << ToServiceParameterName << " " << anOutPort->State() << " Done " << anOutPort->Done() - << endl ; + << " " << State() << " " << ToServiceParameterName << " " << anOutPort->State() + << " Done : " << anOutPort->Done() << endl ; RetVal = AddInputData( Graph()->Name() , ToServiceParameterName , aValue ) ; anOutPort->State( SUPERV::ReadyState ) ; +// There is only one port : + anOutPort->ChangeInPorts( 0 )->State( SUPERV::ReadyState ) ; anOutPort->Done( true ) ; +// There is only one inport of a Node in an ReversedOutport of a graph : GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( anOutPort->InPorts( 0 )->NodeName() )->GetInNode() ; cdebug << pthread_self() << "GraphExecutor::DataFlow::InputOfAny : " << anInNode->Name() - << "->SendSomeDataReady( " << Graph()->Name() << " ) " << endl ; - anInNode->SendSomeDataReady( Graph()->Name() ) ; - if ( anInNode->IsReady() ) { - cdebug << pthread_self() << "GraphExecutor::DataFlow::InputOfAny : " << anInNode->Name() - << "->SendEvent( GraphExecutor::ExecuteEvent ) " - << " " << anInNode->Name() << "->IsReady() " << anInNode->IsReady() << " State " - << anInNode->State() << endl ; - if ( anInNode->IsLockedDataWait() ) { - cdebug << pthread_self() << "GraphExecutor::DataFlow::InputOfAny : " << anInNode->Name() - << " IsLockedDataWait() ==> UnLockDataWait" << endl ; - anInNode->UnLockDataWait() ; + << "->SendSomeDataReady( " << Graph()->Name() << " ) for Port " << anOutPort->InPorts( 0 )->PortName() + << endl ; + if ( SomeDataReady ) { + MESSAGE( "GraphExecutor::InputOfAny " << Graph()->Name() << " SendSomeDataReady --> " << anInNode->Name() + << " " << anInNode->State() << " " << anOutPort->InPorts( 0 )->PortName() ) ; + int sts = anInNode->SendSomeDataReady( Graph()->Name() ) ; + cdebug << "GraphExecutor::DataFlow::InputOfAny " << anInNode->Name() + << "->SendSomeDataReady( " << Graph()->Name() << " ) sts " << sts << endl ; + if ( sts && anInNode->IsReady() ) { + cdebug << pthread_self() << "/" << anInNode->ThreadNo() << "GraphExecutor::DataFlow::InputOfAny : " + << anInNode->Name() << "->SendEvent( GraphExecutor::ExecuteEvent ) " + << " " << anInNode->Name() << "->IsReady() " << anInNode->IsReady() << " State " + << anInNode->State() << endl ; + if ( anInNode->IsLockedDataWait() ) { + cdebug << pthread_self() << "/" << anInNode->ThreadNo() << "GraphExecutor::DataFlow::InputOfAny : " + << anInNode->Name() << " IsLockedDataWait() ==> UnLockDataWait" << endl ; + anInNode->UnLockDataWait() ; + } + anInNode->ThreadNo( 0 ) ; + anInNode->CreateNewThread( true ) ; + anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ; + State( GraphExecutor::ExecutingState ) ; } - anInNode->CreateNewThread( true ) ; - anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ; - State( GraphExecutor::ExecutingState ) ; } } - cdebug_out << "GraphExecutor::DataFlow::InputOfAny " << RetVal << endl ; + else { + cdebug << pthread_self() << "GraphExecutor::DataFlow::InputOfAny GraphMacroLevel " + << Graph()->GraphMacroLevel() << " ERROR" << endl ; + MESSAGE( "GraphExecutor::DataFlow::InputOfAny GraphMacroLevel " << Graph()->GraphMacroLevel() + << " ERROR" ) ; + } + cdebug_out << pthread_self() << " GraphExecutor::DataFlow::InputOfAny " << RetVal << endl ; return RetVal ; } bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName , const char * ToServiceParameterName , const CORBA::Any & aValue ) { - cdebug_in << "GraphExecutor::DataFlow::OutputOfAny" << endl ; + cdebug_in << pthread_self() << "/" << ThreadNo() << "GraphExecutor::DataFlow::OutputOfAny( " << aNodeName + << " , " << ToServiceParameterName + << " , aValue ) from " << Graph()->Name() << endl ; bool RetVal = false ; - GraphBase::Graph * aMacroGraph = (GraphBase::Graph * ) Graph()->GetChangeGraphNode( aNodeName ) ; + GraphBase::Graph * aMacroNode = (GraphBase::Graph * ) Graph()->GetChangeGraphNode( aNodeName ) ; // GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) aMacroGraph->GetInNode() ; RetVal = Graph()->AddOutputData( aNodeName , ToServiceParameterName , aValue ) ; - GraphBase::OutPort * anOutPort = aMacroGraph->GetChangeOutPort( ToServiceParameterName ) ; + GraphBase::OutPort * anOutPort = aMacroNode->GetChangeOutPort( ToServiceParameterName ) ; int i ; +// Loop over Inports linked to that OutPort of the MacroNode for ( i = 0 ; i < anOutPort->InPortsSize() ; i++ ) { - if ( strcmp( anOutPort->ChangeInPorts( i )->NodeName() , Graph()->Name() ) ) { - cdebug << "GraphExecutor::DataFlow::OutputOfAny toNodeName " << anOutPort->ChangeInPorts( i )->NodeName() - << "(" << anOutPort->ChangeInPorts( i )->PortName() << ")" << endl ; - GraphExecutor::InNode * aLinkedNode = (GraphExecutor::InNode * ) Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( i )->NodeName() )->GetInNode() ; + const char * ToNodeName = anOutPort->ChangeInPorts( i )->NodeName() ; + const char * ToParameterName = anOutPort->ChangeInPorts( i )->PortName() ; + GraphBase::ComputingNode * aComputingNode = Graph()->GetChangeGraphNode( ToNodeName ) ; + if ( strcmp( ToNodeName , Graph()->Name() ) ) { + GraphExecutor::InNode * aLinkedNode = (GraphExecutor::InNode * ) aComputingNode->GetInNode() ; + cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo() + << "GraphExecutor::DataFlow::OutputOfAny to Node " + << ToNodeName << "(" << ToParameterName << ") from MacroNode " << aNodeName << endl ; int sts ; if ( aLinkedNode->IsLockedDataWait() ) { cdebug << "GraphExecutor::DataFlow::OutputOfAny " << aLinkedNode->Name() << " IsLockedDataWait --> UnLockDataWait" << endl ; } sts = aLinkedNode->SendSomeDataReady( (char * ) aNodeName ) ; - cdebug << "GraphExecutor::DataFlow::OutputOfAny " << aLinkedNode->Name() - << "->SendSomeDataReady( " << aNodeName << " ) sts " << sts << endl ; + cdebug << pthread_self() << "/" << aLinkedNode->ThreadNo() + << "GraphExecutor::DataFlow::OutputOfAny " << aLinkedNode->Name() + << "->SendSomeDataReady( " << aNodeName << " ) sts " << sts << " " << aLinkedNode->State() << endl ; if ( sts ) { if ( aLinkedNode->State() == GraphExecutor::DataReadyState ) { aLinkedNode->CreateNewThreadIf( true ) ; aLinkedNode->UnLockDataWait() ; - int res = aLinkedNode->DataUndef_AllDataReadyAction() ; +// aLinkedNode->DataUndef_AllDataReadyAction() ; + aLinkedNode->SendEvent( GraphExecutor::ExecuteEvent ) ; } } } else if ( Graph()->GraphMacroLevel() != 0 ) { - cdebug << "GraphExecutor::DataFlow::OutputOfAny to MacroGraph " << anOutPort->ChangeInPorts( i )->NodeName() - << "(" << anOutPort->ChangeInPorts( i )->PortName() << ") " << Graph()->CoupledNodeName () << endl ; - Graph()->CoupledNode()->GraphExecutor()->OutputOfAny( Graph()->CoupledNodeName() , - anOutPort->ChangeInPorts( i )->PortName() , + cdebug << pthread_self() << "/" << Graph()->CoupledNode()->ThreadNo() + << "GraphExecutor::DataFlow::OutputOfAny to that graph " + << ToNodeName << "(" << ToParameterName << ") " << State() << " " << Graph()->CoupledNodeName () + << " sended recursively to the MacroNode coupled to that graph" << endl ; + Graph()->CoupledNode()->GraphEditor()->Executor()->OutputOfAny( Graph()->CoupledNodeName() , + ToParameterName , *anOutPort->Value() ) ; } else { - cdebug << "GraphExecutor::DataFlow::OutputOfAny to Graph " << anOutPort->ChangeInPorts( i )->NodeName() - << "(" << anOutPort->ChangeInPorts( i )->PortName() << ") ignored" << endl ; + cdebug << "GraphExecutor::DataFlow::OutputOfAny to Graph " << ToNodeName + << "(" << ToParameterName << ") ignored" << endl ; } } - cdebug_out << "GraphExecutor::DataFlow::OutputOfAny " << RetVal << endl ; + cdebug_out << pthread_self() << "/" << ThreadNo() << " GraphExecutor::DataFlow::OutputOfAny " << RetVal + << endl ; return RetVal ; } diff --git a/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx b/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx index 3c348af..ddbf265 100644 --- a/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx +++ b/src/GraphExecutor/DataFlowExecutor_DataFlow.hxx @@ -71,7 +71,8 @@ namespace GraphExecutor { const char * ToParameterName , const CORBA::Any aValue = CORBA::Any() ) ; bool InputOfAny( const char * ToServiceParameterName , - const CORBA::Any & aValue ) ; + const CORBA::Any & aValue , + const bool SomeDataReady = true ) ; bool OutputOfAny( const char * aNodeName , const char * ToServiceParameterName , diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx index 9916c77..af0e086 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx @@ -588,7 +588,7 @@ bool GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName , P return RetVal ; } - +/* GraphBase::Graph * GraphExecutor::FiniteStateMachine::MapGraph( const char * aGraphName ) { GraphBase::Graph * aGraph = _MapOfGraphs[ aGraphName ] ; //cout << "MapGraph " << aGraphName << " --> " << aGraph << endl ; @@ -632,6 +632,7 @@ string GraphExecutor::FiniteStateMachine::GraphInstanceName( const char * aGraph // << theGraphInstanceName << endl ; return theGraphInstanceName ; } +*/ void GraphExecutor::FiniteStateMachine::JoinThread() { if ( pthread_mutex_lock( &_MutexJoinWait ) ) { diff --git a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx index 4389c4a..f99c191 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.hxx @@ -162,8 +162,10 @@ namespace GraphExecutor { int _GraphExecutingNumber ; int _DbgFileNumber ; - map< string , GraphBase::Graph * > _MapOfGraphs ; - map< string , int > _MapOfGraphNames ; + +// fields and methods that use them are moved to GraphEditor::OutNode class (asv 20.09.04) +//map< string , GraphBase::Graph * > _MapOfGraphs ; +//map< string , int > _MapOfGraphNames ; bool _JoinThread ; pthread_t _JoinThreadNo ; @@ -184,16 +186,19 @@ namespace GraphExecutor { bool PyFunction( const char * aPyFuncName , PyObject * aPyFunction ) ; PyObject * PyFunction( const char * aPyFuncName ) ; + string DbgFileNumber() { _DbgFileNumber += 1 ; ostringstream astr ; astr << _DbgFileNumber ; return astr.str() ; } ; +/* GraphBase::Graph * MapGraph( const char * aGraphName ) ; bool MapGraph( GraphBase::Graph * aGraph , const char * aGraphName ) ; void EraseGraph( const char * aGraphName ) ; bool GraphName( const char * aGraphName ) ; string GraphInstanceName( const char * aGraphName ) ; +*/ void JoinThread() ; void JoinThread( pthread_t aThread ) ; diff --git a/src/GraphExecutor/DataFlowExecutor_InNode.cxx b/src/GraphExecutor/DataFlowExecutor_InNode.cxx index 213e0ff..87f1960 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.cxx @@ -1139,18 +1139,19 @@ void GraphExecutor::InNode::InitialState( GraphExecutor::OutNode * theOutNode ) *anAny <<= (long ) 1 ; anOutPort->Value( anAny ) ; } +// JR 15_09_2004 if backward link from GOTONode or EndLoopNode ==> DataConnected else if ( anInPort->IsGate() && anOutPort ) { - if ( IsComputingNode() || IsFactoryNode() ) { - anOutPort->State( SUPERV::WaitingState ) ; - anOutPort->Done( false ) ; - } - else if ( IsOneOfInLineNodes() ) { + anOutPort->State( SUPERV::WaitingState ) ; + anOutPort->Done( false ) ; + const GraphBase::ComputingNode * aFromNode = _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() ) ; + if ( aFromNode->IsGOTONode() || aFromNode->IsEndLoopNode() ) { // ASV: bug with synchronization of Inline nodes (via Gate ports) fixed. + // before was "else if ( IsOneOfInlineNodes() )" + // IsOneOfInline() == ( Inline || IsOneOfGOTO() ), so Inline are removed.. anOutPort->PortStatus( DataConnected ); anOutPort->State( SUPERV::ReadyState ) ; anOutPort->Done( true ) ; } } -// if ( ( anInPort->IsGate() || anInPort->IsBus() ) && anOutPort == NULL ) { if ( anInPort->IsGate() && anOutPort == NULL ) { Pc-- ; } diff --git a/src/GraphExecutor/DataFlowExecutor_InNode.hxx b/src/GraphExecutor/DataFlowExecutor_InNode.hxx index ca7ec68..9745f94 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.hxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.hxx @@ -220,9 +220,9 @@ namespace GraphExecutor { void SetObjRef( SUPERV::CNode_var aNode ) { _ComputingNode->SetObjRef( aNode ) ; } ; - Graph_Impl * ObjImpl() const { return _GraphMacroNode->ObjImpl() ; } ; - void SetObjImpl( Graph_Impl * aGraph ) { - _GraphMacroNode->SetObjImpl( aGraph ) ; } ; + CNode_Impl * ObjImpl() const { return _ComputingNode->ObjImpl() ; } ; + void SetObjImpl( CNode_Impl * aGraph ) { + _ComputingNode->SetObjImpl( aGraph ) ; } ; Engines::Component_var Component() const ; Engines::Container_var Container() const ; diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index 835c0e1..83d4c53 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -54,10 +54,8 @@ using namespace std; #include CORBA_CLIENT_HEADER(SALOME_Component) #include "SALOME_LifeCycleCORBA.hxx" -//#include "StreamGraph_Impl.hxx" - -//#include "DataFlowExecutor_OutNode.hxx" #include "DataFlowExecutor_DataFlow.hxx" +#include "DataFlowEditor_DataFlow.hxx" // GraphEditor package must be built BEFORE static void UpperCase(std::string& rstr) @@ -611,6 +609,8 @@ void * run_function(void *p) { exit(0) ; } aNode->ThreadStartAction() ; +// cout << "run_function " << aNode->Name() << "->ExecuteAction() Coupled : " << aNode->CoupledNode() +// << endl ; aNode->ExecuteAction() ; char * msg = new char[40] ; sprintf( msg , "%d" , (int ) aNode->ThreadNo() ) ; @@ -936,7 +936,9 @@ int GraphExecutor::InNode::DataWaiting_SomeDataReadyAction() { cdebug << endl ; // MacroNode : give immediately the value to the corresponding graph if ( IsMacroNode() ) { - GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphExecutor() ; + cout << "SomeDataReadyAction " << GraphMacroNode() << " " << GraphMacroNode()->Name() + << " coupled to " << GraphMacroNode()->CoupledNode() << endl ; + GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ; cdebug << "SomeDataReadyAction MacroNode " << aMacroGraph->Graph()->Name() << " --> InputOfAny " << InReady << "/" << GetNodeInPortsSize() << " InPorts are Ready" << endl ; // GraphMacroNode()->MacroObject()->InputOfAny( anInPort->PortName() , *anOutPort->Value() ) ; @@ -1518,7 +1520,7 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { SendEvent( NewEvent ) ; } else { - GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphExecutor() ; + GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ; cdebug << ThreadNo() << " DataReady_ExecuteAction " << aMacroGraph->Graph()->Name() << " ->DoneWait()" << " State " << aMacroGraph->State() << endl; aMacroGraph->DoneWait() ; @@ -2791,9 +2793,11 @@ bool GraphExecutor::InNode::OutParametersSet( bool Err , bool fromGOTO = false ; const char * ToNodeName = anOutPort->ChangeInPorts( j )->NodeName() ; if ( !strcmp( ToNodeName , _OutNode->Graph()->Name() ) && _OutNode->Graph()->GraphMacroLevel() != 0 ) { - cdebug << "OutParametersSet ToNodeName " << _OutNode->Graph()->CoupledNode() - << " GraphExecutor " << _OutNode->Graph()->CoupledNode()->GraphExecutor() << endl ; - _OutNode->Graph()->CoupledNode()->GraphExecutor()->OutputOfAny( _OutNode->Graph()->CoupledNodeName() , + cdebug << "OutParametersSet ToNodeName " << _OutNode->Graph()->Name() << " CoupledNode " + << _OutNode->Graph()->CoupledNodeName() << _OutNode->Graph()->CoupledNode() + << endl ; + cdebug << " GraphExecutor " << _OutNode->Graph()->CoupledNode()->GraphEditor()->Executor() << endl ; + _OutNode->Graph()->CoupledNode()->GraphEditor()->Executor()->OutputOfAny( _OutNode->Graph()->CoupledNodeName() , anOutPort->ChangeInPorts( j )->PortName() , *anOutPort->Value() ) ; } diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx index 26b81bf..090d9a8 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx @@ -80,6 +80,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, _prof_debug , _fdebug ) ; _Graph = _StreamGraph ; } +//_Graph->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; _Valid = false ; _Executable = false ; _Done = false ; @@ -212,7 +213,8 @@ bool GraphExecutor::OutNode::LoadDataFlow(const GraphBase::SGraph * aDataFlow ) else { cdebug << "GraphExecutor::OutNode::LoadDataFlow ServiceName Error." << endl ; } - cdebug_in << "GraphExecutor::OutNode::LoadDataFlow " << RetVal << endl ; + cdebug_out << "GraphExecutor::OutNode::LoadDataFlow " << Graph()->Name() << " RetVal " + << RetVal << endl ; return RetVal ; } @@ -342,11 +344,11 @@ bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfSNodes &aListOfNod aCoupledCoupledNode = (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ; if ( aCoupledCoupledNode != NULL ) { aCoupledNode->CoupledNode( aCoupledCoupledNode ) ; +//aCoupledNode->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; } else { aCoupledNode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ; } - aCoupledNode->SetGraphExecutor( (GraphExecutor::DataFlow * ) this ) ; } } return RetVal ; @@ -426,6 +428,7 @@ GraphExecutor::InNode *GraphExecutor::OutNode::AddNode( NodeComputer , NodeComment , false , NodeX , NodeY , _prof_debug , _fdebug ) ; Graph()->AddNode( Nd->ComputingNode() ) ; +//Nd->ComputingNode()->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; cdebug_out << "GraphExecutor::OutNode::AddNode" << endl; return Nd ; } @@ -484,7 +487,7 @@ bool GraphExecutor::OutNode::Executable() { bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { bool RetVal = false ; - cdebug_in << "GraphExecutor::OutNode::Run" << endl; + cdebug_in << "GraphExecutor::OutNode::Run( AndSuspend " << AndSuspend << " )" << endl; if ( Executable() ) { _ControlState = SUPERV::VoidState ; @@ -492,6 +495,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { Graph()->ThreadNo( pthread_self() ) ; Done( false ) ; _JustStarted = true ; + RetVal = true ; int i ; for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) { GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ; @@ -524,22 +528,23 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) { GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ; - if ( anInNode->IsMacroNode() ) { + if ( RetVal && anInNode->IsMacroNode() ) { GraphBase::Graph * aMacroGraph = anInNode->GraphMacroNode() ; cdebug << "GraphExecutor::OutNode::Run " << anInNode << " MacroNode " << aMacroGraph << aMacroGraph->Name() << endl ; SUPERV::Graph_var iobject = anInNode->GraphMacroNode()->MacroObject() ; if ( CORBA::is_nil( iobject ) ) { - cdebug << "MacroObject() is a nil object. Error" << endl ; + cdebug << "GraphExecutor::OutNode::Run MacroObject() is a nil object. Error" << endl ; + RetVal = false ; } else { - cdebug << "MacroObject() is NOT a nil object." << endl ; + cdebug << "GraphExecutor::OutNode::Run MacroObject() is NOT a nil object." << endl ; } } } if ( Graph()->GraphMacroLevel() != 0 ) { - cdebug << "Execution starting GraphExecutor::Action_DataOk_RunService Node " + cdebug << "GraphExecutor::OutNode::Run Execution starting GraphExecutor::Action_DataOk_RunService Node " << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ; PushEvent( NULL , GraphExecutor::NoDataReadyEvent , GraphExecutor::DataUndefState ) ; @@ -620,7 +625,8 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { } } - cdebug_out << "GraphExecutor::OutNode::Run GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ; + cdebug_out << "GraphExecutor::OutNode::Run " << Graph()->Name() << " GraphMacroLevel " + << Graph()->GraphMacroLevel() << " RetVal " << RetVal << endl ; return RetVal ; } @@ -721,12 +727,11 @@ void GraphExecutor::OutNode::CheckAllDone() { cdebug << Graph()->Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize " << EventQSize() << endl ; cdebug << "================================================================================" << endl ; -// ostringstream astr ; -// astr << "Graph " << Graph()->Name() << " is done : " -// << theAutomaton->StateName( AutomatonState() ) ; -// Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ; - //cout << Graph()->Name() << " IS DONE : " << theAutomaton->StateName( AutomatonState() ) << " EventQSize " - // << EventQSize() << endl ; + + // asv : fix for 6798 and other bugs: "sift" the event queue after execution + //cout << "Before siftEvents() event count = " << _EventNodes.size(); + siftEvents(); + //cout << ". After event count = " << _EventNodes.size() << endl; } cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() << " GraphAutomatonState " << theAutomaton->StateName( AutomatonState() ) @@ -1177,15 +1182,14 @@ bool GraphExecutor::OutNode::PushEvent( GraphExecutor::InNode * aNode , perror("PushEvent pthread_mutex_lock ") ; exit( 0 ) ; } - if ( aNode ) { - _EventNodes.push_back( aNode->Name() ) ; - } - else { - _EventNodes.push_back( Graph()->Name() ) ; - } + char* aNodeName = aNode ? aNode->Name() : Graph()->Name() ; + _EventNodes.push_back( aNodeName ) ; _Events.push_back( anEvent ) ; _States.push_back( aState ) ; + pthread_cond_broadcast( &_EventWait ); + cdebug << pthread_self() << " PushEvent Threads " << Threads() << " SuspendedThreads " + << SuspendedThreads() << " pthread_cond_broadcast _EventWait " << &_EventWait << endl ; if ( aNode ) { // cdebug << aNode->ThreadNo() << " PushEvent " << aNode->Name() ; // cdebug << " " << aNode->Automaton()->EventName( anEvent ) @@ -1287,7 +1291,8 @@ bool GraphExecutor::OutNode::Event( char ** aNodeName , exit( 0 ) ; } if ( _EventNodes.size() > 0 ) { - cdebug_out << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue" << endl ; + cdebug_out << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue" + << *aNodeName << " " << anEvent << " " << aState << endl ; } return RetVal ; } @@ -1522,9 +1527,13 @@ GraphExecutor::AutomatonState GraphExecutor::OutNode::AutomatonState() { GraphExecutor::AutomatonState GraphExecutor::OutNode::AutomatonState( const char * NodeName ) { // cdebug_in << "GraphExecutor::OutNode::AutomatonState " << NodeName << endl; GraphExecutor::AutomatonState aret = GraphExecutor::UnKnownState ; - GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ; - if ( anInNode ) - aret = anInNode->State() ; + const GraphBase::ComputingNode * aNode = Graph()->GetGraphNode( NodeName ) ; + if ( aNode ) { + GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) aNode->GetInNode() ; + if ( anInNode ) { + aret = anInNode->State() ; + } + } // cdebug_out << "GraphExecutor::OutNode::AutomatonState" << endl ; return aret ; } @@ -1538,9 +1547,13 @@ SUPERV::ControlState GraphExecutor::OutNode::ControlState() { SUPERV::ControlState GraphExecutor::OutNode::ControlState( const char * NodeName ) { // cdebug_in << "GraphExecutor::OutNode::ControlState " << NodeName << endl; SUPERV::ControlState aret = SUPERV::VoidState ; - GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ; - if ( anInNode ) - aret = anInNode->ControlState() ; + const GraphBase::ComputingNode * aNode = Graph()->GetGraphNode( NodeName ) ; + if ( aNode ) { + GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) aNode->GetInNode() ; + if ( anInNode ) { + aret = anInNode->ControlState() ; + } + } // cdebug_out << "GraphExecutor::OutNode::ControlState" << endl ; return aret ; } @@ -1553,9 +1566,13 @@ void GraphExecutor::OutNode::ControlClear() { void GraphExecutor::OutNode::ControlClear( const char * NodeName ) { // cdebug_in << "GraphExecutor::OutNode::ControlClear " << NodeName << endl; - GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( NodeName )->GetInNode() ; - if ( anInNode ) - anInNode->ControlClear() ; + const GraphBase::ComputingNode * aNode = Graph()->GetGraphNode( NodeName ) ; + if ( aNode ) { + GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) aNode->GetInNode() ; + if ( anInNode ) { + anInNode->ControlClear() ; + } + } // cdebug_out << "GraphExecutor::OutNode::ControlClear" << endl ; } @@ -1916,7 +1933,7 @@ bool GraphExecutor::OutNode::RunningWait() { } bool GraphExecutor::OutNode::DoneWait() { - cdebug_in << "GraphExecutor::OutNode::DoneWait" << endl; + cdebug_in << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name() << endl; bool aret ; if ( pthread_mutex_lock( &_MutexWait ) ) { perror("pthread_mutex_lock _DoneWait") ; @@ -1924,16 +1941,19 @@ bool GraphExecutor::OutNode::DoneWait() { } aret = IsDone() ; while ( !aret && !IsSuspended() && IsRunning() ) { - cdebug << "DoneWait pthread_cond_wait _EventWait" << endl; + cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name() + << " DoneWait pthread_cond_wait _EventWait " << &_EventWait << endl; pthread_cond_wait( &_EventWait , &_MutexWait ); aret = IsDone() ; - cdebug << "DoneWait pthread_cond_waited _EventWait " << aret << endl; + cdebug << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name() + << " DoneWait pthread_cond_waited _EventWaited " << &_EventWait << " : "<< aret << endl; } if ( pthread_mutex_unlock( &_MutexWait ) ) { perror("pthread_mutex_lock _DoneWait") ; exit( 0 ) ; } - cdebug_out << "GraphExecutor::OutNode::DoneWait " << aret << endl ; + cdebug_out << pthread_self() << " GraphExecutor::DoneWait " << this << " " << Graph()->Name() + << " " << State() << " : " << aret << endl ; return aret ; } @@ -2052,4 +2072,36 @@ const long GraphExecutor::OutNode::CpuUsed( const char * aNodeName ) { return 0 ; } +// remove equal sets "Node-Event-State" from _EventNodes/_Events/_States queues +void GraphExecutor::OutNode::siftEvents() { + list::reverse_iterator itNodes = _EventNodes.rbegin(); + list::reverse_iterator itEvents = _Events.rbegin(); + list::reverse_iterator itStates = _States.rbegin(); + list _NewEventNodes; + list _NewEvents; + list _NewStates; + for ( ; itNodes != _EventNodes.rend() ; ++itNodes, ++itEvents, ++itStates) { + //cout << "----- aNodeName ==> " << *itNodes; + list::reverse_iterator itNewNodes = _NewEventNodes.rbegin(); + bool found = false; + for ( ; itNewNodes != _NewEventNodes.rend() ; ++itNewNodes ) { + if ( !strcmp( *itNewNodes, *itNodes ) ) { + found = true; + break; + } + } + if ( found ) { + //cout << " FOUND"; + } + else { + _NewEventNodes.push_back( *itNodes ); + _NewEvents.push_back( *itEvents ); + _NewStates.push_back( *itStates ); + } + //cout << endl; + } + _EventNodes = _NewEventNodes; + _Events = _NewEvents; + _States = _NewStates; +} diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.hxx b/src/GraphExecutor/DataFlowExecutor_OutNode.hxx index 72c38db..c5b7c9a 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.hxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.hxx @@ -75,6 +75,10 @@ namespace GraphExecutor { CORBA::ORB_ptr _Orb ; + // scan (reverse) the _EventNodes queue and leave only 1 (the last one that came) + // event for every node + void siftEvents(); + public : OutNode() ; diff --git a/src/GraphExecutor/Makefile.in b/src/GraphExecutor/Makefile.in index ccf0b54..9438f6d 100644 --- a/src/GraphExecutor/Makefile.in +++ b/src/GraphExecutor/Makefile.in @@ -47,9 +47,9 @@ BIN_SERVER_IDL = CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \ -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS+= -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ +CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSALOMELocalTrace \ +LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace \ -lc $(QT_MT_LIBS) $(OGL_LIBS) \ -L${KERNEL_ROOT_DIR}/lib/salome #LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS) diff --git a/src/Makefile.in b/src/Makefile.in index cbd9e23..a5b7bf2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -31,6 +31,6 @@ VPATH=.:@srcdir@ @COMMENCE@ -SUBDIRS = GraphBase GraphExecutor GraphEditor Supervision SUPERVGUI +SUBDIRS = GraphBase GraphEditor GraphExecutor Supervision SUPERVGUI @MODULE@ diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index f622c04..83498b5 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -283,11 +283,20 @@ void SUPERVGUI::displayDataflow() { QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) return; } - aDataFlow = engine->getStreamGraph(ior); + //aDataFlow = engine->getStreamGraph(ior); + aDataFlow = engine->getGraph(ior); if (SUPERV_isNull(aDataFlow)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR")); return; } + if (aDataFlow->IsStreamGraph()) { + SUPERV_StreamGraph aDataFlowStream = aDataFlow->ToStreamGraph(); + if (SUPERV_isNull(aDataFlowStream)) { + QMessageBox::warning(0, tr("ERROR"), tr("MSG_ACCESS_BAD_IOR")); + return; + } + aDataFlow = aDataFlowStream; + } } QAD_StudyFrame* aStudyFrame = createGraph(); SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast @@ -526,9 +535,16 @@ void SUPERVGUI::whatIsSelected(const Handle(SALOME_InteractiveObject)& theObj, b SALOMEDS::GenericAttribute_var anAttr; if (obj->FindAttribute(anAttr, "AttributeIOR")) { SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr); - SUPERV_Graph aDataFlow = engine->getStreamGraph(anIOR->Value()); - if (!SUPERV_isNull(aDataFlow)) - theIsDataflow = true; + //SUPERV_Graph aDataFlow = engine->getStreamGraph(anIOR->Value()); + SUPERV_Graph aDataFlow = engine->getGraph(anIOR->Value()); + if (!SUPERV_isNull(aDataFlow)) { + if (aDataFlow->IsStreamGraph()) { + if (!SUPERV_isNull(aDataFlow->ToStreamGraph())) + theIsDataflow = true; + } + else + theIsDataflow = true; + } } CORBA::String_var anObjectID = obj->GetID(); CORBA::String_var aComponentID = comp->GetID(); diff --git a/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx b/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx index 239575e..dd0939e 100644 --- a/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx +++ b/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx @@ -69,7 +69,6 @@ bool SUPERVGUI_PortField::setNewValue() { if ( aTxt.isNull() || aTxt.isEmpty() ) return false; if ( aTxt.find( "Unknown" ) < 0 ) { - //cout<<" ===> Set new value!"<Input( Supervision.getEngine()->StringValue( aTxt ) ); } return false; diff --git a/src/SUPERVGUI/SUPERVGUI_Canvas.cxx b/src/SUPERVGUI/SUPERVGUI_Canvas.cxx index 3ca3595..fb1f77c 100644 --- a/src/SUPERVGUI/SUPERVGUI_Canvas.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Canvas.cxx @@ -157,7 +157,7 @@ void SUPERVGUI_Canvas::updateLinks() } void SUPERVGUI_Canvas::sync() { - // cout << "===> SUPERVGUI_Canvas::sync()" << endl; + // MESSAGE("===> SUPERVGUI_Canvas::sync()"); if (SUPERV_isNull(myMain->getDataflow())) return; SUPERVGUI_CanvasNode* ihmNode; @@ -174,7 +174,7 @@ void SUPERVGUI_Canvas::sync() { * Synchronizes Graph presentation with internal graph structure */ void SUPERVGUI_Canvas::merge() { - // cout << "===> SUPERVGUI_Canvas::merge()" << endl; + // MESSAGE("===> SUPERVGUI_Canvas::merge()"); if (SUPERV_isNull(myMain->getDataflow())) return; SUPERVGUI_CanvasNode* ihmNode; @@ -190,14 +190,12 @@ void SUPERVGUI_Canvas::merge() { MESSAGE("Graphs="<Graphs.length()); int n; - //cout << " update nodes " << endl; UPDATENODES(CNodes, addComputeNode); UPDATENODES(FNodes, addComputeNode); UPDATENODES(INodes, addComputeNode); UPDATENODES(Graphs, addMacroNode); UPDATENODES(GNodes, addGOTONode); - //cout << " update control nodes " << endl; UPDATECONTROLNODES(LNodes); UPDATECONTROLNODES(SNodes); @@ -210,7 +208,6 @@ void SUPERVGUI_Canvas::merge() { delete ihmList; // update links - //cout << " update links " << endl; SUPERVGUI_CanvasLink* ihmLink; ihmList = queryList("SUPERVGUI_CanvasLink"); /* @@ -218,14 +215,12 @@ void SUPERVGUI_Canvas::merge() { */ //SUPERV_Links links = myMain->getDataflow()->Links(); SUPERV_Links links = myMain->getDataflow()->GLinks(); - //cout << "===> Number of links " << links->length() << endl; for (int i = 0; i < links->length(); i++) { UPDATELINK(links[i]); } /* SUPERV_StreamLinks slinks = myMain->getDataflow()->StreamLinks(); - //cout << "===> Number of stream links " << slinks->length() << endl; for (int i = 0; i < slinks->length(); i++) { UPDATELINK(slinks[i]); } @@ -235,7 +230,6 @@ void SUPERVGUI_Canvas::merge() { SUPERV_StreamGraph aSGraph = myMain->getDataflow()->ToStreamGraph(); if (!SUPERV_isNull(aSGraph)) { SUPERV_StreamLinks slinks = aSGraph->StreamLinks(); // <<- doesn't work!!! - //cout << "===> Number of stream links " << slinks->length() << endl; for (int i = 0; i < slinks->length(); i++) { UPDATELINK(slinks[i]); } @@ -276,7 +270,6 @@ void SUPERVGUI_Canvas::merge() { delete ihmLink; } delete ihmList; - //cout << " merge done " << endl; } void SUPERVGUI_Canvas::setAsFromStudy(bool theToStudy) diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index ce06ff8..3277349 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -35,7 +35,6 @@ SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* t myBrowseDlg(0) { Trace("SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode"); - //cout << "===> SUPERVGUI_CanvasNode " << myNode->Name() << endl; setName(myNode->Name()); @@ -75,7 +74,6 @@ SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* t } isIgnore = false; - //cout << "<=== SUPERVGUI_CanvasNode " << myNode->Name() << endl; } SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode() @@ -214,7 +212,7 @@ void SUPERVGUI_CanvasNode::move(int x, int y) void SUPERVGUI_CanvasNode::merge() { - //cout << "===> SUPERVGUI_CanvasNode::merge() " << myNode->Name() << endl; + //MESSAGE("===> SUPERVGUI_CanvasNode::merge() " << myNode->Name()); // synchronize port list bool update = false; isIgnore = true; @@ -273,7 +271,7 @@ void SUPERVGUI_CanvasNode::merge() void SUPERVGUI_CanvasNode::sync() { - //cout << "===> SUPERVGUI_CanvasNode::sync() " << myNode->Name() << ", state " << myNode->State() << endl; + //MESSAGE("===> SUPERVGUI_CanvasNode::sync() " << myNode->Name() << ", state " << myNode->State()); //if myNode is a MacroNode then set it state to state of its subgraph if (myNode->IsMacro() && myMain->getDataflow()->IsExecuting()) { diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx index cda5aaf..f7e8793 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNodePrs.cxx @@ -511,7 +511,30 @@ void drawText(QPainter& thePainter, const QString& theText, int flags = theHAlign | Qt::AlignVCenter; QRect r(theRect.x() + TEXT_MARGIN, theRect.y(), theRect.width() - 2*TEXT_MARGIN, theRect.height()); - thePainter.drawText(r, flags, theText); + + QWMatrix aMat = thePainter.worldMatrix(); + if (aMat.m11() != 1.0) { + // for scaled picture only + QRect r1 = aMat.mapRect(r); + QFont saved = thePainter.font(); + QFont f(saved); + if (f.pointSize() == -1) { + f.setPixelSize(f.pixelSize()*aMat.m11()); + } + else { + f.setPointSize(f.pointSize()*aMat.m11()); + } + thePainter.save(); + QWMatrix m; + thePainter.setWorldMatrix(m); + thePainter.setFont(f); + thePainter.drawText(r1, flags, theText); + thePainter.setFont(saved); + thePainter.restore(); + } + else { + thePainter.drawText(r, flags, theText); + } } void SUPERVGUI_CanvasNodePrs::draw(QPainter& thePainter) diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx index db186c3..91f32e5 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx @@ -64,9 +64,13 @@ QPopupMenu* SUPERVGUI_CanvasPort::getPopupMenu(QWidget* theParent) || myPort->Kind() == SUPERV::EndSwitchParameter); popup->insertSeparator(); } - if ((myPort->IsEndSwitch() && myPort->IsInput()) || - (myPort->IsInLine() && myPort->Node()->Kind() != SUPERV::EndLoopNode - && !(myPort->Node()->Kind() == SUPERV::LoopNode && !myPort->IsInput()))) { + if (myMain->isEditable() + && + ((myPort->IsEndSwitch() && myPort->IsInput()) + || + (myPort->IsInLine() && myPort->Node()->Kind() != SUPERV::EndLoopNode + && + !(myPort->Node()->Kind() == SUPERV::LoopNode && !myPort->IsInput())))) { popup->insertItem(tr("ITM_DEL_PORT"), this, SLOT(remove())); } diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx index 2f6f04e..5e9ffd3 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx @@ -143,7 +143,7 @@ SUPERVGUI_CanvasView::~SUPERVGUI_CanvasView() void SUPERVGUI_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent) { - // cout << "===> SUPERVGUI_CanvasView::contentsMousePressEvent(...) " << endl; + // MESSAGE("===> SUPERVGUI_CanvasView::contentsMousePressEvent(...) "); myPoint = inverseWorldMatrix().map(theEvent->pos()); myGlobalPoint = theEvent->globalPos(); myCurrentItem = 0; @@ -364,7 +364,7 @@ void SUPERVGUI_CanvasView::contentsMouseMoveEvent(QMouseEvent* theEvent) void SUPERVGUI_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) { - // cout << "===> SUPERVGUI_CanvasView::contentsMouseReleaseEvent(...) " << endl; + // MESSAGE("===> SUPERVGUI_CanvasView::contentsMouseReleaseEvent(...) "); if (myTimer->isActive()) myTimer->stop(); if (myCurrentItem) { @@ -392,7 +392,7 @@ void SUPERVGUI_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) void SUPERVGUI_CanvasView::contentsMouseDoubleClickEvent(QMouseEvent* theEvent) { - // cout << "===> SUPERVGUI_CanvasView::contentsMouseDoubleClickEvent(...) " << endl; + // MESSAGE("===> SUPERVGUI_CanvasView::contentsMouseDoubleClickEvent(...) "); QPoint p = inverseWorldMatrix().map(theEvent->pos()); // compute collision rectangle @@ -482,7 +482,7 @@ void SUPERVGUI_CanvasView::startSketch(SUPERVGUI_CanvasPort* thePort) void SUPERVGUI_CanvasView::endSketch(SUPERVGUI_CanvasPort* thePort) { - // cout << "===> SUPERVGUI_CanvasView::endSketch(" << thePort->name() << ")" << endl; + // MESSAGE("===> SUPERVGUI_CanvasView::endSketch(" << thePort->name() << ")"); if (!myIsLinkCreating) return; if (myLinkBuilder && myLinkBuilder->canCreateEngine(thePort)) { diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index ce4f2e2..f4009e7 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -230,14 +230,17 @@ void SUPERVGUI_Main::init(QAD_Desktop* theDesktop) { } SUPERVGUI_Main::~SUPERVGUI_Main() { -//cout << "===> SUPERVGUI_Main::~SUPERVGUI_Main() " << endl; Trace("SUPERVGUI_Main::~SUPERVGUI_Main"); // close all opened SubGraphs QMap::iterator it; for (it = mySubGraphs.begin(); it != mySubGraphs.end(); ++it) { it.data()->removeEventFilter(this); + it.data()->disconnect(); it.data()->close(); + + QAD_Study* aStudy = it.data()->getStudy(); + aStudy->removeStudyFrame(it.data()); } mySubGraphs.clear(); mySubGraphMap.clear(); @@ -516,8 +519,6 @@ void SUPERVGUI_Main::copy() { void SUPERVGUI_Main::openSubGraph(SUPERV_CNode theNode, bool correct) { - //cout << "===> SUPERVGUI_Main::openSubGraph(" << theNode->Name() << ")" << endl; - //cout << " macro node : " << theNode->IsMacro() << ", " << theNode->IsFlowMacro() << ", " << theNode->IsStreamMacro() << endl; if (theNode->IsMacro()) { // get SubGraph from MacroNode SUPERV_Graph aMacro = SUPERV::Graph::_narrow(theNode); @@ -536,7 +537,6 @@ void SUPERVGUI_Main::openSubGraph(SUPERV_CNode theNode, bool correct) QString aGraphName = aGraph->Name(); QAD_StudyFrame* aStudyFrame; if (mySubGraphs.contains(aGraphName)) { - //cout << " activate already opened dataflow " << aGraphName << endl; aStudyFrame = mySubGraphs[aGraphName]; aStudyFrame->setActiveWindow(); aStudyFrame->setFocus(); @@ -1380,6 +1380,7 @@ void SUPERVGUI_Main::startTimer() { void SUPERVGUI_Main::executionFinished() { getStudy()->updateObjBrowser(); + myCanvas->update(); } void SUPERVGUI_Main::checkExecution() { @@ -1464,11 +1465,11 @@ void SUPERVGUI_Thread::run() myIsActive = false; } else { - if ( aNode != NULL) { + if ( aNode != NULL && !CORBA::is_nil( aNode ) ) { aName = aNode->Name(); } - if ( aPrevNode == NULL ) { //first initialize aPrev... variables + if ( aPrevNode == NULL || CORBA::is_nil( aPrevNode ) ) { //first initialize aPrev... variables anEventNodes = myMain->getEventNodes(); anEventNodes.append( &aName ) ; myMain->setEventNodes(anEventNodes); @@ -1516,7 +1517,7 @@ void SUPERVGUI_Thread::run() stopThread(tr("MSG_GRAPH_FINISHED")); break; - case SUPERV_Error : + case SUPERV_Error : stopThread(tr("MSG_GRAPH_ABORTED")); break; @@ -1544,7 +1545,12 @@ void SUPERVGUI_Thread::run() aPrevNode = aNode; aPrevEvent = aEvent; aPrevState = aState; - aPrevName = aPrevNode->Name(); + if ( aPrevNode == NULL || CORBA::is_nil( aPrevNode ) ) { + aPrevName = ""; + } + else { + aPrevName = aPrevNode->Name(); + } //usleep(10); //msleep(5); diff --git a/src/SUPERVGUI/SUPERVGUI_Node.cxx b/src/SUPERVGUI/SUPERVGUI_Node.cxx index 1d5a39c..563dcab 100644 --- a/src/SUPERVGUI/SUPERVGUI_Node.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Node.cxx @@ -171,7 +171,6 @@ void SUPERVGUI_Node::setState(SUPERV::GraphState theState) myRunPopup->setItemEnabled(myStopItem, true); break; default: - //cout<<"### Node state = "<setText("No Status"); myStatus->setPaletteBackgroundColor(QColor(NODE_RED, NODE_GREEN, NODE_BLUE)); myRunPopup->setItemEnabled(mySuspendItem, false); diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 017ddeb..4345b0d 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -606,7 +606,7 @@ void SUPERVGUI_Service::loadGraph() { if ( getenv( "ENABLE_MACRO_NODE" ) == NULL ) // error! if ENABLE_MACRO_NODE is set - we should NOT get here by any means.. { - //cout << "Error: ENABLE_MACRO_NODE is not set, but loadGraph() was called!" << endl; + //MESSAGE("Error: ENABLE_MACRO_NODE is not set, but loadGraph() was called!"); return; } diff --git a/src/SUPERVGUI/SUPERV_msg_en.po b/src/SUPERVGUI/SUPERV_msg_en.po index 5832601..d22a5b4 100644 --- a/src/SUPERVGUI/SUPERV_msg_en.po +++ b/src/SUPERVGUI/SUPERV_msg_en.po @@ -345,9 +345,6 @@ msgstr "Parameters..." msgid "MSG_STREAM_DLG_TIT" msgstr "Stream Port Parameters" -msgid "MSG_STREAM_DLG_TIT" -msgstr "Stream Port Parameters" - msgid "MSG_STREAM_SCHEMA" msgstr "Schema" diff --git a/src/Supervision/CNode_Impl.cxx b/src/Supervision/CNode_Impl.cxx index e33332e..9457225 100644 --- a/src/Supervision/CNode_Impl.cxx +++ b/src/Supervision/CNode_Impl.cxx @@ -42,9 +42,7 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , _Poa = poa ; _ContId = contId ; _DataFlowEditor = NULL ; - _DataFlowExecutor = NULL ; _DataFlowNode = NULL ; - _DataFlowExecutorNode = NULL ; if ( aKindOfNode == SUPERV::MacroNode ) { _IsNode = true ; } @@ -85,8 +83,7 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , _Poa = poa ; _ContId = contId ; _DataFlowEditor = aDataFlowEditor ; - _DataFlowExecutor = NULL ; - DataFlowEditor()->Graph()->SetGraphEditor( aDataFlowEditor ) ; + DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ; GraphBase::ListOfFuncName aFuncName ; GraphBase::ListOfPythonFunctions aPythonFunction ; if ( FuncName ) { @@ -95,11 +92,10 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , aPythonFunction.resize(1) ; aPythonFunction[0] = &PythonFunction ; } - _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName , + _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName , NodeKindOfNode , aFuncName , aPythonFunction ) ; - _DataFlowExecutorNode = NULL ; _IsNode = true ; // endService( "CNode_Impl::CNode_Impl" ); // cout << "<-- CNode_Impl::CNode_Impl" << endl ; @@ -131,13 +127,11 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , _Poa = poa ; _ContId = contId ; _DataFlowEditor = aDataFlowEditor ; - _DataFlowExecutor = NULL ; - DataFlowEditor()->Graph()->SetGraphEditor( aDataFlowEditor ) ; - _DataFlowNode = _DataFlowEditor->AddNode( NodeService , "" , "" , NodeName , + DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ; + _DataFlowNode = DataFlowEditor()->AddNode( NodeService , "" , "" , NodeName , NodeKindOfNode , aFuncName , aPythonFunction ) ; - _DataFlowExecutorNode = NULL ; _IsNode = true ; // endService( "CNode_Impl::CNode_Impl" ); } @@ -163,10 +157,8 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , _Poa = poa ; _ContId = contId ; _DataFlowEditor = aDataFlowEditor ; - _DataFlowExecutor = NULL ; - DataFlowEditor()->Graph()->SetGraphEditor( aDataFlowEditor ) ; + DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ; _DataFlowNode = aDataFlowNode ; - _DataFlowExecutorNode = NULL ; if ( aDataFlowNode ) { _IsNode = true ; } @@ -176,40 +168,6 @@ CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , // endService( "CNode_Impl::CNode_Impl" ); } -CNode_Impl::CNode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * aDataFlowExecutor , - GraphExecutor::InNode * aDataFlowExecutorNode ) : - Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) { -// beginService( "CNode_Impl::CNode_Impl" ); - if ( aDataFlowExecutorNode && aDataFlowExecutorNode->IsComputingNode() ) { -// MESSAGE( "CNode_Impl::CNode_Impl _poa->activate_object" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - } - else { -// MESSAGE( "CNode_Impl::CNode_Impl NO _poa->activate_object " ); - } - _Orb = CORBA::ORB::_duplicate(orb); - _Poa = poa ; - _ContId = contId ; - _DataFlowEditor = NULL ; - _DataFlowExecutor = aDataFlowExecutor ; - DataFlowExecutor()->Graph()->SetGraphExecutor( aDataFlowExecutor ) ; - _DataFlowNode = NULL ; - _DataFlowExecutorNode = aDataFlowExecutorNode ; - if ( aDataFlowExecutorNode ) { - _IsNode = true ; - } - else { - _IsNode = false ; - } -// endService( "CNode_Impl::CNode_Impl" ); -} - CNode_Impl::~CNode_Impl() { beginService( "CNode_Impl::~CNode_Impl" ); endService( "CNode_Impl::~CNode_Impl" ); @@ -217,7 +175,7 @@ CNode_Impl::~CNode_Impl() { void CNode_Impl::destroy() { beginService( "CNode_Impl::Destroy" ); - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { if ( Delete() ) { _DataFlowNode = NULL ; _poa->deactivate_object(*_id) ; @@ -232,11 +190,11 @@ void CNode_Impl::destroy() { bool CNode_Impl::Delete() { beginService( "CNode_Impl::Delete" ); bool RetVal = false ; - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { DeletePorts() ; - RetVal = _DataFlowEditor->RemoveNode( Name() ) ; + RetVal = DataFlowEditor()->RemoveNode( Name() ) ; if ( RetVal ) { - RetVal = _DataFlowEditor->UnValid() ; + RetVal = DataFlowEditor()->UnValid() ; } } endService( "CNode_Impl::Delete" ); @@ -245,16 +203,16 @@ bool CNode_Impl::Delete() { void CNode_Impl::DeletePorts() { beginService( "CNode_Impl::DeletePorts" ); - if ( _DataFlowEditor->IsEditing() && _DataFlowNode ) { + if ( DataFlowEditor()->IsEditing() && DataFlowNode() ) { int i ; - for ( i = 0 ; i < _DataFlowNode->ComputingNode()->GetNodeInPortsSize() ; i++ ) { - SUPERV::Port_var aPort = _DataFlowNode->ComputingNode()->GetChangeNodeInPort( i )->ObjRef() ; + for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeInPortsSize() ; i++ ) { + SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeInPort( i )->ObjRef() ; if ( !CORBA::is_nil( aPort ) ) { aPort->Remove() ; } } - for ( i = 0 ; i < _DataFlowNode->ComputingNode()->GetNodeOutPortsSize() ; i++ ) { - SUPERV::Port_var aPort = _DataFlowNode->ComputingNode()->GetChangeNodeOutPort( i )->ObjRef() ; + for ( i = 0 ; i < DataFlowNode()->ComputingNode()->GetNodeOutPortsSize() ; i++ ) { + SUPERV::Port_var aPort = DataFlowNode()->ComputingNode()->GetChangeNodeOutPort( i )->ObjRef() ; if ( !CORBA::is_nil( aPort ) ) { aPort->Remove() ; } @@ -267,10 +225,10 @@ SALOME_ModuleCatalog::Service * CNode_Impl::Service() { // beginService( "CNode_Impl::Service" ); SALOME_ModuleCatalog::Service * RetVal ; if ( _IsNode ) { - RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowNode->GetService() ) ; + RetVal = new SALOME_ModuleCatalog::Service( *DataFlowNode()->GetService() ) ; } else { - RetVal = new SALOME_ModuleCatalog::Service( *_DataFlowEditor->GetService() ) ; + RetVal = new SALOME_ModuleCatalog::Service( *DataFlowEditor()->GetService() ) ; } // endService( "CNode_Impl::Service" ); return RetVal ; @@ -280,10 +238,10 @@ char * CNode_Impl::Name() { // beginService( "CNode_Impl::Name" ); char * RetVal = NULL ; if ( _IsNode ) { - RetVal = _DataFlowNode->Name() ; + RetVal = DataFlowNode()->Name() ; } else { - RetVal = _DataFlowEditor->Graph()->Name() ; + RetVal = DataFlowEditor()->Graph()->Name() ; } // endService( "CNode_Impl::Name" ); return CORBA::string_dup( RetVal ); @@ -291,14 +249,14 @@ char * CNode_Impl::Name() { bool CNode_Impl::SetName( const char * aDataFlowName ) { // beginService( "CNode_Impl::SetName" ); bool RetVal = false ; - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { if ( _IsNode ) { - RetVal = _DataFlowEditor->ReNameNode( _DataFlowNode->Name() , + RetVal = DataFlowEditor()->ReNameNode( DataFlowNode()->Name() , aDataFlowName ) ; } else { -// RetVal = _DataFlowEditor->Graph()->Name( aDataFlowName ) ; - RetVal = _DataFlowEditor->Name( aDataFlowName ) ; +// RetVal = DataFlowEditor()->Graph()->Name( aDataFlowName ) ; + RetVal = DataFlowEditor()->Name( aDataFlowName ) ; } } // endService( "CNode_Impl::SetName" ); @@ -308,10 +266,10 @@ SUPERV::KindOfNode CNode_Impl::Kind() { // beginService( "CNode_Impl::Kind" ); SUPERV::KindOfNode RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->Kind() ; + RetVal = DataFlowNode()->Kind() ; } else { - RetVal = _DataFlowEditor->Graph()->Kind() ; + RetVal = DataFlowEditor()->Graph()->Kind() ; } // endService( "CNode_Impl::Kind" ); return RetVal ; @@ -320,10 +278,10 @@ bool CNode_Impl::IsGraph() { // beginService( "CNode_Impl::IsGraph" ); bool RetVal = false ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsDataFlowNode() ; + RetVal = DataFlowNode()->IsDataFlowNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsDataFlowNode() ; + RetVal = DataFlowEditor()->Graph()->IsDataFlowNode() ; } // endService( "CNode_Impl::IsGraph" ); return RetVal ; @@ -332,10 +290,10 @@ bool CNode_Impl::IsStreamGraph() { // beginService( "CNode_Impl::IsStreamGraph" ); bool RetVal = false ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsDataStreamNode() ; + RetVal = DataFlowNode()->IsDataStreamNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsDataStreamNode() ; + RetVal = DataFlowEditor()->Graph()->IsDataStreamNode() ; } // endService( "CNode_Impl::IsStreamGraph" ); return RetVal ; @@ -343,7 +301,7 @@ bool CNode_Impl::IsStreamGraph() { bool CNode_Impl::IsMacro() { // beginService( "CNode_Impl::IsMacro" ); bool RetVal = false ; - if ( _IsNode && _DataFlowNode->IsMacroNode() ) { + if ( _IsNode && DataFlowNode()->IsMacroNode() ) { RetVal = true ; } // endService( "CNode_Impl::IsMacro" ); @@ -352,7 +310,7 @@ bool CNode_Impl::IsMacro() { bool CNode_Impl::IsFlowMacro() { // beginService( "CNode_Impl::IsFlowMacro" ); bool RetVal = false ; - if ( _IsNode && _DataFlowNode->IsMacroNode() && _DataFlowNode->ComputingNode()->MacroObject()->IsGraph() ) { + if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsGraph() ) { RetVal = true ; } // endService( "CNode_Impl::IsFlowMacro" ); @@ -361,7 +319,7 @@ bool CNode_Impl::IsFlowMacro() { bool CNode_Impl::IsStreamMacro() { // beginService( "CNode_Impl::IsStreamMacro" ); bool RetVal = false ; - if ( _IsNode && _DataFlowNode->IsMacroNode() && _DataFlowNode->ComputingNode()->MacroObject()->IsStreamGraph() ) { + if ( _IsNode && DataFlowNode()->IsMacroNode() && DataFlowNode()->ComputingNode()->MacroObject()->IsStreamGraph() ) { RetVal = true ; } // endService( "CNode_Impl::IsStreamMacro" ); @@ -385,10 +343,10 @@ bool CNode_Impl::IsComputing() { // beginService( "CNode_Impl::IsComputing" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsComputingNode() ; + RetVal = DataFlowNode()->IsComputingNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsComputingNode() ; + RetVal = DataFlowEditor()->Graph()->IsComputingNode() ; } // endService( "CNode_Impl::IsComputing" ); return RetVal ; @@ -397,10 +355,10 @@ bool CNode_Impl::IsFactory() { // beginService( "CNode_Impl::IsFactory" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsFactoryNode() ; + RetVal = DataFlowNode()->IsFactoryNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsFactoryNode() ; + RetVal = DataFlowEditor()->Graph()->IsFactoryNode() ; } // endService( "CNode_Impl::IsFactory" ); return RetVal ; @@ -409,10 +367,10 @@ bool CNode_Impl::IsInLine() { // beginService( "CNode_Impl::IsInLine" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsInLineNode() ; + RetVal = DataFlowNode()->IsInLineNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsInLineNode() ; + RetVal = DataFlowEditor()->Graph()->IsInLineNode() ; } // endService( "CNode_Impl::IsInLine" ); return RetVal ; @@ -421,10 +379,10 @@ bool CNode_Impl::IsGOTO() { // beginService( "CNode_Impl::IsGOTO" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsGOTONode() ; + RetVal = DataFlowNode()->IsGOTONode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsGOTONode() ; + RetVal = DataFlowEditor()->Graph()->IsGOTONode() ; } // endService( "CNode_Impl::IsGOTO" ); return RetVal ; @@ -433,10 +391,10 @@ bool CNode_Impl::IsLoop() { // beginService( "CNode_Impl::IsLoop" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsLoopNode() ; + RetVal = DataFlowNode()->IsLoopNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsLoopNode() ; + RetVal = DataFlowEditor()->Graph()->IsLoopNode() ; } // endService( "CNode_Impl::IsLoop" ); return RetVal ; @@ -445,10 +403,10 @@ bool CNode_Impl::IsEndLoop() { // beginService( "CNode_Impl::IsEndLoop" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsEndLoopNode() ; + RetVal = DataFlowNode()->IsEndLoopNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsEndLoopNode() ; + RetVal = DataFlowEditor()->Graph()->IsEndLoopNode() ; } // endService( "CNode_Impl::IsEndLoop" ); return RetVal ; @@ -457,10 +415,10 @@ bool CNode_Impl::IsSwitch() { // beginService( "CNode_Impl::IsSwitch" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsSwitchNode() ; + RetVal = DataFlowNode()->IsSwitchNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsSwitchNode() ; + RetVal = DataFlowEditor()->Graph()->IsSwitchNode() ; } // endService( "CNode_Impl::IsSwitch" ); return RetVal ; @@ -469,10 +427,10 @@ bool CNode_Impl::IsEndSwitch() { // beginService( "CNode_Impl::IsEndSwitch" ); bool RetVal = SUPERV::UnknownNode ; if ( _IsNode ) { - RetVal = _DataFlowNode->IsEndSwitchNode() ; + RetVal = DataFlowNode()->IsEndSwitchNode() ; } else { - RetVal = _DataFlowEditor->Graph()->IsEndSwitchNode() ; + RetVal = DataFlowEditor()->Graph()->IsEndSwitchNode() ; } // endService( "CNode_Impl::IsEndSwitch" ); return RetVal ; @@ -482,12 +440,12 @@ SUPERV::SDate CNode_Impl::CreationDate() { // beginService( "CNode_Impl::CreationDate" ); SUPERV::SDate_var RetVal ; if ( _IsNode ) { - RetVal = new SUPERV::SDate( _DataFlowNode->FirstCreation() ) ; + RetVal = new SUPERV::SDate( DataFlowNode()->FirstCreation() ) ; } else { -// cout << " CNode_Impl::CreationDate " << _DataFlowEditor->FirstCreation() +// cout << " CNode_Impl::CreationDate " << DataFlowEditor()->FirstCreation() // << endl ; - RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->FirstCreation() ) ; + RetVal = new SUPERV::SDate( DataFlowEditor()->Graph()->FirstCreation() ) ; } // endService( "CNode_Impl::CreationDate" ); return (RetVal._retn()) ; @@ -496,10 +454,10 @@ SUPERV::SDate CNode_Impl::LastUpdateDate() { // beginService( "CNode_Impl::LastUpdateDate" ); SUPERV::SDate_var RetVal ; if ( _IsNode ) { - RetVal = new SUPERV::SDate( _DataFlowNode->LastModification() ) ; + RetVal = new SUPERV::SDate( DataFlowNode()->LastModification() ) ; } else { - RetVal = new SUPERV::SDate( _DataFlowEditor->Graph()->LastModification() ) ; + RetVal = new SUPERV::SDate( DataFlowEditor()->Graph()->LastModification() ) ; } // endService( "CNode_Impl::LastUpdateDate" ); return (RetVal._retn()) ; @@ -508,10 +466,10 @@ char * CNode_Impl::Version() { // beginService( "CNode_Impl::Version" ); char * RetVal ; if ( _IsNode ) { - RetVal = _DataFlowNode->EditorRelease() ; + RetVal = DataFlowNode()->EditorRelease() ; } else { - RetVal = _DataFlowEditor->Graph()->EditorRelease() ; + RetVal = DataFlowEditor()->Graph()->EditorRelease() ; } // endService( "CNode_Impl::Version" ); return CORBA::string_dup( RetVal ) ; @@ -520,10 +478,10 @@ char * CNode_Impl::Author() { // beginService( "CNode_Impl::Author" ); char * RetVal ; if ( _IsNode ) { - RetVal = _DataFlowNode->Author() ; + RetVal = DataFlowNode()->Author() ; } else { - RetVal = _DataFlowEditor->Graph()->Author() ; + RetVal = DataFlowEditor()->Graph()->Author() ; } // endService( "CNode_Impl::Author" ); return CORBA::string_dup( RetVal ) ; @@ -531,12 +489,12 @@ char * CNode_Impl::Author() { bool CNode_Impl::SetAuthor( const char * aDataFlowAuthor ) { // beginService( "CNode_Impl::SetAuthor" ); bool RetVal = false ; - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { if ( _IsNode ) { - RetVal = _DataFlowNode->Author( aDataFlowAuthor ) ; + RetVal = DataFlowNode()->Author( aDataFlowAuthor ) ; } else { - RetVal = _DataFlowEditor->Graph()->Author( aDataFlowAuthor ) ; + RetVal = DataFlowEditor()->Graph()->Author( aDataFlowAuthor ) ; } } // endService( "CNode_Impl::SetAuthor" ); @@ -546,10 +504,10 @@ char * CNode_Impl::Comment() { // beginService( "CNode_Impl::Comment" ); char * RetVal ; if ( _IsNode ) { - RetVal = _DataFlowNode->Comment() ; + RetVal = DataFlowNode()->Comment() ; } else { - RetVal = _DataFlowEditor->Graph()->Comment() ; + RetVal = DataFlowEditor()->Graph()->Comment() ; } // endService( "CNode_Impl::Comment" ); return CORBA::string_dup( RetVal ) ; @@ -557,12 +515,12 @@ char * CNode_Impl::Comment() { bool CNode_Impl::SetComment( const char * aDataFlowComment ) { // beginService( "CNode_Impl::SetComment" ); bool RetVal = false ; - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { if ( _IsNode ) { - RetVal = _DataFlowNode->Comment( aDataFlowComment ) ; + RetVal = DataFlowNode()->Comment( aDataFlowComment ) ; } else { - RetVal = _DataFlowEditor->Graph()->Comment( aDataFlowComment ) ; + RetVal = DataFlowEditor()->Graph()->Comment( aDataFlowComment ) ; } } // endService( "CNode_Impl::SetComment" ); @@ -571,12 +529,12 @@ bool CNode_Impl::SetComment( const char * aDataFlowComment ) { void CNode_Impl::Coords(long X , long Y ) { // beginService( "CNode_Impl::Coords" ); - if ( _DataFlowEditor->IsEditing() ) { + if ( DataFlowEditor()->IsEditing() ) { if ( _IsNode ) { - ((GraphEditor::InNode *) _DataFlowNode)->Coordinates( X , Y ) ; + ((GraphEditor::InNode *) DataFlowNode())->Coordinates( X , Y ) ; } else { - _DataFlowEditor->Graph()->Coordinates( X , Y ) ; + DataFlowEditor()->Graph()->Coordinates( X , Y ) ; } } // endService( "CNode_Impl::Coords" ); @@ -585,10 +543,10 @@ long CNode_Impl::X() { // beginService( "CNode_Impl::X" ); long RetVal ; if ( _IsNode ) { - RetVal = _DataFlowNode->XCoordinate() ; + RetVal = DataFlowNode()->XCoordinate() ; } else { - RetVal = _DataFlowEditor->Graph()->XCoordinate() ; + RetVal = DataFlowEditor()->Graph()->XCoordinate() ; } // endService( "CNode_Impl::X" ); return RetVal ; @@ -597,10 +555,10 @@ long CNode_Impl::Y() { // beginService( "CNode_Impl::Y" ); long RetVal ; if ( _IsNode ) { - RetVal = _DataFlowNode->YCoordinate() ; + RetVal = DataFlowNode()->YCoordinate() ; } else { - RetVal = _DataFlowEditor->Graph()->YCoordinate() ; + RetVal = DataFlowEditor()->Graph()->YCoordinate() ; } // endService( "CNode_Impl::Y" ); return RetVal ; @@ -612,25 +570,25 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { SUPERV::Port_var iobject = SUPERV::Port::_nil() ; bool aninport ; if ( _IsNode ) { - aninport = _DataFlowNode->GetInPort( ServiceParameterName ) ; + aninport = DataFlowNode()->GetInPort( ServiceParameterName ) ; } else { - aninport = _DataFlowEditor->GetInPort( ServiceParameterName ) ; + aninport = DataFlowEditor()->GetInPort( ServiceParameterName ) ; } bool anoutport ; if ( _IsNode ) { - anoutport = _DataFlowNode->GetOutPort( ServiceParameterName ) ; + anoutport = DataFlowNode()->GetOutPort( ServiceParameterName ) ; } else { - anoutport = _DataFlowEditor->GetOutPort( ServiceParameterName ) ; + anoutport = DataFlowEditor()->GetOutPort( ServiceParameterName ) ; } if ( aninport ) { GraphBase::InPort * anInPort ; if ( _IsNode ) { - anInPort = _DataFlowNode->GetChangeInPort( ServiceParameterName ) ; + anInPort = DataFlowNode()->GetChangeInPort( ServiceParameterName ) ; } else { - anInPort = _DataFlowEditor->GetChangeInPort( ServiceParameterName ) ; + anInPort = DataFlowEditor()->GetChangeInPort( ServiceParameterName ) ; } if ( anInPort->IsDataStream() ) { MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ; @@ -642,17 +600,17 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { } bool hasinput ; if ( _IsNode ) { - hasinput = _DataFlowNode->HasInput( anInPort->PortName() ) ; + hasinput = DataFlowNode()->HasInput( anInPort->PortName() ) ; } else { - hasinput = _DataFlowEditor->HasInput( anInPort->PortName() ) ; + hasinput = DataFlowEditor()->HasInput( anInPort->PortName() ) ; } if ( hasinput ) { const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , // ServiceParameterName , (GraphBase::Port * ) anInPort , true , @@ -661,8 +619,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { else { myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , // ServiceParameterName ) ; (GraphBase::Port * ) anInPort , true ) ; @@ -679,10 +637,10 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { else if ( anoutport ) { GraphBase::OutPort * anOutPort ; if ( _IsNode ) { - anOutPort = _DataFlowNode->GetChangeOutPort( ServiceParameterName ) ; + anOutPort = DataFlowNode()->GetChangeOutPort( ServiceParameterName ) ; } else { - anOutPort = _DataFlowEditor->GetChangeOutPort( ServiceParameterName ) ; + anOutPort = DataFlowEditor()->GetChangeOutPort( ServiceParameterName ) ; } if ( anOutPort->IsDataStream() ) { MESSAGE( "CNode_Impl::Port ERROR IsDataStream " ) ; @@ -695,8 +653,8 @@ SUPERV::Port_ptr CNode_Impl::Port( const char * ServiceParameterName ) { const CORBA::Any * anAny = anOutPort->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , // ServiceParameterName , (GraphBase::Port * ) anOutPort , false , @@ -721,21 +679,21 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName , const SUPERV::Value_ptr aValue ) { bool begin = true ; SUPERV::Port_var iobject = SUPERV::Port::_nil() ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; bool sts = false ; GraphBase::InPort * anInPort = NULL ; - if ( _DataFlowEditor->IsEditing() && _DataFlowEditor->Graph()->GraphMacroLevel() == 0 ) { +if ( DataFlowEditor()->IsEditing() /*&& DataFlowEditor()->Graph()->GraphMacroLevel() == 0*/ ) { if ( _IsNode ) { - sts = _DataFlowEditor->AddInputData( _DataFlowNode->Name() , + sts = DataFlowEditor()->AddInputData( DataFlowNode()->Name() , ToServiceParameterName , *aValue->ToAny() ) ; - anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ; + anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ; } else { - sts = _DataFlowEditor->AddInputData( _DataFlowEditor->Graph()->Name() , + sts = DataFlowEditor()->AddInputData( DataFlowEditor()->Graph()->Name() , ToServiceParameterName , *aValue->ToAny() ) ; - anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ; + anInPort = DataFlowEditor()->Graph()->GetChangeInPort( ToServiceParameterName ) ; } if ( sts && anInPort ) { if ( CORBA::is_nil( anInPort->ObjRef() ) ) { @@ -746,8 +704,8 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName , Port_Impl * myPort ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , // ToServiceParameterName , (GraphBase::Port * ) anInPort , true , @@ -761,19 +719,20 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName , iobject = anInPort->ObjRef() ; } } + DataFlowEditor()->UnValid() ; } - else if ( _DataFlowExecutor ) { + else if ( aDataFlowExecutor ) { if ( _IsNode ) { - sts = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() , + sts = aDataFlowExecutor->ChangeInputData( DataFlowNode()->Name() , ToServiceParameterName , *aValue->ToAny() ) ; - anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ; + anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ; } else { - sts = _DataFlowExecutor->ChangeInputData( _DataFlowEditor->Graph()->Name() , + sts = aDataFlowExecutor->ChangeInputData( DataFlowEditor()->Graph()->Name() , ToServiceParameterName , *aValue->ToAny() ) ; - anInPort = _DataFlowEditor->Graph()->GetChangeInPort( ToServiceParameterName ) ; + anInPort = DataFlowEditor()->Graph()->GetChangeInPort( ToServiceParameterName ) ; } if ( sts && anInPort ) { if ( CORBA::is_nil( anInPort->ObjRef() ) ) { @@ -784,8 +743,8 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName , Port_Impl * myPort ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , // ToServiceParameterName , (GraphBase::Port * ) anInPort , true , @@ -804,55 +763,13 @@ SUPERV::Port_ptr CNode_Impl::Input( const char * ToServiceParameterName , endService( "CNode_Impl::Input" ); } if ( CORBA::is_nil( iobject ) ) { - MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts << " anInPort " - << anInPort ) ; + MESSAGE( "CNode_Impl::Input returns nil object _IsNode " << _IsNode << " sts " << sts + << " Node " << Name() << " ToServiceParameterName " << ToServiceParameterName + << " anInPort " << anInPort ) ; } - DataFlowEditor()->UnValid() ; return SUPERV::Port::_duplicate( iobject ) ; } -#if 0 -bool CNode_Impl::InputOfAny( const char * ToServiceParameterName , - const CORBA::Any & aValue ) { - beginService( "CNode_Impl::InputOfAny" ); - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - bool RetVal = false ; - MESSAGE( pthread_self() << "CNode_Impl::InputOfAny " << Name() << "(" << ToServiceParameterName << ")" ) ; - if ( !_DataFlowEditor->IsEditing() && _DataFlowExecutor && _DataFlowEditor->Graph()->GraphMacroLevel() ) { - if ( !_IsNode ) { - GraphBase::OutPort * anOutPort ; - anOutPort = _DataFlowExecutor->Graph()->GetChangeInDataNodePort( ToServiceParameterName ) ; - MESSAGE( pthread_self() << "CNode_Impl::InputOfAny " << _DataFlowExecutor->Graph()->Name() << " " << ToServiceParameterName - << " " << anOutPort->State() << " Done " << anOutPort->Done() ) ; - RetVal = _DataFlowExecutor->AddInputData( _DataFlowExecutor->Graph()->Name() , - ToServiceParameterName , - aValue ) ; - anOutPort->State( SUPERV::ReadyState ) ; - anOutPort->Done( true ) ; - GraphExecutor::InNode * anInNode = (GraphExecutor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( anOutPort->InPorts( 0 )->NodeName() )->GetInNode() ; - MESSAGE( pthread_self() << "CNode_Impl::InputOfAny : " << anInNode->Name() << "->SendSomeDataReady( " - << _DataFlowExecutor->Graph()->Name() << " ) " ) ; - anInNode->SendSomeDataReady( _DataFlowExecutor->Graph()->Name() ) ; - if ( anInNode->IsReady() ) { - MESSAGE( pthread_self() << "CNode_Impl::InputOfAny : " << anInNode->Name() - << "->SendEvent( GraphExecutor::ExecuteEvent ) " - << " " << anInNode->Name() << "->IsReady() " << anInNode->IsReady() << " State " - << anInNode->State() ) ; - if ( anInNode->IsLockedDataWait() ) { - MESSAGE( pthread_self() << "CNode_Impl::InputOfAny : " << anInNode->Name() - << " IsLockedDataWait() ==> UnLockDataWait" ) ; - anInNode->UnLockDataWait() ; - } - anInNode->CreateNewThread( true ) ; - anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ; - _DataFlowExecutor->State( GraphExecutor::ExecutingState ) ; - } - } - } - endService( "CNode_Impl::InputOfAny" ); - return RetVal ; -} -#endif SUPERV::Port_ptr CNode_Impl::GetInPort( const char *aParameterName ) { SUPERV::Port_ptr Inobject = SUPERV::Port::_nil() ; @@ -970,12 +887,12 @@ SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) { SUPERV::Link_var iobject = SUPERV::Link::_nil() ; char* FromNodeName ; char* FromServiceParameterName ; - bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() , + bool status = DataFlowEditor()->GetLink( DataFlowNode()->Name() , ToServiceParameterName , & FromNodeName , & FromServiceParameterName ) ; if ( status ) { - GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ; + GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ; if ( !anInPort->IsDataStream() && anInPort->GetOutPort() ) { GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ; if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) { @@ -986,10 +903,10 @@ SUPERV::Link_ptr CNode_Impl::GetLink(const char * ToServiceParameterName ) { bool Success ; Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , ToServiceParameterName , - (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() , + (GraphEditor::InNode *) DataFlowEditor()->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() , FromServiceParameterName , true , false , Success ) ; if ( Success ) { @@ -1016,12 +933,12 @@ SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameter char* FromNodeName ; char* FromServiceParameterName ; if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) { - bool status = _DataFlowEditor->GetLink( _DataFlowNode->Name() , + bool status = DataFlowEditor()->GetLink( DataFlowNode()->Name() , ToServiceParameterName , & FromNodeName , & FromServiceParameterName ) ; if ( status ) { - GraphBase::InPort * anInPort = _DataFlowNode->GetChangeInPort( ToServiceParameterName ) ; + GraphBase::InPort * anInPort = DataFlowNode()->GetChangeInPort( ToServiceParameterName ) ; if ( anInPort->IsDataStream() && anInPort->GetOutPort() ) { GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ; if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) { @@ -1033,10 +950,10 @@ SUPERV::StreamLink_ptr CNode_Impl::GetStreamLink(const char * ToServiceParameter StreamLink_Impl * myStreamLink = new StreamLink_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , ToServiceParameterName , - (GraphEditor::InNode *) _DataFlowEditor->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() , + (GraphEditor::InNode *) DataFlowEditor()->Graph()->GetChangeGraphNode( FromNodeName )->GetInNode() , FromServiceParameterName , true , Success ) ; if ( Success ) { @@ -1064,28 +981,28 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { int PortCount = 0 ; SUPERV::ListOfPorts_var RetVal = new SUPERV::ListOfPorts ; if ( _IsNode ) { - for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) { - GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ; + for ( i = 0 ; i < DataFlowNode()->GetNodeInPortsSize() ; i++ ) { + GraphBase::InPort * anInPort = DataFlowNode()->GetChangeNodeInPort( i ) ; if ( !anInPort->IsDataStream() ) { if ( begin ) { beginService( "CNode_Impl::Ports" ); begin = false ; } if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() && - ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) { + ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) { // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ; } else if ( CORBA::is_nil( anInPort->ObjRef() ) ) { // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting " -// << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate() +// << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate() // << "/" << anInPort->IsNotConnected() ) ; Port_Impl * myPort ; - if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) { + if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) { const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , true , anAny ) ; @@ -1093,8 +1010,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { else { myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , true ) ; } @@ -1118,15 +1035,15 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { // MESSAGE( "InPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsDataStream" ) ; } } - for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) { - GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ; + for ( i = 0 ; i < DataFlowNode()->GetNodeOutPortsSize() ; i++ ) { + GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeNodeOutPort( i ) ; if ( !anOutPort->IsDataStream() ) { if ( begin ) { beginService( "CNode_Impl::Ports" ); begin = false ; } if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() && - ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) { + ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) { // MESSAGE( "OutPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ; } else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { @@ -1134,8 +1051,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { const CORBA::Any * anAny = anOutPort->Value() ; Port_Impl * myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , false , anAny ) ; @@ -1161,11 +1078,12 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { } } else { - if ( _DataFlowEditor->IsValid() ) { - RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() + - _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ; - for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) { - GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ; + if ( DataFlowEditor()->IsValid() ) { + //DataFlowEditor()->Graph()->Values() ; + RetVal->length( DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() + + DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ) ; + for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; i++ ) { + GraphBase::OutPort * anOutPort = DataFlowEditor()->Graph()->GetChangeNodeInDataNodePort(i) ; if ( !anOutPort->IsDataStream() ) { if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { if ( begin ) { @@ -1177,8 +1095,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { const CORBA::Any * anAny = anOutPort->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , true , anAny ) ; @@ -1186,8 +1104,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { else { myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , true ) ; } @@ -1209,9 +1127,9 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { else { } } - j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; - for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) { - GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ; + j = DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; + for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) { + GraphBase::InPort * anInPort = DataFlowEditor()->Graph()->GetChangeNodeOutDataNodePort(i) ; if ( !anInPort->IsDataStream() ) { if ( CORBA::is_nil( anInPort->ObjRef() ) ) { if ( begin ) { @@ -1223,8 +1141,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , false , anAny ) ; @@ -1232,8 +1150,8 @@ SUPERV::ListOfPorts * CNode_Impl::Ports() { else { myPort = new Port_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , anInPort , false ) ; } @@ -1278,31 +1196,31 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { // MESSAGE("CNode_Impl::StreamPorts NOT a DataStreamNode" ) ; } else if ( _IsNode ) { -// RetVal->length( _DataFlowNode->GetNodeInPortsSize() + -// _DataFlowNode->GetNodeOutPortsSize() ) ; - for ( i = 0 ; i < _DataFlowNode->GetNodeInPortsSize() ; i++ ) { - GraphBase::InPort * anInPort = _DataFlowNode->GetChangeNodeInPort( i ) ; +// RetVal->length( DataFlowNode()->GetNodeInPortsSize() + +// DataFlowNode()->GetNodeOutPortsSize() ) ; + for ( i = 0 ; i < DataFlowNode()->GetNodeInPortsSize() ; i++ ) { + GraphBase::InPort * anInPort = DataFlowNode()->GetChangeNodeInPort( i ) ; if ( anInPort->IsDataStream() ) { if ( begin ) { beginService( "CNode_Impl::StreamPorts" ); begin = false ; } if ( anInPort->IsLoop() || ( anInPort->IsGate() && anInPort->IsNotConnected() && - ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) { + ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) { MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " ignored" ) ; // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ; } else if ( CORBA::is_nil( anInPort->ObjRef() ) ) { MESSAGE( "InStreamPort " << i << " " << anInPort->PortName() << " of Node " << Name() << " IsExecuting " - << _DataFlowEditor->IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate() + << IsExecuting() << " IsGate/IsConnected " << anInPort->IsGate() << "/" << anInPort->IsNotConnected() ) ; StreamPort_Impl * myStreamPort ; - if ( _DataFlowNode->HasInput( anInPort->PortName() ) ) { + if ( DataFlowNode()->HasInput( anInPort->PortName() ) ) { const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , true , anAny ) ; @@ -1310,8 +1228,8 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , true ) ; } @@ -1335,25 +1253,25 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ; } } - for ( i = 0 ; i < _DataFlowNode->GetNodeOutPortsSize() ; i++ ) { - GraphBase::OutPort * anOutPort = _DataFlowNode->GetChangeNodeOutPort( i ) ; + for ( i = 0 ; i < DataFlowNode()->GetNodeOutPortsSize() ; i++ ) { + GraphBase::OutPort * anOutPort = DataFlowNode()->GetChangeNodeOutPort( i ) ; if ( anOutPort->IsDataStream() ) { if ( begin ) { beginService( "CNode_Impl::StreamPorts" ); begin = false ; } if ( anOutPort->IsLoop() || ( anOutPort->IsGate() && anOutPort->IsNotConnected() && - ( _DataFlowEditor->IsExecuting() || _DataFlowEditor->IsReadOnly() ) ) ) { + ( IsExecuting() || DataFlowEditor()->IsReadOnly() ) ) ) { MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() << " ignored" ) ; -// RetVal[ _DataFlowNode->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ; +// RetVal[ DataFlowNode()->GetNodeInPortsSize() + i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ; } else if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { MESSAGE( "OutStreamPort " << i << " " << anOutPort->PortName() << " of Node " << Name() ) ; const CORBA::Any * anAny = anOutPort->Value() ; StreamPort_Impl * myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , false , anAny ) ; @@ -1379,11 +1297,11 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { } } else { - if ( _DataFlowEditor->IsValid() ) { -// RetVal->length( _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() + -// _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ) ; - for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; i++ ) { - GraphBase::OutPort * anOutPort = _DataFlowEditor->Graph()->GetChangeNodeInDataNodePort(i) ; + if ( DataFlowEditor()->IsValid() ) { +// RetVal->length( DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() + +// DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ) ; + for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; i++ ) { + GraphBase::OutPort * anOutPort = DataFlowEditor()->Graph()->GetChangeNodeInDataNodePort(i) ; if ( anOutPort->IsDataStream() ) { if ( CORBA::is_nil( anOutPort->ObjRef() ) ) { if ( begin ) { @@ -1395,8 +1313,8 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { const CORBA::Any * anAny = anOutPort->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , true , anAny ) ; @@ -1404,8 +1322,8 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anOutPort , true ) ; } @@ -1428,9 +1346,9 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { // RetVal[ i ] = SUPERV::StreamPort::_duplicate( SUPERV::StreamPort::_narrow( CORBA::Object::_nil() ) ) ; } } - j = _DataFlowEditor->Graph()->GetNodeInDataNodePortsSize() ; - for ( i = 0 ; i < _DataFlowEditor->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) { - GraphBase::InPort * anInPort = _DataFlowEditor->Graph()->GetChangeNodeOutDataNodePort(i) ; + j = DataFlowEditor()->Graph()->GetNodeInDataNodePortsSize() ; + for ( i = 0 ; i < DataFlowEditor()->Graph()->GetNodeOutDataNodePortsSize() ; i++ ) { + GraphBase::InPort * anInPort = DataFlowEditor()->Graph()->GetChangeNodeOutDataNodePort(i) ; if ( anInPort->IsDataStream() ) { if ( CORBA::is_nil( anInPort->ObjRef() ) ) { if ( begin ) { @@ -1442,8 +1360,8 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { const CORBA::Any * anAny = anInPort->GetOutPort()->Value() ; myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , (GraphBase::Port * ) anInPort , false , anAny ) ; @@ -1451,8 +1369,8 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { else { myStreamPort = new StreamPort_Impl( _Orb , _Poa , _ContId , instanceName() , interfaceName() , - _DataFlowEditor , - _DataFlowNode , + DataFlowEditor() , + DataFlowNode() , anInPort , false ) ; } @@ -1490,12 +1408,12 @@ SUPERV::ListOfStreamPorts * CNode_Impl::StreamPorts() { SUPERV::ListOfLinks * CNode_Impl::Links() { beginService( "CNode_Impl::Links" ) ; SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ; - if ( _DataFlowNode ) { -// MESSAGE( "CNode_Impl::Links " << DataFlowEditor() << " " << DataFlowEditor()->Graph() << " " << DataFlowEditor()->Graph()->ObjImpl() << " " << _DataFlowNode->ComputingNode() << " " << _DataFlowNode->ComputingNode()->Name() ) ; - RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , NULL ) ; + if ( DataFlowNode() ) { +// MESSAGE( "CNode_Impl::Links " << DataFlowEditor() << " " << DataFlowEditor()->Graph() << " " << DataFlowEditor()->Graph()->ObjImpl() << " " << DataFlowNode()->ComputingNode() << " " << DataFlowNode()->ComputingNode()->Name() ) ; + RetVal = ((Graph_Impl * ) DataFlowEditor()->Graph()->ObjImpl())->Links( DataFlowNode()->ComputingNode() , NULL ) ; } else { - RetVal = DataFlowEditor()->Graph()->ObjImpl()->Links( NULL , NULL ) ; + RetVal = ((Graph_Impl * ) DataFlowEditor()->Graph()->ObjImpl())->Links( NULL , NULL ) ; } MESSAGE( "CNode_Impl::Links " << RetVal->length() << " Links" ) ; endService( "CNode_Impl::Links" ) ; @@ -1505,8 +1423,8 @@ SUPERV::ListOfLinks * CNode_Impl::Links() { SUPERV::ListOfStreamLinks * CNode_Impl::StreamLinks() { beginService( "CNode_Impl::StreamLinks" ) ; SUPERV::ListOfStreamLinks_var RetVal = new SUPERV::ListOfStreamLinks ; - if ( _DataFlowNode && DataFlowEditor()->Graph()->IsDataStreamNode() ) { - RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( _DataFlowNode->ComputingNode() , NULL ) ; + if ( DataFlowNode() && DataFlowEditor()->Graph()->IsDataStreamNode() ) { + RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( DataFlowNode()->ComputingNode() , NULL ) ; } else if ( DataFlowEditor()->Graph()->IsDataStreamNode() ) { RetVal = ((StreamGraph_Impl *) (DataFlowEditor()->StreamGraph()->ObjImpl()))->StreamLinks( NULL , NULL ) ; @@ -1520,7 +1438,7 @@ long CNode_Impl::SubGraph() { // beginService( "CNode_Impl::SubGraph" ); long RetVal = 0 ; if ( _IsNode ) { - RetVal = _DataFlowNode->SubGraph() ; + RetVal = DataFlowNode()->SubGraph() ; } // endService( "CNode_Impl::SubGraph" ); return RetVal ; @@ -1530,7 +1448,7 @@ long CNode_Impl::SubStreamGraph() { // beginService( "CNode_Impl::SubStreamGraph" ); long RetVal = 0 ; if ( _IsNode ) { - RetVal = _DataFlowNode->SubStreamGraph() ; + RetVal = DataFlowNode()->SubStreamGraph() ; } // endService( "CNode_Impl::SubStreamGraph" ); return RetVal ; @@ -1538,7 +1456,7 @@ long CNode_Impl::SubStreamGraph() { bool CNode_Impl::IsLinked(const char * ServiceParameterName ) { beginService( "CNode_Impl::IsLinked" ); - bool RetVal = _DataFlowNode->IsLinked( ServiceParameterName ) ; + bool RetVal = DataFlowNode()->IsLinked( ServiceParameterName ) ; MESSAGE( Name() << "->IsLinked( '" << ServiceParameterName << "' )" ) ; endService( "CNode_Impl::IsLinked" ); return RetVal ; @@ -1546,7 +1464,7 @@ bool CNode_Impl::IsLinked(const char * ServiceParameterName ) { bool CNode_Impl::HasInput(const char * ServiceParameterName ) { // beginService( "CNode_Impl::HasInput" ); - bool RetVal = _DataFlowNode->HasInput( ServiceParameterName ) ; + bool RetVal = DataFlowNode()->HasInput( ServiceParameterName ) ; // endService( "CNode_Impl::HasInput" ); return RetVal ; } @@ -1554,14 +1472,14 @@ bool CNode_Impl::HasInput(const char * ServiceParameterName ) { SUPERV::GraphState CNode_Impl::State() { // beginService( "CNode_Impl::State" ); SUPERV::GraphState RetVal = SUPERV::EditingState ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor && !_DataFlowEditor->EditedAfterExecution() ) { - //JR : 12/06/03 if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor && !DataFlowEditor()->EditedAfterExecution() ) { + //JR : 12/06/03 if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->State( Name() ) ; + RetVal = aDataFlowExecutor->State( Name() ) ; } else { - RetVal = _DataFlowExecutor->State() ; + RetVal = aDataFlowExecutor->State() ; } } // endService( "CNode_Impl::State" ); @@ -1570,13 +1488,13 @@ SUPERV::GraphState CNode_Impl::State() { long CNode_Impl::Thread() { // beginService( "CNode_Impl::Thread" ); long RetVal = 0 ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->Thread( Name() ) ; + RetVal = aDataFlowExecutor->Thread( Name() ) ; } else { - RetVal = _DataFlowExecutor->Thread() ; + RetVal = aDataFlowExecutor->Thread() ; } } // endService( "CNode_Impl::Thread" ); @@ -1585,13 +1503,13 @@ long CNode_Impl::Thread() { GraphExecutor::AutomatonState CNode_Impl::AutoState() { // beginService( "CNode_Impl::AutoState" ); GraphExecutor::AutomatonState RetVal = GraphExecutor::UnKnownState ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->AutomatonState( Name() ) ; + RetVal = aDataFlowExecutor->AutomatonState( Name() ) ; } else { - RetVal = _DataFlowExecutor->AutomatonState() ; + RetVal = aDataFlowExecutor->AutomatonState() ; } } // endService( "CNode_Impl::AutoState" ); @@ -1600,13 +1518,13 @@ GraphExecutor::AutomatonState CNode_Impl::AutoState() { SUPERV::ControlState CNode_Impl::Control() { // beginService( "CNode_Impl::Control" ); SUPERV::ControlState RetVal = SUPERV::VoidState ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->ControlState( Name() ) ; + RetVal = aDataFlowExecutor->ControlState( Name() ) ; } else { - RetVal = _DataFlowExecutor->ControlState() ; + RetVal = aDataFlowExecutor->ControlState() ; } } // endService( "CNode_Impl::Control" ); @@ -1615,13 +1533,13 @@ SUPERV::ControlState CNode_Impl::Control() { void CNode_Impl::ControlClear() { // beginService( "CNode_Impl::ControlClear" ); // SUPERV::ControlState RetVal = SUPERV::VoidState ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - _DataFlowExecutor->ControlClear( Name() ) ; + aDataFlowExecutor->ControlClear( Name() ) ; } else { - _DataFlowExecutor->ControlClear() ; + aDataFlowExecutor->ControlClear() ; } } // endService( "CNode_Impl::ControlClear" ); @@ -1631,13 +1549,13 @@ void CNode_Impl::ControlClear() { bool CNode_Impl::IsReady() { // beginService( "CNode_Impl::IsReady" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->IsReady( Name() ) ; + RetVal = aDataFlowExecutor->IsReady( Name() ) ; } else { - RetVal = _DataFlowExecutor->IsReady() ; + RetVal = aDataFlowExecutor->IsReady() ; } } // endService( "CNode_Impl::IsReady" ); @@ -1647,13 +1565,13 @@ bool CNode_Impl::IsReady() { bool CNode_Impl::IsWaiting() { // beginService( "CNode_Impl::IsWaiting" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->IsWaiting( Name() ) ; + RetVal = aDataFlowExecutor->IsWaiting( Name() ) ; } else { - RetVal = _DataFlowExecutor->IsWaiting() ; + RetVal = aDataFlowExecutor->IsWaiting() ; } } // endService( "CNode_Impl::IsWaiting" ); @@ -1663,13 +1581,13 @@ bool CNode_Impl::IsWaiting() { bool CNode_Impl::IsRunning() { // beginService( "CNode_Impl::IsRunning" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->IsRunning( Name() ) ; + RetVal = aDataFlowExecutor->IsRunning( Name() ) ; } else { - RetVal = _DataFlowExecutor->IsRunning() ; + RetVal = aDataFlowExecutor->IsRunning() ; } } // endService( "CNode_Impl::IsRunning" ); @@ -1679,13 +1597,13 @@ bool CNode_Impl::IsRunning() { bool CNode_Impl::IsDone() { // beginService( "CNode_Impl::IsDone" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->IsDone( Name() ) ; + RetVal = aDataFlowExecutor->IsDone( Name() ) ; } else { - RetVal = _DataFlowExecutor->IsDone() ; + RetVal = aDataFlowExecutor->IsDone() ; } } // endService( "CNode_Impl::IsDone" ); @@ -1695,13 +1613,13 @@ bool CNode_Impl::IsDone() { bool CNode_Impl::IsSuspended() { // beginService( "CNode_Impl::IsSuspended" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->IsSuspended( Name() ) ; + RetVal = aDataFlowExecutor->IsSuspended( Name() ) ; } else { - RetVal = _DataFlowExecutor->IsSuspended() ; + RetVal = aDataFlowExecutor->IsSuspended() ; } } // endService( "CNode_Impl::IsSuspended" ); @@ -1711,13 +1629,13 @@ bool CNode_Impl::IsSuspended() { bool CNode_Impl::ReadyW() { // beginService( "CNode_Impl::ReadyW" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->ReadyWait( Name() ) ; + RetVal = aDataFlowExecutor->ReadyWait( Name() ) ; } else { - RetVal = _DataFlowExecutor->ReadyWait() ; + RetVal = aDataFlowExecutor->ReadyWait() ; } } // endService( "CNode_Impl::ReadyW" ); @@ -1727,13 +1645,13 @@ bool CNode_Impl::ReadyW() { bool CNode_Impl::RunningW() { // beginService( "CNode_Impl::RunningW" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->RunningWait( Name() ) ; + RetVal = aDataFlowExecutor->RunningWait( Name() ) ; } else { - RetVal = _DataFlowExecutor->RunningWait() ; + RetVal = aDataFlowExecutor->RunningWait() ; } } // endService( "CNode_Impl::RunningW" ); @@ -1743,13 +1661,13 @@ bool CNode_Impl::RunningW() { bool CNode_Impl::DoneW() { // beginService( "CNode_Impl::DoneW" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->DoneWait( Name() ) ; + RetVal = aDataFlowExecutor->DoneWait( Name() ) ; } else { - RetVal = _DataFlowExecutor->DoneWait() ; + RetVal = aDataFlowExecutor->DoneWait() ; } } // endService( "CNode_Impl::DoneW" ); @@ -1759,13 +1677,13 @@ bool CNode_Impl::DoneW() { bool CNode_Impl::SuspendedW() { // beginService( "CNode_Impl::SuspendedW" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->SuspendedWait( Name() ) ; + RetVal = aDataFlowExecutor->SuspendedWait( Name() ) ; } else { - RetVal = _DataFlowExecutor->SuspendedWait() ; + RetVal = aDataFlowExecutor->SuspendedWait() ; } } // endService( "CNode_Impl::SuspendedW" ); @@ -1775,10 +1693,10 @@ bool CNode_Impl::SuspendedW() { void CNode_Impl::ping() { // beginService( "CNode_Impl::ping" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->Ping( Name() ) ; + RetVal = aDataFlowExecutor->Ping( Name() ) ; } else { RetVal = false ; @@ -1791,13 +1709,13 @@ void CNode_Impl::ping() { bool CNode_Impl::ContainerKill() { beginService( "CNode_Impl::ContainerKill" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor && _DataFlowEditor->IsExecuting() ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor && IsExecuting() ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->ContainerKill( Name() ) ; + RetVal = aDataFlowExecutor->ContainerKill( Name() ) ; } else { - RetVal = _DataFlowExecutor->ContainerKill() ; + RetVal = aDataFlowExecutor->ContainerKill() ; } } endService( "CNode_Impl::ContainerKill" ); @@ -1806,13 +1724,13 @@ bool CNode_Impl::ContainerKill() { bool CNode_Impl::Kill() { beginService( "CNode_Impl::Kill" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->Kill( Name() ) ; + RetVal = aDataFlowExecutor->Kill( Name() ) ; } else { - RetVal = _DataFlowExecutor->Kill() ; + RetVal = aDataFlowExecutor->Kill() ; MESSAGE( "Graph execution was killed " << RetVal ) ; } } @@ -1822,10 +1740,10 @@ bool CNode_Impl::Kill() { bool CNode_Impl::KillDone() { // beginService( "CNode_Impl::KillDone" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->KillDone( Name() ) ; + RetVal = aDataFlowExecutor->KillDone( Name() ) ; } } // endService( "CNode_Impl::KillDone" ); @@ -1833,22 +1751,22 @@ bool CNode_Impl::KillDone() { } bool CNode_Impl::Stop() { // beginService( "CNode_Impl::Stop" ); - bool RetVal ; // = _DataFlowExecutor->Stop() ; + bool RetVal ; // = aDataFlowExecutor->Stop() ; // endService( "CNode_Impl::Stop" ); return RetVal ; } bool CNode_Impl::Suspend() { beginService( "CNode_Impl::Suspend" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { MESSAGE( "CNode_Impl::Suspend " << Name() ) ; - RetVal = _DataFlowExecutor->Suspend( Name() ) ; + RetVal = aDataFlowExecutor->Suspend( Name() ) ; } else { - MESSAGE( "CNode_Impl::Suspend " << _DataFlowExecutor->Graph()->Name() ) ; - RetVal = _DataFlowExecutor->Suspend() ; + MESSAGE( "CNode_Impl::Suspend " << aDataFlowExecutor->Graph()->Name() ) ; + RetVal = aDataFlowExecutor->Suspend() ; } } endService( "CNode_Impl::Suspend" ); @@ -1857,13 +1775,13 @@ bool CNode_Impl::Suspend() { bool CNode_Impl::SuspendDone() { // beginService( "CNode_Impl::SuspendDone" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->SuspendDone( Name() ) ; + RetVal = aDataFlowExecutor->SuspendDone( Name() ) ; } else { - RetVal = _DataFlowExecutor->SuspendDone() ; + RetVal = aDataFlowExecutor->SuspendDone() ; } } // endService( "CNode_Impl::SuspendDone" ); @@ -1872,15 +1790,15 @@ bool CNode_Impl::SuspendDone() { bool CNode_Impl::Resume() { bool RetVal = false ; beginService( "CNode_Impl::Resume" ); - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { MESSAGE( "CNode_Impl::Resume " << Name() ) ; - RetVal = _DataFlowExecutor->Resume( Name() ) ; + RetVal = aDataFlowExecutor->Resume( Name() ) ; } else { - MESSAGE( "CNode_Impl::Resume " << _DataFlowExecutor->Graph()->Name() ) ; - RetVal = _DataFlowExecutor->Resume() ; + MESSAGE( "CNode_Impl::Resume " << aDataFlowExecutor->Graph()->Name() ) ; + RetVal = aDataFlowExecutor->Resume() ; } } endService( "CNode_Impl::Resume" ); @@ -1890,15 +1808,15 @@ bool CNode_Impl::Resume() { bool CNode_Impl::Run() { beginService( "CNode_Impl::Run" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - MESSAGE( "CNode_Impl::Run DataFlowExecutor " << _DataFlowExecutor << Name() << " _IsNode " << _IsNode ) ; - if ( _DataFlowExecutor ) { - _DataFlowEditor->EditedAfterExecution( false ) ; + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + MESSAGE( "CNode_Impl::Run DataFlowExecutor " << aDataFlowExecutor << Name() << " _IsNode " << _IsNode ) ; + if ( aDataFlowExecutor ) { + DataFlowEditor()->EditedAfterExecution( false ) ; if ( _IsNode ) { - RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ; + RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ; } else { - RetVal = _DataFlowExecutor->Run( false ) ; + RetVal = aDataFlowExecutor->Run( false ) ; } } endService( "CNode_Impl::Run" ); @@ -1908,15 +1826,17 @@ bool CNode_Impl::Run() { bool CNode_Impl::ReRun() { beginService( "CNode_Impl::ReRun" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { - _DataFlowEditor->EditedAfterExecution( false ) ; + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { + DataFlowEditor()->EditedAfterExecution( false ) ; if ( _IsNode ) { - RetVal = _DataFlowExecutor->Run( Name() , Name() , false ) ; + RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ; } else if ( DataFlowEditor()->IsEditing() ) { - // RetVal = _DataFlowExecutor->Run( false ) ; - return ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ; + RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ; + } + else { + RetVal = aDataFlowExecutor->Run( false ) ; } } endService( "CNode_Impl::ReRun" ); @@ -1926,11 +1846,11 @@ bool CNode_Impl::ReRun() { bool CNode_Impl::ReRunAt( const char * aNodeName ) { beginService( "CNode_Impl::ReRunAt" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { - _DataFlowEditor->EditedAfterExecution( false ) ; + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { + DataFlowEditor()->EditedAfterExecution( false ) ; if ( _IsNode ) { - RetVal = _DataFlowExecutor->Run( Name() , aNodeName , false ) ; + RetVal = aDataFlowExecutor->Run( Name() , aNodeName , false ) ; } } endService( "CNode_Impl::ReRunAt" ); @@ -1940,13 +1860,13 @@ bool CNode_Impl::ReRunAt( const char * aNodeName ) { bool CNode_Impl::ReStart() { beginService( "CNode_Impl::ReStart" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->Run( Name() , Name() , true ) ; + RetVal = aDataFlowExecutor->Run( Name() , Name() , true ) ; } else { - RetVal = _DataFlowExecutor->Run( true ) ; + RetVal = aDataFlowExecutor->Run( true ) ; } } endService( "CNode_Impl::ReStart" ); @@ -1956,10 +1876,10 @@ bool CNode_Impl::ReStart() { bool CNode_Impl::ReStartAt( const char * aNodeName ) { beginService( "CNode_Impl::ReStartAt" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->Run( Name() , aNodeName , true ) ; + RetVal = aDataFlowExecutor->Run( Name() , aNodeName , true ) ; } } endService( "CNode_Impl::ReStartAt" ); @@ -1968,16 +1888,25 @@ bool CNode_Impl::ReStartAt( const char * aNodeName ) { long CNode_Impl::CpuUsed() { long RetVal = 0 ; - GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; - if ( _DataFlowExecutor ) { + GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ; + if ( aDataFlowExecutor ) { if ( _IsNode ) { - RetVal = _DataFlowExecutor->CpuUsed( Name() ) ; + RetVal = aDataFlowExecutor->CpuUsed( Name() ) ; } else { - RetVal = _DataFlowExecutor->CpuUsed() ; + RetVal = aDataFlowExecutor->CpuUsed() ; } } return RetVal ; } +bool CNode_Impl::IsExecuting() { + bool RetVal = false; + if ( !IsMacro() && DataFlowEditor() && DataFlowEditor()->Executor() ) { + if ( DataFlowEditor()->IsExecuting() && DataFlowEditor()->Executor()->IsDone() ) + DataFlowEditor()->Executing( false ); + RetVal = DataFlowEditor()->IsExecuting(); + } + return RetVal; +} diff --git a/src/Supervision/CNode_Impl.hxx b/src/Supervision/CNode_Impl.hxx index d67d4d2..abe1edb 100644 --- a/src/Supervision/CNode_Impl.hxx +++ b/src/Supervision/CNode_Impl.hxx @@ -32,9 +32,7 @@ class CNode_Impl : public POA_SUPERV::CNode , PortableServer::ObjectId * _ContId ; GraphEditor::DataFlow * _DataFlowEditor ; - GraphExecutor::DataFlow * _DataFlowExecutor ; GraphEditor::InNode * _DataFlowNode ; - GraphExecutor::InNode * _DataFlowExecutorNode ; bool _IsNode ; public: @@ -75,13 +73,6 @@ class CNode_Impl : public POA_SUPERV::CNode , const char *interfaceName , GraphEditor::DataFlow * DataFlowEditor , GraphEditor::InNode * DataFlowNode ) ; - CNode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * DataFlowExecutor , - GraphExecutor::InNode * DataFlowExecutorNode ) ; virtual ~CNode_Impl() ; virtual void destroy() ; virtual bool Delete() ; @@ -92,18 +83,14 @@ class CNode_Impl : public POA_SUPERV::CNode , _DataFlowEditor = DataFlowEditor ; } ; virtual GraphEditor::DataFlow * DataFlowEditor() { return _DataFlowEditor ; } ; - virtual void DataFlowExecutor( GraphExecutor::DataFlow * DataFlowExecutor ) { - _DataFlowExecutor = DataFlowExecutor ; } ; + virtual GraphExecutor::DataFlow * DataFlowExecutor() { - return _DataFlowExecutor ; } ; + return DataFlowEditor()->Executor(); } ; + virtual void DataFlowNode( GraphEditor::InNode * DataFlowNode ) { _DataFlowNode = DataFlowNode ; } ; virtual GraphEditor::InNode * DataFlowNode() { return _DataFlowNode ; } ; - virtual void DataFlowNode( GraphExecutor::InNode * DataFlowExecutorNode ) { - _DataFlowExecutorNode = DataFlowExecutorNode ; } ; - virtual GraphExecutor::InNode * DataFlowExecutorNode() { - return _DataFlowExecutorNode ; } ; virtual char * Name() ; virtual bool SetName( const char * aDataFlowName ) ; @@ -120,27 +107,51 @@ class CNode_Impl : public POA_SUPERV::CNode , virtual GraphEditor::InNode * DataFlowNode() const { return _DataFlowNode ; } ; virtual GraphBase::ComputingNode * BaseNode() { - return _DataFlowNode->ComputingNode() ; } ; + return DataFlowNode()->ComputingNode() ; } ; virtual SUPERV::CNode_var ObjRef() { SUPERV::CNode_var iobject = SUPERV::GNode::_nil() ; - if ( _DataFlowNode && _IsNode ) { - iobject = SUPERV::CNode::_narrow( _DataFlowNode->ObjRef() ) ; + if ( DataFlowNode() && _IsNode ) { + iobject = SUPERV::CNode::_narrow( DataFlowNode()->ObjRef() ) ; } else { - iobject = SUPERV::CNode::_narrow( _DataFlowEditor->Graph()->ObjRef() ) ; + iobject = SUPERV::CNode::_narrow( DataFlowEditor()->Graph()->ObjRef() ) ; } return iobject ; } ; virtual void SetObjRef(SUPERV::CNode_var aNode ) { - if ( _DataFlowNode && _IsNode ) { - _DataFlowNode->SetObjRef( aNode ) ; + if ( DataFlowNode() && _IsNode ) { + DataFlowNode()->SetObjRef( aNode ) ; } else { - if ( _DataFlowEditor ) { - _DataFlowEditor->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ; + if ( DataFlowEditor() ) { + DataFlowEditor()->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ; } - if ( _DataFlowExecutor ) { - _DataFlowExecutor->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ; + if ( DataFlowExecutor() ) { + DataFlowExecutor()->Graph()->SetObjRef( SUPERV::Graph::_narrow( aNode ) ) ; + } + + } + } ; + + virtual CNode_Impl * ObjImpl() { + CNode_Impl * objimpl = NULL ; + if ( DataFlowNode() && _IsNode ) { + objimpl = DataFlowNode()->ObjImpl() ; + } + else { + objimpl = DataFlowEditor()->Graph()->ObjImpl() ; + } + return objimpl ; } ; + virtual void SetObjImpl( CNode_Impl * objimpl ) { + if ( DataFlowNode() && _IsNode ) { + DataFlowNode()->SetObjImpl( objimpl ) ; + } + else { + if ( DataFlowEditor() ) { + DataFlowEditor()->Graph()->SetObjImpl( objimpl ) ; + } + if ( DataFlowExecutor() ) { + DataFlowExecutor()->Graph()->SetObjImpl( objimpl ) ; } } @@ -246,6 +257,8 @@ class CNode_Impl : public POA_SUPERV::CNode , virtual long CpuUsed() ; + virtual bool IsExecuting(); + } ; #endif diff --git a/src/Supervision/GNode_Impl.cxx b/src/Supervision/GNode_Impl.cxx index 6d7cd4a..fcad1e7 100644 --- a/src/Supervision/GNode_Impl.cxx +++ b/src/Supervision/GNode_Impl.cxx @@ -130,31 +130,6 @@ GNode_Impl::GNode_Impl( CORBA::ORB_ptr orb , // endService( "GNode_Impl::GNode_Impl" ); } -GNode_Impl::GNode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * aDataFlowExecutor , - GraphExecutor::InNode * aDataFlowExecutorNode ) : -// Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) { - INode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowExecutor , aDataFlowExecutorNode ) { -// beginService( "GNode_Impl::GNode_Impl" ); - if ( DataFlowExecutorNode() && DataFlowExecutorNode()->IsGOTONode() ) { -// MESSAGE( "GNode_Impl::GNode_Impl " << DataFlowExecutorNode()->Name() -// << " _poa->activate_object" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - } - else { -// MESSAGE( "GNode_Impl::GNode_Impl NO _poa->activate_object" ); - } - _Orb = CORBA::ORB::_duplicate(orb); - _Poa = poa ; - _ContId = contId ; -// endService( "GNode_Impl::GNode_Impl" ); -} - GNode_Impl::~GNode_Impl() { beginService( "GNode_Impl::~GNode_Impl" ); endService( "GNode_Impl::~GNode_Impl" ); @@ -177,6 +152,18 @@ bool GNode_Impl::Delete() { beginService( "GNode_Impl::Delete" ); bool RetVal = false ; if ( DataFlowEditor()->IsEditing() ) { + if ( DataFlowNode() ) { + GraphBase::GOTONode * aGOTONode = DataFlowNode()->GOTONode() ; + if ( aGOTONode ) { + GraphBase::GOTONode * aCoupledNode = (GraphBase::GOTONode * ) aGOTONode->CoupledNode() ; + if ( aCoupledNode && ( aCoupledNode->IsOneOfGOTONodes() || aCoupledNode->IsDataFlowNode() || + aCoupledNode->IsDataStreamNode() ) ) { + aCoupledNode->CoupledNode( NULL ) ; + aCoupledNode->MacroObject( SUPERV::Graph::_nil() ) ; + aCoupledNode->GraphMacroLevel( 0 ) ; + } + } + } DeletePorts() ; RetVal = DataFlowEditor()->RemoveNode( Name() ) ; if ( RetVal ) diff --git a/src/Supervision/GNode_Impl.hxx b/src/Supervision/GNode_Impl.hxx index 52ddcc1..ea87b67 100644 --- a/src/Supervision/GNode_Impl.hxx +++ b/src/Supervision/GNode_Impl.hxx @@ -68,13 +68,6 @@ class GNode_Impl : public INode_Impl , const char *interfaceName , GraphEditor::DataFlow * DataFlowEditor , GraphEditor::InNode * DataFlowNode ) ; - GNode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * DataFlowExecutor , - GraphExecutor::InNode * DataFlowExecutorNode ) ; virtual ~GNode_Impl() ; virtual void destroy() ; virtual bool Delete() ; diff --git a/src/Supervision/Graph_Impl.cxx b/src/Supervision/Graph_Impl.cxx index 31358d7..1a2350a 100644 --- a/src/Supervision/Graph_Impl.cxx +++ b/src/Supervision/Graph_Impl.cxx @@ -73,9 +73,9 @@ static void CreateEditor( CORBA::ORB_ptr orb , } } string theDataFlowInstanceName = theDataFlowName ; - if ( !aXmlFile ) { - theDataFlowInstanceName = theAutomaton->GraphInstanceName( theDataFlowName ) ; - } +// if ( !aXmlFile ) { +// theDataFlowInstanceName = theAutomaton->GraphInstanceName( theDataFlowName ) ; +// } dbgfile += theDataFlowInstanceName ; dbgfile = dbgfile + "_" + theAutomaton->DbgFileNumber() + ".log" ; SALOME_NamingService * NamingService = new SALOME_NamingService( orb ) ; @@ -84,10 +84,11 @@ static void CreateEditor( CORBA::ORB_ptr orb , aKindOfNode ) ; MESSAGE( "CreateEditor " << theDataFlowName << " uniquely named " << theDataFlowInstanceName << " created with " << dbgfile.c_str() ) ; + delete [] theDataFlowName ; } -static void CreateEditor( CORBA::ORB_ptr orb , +static void CreateExecutor( CORBA::ORB_ptr orb , const char *instanceName , const char *aDataFlowName , const SUPERV::KindOfNode aKindOfNode , @@ -116,8 +117,9 @@ static void CreateEditor( CORBA::ORB_ptr orb , *aDataFlowExecutor = new GraphExecutor::DataFlow( orb , NamingService , theDataFlowInstanceName.c_str() , dbgfile.c_str() , aKindOfNode ) ; - MESSAGE( "CreateEditor " << theDataFlowName << " " << theDataFlowInstanceName << " created with " + MESSAGE( "CreateExecutor " << theDataFlowName << " " << theDataFlowInstanceName << " created with " << dbgfile.c_str() ) ; + delete [] theDataFlowName ; } @@ -136,6 +138,7 @@ Graph_Impl::Graph_Impl( CORBA::ORB_ptr orb , _Orb = CORBA::ORB::_duplicate(orb); _Poa = poa ; _ContId = contId ; + _DebugFileName = NULL ; if ( aKindOfNode == SUPERV::DataFlowGraph || aKindOfNode == SUPERV::MacroNode ) { // MESSAGE( "Graph_Impl::Graph_Impl _poa->activate_object" ); _thisObj = this ; @@ -150,12 +153,16 @@ Graph_Impl::Graph_Impl( CORBA::ORB_ptr orb , GraphEditor::DataFlow * aDataFlowEditor ; CreateEditor( orb , instanceName , aDataFlowName , aKindOfNode , dbgfile , &aDataFlowEditor ) ; + + if ( _DebugFileName ) { + delete [] _DebugFileName ; + } _DebugFileName = new char[ strlen( dbgfile.c_str() )+1 ] ; strcpy( _DebugFileName , dbgfile.c_str() ) ; _NamingService = new SALOME_NamingService( orb ) ; DataFlowEditor( aDataFlowEditor ) ; - DataFlowEditor()->Graph()->SetGraphEditor( aDataFlowEditor ) ; + DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ; DataFlowEditor()->Graph()->SetObjImpl( this ) ; } pthread_mutex_init( &_MutexExecutorWait , NULL ) ; @@ -173,7 +180,8 @@ Graph_Impl::Graph_Impl( CORBA::ORB_ptr orb , GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) { // beginService( "Graph_Impl::Graph_Impl" ); // MESSAGE( aDataFlowEditor->Graph()->Name() << " " ); - if ( aDataFlowEditor->Graph()->IsDataFlowNode() || aDataFlowNode->IsMacroNode() ) { + if ( aDataFlowEditor->Graph()->IsDataFlowNode() || + ( aDataFlowNode && aDataFlowNode->IsMacroNode() ) ) { // MESSAGE( "Graph_Impl::Graph_Impl _poa->activate_object" ); _thisObj = this ; _id = _poa->activate_object(_thisObj); @@ -184,43 +192,15 @@ Graph_Impl::Graph_Impl( CORBA::ORB_ptr orb , _Orb = CORBA::ORB::_duplicate(orb); _Poa = poa ; _ContId = contId ; + _DebugFileName = NULL ; DataFlowEditor( aDataFlowEditor ) ; - DataFlowEditor()->Graph()->SetGraphEditor( aDataFlowEditor ) ; + DataFlowEditor()->Graph()->GraphEditor( aDataFlowEditor ) ; DataFlowEditor()->Graph()->SetObjImpl( this ) ; pthread_mutex_init( &_MutexExecutorWait , NULL ) ; // DataFlowExecutor( NULL ) ; // endService( "Graph_Impl::Graph_Impl" ); } -Graph_Impl::Graph_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * aDataFlowExecutor , - GraphExecutor::InNode * aDataFlowExecutorNode ) : - GNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowExecutor , aDataFlowExecutorNode ) { -// beginService( "Graph_Impl::Graph_Impl" ); -// MESSAGE( aDataFlowExecutor->Graph()->Name() << " " ); - if ( aDataFlowExecutor->Graph()->IsDataFlowNode() || aDataFlowExecutorNode->IsMacroNode() ) { -// MESSAGE( "Graph_Impl::Graph_Impl _poa->activate_object" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - } - else { -// MESSAGE( "Graph_Impl::Graph_Impl NO _poa->activate_object " ); - } - _Orb = CORBA::ORB::_duplicate(orb); - _Poa = poa ; - _ContId = contId ; - DataFlowExecutor( aDataFlowExecutor ) ; - DataFlowExecutor()->Graph()->SetGraphExecutor( aDataFlowExecutor ) ; - DataFlowExecutor()->Graph()->SetObjImpl( this ) ; - pthread_mutex_init( &_MutexExecutorWait , NULL ) ; -// DataFlowExecutor( NULL ) ; -// endService( "Graph_Impl::Graph_Impl" ); -} - Graph_Impl::Graph_Impl() { } @@ -231,11 +211,25 @@ Graph_Impl::~Graph_Impl() { void Graph_Impl::destroy() { beginService( "Graph_Impl::destroy" ); + if ( DataFlowNode() && DataFlowNode()->ComputingNode()->IsMacroNode() ) { + SUPERV::Graph_var aGraph = DataFlowNode()->GOTONode()->MacroObject() ; + GNode_Impl::Delete() ; + if ( !CORBA::is_nil( aGraph ) ) { + aGraph->destroy() ; + } + } + else { + SUPERV::Graph_var aGraph = DataFlowEditor()->Graph()->MacroObject() ; + GNode_Impl::Delete() ; + if ( !CORBA::is_nil( aGraph ) ) { + aGraph->destroy() ; + } + } _poa->deactivate_object(*_id) ; CORBA::release(_poa) ; delete(_id) ; _thisObj->_remove_ref(); -// endService( "Graph_Impl::destroy" ); + endService( "Graph_Impl::destroy" ); } @@ -293,7 +287,9 @@ bool Graph_Impl::LoadGraphs( GraphBase::ListOfSGraphs * aListOfDataFlows ) { bool RetVal = false ; if ( DataFlowEditor()->IsEditing() ) { // RetVal = DataFlowEditor()->LoadDataFlows( aListOfDataFlows ) ; - RetVal = LoadDataFlows( DataFlowEditor() , aListOfDataFlows , 0 ) ; + if ( CORBA::is_nil( LoadDataFlows( DataFlowEditor() , aListOfDataFlows , 0 ) ) ) { + RetVal = false ; + } } endService( "Graph_Impl::LoadGraphs" ); return RetVal ; @@ -307,7 +303,9 @@ bool Graph_Impl::Import(const char * aXmlFile ) { RetVal = DataFlowEditor()->LoadXml( aXmlFile , aListOfDataFlows ) ; if ( RetVal && aXmlFile != NULL ) { // RetVal = DataFlowEditor()->LoadDataFlows( &aListOfDataFlows ) ; - RetVal = LoadDataFlows( DataFlowEditor() , &aListOfDataFlows , 0 ) ; + if ( CORBA::is_nil( LoadDataFlows( DataFlowEditor() , &aListOfDataFlows , 0 ) ) ) { + RetVal = false ; + } } } endService( "Graph_Impl::Import" ); @@ -358,6 +356,7 @@ SUPERV::CNode_ptr Graph_Impl::CNode( const SALOME_ModuleCatalog::Service &NodeSe myNode->SetObjRef( SUPERV::CNode::_duplicate( iobject ) ) ; } } + DataFlowEditor()->UnValid() ; endService( "Graph_Impl::CNode" ); return SUPERV::CNode::_duplicate( iobject ) ; } @@ -381,6 +380,7 @@ SUPERV::FNode_ptr Graph_Impl::FNode( const char * NodeComponentName , myNode->SetObjRef( SUPERV::FNode::_duplicate( iobject ) ) ; } } + DataFlowEditor()->UnValid() ; endService( "Graph_Impl::FNode" ); return SUPERV::FNode::_duplicate( iobject ) ; } @@ -432,6 +432,7 @@ SUPERV::GNode_ptr Graph_Impl::GNode( const char * FuncName , } } } + DataFlowEditor()->UnValid() ; endService( "Graph_Impl::GNode" ); return SUPERV::GNode::_duplicate( iobject ) ; } @@ -498,6 +499,7 @@ SUPERV::LNode_ptr Graph_Impl::LNode( const char * InitName , } } anEndOfLoop = SUPERV::ELNode::_duplicate( iendobject ) ; + DataFlowEditor()->UnValid() ; endService( "Graph_Impl::LNode" ); return SUPERV::LNode::_duplicate( iobject ) ; } @@ -551,24 +553,30 @@ SUPERV::SNode_ptr Graph_Impl::SNode( const char * FuncName , } } anEndOfSwitch = SUPERV::ESNode::_duplicate( iendobject ) ; + DataFlowEditor()->UnValid() ; endService( "Graph_Impl::SNode" ); return SUPERV::SNode::_duplicate( iobject ) ; } // WARNING : THIS IS COMPLICATED : -bool Graph_Impl::LoadDataFlows( GraphEditor::DataFlow * aDataFlowEditor , - GraphBase::ListOfSGraphs * aListOfDataFlows , - int index ) { +SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphEditor::DataFlow * aDataFlowEditor , + GraphBase::ListOfSGraphs * aListOfDataFlows , + int index ) { beginService( "Graph_Impl::EditorLoadDataFlows" ) ; + MESSAGE("Graph_Impl::LoadDataFlows index " << index << " " << (*aListOfDataFlows)[index].Info.theName.c_str() ) ; + SUPERV::Graph_var iobject = SUPERV::Graph::_nil() ; +// That method is recursive : +// At first we load the supergraph with index = 0 : +// (After we load the graph corresponding to each MacroNode :) if ( !aDataFlowEditor->LoadDataFlow( &(*aListOfDataFlows)[ index ] ) ) { - MESSAGE("Graph_Impl::LoadDataFlows failed" ) ; - return false ; + MESSAGE("Graph_Impl::LoadDataFlows failed " << (*aListOfDataFlows)[index].Info.theName.c_str() ) ; + return SUPERV::Graph::_duplicate( iobject ) ; } // That graph is not a StreamGraph : else if ( !aDataFlowEditor->Graph()->HasDataStream() ) { aDataFlowEditor->Graph()->Kind( SUPERV::DataFlowGraph ) ; - aDataFlowEditor->Graph()->SetGraphEditor( aDataFlowEditor ) ; +// aDataFlowEditor->Graph()->SetGraphEditor( aDataFlowEditor ) ; Graph_Impl * myGraph ; // We create a Graph ObjRef for that graph myGraph = new Graph_Impl( _Orb , _Poa, _ContId, @@ -578,237 +586,263 @@ bool Graph_Impl::LoadDataFlows( GraphEditor::DataFlow * aDataFlowEditor , CORBA::Object_var obj = _poa->id_to_reference(*id) ; iobject = SUPERV::Graph::_narrow( obj ) ; myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ; + myGraph->SetObjImpl( (CNode_Impl * ) myGraph ) ; GraphBase::Graph * aGraph = myGraph->DataFlowEditor()->Graph() ; int i ; + +// asv: set Editor for the graph itself and for all its macro nodes + aGraph->GraphEditor( aDataFlowEditor ); + +// For the supergraph or each graph of MacroNodes we search MacroNodes recursively : for ( i = 0 ; i < aGraph->GraphNodesSize() ; i++ ) { if ( aGraph->GraphNodes( i )->IsMacroNode() ) { GraphBase::GOTONode * aMacroNode = (GraphBase::GOTONode * ) aGraph->GraphNodes( i ) ; +// asv: set Editor for the graph itself and for all its macro nodes + aMacroNode->GraphEditor( aDataFlowEditor ); - -// Creation of a GraphMacroNode in the current editor +// Creation of a GraphMacroNode ObjRef in the current editor SUPERV::Graph_var macroiobject = SUPERV::Graph::_nil() ; - string aMacroNodeName = string( "Macro_" ) + string( myGraph->Name() ) ; Graph_Impl * myMacroNode ; myMacroNode = new Graph_Impl( _Orb , _Poa, _ContId, instanceName() , interfaceName() , - aMacroNodeName.c_str() , SUPERV::MacroNode ) ; + aMacroNode->Name() , SUPERV::MacroNode ) ; id = myMacroNode->getId() ; obj = _poa->id_to_reference(*id); macroiobject = SUPERV::Graph::_narrow( obj ) ; - myMacroNode->DataFlowEditor( DataFlowEditor() ) ; - aMacroNode->SetGraphEditor( DataFlowEditor() ) ; + myMacroNode->DataFlowEditor( aDataFlowEditor ) ; GraphEditor::InNode * aDataFlowNode = (GraphEditor::InNode * ) aMacroNode->GetInNode() ; myMacroNode->DataFlowNode( aDataFlowNode ) ; aDataFlowNode->SetObjRef( SUPERV::CNode::_duplicate( SUPERV::CNode::_narrow( obj ) ) ) ; - aDataFlowNode->SetObjImpl( this ) ; - - - - + aDataFlowNode->SetObjImpl( myMacroNode ) ; char * aCoupledNodeName = aMacroNode->CoupledNodeName() ; MESSAGE( "LoadDataFlows MacroNode " << aMacroNode->Name() << " --> " << aCoupledNodeName << " to be searched among " << (*aListOfDataFlows).size() << " Graphs" ) ; int index ; + bool found = false ; for ( index = 0 ; index < (int ) (*aListOfDataFlows).size() ; index++ ) { + MESSAGE( "LoadDataFlows Graph" << index << " " << (*aListOfDataFlows)[index].Info.theName.c_str() ) ; if ( !strcmp( aCoupledNodeName , (*aListOfDataFlows)[index].Info.theName.c_str() ) ) { + found = true ; string dbgfile ; // At first create the editor and a StreamGraph GraphEditor::DataFlow * aMacroGraphDataFlowEditor ; CreateEditor( _Orb , instanceName() , aCoupledNodeName , SUPERV::DataStreamGraph , dbgfile , &aMacroGraphDataFlowEditor ) ; -// if ( !aDataFlowEditor->LoadDataFlow( aDataFlowEditor , aListOfDataFlows , index ) ) { + + if ( _DebugFileName ) { + delete [] _DebugFileName ; + } + _DebugFileName = new char[ strlen( dbgfile.c_str() )+1 ] ; + strcpy( _DebugFileName , dbgfile.c_str() ) ; + MESSAGE( "RECURSIVE IMPORT OF GRAPHS OF MACRONODES :" << aCoupledNodeName ) ; - if ( !LoadDataFlows( aMacroGraphDataFlowEditor , aListOfDataFlows , index ) ) { + if ( CORBA::is_nil( LoadDataFlows( aMacroGraphDataFlowEditor , aListOfDataFlows , index ) ) ) { MESSAGE("Graph_Impl::LoadDataFlows failed" ) ; - return false ; + return SUPERV::Graph::_duplicate( iobject ) ; } // That graph is not a StreamGraph : else if ( !aMacroGraphDataFlowEditor->Graph()->HasDataStream() ) { - aMacroGraphDataFlowEditor->Graph()->Kind( SUPERV::DataFlowGraph ) ; - aMacroGraphDataFlowEditor->Graph()->SetGraphEditor( aMacroGraphDataFlowEditor ) ; Graph_Impl * myMacroGraph ; -// We create a Graph ObjRef for that graph - myMacroGraph = new Graph_Impl( _Orb , _Poa, _ContId, - instanceName() , interfaceName() , - aMacroGraphDataFlowEditor , NULL ) ; - PortableServer::ObjectId * id = myMacroGraph->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - SUPERV::Graph_var iobject = SUPERV::Graph::_narrow( obj ) ; - myMacroGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ; +// The Graph ObjRef for that graph was already created + myMacroGraph = (Graph_Impl * ) aMacroGraphDataFlowEditor->Graph()->ObjImpl() ; GraphBase::Graph * aMacroGraph = myMacroGraph->DataFlowEditor()->Graph() ; + aMacroGraph->GraphMacroLevel( aGraph->GraphMacroLevel() + 1 ) ; aMacroGraph->CoupledNode( aMacroNode ) ; - - aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ; // Set the GraphMacroNode ObjRef in the MacroNode + aMacroNode->GraphMacroLevel( aGraph->GraphMacroLevel() + 1 ) ; aMacroNode->CoupledNode( aMacroGraph ) ; - aMacroNode->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; + aMacroNode->MacroObject( SUPERV::Graph::_narrow( aMacroGraphDataFlowEditor->Graph()->ObjRef() ) ) ; + MESSAGE( "LoadDataFlows aMacroGraph " << aMacroGraph << " " << aMacroGraph->Name() + << " coupled to " << aMacroGraph->CoupledNode() << " " + << aMacroGraph->CoupledNode()->Name() << " Editor " << aMacroGraph->GraphEditor() ) ; + MESSAGE( "LoadDataFlows aMacroNode " << aMacroNode << " " << aMacroNode->Name() + << " coupled to " << aMacroNode->CoupledNode() << " " + << aMacroNode->CoupledNode()->Name() << " Editor " << aMacroNode->GraphEditor() ) ; + MESSAGE( "LoadDataFlows current Graph " << aGraph << " " << aGraph->Name() + << " coupled to " << aGraph->CoupledNode() + << " Editor " << aGraph->GraphEditor() << " " << aGraph->Name() ) ; } + break ; } } + if ( !found ) { + return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; + } } } } + else if ( (*aListOfDataFlows).size() == 1 ) { + StreamGraph_Impl * myStreamGraph ; +// We create a Graph ObjRef for that graph + myStreamGraph = new StreamGraph_Impl( _Orb , _Poa, _ContId, + instanceName() , interfaceName() , + aDataFlowEditor , NULL ) ; + PortableServer::ObjectId * id = myStreamGraph->getId() ; + CORBA::Object_var obj = _poa->id_to_reference(*id) ; + SUPERV::StreamGraph_var Streamiobject = SUPERV::StreamGraph::_nil() ; + Streamiobject = SUPERV::StreamGraph::_narrow( obj ) ; + myStreamGraph->SetObjRef( SUPERV::StreamGraph::_duplicate( Streamiobject ) ) ; + myStreamGraph->SetObjImpl( (CNode_Impl * ) myStreamGraph ) ; +// iobject = SUPERV::Graph::_narrow( obj ) ; + iobject = SUPERV::Graph::_narrow( Streamiobject ) ; + } + else { + MESSAGE( "Graph_Impl::LoadDataFlows StreamGraph with MacroNodes not yet implemented" ) ; + } endService( "Graph_Impl::EditorLoadDataFlows" ); - return true ; + return SUPERV::Graph::_duplicate( iobject ) ; } -bool Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlowExecutor , - GraphBase::ListOfSGraphs * aListOfDataFlows , - int index ) { +SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlowExecutor , + GraphBase::ListOfSGraphs * aListOfDataFlows , + int index ) { beginService( "Graph_Impl::ExecutorLoadDataFlows" ) ; - MESSAGE("Graph_Impl::LoadDataFlows index " << index << " " << (*aListOfDataFlows)[index].Info.theName.c_str() ) ; - SUPERV::Graph_var iobject = SUPERV::Graph::_nil() ; -// That method is recursive : -// At first we load the supergraph with index = 0 : -// (After we load the graph corresponding to each MacroNode :) + MESSAGE("Graph_Impl::LoadDataFlows(Executor) index " << index << " " << (*aListOfDataFlows)[index].Info.theName.c_str() << " aDataFlowExecutor " << aDataFlowExecutor ) ; + + // That method is recursive : + // At first we load the supergraph with index = 0 : + // (After we load the graph corresponding to each MacroNode :) if ( !aDataFlowExecutor->LoadDataFlow( &(*aListOfDataFlows)[ index ] ) ) { - MESSAGE("Graph_Impl::LoadDataFlows failed" ) ; - return false ; + MESSAGE("Graph_Impl::LoadDataFlows(Executor) failed, could not LoadDataFlow(supergraph)" ) ; + return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; } -// That graph is not a StreamGraph : + + // That graph is not a StreamGraph : else if ( !aDataFlowExecutor->Graph()->HasDataStream() ) { aDataFlowExecutor->Graph()->Kind( SUPERV::DataFlowGraph ) ; GraphEditor::DataFlow * aDataFlowEditor ; - aDataFlowEditor = theAutomaton->MapGraph( (*aListOfDataFlows)[index].Info.theName.c_str() )->GraphEditor() ; + aDataFlowEditor = DataFlowEditor() ; + GraphBase::Graph * anEditorGraph = aDataFlowEditor->Graph() ; + GraphBase::Graph * anExecutorGraph = aDataFlowExecutor->Graph() ; + if ( aDataFlowEditor->Executor() ) { + delete aDataFlowEditor->Executor() ; + aDataFlowEditor->Executor( NULL ) ; + aDataFlowEditor->Editing() ; + } aDataFlowEditor->Executor( aDataFlowExecutor ) ; - aDataFlowEditor->Graph()->SetGraphEditor( aDataFlowEditor ) ; - aDataFlowEditor->Graph()->SetGraphExecutor( aDataFlowExecutor ) ; - aDataFlowExecutor->Graph()->SetGraphEditor( aDataFlowEditor ) ; - aDataFlowExecutor->Graph()->SetGraphExecutor( aDataFlowExecutor ) ; - Graph_Impl * myGraph ; -// We create a Graph ObjRef for that graph - myGraph = new Graph_Impl( _Orb , _Poa, _ContId, - instanceName() , interfaceName() , - aDataFlowExecutor , NULL ) ; - PortableServer::ObjectId * id = myGraph->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id) ; - iobject = SUPERV::Graph::_narrow( obj ) ; - myGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ; - myGraph->DataFlowEditor( aDataFlowEditor ) ; - myGraph->DataFlowExecutor( aDataFlowExecutor ) ; - MESSAGE("ExecutorLoadDataFlows IsEditing " << myGraph->Name() << " " - << myGraph->DataFlowEditor() << " " << myGraph->DataFlowEditor()->IsEditing() << " " - << myGraph->DataFlowEditor()->Graph()->Name() << " " - << myGraph->DataFlowEditor()->Graph()->GraphEditor() << " " - << myGraph->DataFlowEditor()->Graph()->GraphEditor()->IsEditing() ) ; - GraphBase::Graph * aGraph = myGraph->DataFlowExecutor()->Graph() ; - int i ; -// For the supergraph or each graph of MacroNodes we search MacroNodes recursively : - for ( i = 0 ; i < aGraph->GraphNodesSize() ; i++ ) { - if ( aGraph->GraphNodes( i )->IsMacroNode() ) { - GraphBase::GOTONode * aMacroNode = (GraphBase::GOTONode * ) aGraph->GraphNodes( i ) ; - - - -// Creation of a GraphMacroNode ObjRef in the current executor - SUPERV::Graph_var macroiobject = SUPERV::Graph::_nil() ; - string aMacroNodeName = string( "Macro_" ) + string( aGraph->Name() ) ; - Graph_Impl * myMacroNode ; - myMacroNode = new Graph_Impl( _Orb , _Poa, _ContId, - instanceName() , interfaceName() , - aMacroNodeName.c_str() , SUPERV::MacroNode ) ; - id = myMacroNode->getId() ; - obj = _poa->id_to_reference(*id); - macroiobject = SUPERV::Graph::_narrow( obj ) ; - myMacroNode->DataFlowEditor( DataFlowEditor() ) ; - myMacroNode->DataFlowExecutor( DataFlowExecutor() ) ; - aMacroNode->SetGraphEditor( DataFlowEditor() ) ; - GraphExecutor::InNode * aDataFlowExecutorNode = (GraphExecutor::InNode * ) aMacroNode->GetInNode() ; - myMacroNode->DataFlowNode( aDataFlowExecutorNode ) ; - aDataFlowExecutorNode->SetObjRef( SUPERV::CNode::_duplicate( SUPERV::CNode::_narrow( obj ) ) ) ; - aDataFlowExecutorNode->SetObjImpl( this ) ; - - char * aCoupledNodeName = aMacroNode->CoupledNodeName() ; - MESSAGE( "LoadDataFlows MacroNode " << aMacroNode->Name() << " --> " << aCoupledNodeName - << " to be searched among " << (*aListOfDataFlows).size() << " Graphs" ) ; - int index ; - for ( index = 0 ; index < (int ) (*aListOfDataFlows).size() ; index++ ) { - if ( !strcmp( aCoupledNodeName , (*aListOfDataFlows)[index].Info.theName.c_str() ) ) { - string dbgfile ; -// At first create the editor and a StreamGraph - GraphExecutor::DataFlow * aMacroGraphDataFlowExecutor ; - CreateEditor( _Orb , instanceName() , aCoupledNodeName , SUPERV::DataStreamGraph , - dbgfile , &aMacroGraphDataFlowExecutor ) ; -// if ( !aDataFlowEditor->LoadDataFlow( aDataFlowEditor , aListOfDataFlows , index ) ) { - MESSAGE( "RECURSIVE IMPORT OF GRAPHS OF MACRONODES :" << aCoupledNodeName ) ; - if ( !LoadDataFlows( aMacroGraphDataFlowExecutor , aListOfDataFlows , index ) ) { - MESSAGE("Graph_Impl::LoadDataFlows failed" ) ; - return false ; - } - -// That graph is not a StreamGraph : - else if ( !aMacroGraphDataFlowExecutor->Graph()->HasDataStream() ) { - aMacroGraphDataFlowExecutor->Graph()->Kind( SUPERV::DataFlowGraph ) ; - aMacroGraphDataFlowExecutor->Graph()->SetGraphExecutor( aMacroGraphDataFlowExecutor ) ; - GraphEditor::DataFlow * aDataFlow = theAutomaton->MapGraph( aCoupledNodeName )->GraphEditor() ; - if ( aDataFlow == NULL ) { - MESSAGE( "ExecutorLoadDataFlows NULL GraphEditor ERROR" ) ; - } - aMacroGraphDataFlowExecutor->Graph()->SetGraphEditor( aDataFlow ) ; - aMacroGraphDataFlowExecutor->Graph()->SetGraphExecutor( aMacroGraphDataFlowExecutor ) ; - aMacroGraphDataFlowExecutor->Graph()->SetGraphPorts() ; - Graph_Impl * myMacroGraph ; -// We create a Graph ObjRef for that graph - myMacroGraph = new Graph_Impl( _Orb , _Poa, _ContId, - instanceName() , interfaceName() , - aMacroGraphDataFlowExecutor , NULL ) ; - PortableServer::ObjectId * id = myMacroGraph->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - SUPERV::Graph_var iobject = SUPERV::Graph::_narrow( obj ) ; - myMacroGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ; - myMacroGraph->DataFlowEditor( aDataFlow ) ; - aDataFlow->Executor( aMacroGraphDataFlowExecutor ) ; - myMacroGraph->DebugFileName( (char * ) dbgfile.c_str() ) ; - - GraphBase::Graph * aMacroGraph = myMacroGraph->DataFlowExecutor()->Graph() ; - aMacroGraph->GraphMacroLevel( aGraph->GraphMacroLevel() + 1 ) ; - -// Set the MacroNode ObjRef in the GraphMacroNode - aMacroGraph->CoupledNode( aMacroNode ) ; - aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ; - -// Set the GraphMacroNode ObjRef in the MacroNode - aMacroNode->CoupledNode( aMacroGraph ) ; - aMacroNode->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; - - iobject->Run() ; + anExecutorGraph->GraphEditor( aDataFlowEditor ) ; + + // For the supergraph or each graph of MacroNodes we search MacroNodes recursively : + int i; + for ( i = 0 ; i < anExecutorGraph->GraphNodesSize() ; i++ ) { + if ( anExecutorGraph->GraphNodes( i )->IsMacroNode() ) { + GraphBase::GOTONode * aMacroNode = (GraphBase::GOTONode * ) anExecutorGraph->GraphNodes( i ) ; + aMacroNode->GraphEditor( aDataFlowEditor ) ; + + // get the macro node's editor object + char * aMacroGraphName = aMacroNode->CoupledNodeName() ; + GraphBase::Graph* aMacroGraph = (GraphBase::Graph*)((GraphBase::GOTONode *)anEditorGraph->GetGraphNode( aMacroNode->Name() ))->CoupledNode() ; + GraphEditor::DataFlow* aMacroGraphEditor = aMacroGraph->GraphEditor(); + + MESSAGE( "LoadDataFlows(Executor) MacroNode " << aMacroNode->Name() << " Coupled to " << aMacroGraphName + << " to be searched among " << (*aListOfDataFlows).size() << " Graphs" << endl ) ; + int index; + bool found = false ; + for ( index = 0 ; index < (int ) (*aListOfDataFlows).size() && !found; index++ ) { + if ( !strcmp( aMacroGraphName , (*aListOfDataFlows)[index].Info.theName.c_str() ) ) + found = true; + } + if ( !found ) { + MESSAGE("Graph_Impl::LoadDataFlows(Executor) failed, Macro node's coupled graph \"" << aMacroGraphName << "\" was not found" ) ; + return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; + } + index--; // it was incremented in "for ..." before last check ( !found ). + + // At first create the editor and a StreamGraph + string dbgfile ; + GraphExecutor::DataFlow * aMacroGraphExecutor ; + CreateExecutor( _Orb , instanceName() , aMacroGraphName , SUPERV::DataStreamGraph , + dbgfile , &aMacroGraphExecutor ); + + // set GraphMacroLevel for Executor's graph + GraphBase::Graph* aMacroGraphExe = aMacroGraphExecutor->Graph(); + aMacroGraphExe->GraphMacroLevel( anExecutorGraph->GraphMacroLevel() + 1 ); + + // load data flows in MacroGraph's executor + Graph_Impl* aMacroGraphImpl = (Graph_Impl*) aMacroGraphEditor->Graph()->ObjImpl(); + MESSAGE( "RECURSIVE IMPORT OF GRAPHS OF MACRONODES : " << aMacroGraphName ) ; + if ( CORBA::is_nil( aMacroGraphImpl->LoadDataFlows( aMacroGraphExecutor, aListOfDataFlows , index ) ) ) { + MESSAGE("Graph_Impl::LoadDataFlows(Executor) failed, could not LoadDataFlow( MacroNodeGraph \"" < MacroGraph + aMacroGraphExe->CoupledNode( aMacroNode ) ; + aMacroNode->CoupledNode( aMacroGraphExe ) ; + + // set MacroObject pair ???? + /* + PortableServer::ObjectId * id = aMacroNode->ObjImpl()->getId(); + CORBA::Object_var obj = _poa->id_to_reference( *id ); + SUPERV::Graph_var aMacroNodeImpl = SUPERV::Graph::_narrow( obj ) ; + + aMacroGraphExe->MacroObject( SUPERV::Graph::_duplicate( aMacroNodeImpl ) ) ; + aMacroNode->MacroObject( SUPERV::Graph::_duplicate( SUPERV::Graph::_narrow( aMacroGraphExecutor->Graph()->ObjRef() ) ) ) ; + */ + // initialize MacroNode's InPorts with corresponding "external" values + int q ; + for ( q = 0 ; q < aMacroNode->GetNodeInPortsSize() ; q++ ) { + const GraphBase::InPort * anInPort = aMacroNode->GetNodeInPort( q ) ; + if ( anInPort->IsDataConnected() ) { + if ( !aMacroGraphExecutor->InputOfAny( aMacroGraph->GetNodeInPort( q )->PortName() , + *anInPort->GetOutPort()->Value() , + false ) ) { + return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; + } + else { + MESSAGE( "LoadDataFlows(Executor) " << aMacroGraph->Name() << "->InputOfAny( " + << aMacroGraph->GetNodeInPort( i )->PortName() << " , Value )" ) ; } - break ; } - } + } // end of init MacroNode's InPorts + + aMacroGraphImpl->Run() ; + } - } - } + } // end of for( get nodes of the graph...) + } // end of setting initial graph's structure.. endService( "Graph_Impl::ExecutorLoadDataFlows" ); - return true ; + + PortableServer::ObjectId * id = getId(); + CORBA::Object_var obj = _poa->id_to_reference( *id ); + SUPERV::Graph_var iobject = SUPERV::Graph::_narrow( obj ) ; + return SUPERV::Graph::_duplicate( iobject ) ; } SUPERV::Graph_ptr Graph_Impl::MNode( const char * aXmlFileName ) { beginService( "Graph_Impl::MNode" ); SUPERV::Graph_var iobject = SUPERV::Graph::_nil() ; - if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() && !IsMacro() ) { + MESSAGE( "Graph_Impl::MNode( " << aXmlFileName << " )" ) ; + if ( !IsMacro() ) { GraphBase::ListOfSGraphs aListOfDataFlows ; string dbgfile ; // At first create the editor and a StreamGraph with the xml file GraphEditor::DataFlow * aDataFlowEditor ; CreateEditor( _Orb , instanceName() , aXmlFileName , SUPERV::DataStreamGraph , dbgfile , &aDataFlowEditor ) ; + + if ( _DebugFileName ) { + delete [] _DebugFileName ; + } + _DebugFileName = new char[ strlen( dbgfile.c_str() )+1 ] ; + strcpy( _DebugFileName , dbgfile.c_str() ) ; + int lenname = strlen( aXmlFileName ) ; bool loaded = false ; // Import of the xml file if ( lenname > 4 && !strcmp( &aXmlFileName[ lenname - 4 ] , ".xml" ) ) { loaded = aDataFlowEditor->LoadXml( aXmlFileName , aListOfDataFlows ) ; if ( loaded ) { - iobject = MNode( aDataFlowEditor , aListOfDataFlows ) ; + iobject = MNode( aDataFlowEditor , &aListOfDataFlows ) ; } } } @@ -818,13 +852,16 @@ SUPERV::Graph_ptr Graph_Impl::MNode( const char * aXmlFileName ) { // WARNING : THIS IS COMPLICATED : // I should have to remove duplicated code ... SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlowEditor , - GraphBase::ListOfSGraphs aListOfDataFlows ) { + GraphBase::ListOfSGraphs * aListOfDataFlows ) { beginService( "Graph_Impl::MNode" ) ; SUPERV::Graph_var iobject = SUPERV::Graph::_nil() ; SUPERV::Graph_var macroiobject = SUPERV::Graph::_nil() ; if ( !IsMacro() ) { - if ( !aMacroGraphDataFlowEditor->LoadDataFlow( &aListOfDataFlows[ 0 ] ) ) { + MESSAGE( "Graph_Impl::MNode DataFlowEditor->LoadDataFlow" ) ; +// if ( !aMacroGraphDataFlowEditor->LoadDataFlow( &aListOfDataFlows[ 0 ] ) ) { + iobject = LoadDataFlows( aMacroGraphDataFlowEditor , aListOfDataFlows , 0 ) ; + if ( CORBA::is_nil( iobject ) ) { MESSAGE("Graph_Impl::MNode LoadDataFlow failed" ) ; return false ; } @@ -832,27 +869,17 @@ SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlow // That graph is not a StreamGraph : else if ( !aMacroGraphDataFlowEditor->Graph()->HasDataStream() ) { aMacroGraphDataFlowEditor->Graph()->Kind( SUPERV::DataFlowGraph ) ; - aMacroGraphDataFlowEditor->Graph()->SetGraphEditor( aMacroGraphDataFlowEditor ) ; - Graph_Impl * myMacroGraph ; -// We create a Graph ObjRef for that graph - myMacroGraph = new Graph_Impl( _Orb , _Poa, _ContId, - instanceName() , interfaceName() , - aMacroGraphDataFlowEditor , NULL ) ; - PortableServer::ObjectId * id = myMacroGraph->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - iobject = SUPERV::Graph::_narrow( obj ) ; - myMacroGraph->SetObjRef( SUPERV::Graph::_duplicate( iobject ) ) ; - - + aMacroGraphDataFlowEditor->Graph()->GraphEditor( aMacroGraphDataFlowEditor ) ; + Graph_Impl * myMacroGraph = (Graph_Impl * ) aMacroGraphDataFlowEditor->Graph()->ObjImpl() ; // Creation of a GraphMacroNode in the current editor string aMacroNodeName = string( "Macro_" ) + string( myMacroGraph->Name() ) ; Graph_Impl * myMacroNode ; myMacroNode = new Graph_Impl( _Orb , _Poa, _ContId, instanceName() , interfaceName() , aMacroNodeName.c_str() , SUPERV::MacroNode ) ; - id = myMacroNode->getId() ; - obj = _poa->id_to_reference(*id); + PortableServer::ObjectId * id = myMacroNode->getId() ; + CORBA::Object_var obj = _poa->id_to_reference(*id); macroiobject = SUPERV::Graph::_narrow( obj ) ; myMacroNode->DataFlowEditor( DataFlowEditor() ) ; @@ -876,13 +903,11 @@ SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlow aDataFlowNode->SetObjRef( SUPERV::CNode::_duplicate( SUPERV::CNode::_narrow( obj ) ) ) ; aDataFlowNode->SetObjImpl( this ) ; - - GraphBase::Graph * aGraph = myMacroGraph->DataFlowEditor()->Graph() ; GraphBase::Graph * aGraphOfMacroGraph = myMacroNode->DataFlowEditor()->Graph() ; GraphBase::Graph * aMacroGraph = myMacroNode->DataFlowNode()->GraphMacroNode() ; aMacroGraph->Kind( SUPERV::MacroNode ) ; - aMacroGraph->SetGraphEditor( DataFlowEditor() ) ; + aMacroGraph->GraphEditor( DataFlowEditor() ) ; // Creation of the Ports of the MacroNode from the ports of the GraphMacroNode aMacroGraph->SetMacroPorts( aGraph ) ; // Valid ==> creation of Service and the ports of the current Graph @@ -894,8 +919,11 @@ SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlow aGraph->CoupledNode( aMacroGraph ) ; aGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ; // Set the GraphMacroNode ObjRef in the MacroNode + aDataFlowNode->GraphMacroNode()->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ; aMacroGraph->CoupledNode( aGraph ) ; +// aGraphOfMacroGraph->CoupledNode( aGraph ) ; aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; +// aGraphOfMacroGraph->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; // aDataFlowNode->CoupledNode( aGraph ) ; // aDataFlowNode->ComputingNode()->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; // Set the MacroLevel of that graph @@ -903,6 +931,15 @@ SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlow aMacroGraph->Coordinates( 0 , 0 ) ; MESSAGE( "DataFlowNode Graph " << this << " DataFlowEditor " << DataFlowEditor() << " aDataFlowNode " << aDataFlowNode << " " << aDataFlowNode->Name() << " created" ) ; + MESSAGE( "MNode aGraph " << aGraph << " " << aGraph->Name() + << " coupled to " << aGraph->CoupledNode() << " " + << aGraph->CoupledNode()->Name() ) ; + MESSAGE( "MNode aMacroGraph " << aMacroGraph << " " << aMacroGraph->Name() + << " coupled to " << aMacroGraph->CoupledNode() << " " + << aMacroGraph->CoupledNode()->Name() ) ; + MESSAGE( "MNode aMacroGraph " << myMacroNode->DataFlowEditor()->Graph() << " " + << myMacroNode->DataFlowEditor()->Graph()->Name() + << " coupled to " << myMacroNode->DataFlowEditor()->Graph()->CoupledNode() ) ; } else { delete aMacroGraphDataFlowEditor ; @@ -912,6 +949,7 @@ SUPERV::Graph_ptr Graph_Impl::MNode( GraphEditor::DataFlow * aMacroGraphDataFlow return SUPERV::Graph::_duplicate( macroiobject ) ; } +// For python supergraph SUPERV::Graph_ptr Graph_Impl::GraphMNode( SUPERV::Graph_ptr myMacroGraph ) { SUPERV::Graph_var iobject = myMacroGraph ; beginService( "Graph_Impl::GraphMNode" ) ; @@ -921,6 +959,7 @@ SUPERV::Graph_ptr Graph_Impl::GraphMNode( SUPERV::Graph_ptr myMacroGraph ) { // Creation of a GraphMacroNode in the current editor if ( !IsMacro() ) { string aMacroNodeName = string( "Macro_" ) + string( myMacroGraph->Name() ) ; + //string aMacroNodeName = string( myMacroGraph->CoupledName() ) ; MESSAGE( "GraphMNode( " << myMacroGraph->Name() << " )" ) ; Graph_Impl * myMacroNode ; myMacroNode = new Graph_Impl( _Orb , _Poa, _ContId, @@ -942,23 +981,24 @@ SUPERV::Graph_ptr Graph_Impl::GraphMNode( SUPERV::Graph_ptr myMacroGraph ) { aPythonFunction.resize( 1 ) ; aPythonFunction[0] = &aListOfStrings ; SALOME_ModuleCatalog::Service * aMacroNodeService = myMacroGraph->Service() ; - GraphEditor::InNode * aDataFlowNode = DataFlowEditor()->AddNode( *aMacroNodeService , "" , "" , - aMacroNodeName.c_str() , SUPERV::MacroNode , - aFuncName , aPythonFunction ) ; + GraphEditor::InNode * aDataFlowNode ; + aDataFlowNode = DataFlowEditor()->AddNode( *aMacroNodeService , "" , "" , + aMacroNodeName.c_str() , SUPERV::MacroNode , + aFuncName , aPythonFunction ) ; aDataFlowNode->SetPythonFunction( "" , aListOfStrings ) ; myMacroNode->DataFlowNode( aDataFlowNode ) ; aDataFlowNode->ComputingNode()->SetService( *aMacroNodeService ) ; aDataFlowNode->SetObjRef( SUPERV::CNode::_duplicate( SUPERV::CNode::_narrow( obj ) ) ) ; aDataFlowNode->SetObjImpl( this ) ; - - -// GraphBase::Graph * aGraph = myMacroGraph->DataFlowEditor()->Graph() ; - GraphBase::Graph * aGraph = DataFlowEditor()->Automaton()->MapGraph( myMacroGraph->Name() ) ; +// GraphBase::Graph * aGraph = DataFlowEditor()->Automaton()->MapGraph( myMacroGraph->Name() ) ; + GraphBase::Graph * aGraph ; + //DataFlowEditor()->Automaton()->GraphBase( &aGraph ) ; + myMacroGraph->Coupled() ; GraphBase::Graph * aGraphOfMacroGraph = myMacroNode->DataFlowEditor()->Graph() ; GraphBase::Graph * aMacroGraph = myMacroNode->DataFlowNode()->GraphMacroNode() ; aMacroGraph->Kind( SUPERV::MacroNode ) ; - aMacroGraph->SetGraphEditor( DataFlowEditor() ) ; + aMacroGraph->GraphEditor( DataFlowEditor() ) ; // Creation of the Ports of the MacroNode from the ports of the GraphMacroNode aMacroGraph->SetMacroPorts( aGraph ) ; // Valid ==> creation of Service and the ports of the current Graph @@ -971,6 +1011,7 @@ SUPERV::Graph_ptr Graph_Impl::GraphMNode( SUPERV::Graph_ptr myMacroGraph ) { aGraph->CoupledNode( aMacroGraph ) ; aGraph->MacroObject( SUPERV::Graph::_duplicate( macroiobject ) ) ; // Set the GraphMacroNode ObjRef in the MacroNode + aDataFlowNode->GraphMacroNode()->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ; aMacroGraph->CoupledNode( aGraph ) ; aMacroGraph->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; // aDataFlowNode->CoupledNode( aGraph ) ; @@ -979,7 +1020,8 @@ SUPERV::Graph_ptr Graph_Impl::GraphMNode( SUPERV::Graph_ptr myMacroGraph ) { aGraph->GraphMacroLevel( aGraphOfMacroGraph->GraphMacroLevel() + 1 ) ; aMacroGraph->Coordinates( 0 , 0 ) ; MESSAGE( aGraph->Name() << "->CoupledNode()->GraphEditor() : " << aGraph->CoupledNode()->GraphEditor() ) ; - MESSAGE( aMacroGraph->Name() << "->CoupledNode()->GraphEditor() : " << aMacroGraph->CoupledNode()->GraphEditor() ) ; + MESSAGE( aMacroGraph->Name() << "->CoupledNode()->GraphEditor() : " + << aMacroGraph->CoupledNode()->GraphEditor() ) ; MESSAGE( "DataFlowNode Graph " << this << " DataFlowEditor " << DataFlowEditor() << " aDataFlowNode " << aDataFlowNode << " " << aDataFlowNode->Name() << " created" ) ; } @@ -1051,40 +1093,55 @@ SUPERV::CNode_ptr Graph_Impl::Node(char const * aNodeName ) { SUPERV::Link_ptr Graph_Impl::Link( SUPERV::Port_ptr OutPort , SUPERV::Port_ptr InPort ) { - beginService( "Graph_Impl::Link" ); +// beginService( "Graph_Impl::Link" ); SUPERV::Link_var iobject = SUPERV::Link::_nil() ; if ( DataFlowEditor()->IsEditing() && !DataFlowEditor()->IsReadOnly() && !OutPort->IsDataStream() && !InPort->IsDataStream() && !IsMacro() ) { - GraphBase::InPort * anInPort = DataFlowEditor()->GetNode( InPort->Node()->Name() )->ComputingNode()->GetChangeInPort( InPort->Name() ) ; - GraphBase::OutPort * anOutPort = DataFlowEditor()->GetNode( OutPort->Node()->Name() )->ComputingNode()->GetChangeOutPort( OutPort->Name() ) ; - if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) { - const char * DataFlowOutNodeName = OutPort->Node()->Name() ; - GraphEditor::InNode * DataFlowOutNode = DataFlowEditor()->GetNode( DataFlowOutNodeName ) ; - const char * DataFlowInNodeName = InPort->Node()->Name() ; - GraphEditor::InNode * DataFlowInNode = DataFlowEditor()->GetNode( DataFlowInNodeName ) ; - if ( DataFlowOutNode && DataFlowInNode ) { - bool Success ; - Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId , - instanceName() , interfaceName() , - DataFlowEditor() , - DataFlowInNode , - InPort->Name() , - DataFlowOutNode , - OutPort->Name() , - true , false , Success ) ; - if ( Success ) { - PortableServer::ObjectId * id = myLink->getId() ; - CORBA::Object_var obj = _poa->id_to_reference(*id); - iobject = SUPERV::Link::_narrow(obj) ; - anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ; - } - } + MESSAGE( "Graph_Impl::Link( " << OutPort->Node()->Name() << "( " << OutPort->Name() << " ) --> " + << InPort->Node()->Name() << "( " << InPort->Name() << " )" ) ; + GraphEditor::InNode * anInNode = DataFlowEditor()->GetNode( InPort->Node()->Name() ) ; + GraphEditor::InNode * anOutNode = DataFlowEditor()->GetNode( OutPort->Node()->Name() ) ; + if ( anInNode == NULL || anOutNode== NULL ) { + MESSAGE( "Graph_Impl::Link( " << OutPort->Node()->Name() << " " << anOutNode << " , " + << InPort->Node()->Name() << " " << anInNode << " ) Node(s) not found in " << Name() ) ; } else { - iobject = anOutPort->InPortObjRef( anInPort ) ; + GraphBase::InPort * anInPort = anInNode->ComputingNode()->GetChangeInPort( InPort->Name() ) ; + GraphBase::OutPort * anOutPort = anOutNode->ComputingNode()->GetChangeOutPort( OutPort->Name() ) ; + if ( anInPort == NULL || anOutPort== NULL ) { + MESSAGE( "Graph_Impl::Link( " << OutPort->Name() << " " << anOutPort << " , " + << InPort->Name() << " " << anInPort << " ) Port(s) not found" ) ; + } + else if ( CORBA::is_nil( anOutPort->InPortObjRef( anInPort ) ) ) { + const char * DataFlowOutNodeName = OutPort->Node()->Name() ; + GraphEditor::InNode * DataFlowOutNode = DataFlowEditor()->GetNode( DataFlowOutNodeName ) ; + const char * DataFlowInNodeName = InPort->Node()->Name() ; + GraphEditor::InNode * DataFlowInNode = DataFlowEditor()->GetNode( DataFlowInNodeName ) ; + if ( DataFlowOutNode && DataFlowInNode ) { + bool Success ; + Link_Impl * myLink = new Link_Impl( _Orb , _Poa , _ContId , + instanceName() , interfaceName() , + DataFlowEditor() , + DataFlowInNode , + InPort->Name() , + DataFlowOutNode , + OutPort->Name() , + true , false , Success ) ; + if ( Success ) { + PortableServer::ObjectId * id = myLink->getId() ; + CORBA::Object_var obj = _poa->id_to_reference(*id); + iobject = SUPERV::Link::_narrow(obj) ; + anOutPort->AddInPortObjRef( anInPort , SUPERV::Link::_duplicate( iobject ) ) ; + } + } + } + else { + iobject = anOutPort->InPortObjRef( anInPort ) ; + } } } - endService( "Graph_Impl::Link" ); + DataFlowEditor()->UnValid() ; +// endService( "Graph_Impl::Link" ); return SUPERV::Link::_duplicate( iobject ) ; } @@ -1455,8 +1512,9 @@ SUPERV::ListOfLinks * Graph_Impl::Links( GraphBase::ComputingNode * theNode , GraphBase::InPort * anInPort = anOutPort->ChangeInPorts( k ) ; // MESSAGE( " --> In" << k << " " << anInPort->NodeName() << " " << anInPort->PortName() // << " " << anInPort->PortStatus() ) ; - if ( !anInPort->IsExternConnected() ) { - GraphEditor::InNode * toNode = (GraphEditor::InNode * ) DataFlowEditor()->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ; + if ( anInPort->IsPortConnected() ) { + GraphBase::ComputingNode * aComputingNode = DataFlowEditor()->Graph()->GetChangeGraphNode( anInPort->NodeName() ) ; + GraphEditor::InNode * toNode = (GraphEditor::InNode * ) aComputingNode->GetInNode() ; if ( theNode == NULL || !strcmp( theNode->Name() , aNode->Name() ) ) { if ( !anInPort->IsDataStream() ) { @@ -1570,22 +1628,27 @@ bool Graph_Impl::IsExecutable() { } bool Graph_Impl::IsEditing() { -// beginService( "Graph_Impl::IsEditing" ); +/* bool RetVal = false ; if ( !IsMacro() ) { RetVal = DataFlowEditor()->IsEditing() ; } -// endService( "Graph_Impl::IsEditing" ); return RetVal ; +*/ + if ( IsMacro() ) + return false; + return !IsExecuting(); } + bool Graph_Impl::IsExecuting() { -// beginService( "Graph_Impl::IsExecuting" ); +/* bool RetVal = false ; if ( !IsMacro() ) { RetVal = !DataFlowEditor()->IsEditing() ; } -// endService( "Graph_Impl::IsExecuting" ); return RetVal ; +*/ + return CNode_Impl::IsExecuting(); } bool Graph_Impl::IsReadOnly() { @@ -1674,40 +1737,24 @@ bool Graph_Impl::Begin() { DataFlowExecutor()->JoinedWait() ; } delete DataFlowExecutor() ; - DataFlowExecutor( NULL ) ; DataFlowEditor()->Executor( NULL ) ; } if ( DataFlowEditor()->IsExecutable() ) { DataFlowEditor()->EditedAfterExecution( false ) ; - int _ExecNumber = theAutomaton->ExecNumber() ; - char ExecNumber[30] ; - sprintf( ExecNumber , "_%d" , _ExecNumber ) ; - int len = strlen( _DebugFileName ) ; - char * DebugFileName = new char [ len + strlen( ExecNumber ) + 6 ] ; - strncpy( DebugFileName , _DebugFileName , len - 4 ) ; - DebugFileName[ len - 4 ] = '\0' ; - strcat( DebugFileName , ExecNumber ) ; - strcat( DebugFileName , "_Exec.log" ) ; - GraphExecutor::DataFlow * aDataFlowExecutor ; GraphBase::ListOfSGraphs * myListOfGraphs = DataFlowEditor()->GetDataFlows() ; - int i ; - for ( i = 0 ; i < (int ) myListOfGraphs->size() ; i++ ) { - GraphEditor::DataFlow * aDataFlowEditor ; - aDataFlowEditor = theAutomaton->MapGraph( (*myListOfGraphs)[ i ].Info.theName.c_str() )->GraphEditor() ; - MESSAGE("myListOfGraphs" << i << " " << (*myListOfGraphs)[ i ].Info.theName.c_str() << " " - << aDataFlowEditor << " IsEditing " << aDataFlowEditor->IsEditing() ) ; - - } - aDataFlowExecutor = new GraphExecutor::DataFlow( _Orb , _NamingService , - (*myListOfGraphs)[ 0 ].Info.theName.c_str() , - DebugFileName , Kind() ) ; - DataFlowExecutor( aDataFlowExecutor ) ; + + GraphExecutor::DataFlow * aDataFlowExecutor ; + string dbgfile ; + CreateExecutor( _Orb , instanceName() , (*myListOfGraphs)[ 0 ].Info.theName.c_str() , Kind() , + dbgfile , &aDataFlowExecutor ) ; + MESSAGE( "Graph_Impl::Begin : DataFlowExecutor created" ); - RetVal = LoadDataFlows( DataFlowExecutor() , myListOfGraphs , 0 ) ; - if ( RetVal ) { + if ( !CORBA::is_nil( LoadDataFlows( aDataFlowExecutor, myListOfGraphs , 0 ) ) ) + RetVal = true ; + + if ( RetVal ) DataFlowExecutor()->Graph()->SetObjImpl( DataFlowEditor()->Graph()->ObjImpl() ) ; - DataFlowEditor()->Executor( DataFlowExecutor() ) ; - } + } if ( pthread_mutex_unlock( &_MutexExecutorWait ) ) { perror("pthread_mutex_unlock _MutexExecutorWait") ; @@ -1743,6 +1790,7 @@ bool Graph_Impl::Run() { DataFlowEditor()->Executing() ; RetVal = CNode_Impl::ReRun() ; } + MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " RetVal " << RetVal ) ; endService( "Graph_Impl::Run" ); return RetVal ; } @@ -1758,10 +1806,10 @@ bool Graph_Impl::Start() { RetVal = true ; } if ( RetVal ) { - MESSAGE( "Graph_Impl::(Re)Start " ); // Added by NKV to fix PAL6222 --> to be confirm by JR DataFlowEditor()->Executing() ; // End of NKV's correction + MESSAGE( "Graph_Impl::(Re)Start " ); RetVal = ReStart() ; } } diff --git a/src/Supervision/Graph_Impl.hxx b/src/Supervision/Graph_Impl.hxx index 66c29ba..5f1d8c0 100644 --- a/src/Supervision/Graph_Impl.hxx +++ b/src/Supervision/Graph_Impl.hxx @@ -80,13 +80,6 @@ class Graph_Impl : public POA_SUPERV::Graph , const char *interfaceName , GraphEditor::DataFlow * DataFlowEditor , GraphEditor::InNode * DataFlowNode ) ; - Graph_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * DataFlowExecutor , - GraphExecutor::InNode * DataFlowExecutorNode ) ; virtual SUPERV::Graph_ptr Copy() ; virtual ~Graph_Impl() ; @@ -140,16 +133,16 @@ class Graph_Impl : public POA_SUPERV::Graph , const SUPERV::ListOfStrings & PythonFunction , SUPERV::INode_out anEndOfSwitch ) ; - bool LoadDataFlows( GraphEditor::DataFlow * aDataFlowEditor , - GraphBase::ListOfSGraphs * aListOfDataFlows , - int index ) ; - bool LoadDataFlows( GraphExecutor::DataFlow * aDataFlowExecutor , - GraphBase::ListOfSGraphs * aListOfDataFlows , - int index ) ; + SUPERV::Graph_var LoadDataFlows( GraphEditor::DataFlow * aDataFlowEditor , + GraphBase::ListOfSGraphs * aListOfDataFlows , + int index ) ; + SUPERV::Graph_var LoadDataFlows( GraphExecutor::DataFlow * aDataFlowExecutor , + GraphBase::ListOfSGraphs * aListOfDataFlows , + int index ) ; virtual SUPERV::Graph_ptr MNode( const char * aXmlFileName ) ; virtual SUPERV::Graph_ptr MNode( GraphEditor::DataFlow * aDataFlowEditor , - GraphBase::ListOfSGraphs aListOfDataFlows ) ; + GraphBase::ListOfSGraphs * aListOfDataFlows ) ; virtual SUPERV::Graph_ptr GraphMNode( SUPERV::Graph_ptr aGraph ) ; diff --git a/src/Supervision/INode_Impl.cxx b/src/Supervision/INode_Impl.cxx index a17f538..64a355c 100644 --- a/src/Supervision/INode_Impl.cxx +++ b/src/Supervision/INode_Impl.cxx @@ -123,31 +123,6 @@ INode_Impl::INode_Impl( CORBA::ORB_ptr orb , // endService( "INode_Impl::INode_Impl" ); } -INode_Impl::INode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * aDataFlowExecutor , - GraphExecutor::InNode * aDataFlowExecutorNode ) : -// Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, false) { - CNode_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowExecutor , aDataFlowExecutorNode ) { -// beginService( "INode_Impl::INode_Impl" ); - if ( DataFlowExecutorNode() && DataFlowExecutorNode()->IsInLineNode() ) { -// MESSAGE( "INode_Impl::INode_Impl " << DataFlowExecutorNode()->Name() -// << " _poa->activate_object" ); - _thisObj = this ; - _id = _poa->activate_object(_thisObj); - } - else { -// MESSAGE( "INode_Impl::INode_Impl NO _poa->activate_object" ); - } - _Orb = CORBA::ORB::_duplicate(orb); - _Poa = poa ; - _ContId = contId ; -// endService( "INode_Impl::INode_Impl" ); -} - INode_Impl::~INode_Impl() { beginService( "INode_Impl::~INode_Impl" ); endService( "INode_Impl::~INode_Impl" ); diff --git a/src/Supervision/INode_Impl.hxx b/src/Supervision/INode_Impl.hxx index f0324d4..13000bf 100644 --- a/src/Supervision/INode_Impl.hxx +++ b/src/Supervision/INode_Impl.hxx @@ -69,13 +69,6 @@ class INode_Impl : public CNode_Impl , const char *interfaceName , GraphEditor::DataFlow * DataFlowEditor , GraphEditor::InNode * DataFlowNode ) ; - INode_Impl( CORBA::ORB_ptr orb , - PortableServer::POA_ptr poa , - PortableServer::ObjectId * contId , - const char *instanceName , - const char *interfaceName , - GraphExecutor::DataFlow * DataFlowExecutor , - GraphExecutor::InNode * DataFlowExecutorNode ) ; virtual ~INode_Impl() ; virtual void destroy() ; virtual bool Delete() ; diff --git a/src/Supervision/Makefile.in b/src/Supervision/Makefile.in index cd9aed0..60bce4d 100755 --- a/src/Supervision/Makefile.in +++ b/src/Supervision/Makefile.in @@ -87,7 +87,7 @@ BIN_SERVER_IDL = CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) \ -I${KERNEL_ROOT_DIR}/include/salome -CXXFLAGS += -g -D_DEBUG_ -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ +CXXFLAGS += -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome LDFLAGS+= -lSalomeSuperVisionEditor -lSalomeSuperVisionExecutor -lSalomeSuperVisionBase \ -lSalomeContainer -lSalomeNotification -lSalomeNS -lSalomeLifeCycleCORBA \ diff --git a/src/Supervision/Port_Impl.cxx b/src/Supervision/Port_Impl.cxx index 3593476..55a69f5 100644 --- a/src/Supervision/Port_Impl.cxx +++ b/src/Supervision/Port_Impl.cxx @@ -175,9 +175,12 @@ bool Port_Impl::Input( const CORBA::Any * anAny ) { } else if ( _DataFlowEditor->IsExecuting() ) { GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ; -// if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() || -// _DataFlowExecutor->IsSuspended( _DataFlowNode->Name() ) ) ) { - if ( _DataFlowExecutor ) { + + // asv: turn off Editor::_Executing flag + if ( _DataFlowExecutor->IsDone() ) { + _DataFlowEditor->Executing( false ); + } + else { RetVal = _DataFlowExecutor->ChangeInputData( _DataFlowNode->Name() , _DataFlowPort->PortName() , *anAny ) ; @@ -335,8 +338,8 @@ SUPERV::CNode_ptr Port_Impl::Node() { SUPERV::ListOfLinks * Port_Impl::Links() { beginService( "Port_Impl::Links" ) ; SUPERV::ListOfLinks_var RetVal = new SUPERV::ListOfLinks ; - RetVal = _DataFlowEditor->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , - _DataFlowPort->PortName() ) ; + RetVal = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() , + _DataFlowPort->PortName()*/ ) ; MESSAGE( "Links of Node " << _DataFlowNode->ComputingNode()->Name() << " and of Port " << _DataFlowPort->PortName() << " _InputPort " << _InputPort ) ; @@ -360,8 +363,8 @@ SUPERV::Link_ptr Port_Impl::Link() { SUPERV::ListOfLinks_var Links = new SUPERV::ListOfLinks ; // cout << "Port_Impl::Link " << _DataFlowNode->Name() << " " // << _DataFlowPort->PortName() << endl ; - Links = _DataFlowEditor->Graph()->ObjImpl()->Links( _DataFlowNode->ComputingNode() , - _DataFlowPort->PortName() ) ; + Links = _DataFlowEditor->Graph()->ObjImpl()->Links( /*_DataFlowNode->ComputingNode() , + _DataFlowPort->PortName()*/ ) ; if ( Links->length() ) { iobject = Links[ 0 ] ; } diff --git a/src/Supervision/SuperV_Impl.cxx b/src/Supervision/SuperV_Impl.cxx index f64b10f..b5bf8f3 100644 --- a/src/Supervision/SuperV_Impl.cxx +++ b/src/Supervision/SuperV_Impl.cxx @@ -100,7 +100,7 @@ SALOMEDS::TMPFile* SuperV_Impl::Save(SALOMEDS::SComponent_ptr theComponent, SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; TCollection_AsciiString myStudyName(""); - if (isMultiFile) myStudyName = strdup(SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL())); + if (isMultiFile) myStudyName = (char*)SALOMEDS_Tool::GetNameFromPath(theComponent->GetStudy()->URL()).c_str(); SALOMEDS::ChildIterator_var anIter = theComponent->GetStudy()->NewChildIterator(theComponent); TColStd_SequenceOfAsciiString aFileNames; @@ -120,7 +120,7 @@ SALOMEDS::TMPFile* SuperV_Impl::Save(SALOMEDS::SComponent_ptr theComponent, CORBA::Object_var anObj = _orb->string_to_object(SALOMEDS::AttributeIOR::_narrow(anAttr)->Value()) ; SUPERV::Graph_var graph = SUPERV::Graph::_narrow(anObj); if (aTmpDir.Length() == 0) - aTmpDir = (isMultiFile)?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir(); + aTmpDir = (isMultiFile)?TCollection_AsciiString((char*)theURL):(char*)SALOMEDS_Tool::GetTmpDir().c_str(); graph->Export((aTmpDir + aName).ToCString()); } } @@ -167,7 +167,7 @@ CORBA::Boolean SuperV_Impl::Load(SALOMEDS::SComponent_ptr theComponent, // MESSAGE("SuperV_Impl::Load : IOR = " << IORSComponent << " , Url = " << aUrlOfFile); // Get a temporary directory for a file if (theStream.length() != 0) { - TCollection_AsciiString aTmpDir = (isMultiFile)?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir = (isMultiFile)?TCollection_AsciiString((char*)theURL):(char*)SALOMEDS_Tool::GetTmpDir().c_str(); myStrURL = strdup(aTmpDir.ToCString()); SALOMEDS_Tool::PutStreamToFiles(theStream, myStrURL, isMultiFile); } @@ -237,7 +237,7 @@ char* SuperV_Impl::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject, if (strcmp(aFatherID, aComponentID)) return CORBA::string_dup(aLocalPersistentID); string myStudyName(""); - if (isMultiFile) myStudyName = strdup(SALOMEDS_Tool::GetNameFromPath(theSObject->GetStudy()->URL())); + if (isMultiFile) myStudyName = SALOMEDS_Tool::GetNameFromPath(theSObject->GetStudy()->URL()); string aStr(myStrURL); aStr += myStudyName + string(aLocalPersistentID); @@ -478,7 +478,7 @@ SALOMEDS::TMPFile* SuperV_Impl::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA: } // Get a temporary directory to store a temporary file - CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir(); + CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir().c_str(); // Create a list to store names of created files SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; aSeq->length(1); @@ -528,7 +528,7 @@ SALOMEDS::SObject_ptr SuperV_Impl::PasteInto(const SALOMEDS::TMPFile& theStream, return aResultSO._retn(); } - TCollection_AsciiString aTmpDir = SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir = (char*)SALOMEDS_Tool::GetTmpDir().c_str(); SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(), false); TCollection_AsciiString aFullName; aFullName = aTmpDir+aSeq[0]; diff --git a/src/Supervision/Value_Impl.cxx b/src/Supervision/Value_Impl.cxx index 28ea393..d721730 100644 --- a/src/Supervision/Value_Impl.cxx +++ b/src/Supervision/Value_Impl.cxx @@ -37,6 +37,8 @@ using namespace std; #include "Value_Impl.hxx" +#include "DataFlowExecutor_DataFlow.hxx" + Value_Impl::Value_Impl( CORBA::ORB_ptr orb , PortableServer::POA_ptr poa , PortableServer::ObjectId * contId , diff --git a/src/Supervision/batchmode_SuperV.py b/src/Supervision/batchmode_SuperV.py index 81c7577..e341afb 100644 --- a/src/Supervision/batchmode_SuperV.py +++ b/src/Supervision/batchmode_SuperV.py @@ -28,7 +28,9 @@ except : # except : # SuperV_Swig = None orb = CORBA.ORB_init([''], CORBA.ORB_ID) - lcc = LifeCycleCORBA(orb) + while lcc._catalog == None: + lcc = LifeCycleCORBA(orb) + #lcc = LifeCycleCORBA(orb) naming_service = SALOME_NamingServicePy_i(orb) import re @@ -46,8 +48,9 @@ import SALOMEDS_Attributes_idl SuperVision = lcc.FindOrLoadComponent("SuperVisionContainer","SUPERV") SuperVision.Swig = 0 - -modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog") +modulecatalog = None +while modulecatalog == None: + modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog") myBuilder = myStudy.NewBuilder() father = myStudy.FindComponent("SUPERV") @@ -401,8 +404,6 @@ class CNode: return self.N.Control() def ControlClear( self ): return self.N.ControlClear() - def AutoState( self ): - return self.N.AutoState() def ReadyW( self ): return self.N.ReadyW() def RunningW( self ): @@ -832,7 +833,7 @@ class Graph(INode): def ThreadsMax( self ): return self.G.ThreadsMax() def GraphsNumber( self ): - return self.G.GraphsNumber() + return self.G.SubGraphsNumber() def LevelNodes( self , aLevel ): nodes = self.G.LevelNodes( aLevel ) return self.nodesTuple( nodes ) @@ -972,7 +973,7 @@ class Graph(INode): nodes = self.Nodes() i = 0 while i < len( nodes ) : - print nodes[i].Name(),nodes[i].Thread(),nodes[i].State(),nodes[i].Control(),nodes[i].AutoState() + print nodes[i].Name(),nodes[i].Thread(),nodes[i].State(),nodes[i].Control() i = i + 1 def GLinks( self ): links = self.G.GLinks() -- 2.39.2