From: admin Date: Wed, 1 Dec 2004 10:53:01 +0000 (+0000) Subject: Merge with version on tag OCC-V2_1_0d X-Git-Tag: V2_1_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4b2f8f88a294e451364a8b84d170a59dcbb5d3f;p=modules%2Fsuperv.git Merge with version on tag OCC-V2_1_0d --- 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..0553d96 100644 --- a/examples/GeomGraph.py +++ b/examples/GeomGraph.py @@ -1,106 +1,156 @@ -# Generated python file of Graph GeomGraph +# Generated python file of Graph aNewDataFlow_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 +def DefaNewDataFlow_1() : + aNewDataFlow_1 = Graph( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetName( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetAuthor( '' ) + aNewDataFlow_1.SetComment( '' ) + aNewDataFlow_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + SetStudyID = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) + SetStudyID.SetName( 'SetStudyID' ) + SetStudyID.SetAuthor( '' ) + SetStudyID.SetContainer( 'localhost/FactoryServer' ) + SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' ) + SetStudyID.Coords( 14 , 241 ) + ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' ) + ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' ) + OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' ) + + MakeBox = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' ) + MakeBox.SetName( 'MakeBox' ) + MakeBox.SetAuthor( '' ) + MakeBox.SetContainer( 'localhost/FactoryServer' ) + MakeBox.SetComment( 'MakeBox from GEOM_Superv' ) + MakeBox.Coords( 198 , 46 ) + IMakeBoxtheX1 = MakeBox.GetInPort( 'theX1' ) + IMakeBoxtheY1 = MakeBox.GetInPort( 'theY1' ) + IMakeBoxtheZ1 = MakeBox.GetInPort( 'theZ1' ) + IMakeBoxtheX2 = MakeBox.GetInPort( 'theX2' ) + IMakeBoxtheY2 = MakeBox.GetInPort( 'theY2' ) + IMakeBoxtheZ2 = MakeBox.GetInPort( 'theZ2' ) + IMakeBoxGate = MakeBox.GetInPort( 'Gate' ) + OMakeBoxreturn = MakeBox.GetOutPort( 'return' ) + OMakeBoxGate = MakeBox.GetOutPort( 'Gate' ) + + MakeCopy = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy.SetName( 'MakeCopy' ) + MakeCopy.SetAuthor( '' ) + MakeCopy.SetContainer( 'localhost/FactoryServer' ) + MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy.Coords( 383 , 46 ) + IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' ) + IMakeCopyGate = MakeCopy.GetInPort( 'Gate' ) + OMakeCopyreturn = MakeCopy.GetOutPort( 'return' ) + OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' ) + + TranslateDXDYDZ = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetAuthor( '' ) + TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' ) + TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' ) + TranslateDXDYDZ.Coords( 579 , 46 ) + ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' ) + ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' ) + ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' ) + ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' ) + ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' ) + OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' ) + OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' ) + + MakeCopy_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) + MakeCopy_1.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy_1.Coords( 384 , 168 ) + IMakeCopy_1theOriginal = MakeCopy_1.GetInPort( 'theOriginal' ) + IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' ) + OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' ) + OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) + + MakeSphere_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) + MakeSphere_1.SetName( 'MakeSphere_1' ) + MakeSphere_1.SetAuthor( '' ) + MakeSphere_1.SetContainer( 'localhost/FactoryServer' ) + MakeSphere_1.SetComment( 'MakeSphere from GEOM_Superv' ) + MakeSphere_1.Coords( 201 , 332 ) + IMakeSphere_1theX = MakeSphere_1.GetInPort( 'theX' ) + IMakeSphere_1theY = MakeSphere_1.GetInPort( 'theY' ) + IMakeSphere_1theZ = MakeSphere_1.GetInPort( 'theZ' ) + IMakeSphere_1theRadius = MakeSphere_1.GetInPort( 'theRadius' ) + IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' ) + OMakeSphere_1return = MakeSphere_1.GetOutPort( 'return' ) + OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) + + MakeFuse = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse.SetName( 'MakeFuse' ) + MakeFuse.SetAuthor( '' ) + MakeFuse.SetContainer( 'localhost/FactoryServer' ) + MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse.Coords( 790 , 148 ) + IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' ) + IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' ) + IMakeFuseGate = MakeFuse.GetInPort( 'Gate' ) + OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' ) + + MakeFuse_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse_1.SetName( 'MakeFuse_1' ) + MakeFuse_1.SetAuthor( '' ) + MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) + MakeFuse_1.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse_1.Coords( 993 , 312 ) + IMakeFuse_1theShape1 = MakeFuse_1.GetInPort( 'theShape1' ) + IMakeFuse_1theShape2 = MakeFuse_1.GetInPort( 'theShape2' ) + IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' ) + OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) + OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) + + # Creation of Links + LSetStudyIDGateMakeBoxGate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeBoxGate ) + + LSetStudyIDGateMakeSphere_1Gate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeSphere_1Gate ) + + LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopytheOriginal ) + + LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopy_1theOriginal ) + + LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow_1.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) + + LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow_1.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) + + LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow_1.Link( OMakeCopy_1return , IMakeFusetheShape2 ) + + LMakeSphere_1returnMakeFuse_1theShape2 = aNewDataFlow_1.Link( OMakeSphere_1return , IMakeFuse_1theShape2 ) + + LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow_1.Link( OMakeFusereturn , IMakeFuse_1theShape1 ) + + # Input datas + ISetStudyIDtheStudyID.Input( 1 ) + IMakeBoxtheX1.Input( 0 ) + IMakeBoxtheY1.Input( 0 ) + IMakeBoxtheZ1.Input( 0 ) + IMakeBoxtheX2.Input( 50 ) + IMakeBoxtheY2.Input( 50 ) + IMakeBoxtheZ2.Input( 50 ) + ITranslateDXDYDZtheDX.Input( 10 ) + ITranslateDXDYDZtheDY.Input( 10 ) + ITranslateDXDYDZtheDZ.Input( 10 ) + IMakeSphere_1theX.Input( 0 ) + IMakeSphere_1theY.Input( 0 ) + IMakeSphere_1theZ.Input( 0 ) + IMakeSphere_1theRadius.Input( 12 ) + + # Output Ports of the graph + #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) + return aNewDataFlow_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 = DefaNewDataFlow_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..663002d 100644 --- a/examples/GeomGraph.xml +++ b/examples/GeomGraph.xml @@ -1,651 +1,496 @@ - - - - - + + - - - ? - ? - 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 + 1 + ? + +aNewDataFlow_1 + + +long + SetStudyID__theStudyID + +double + MakeBox__theX1 + +double + MakeBox__theY1 + +double + MakeBox__theZ1 + +double + MakeBox__theX2 + +double + MakeBox__theY2 + +double + MakeBox__theZ2 + +double + TranslateDXDYDZ__theDX + +double + TranslateDXDYDZ__theDY + +double + TranslateDXDYDZ__theDZ + +double + MakeSphere_1__theX + +double + MakeSphere_1__theY + +double + MakeSphere_1__theZ + +double + MakeSphere_1__theRadius + + +GEOM_Object + MakeFuse_1__return + + + 29/10/2004 - 10:52:34 + 11/11/2004 - 11:41:31 + 2.0 + ? + ? + ? + 0 + 0 + + +GEOM_Superv + GEOM_Superv + SetStudyID + 0 + ? + +SetStudyID + + +long + theStudyID + + + + 11/11/2004 - 11:16:35 + 11/11/2004 - 11:16:35 + 2.0 + ? + localhost/FactoryServer + SetStudyID from GEOM_Superv + 14 + 241 + +GEOM_Superv + GEOM_Superv + MakeBox + 0 + ? + +MakeBox + + +double + theX1 + +double + theY1 + +double + theZ1 + +double + theX2 + +double + theY2 + +double + theZ2 + + +GEOM_Object + return + + + 11/11/2004 - 11:17:44 + 11/11/2004 - 11:17:44 + 2.0 + ? + localhost/FactoryServer + MakeBox from GEOM_Superv + 198 + 46 + +GEOM_Superv + GEOM_Superv + MakeCopy + 0 + ? + +MakeCopy + + +GEOM_Object + theOriginal + + +GEOM_Object + return + + + 11/11/2004 - 11:36:29 + 11/11/2004 - 11:36:29 + 2.0 + ? + localhost/FactoryServer + MakeCopy from GEOM_Superv + 383 + 46 + +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 + ? + +TranslateDXDYDZ + + +GEOM_Object + theObject + +double + theDX + +double + theDY + +double + theDZ + + +GEOM_Object + return + + + 11/11/2004 - 11:37:10 + 11/11/2004 - 11:37:10 + 2.0 + ? + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 579 + 46 + +GEOM_Superv + GEOM_Superv + MakeCopy_1 + 0 + ? + +MakeCopy + + +GEOM_Object + theOriginal + + +GEOM_Object + return + + + 11/11/2004 - 11:38:45 + 11/11/2004 - 11:38:45 + 2.0 + ? + localhost/FactoryServer + MakeCopy from GEOM_Superv + 384 + 168 + +GEOM_Superv + GEOM_Superv + MakeSphere_1 + 0 + ? + +MakeSphere + + +double + theX + +double + theY + +double + theZ + +double + theRadius + + +GEOM_Object + return + + + 11/11/2004 - 11:38:54 + 11/11/2004 - 11:38:54 + 2.0 + ? + localhost/FactoryServer + MakeSphere from GEOM_Superv + 201 + 332 + +GEOM_Superv + GEOM_Superv + MakeFuse + 0 + ? + +MakeFuse + + +GEOM_Object + theShape1 + +GEOM_Object + theShape2 + + +GEOM_Object + return + + + 11/11/2004 - 11:39:55 + 11/11/2004 - 11:39:55 + 2.0 + ? + localhost/FactoryServer + MakeFuse from GEOM_Superv + 790 + 148 + +GEOM_Superv + GEOM_Superv + MakeFuse_1 + 0 + ? + +MakeFuse + + +GEOM_Object + theShape1 + +GEOM_Object + theShape2 + + +GEOM_Object + return + + + 11/11/2004 - 11:40:15 + 11/11/2004 - 11:40:15 + 2.0 + ? + localhost/FactoryServer + MakeFuse from GEOM_Superv + 993 + 312 + + +SetStudyID + Gate + MakeBox + Gate + + +SetStudyID + Gate + MakeSphere_1 + Gate + + +MakeBox + return + MakeCopy + theOriginal + + +MakeBox + return + MakeCopy_1 + theOriginal + + +MakeCopy + return + TranslateDXDYDZ + theObject + + +TranslateDXDYDZ + return + MakeFuse + theShape1 + + +MakeCopy_1 + return + MakeFuse + theShape2 + + +MakeSphere_1 + return + MakeFuse_1 + theShape2 + + +MakeFuse + return + MakeFuse_1 + theShape1 + + + +aNewDataFlow_1 + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow_1 + MakeBox__theX1 + MakeBox + theX1 + +7 + 0 + + +aNewDataFlow_1 + MakeBox__theY1 + MakeBox + theY1 + +7 + 0 + + +aNewDataFlow_1 + MakeBox__theZ1 + MakeBox + theZ1 + +7 + 0 + + +aNewDataFlow_1 + MakeBox__theX2 + MakeBox + theX2 + +7 + 50 + + +aNewDataFlow_1 + MakeBox__theY2 + MakeBox + theY2 + +7 + 50 + + +aNewDataFlow_1 + MakeBox__theZ2 + MakeBox + theZ2 + +7 + 50 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX + +7 + 10 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY + +7 + 10 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ + +7 + 10 + + +aNewDataFlow_1 + MakeSphere_1__theX + MakeSphere_1 + theX + +7 + 0 + + +aNewDataFlow_1 + MakeSphere_1__theY + MakeSphere_1 + theY + +7 + 0 + + +aNewDataFlow_1 + MakeSphere_1__theZ + MakeSphere_1 + theZ + +7 + 0 + + +aNewDataFlow_1 + MakeSphere_1__theRadius + MakeSphere_1 + theRadius + +7 + 12 + 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/GeomGraph_py.py b/examples/GeomGraph_py.py new file mode 100644 index 0000000..163a2dd --- /dev/null +++ b/examples/GeomGraph_py.py @@ -0,0 +1,196 @@ + +# Generated python file of Graph aNewDataFlow_1_4_2_1_1_2_2_1_1 + +from SuperV import * + +# Graph creation of aNewDataFlow_1_4_2_1_1_2_2_1_1 +def DefaNewDataFlow_1_4_2_1_1_2_2_1_1() : + aNewDataFlow_1_4_2_1_1_2_2_1_1 = Graph( 'aNewDataFlow_1_4_2_1_1_2_2_1_1' ) + aNewDataFlow_1_4_2_1_1_2_2_1_1.SetName( 'aNewDataFlow_1_4_2_1_1_2_2_1_1' ) + aNewDataFlow_1_4_2_1_1_2_2_1_1.SetAuthor( '' ) + aNewDataFlow_1_4_2_1_1_2_2_1_1.SetComment( '' ) + aNewDataFlow_1_4_2_1_1_2_2_1_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_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_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_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_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=MakeSpherePntR(apoint,radius) ' ) + PyMakeSphere_1.append( ' return shape ' ) + MakeSphere_1 = aNewDataFlow_1_4_2_1_1_2_2_1_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_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_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_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_1.Link( OgagGate , IMakeBox1Gate ) + + LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1_1_2_2_1_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_1.Link( OMakeBox1shape , IMakeCopy_1shape1 ) + + LMakeBox1shapeMakeCopy_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1_1.Link( OMakeBox1shape , IMakeCopy_2shape1 ) + LMakeBox1shapeMakeCopy_2shape1.AddCoord( 1 , 384 , 207 ) + + LMakeCopy_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 ) + + LMakeCopy_2shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1_1_2_2_1_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_1.Link( OMakeSphere_1shape , IMakeFuse_2shape2 ) + + LMakeTranslation_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 ) + + LMakeFuse_1shapeMakeFuse_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1_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_1 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 = DefaNewDataFlow_1_4_2_1_1_2_2_1_1() diff --git a/examples/GeomGraph_py.xml b/examples/GeomGraph_py.xml new file mode 100644 index 0000000..d6ea4e9 --- /dev/null +++ b/examples/GeomGraph_py.xml @@ -0,0 +1,550 @@ + + + + + +? + ? + aNewDataFlow_1_4_2_1_1_2_2_1_1 + 1 + ? + +aNewDataFlow_1_4_2_1_1_2_2_1_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 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeBox1 + 3 + ? + +MakeBox1 + + +double + x1 + +double + y1 + +double + z1 + +double + x2 + +double + y2 + +double + z2 + + +objref + shape + + + +MakeBox1 + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 194 + 3 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 389 + 3 + +? + ? + MakeCopy_2 + 3 + ? + +MakeCopy_2 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_2 + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 389 + 136 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 203 + 315 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 596 + 3 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 2.0 + ? + ? + Compute Node + 823 + 116 + +? + ? + MakeFuse_2 + 3 + ? + +MakeFuse_2 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_2 + + + + + + + + + + + + 29/10/2004 - 10:50:25 + 29/10/2004 - 10:50:25 + 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_1 + MakeBox1__x1 + MakeBox1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeBox1__y1 + MakeBox1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeBox1__z1 + MakeBox1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeBox1__x2 + MakeBox1 + x2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeBox1__y2 + MakeBox1 + y2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeBox1__z2 + MakeBox1 + z2 + +7 + 50 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeSphere_1__radius + MakeSphere_1 + radius + +7 + 12 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + +7 + 25 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeTranslation_1__y1 + MakeTranslation_1 + y1 + +7 + 25 + + +aNewDataFlow_1_4_2_1_1_2_2_1_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + +7 + 25 + diff --git a/examples/GraphCpuUsed.py b/examples/GraphCpuUsed.py index 15906f1..1fc954a 100755 --- a/examples/GraphCpuUsed.py +++ b/examples/GraphCpuUsed.py @@ -134,6 +134,7 @@ CompareResult = Compare.Port( 'Result' ) GraphCpuUsed.Run() GraphCpuUsed.DoneW() +print GraphCpuUsed.State() GraphCpuUsed.PrintPorts() print "sigma",sigma.CpuUsed(),"seconds" print "Sigma",Sigma.CpuUsed(),"seconds" diff --git a/examples/GraphEssai3.py b/examples/GraphEssai3.py index 945840e..325ee69 100644 --- a/examples/GraphEssai3.py +++ b/examples/GraphEssai3.py @@ -62,7 +62,9 @@ AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( AddAndCompare_ServiceoutParameter = [] AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) ) AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) ) -AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , 0 ) +AddAndCompare_ServiceinStreamParameter = [] +AddAndCompare_ServiceoutStreamParameter = [] +AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 ) AddAndCompare = GraphEssai3.CNode( AddAndCompare_Service ) AddAndCompare.SetName( 'AddAndCompare' ) AddAndCompare.SetAuthor( '' ) @@ -117,7 +119,7 @@ GraphEssai3.Run() GraphEssai3.DoneW() -GraphEssai3.State() +print GraphEssai3.State() GraphEssai3.PrintPorts() diff --git a/examples/GraphExample.py b/examples/GraphExample.py index 7329474..672e9dc 100644 --- a/examples/GraphExample.py +++ b/examples/GraphExample.py @@ -13,7 +13,6 @@ from SuperV import * myGraph = Graph( "myDataFlow" ) -print myGraph.SetContainer('FactoryServer') Add = myGraph.Node( "AddComponent" , "AddInterface" , "Add" ) print Add.SetContainer('dm2s0017') diff --git a/examples/GraphGeomEssai.py b/examples/GraphGeomEssai.py new file mode 100644 index 0000000..cd59a99 --- /dev/null +++ b/examples/GraphGeomEssai.py @@ -0,0 +1,116 @@ + +# Generated python file of Graph aNewDataFlow + +from SuperV import * + +# Graph creation of aNewDataFlow +def DefaNewDataFlow() : + aNewDataFlow = Graph( 'aNewDataFlow' ) + aNewDataFlow.SetName( 'aNewDataFlow' ) + aNewDataFlow.SetAuthor( '' ) + aNewDataFlow.SetComment( '' ) + aNewDataFlow.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + SetStudyID = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) + SetStudyID.SetName( 'SetStudyID' ) + SetStudyID.SetAuthor( '' ) + SetStudyID.SetContainer( 'localhost/FactoryServer' ) + SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' ) + SetStudyID.Coords( 13 , 109 ) + ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' ) + ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' ) + OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' ) + + MakeSphere = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) + MakeSphere.SetName( 'MakeSphere' ) + MakeSphere.SetAuthor( '' ) + MakeSphere.SetContainer( 'localhost/FactoryServer' ) + MakeSphere.SetComment( 'MakeSphere from GEOM_Superv' ) + MakeSphere.Coords( 210 , 49 ) + IMakeSpheretheX = MakeSphere.GetInPort( 'theX' ) + IMakeSpheretheY = MakeSphere.GetInPort( 'theY' ) + IMakeSpheretheZ = MakeSphere.GetInPort( 'theZ' ) + IMakeSpheretheRadius = MakeSphere.GetInPort( 'theRadius' ) + IMakeSphereGate = MakeSphere.GetInPort( 'Gate' ) + OMakeSpherereturn = MakeSphere.GetOutPort( 'return' ) + OMakeSphereGate = MakeSphere.GetOutPort( 'Gate' ) + + MakeCopy = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy.SetName( 'MakeCopy' ) + MakeCopy.SetAuthor( '' ) + MakeCopy.SetContainer( 'localhost/FactoryServer' ) + MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy.Coords( 412 , 12 ) + IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' ) + IMakeCopyGate = MakeCopy.GetInPort( 'Gate' ) + OMakeCopyreturn = MakeCopy.GetOutPort( 'return' ) + OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' ) + + MakeCopy_1 = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) + MakeCopy_1.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy_1.Coords( 414 , 183 ) + IMakeCopy_1theOriginal = MakeCopy_1.GetInPort( 'theOriginal' ) + IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' ) + OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' ) + OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) + + TranslateDXDYDZ = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetAuthor( '' ) + TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' ) + TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' ) + TranslateDXDYDZ.Coords( 606 , 12 ) + ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' ) + ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' ) + ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' ) + ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' ) + ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' ) + OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' ) + OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' ) + + MakeFuse = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse.SetName( 'MakeFuse' ) + MakeFuse.SetAuthor( '' ) + MakeFuse.SetContainer( 'localhost/FactoryServer' ) + MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse.Coords( 801 , 163 ) + IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' ) + IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' ) + IMakeFuseGate = MakeFuse.GetInPort( 'Gate' ) + OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' ) + + # Creation of Links + LSetStudyIDGateMakeSphereGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeSphereGate ) + + LMakeSpherereturnMakeCopytheOriginal = aNewDataFlow.Link( OMakeSpherereturn , IMakeCopytheOriginal ) + + LMakeSpherereturnMakeCopy_1theOriginal = aNewDataFlow.Link( OMakeSpherereturn , IMakeCopy_1theOriginal ) + + LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) + + LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow.Link( OMakeCopy_1return , IMakeFusetheShape2 ) + + LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) + + # Input datas + ISetStudyIDtheStudyID.Input( 1 ) + IMakeSpheretheX.Input( 0 ) + IMakeSpheretheY.Input( 0 ) + IMakeSpheretheZ.Input( 0 ) + IMakeSpheretheRadius.Input( 20 ) + ITranslateDXDYDZtheDX.Input( 10 ) + ITranslateDXDYDZtheDY.Input( 10 ) + ITranslateDXDYDZtheDZ.Input( 10 ) + + # Output Ports of the graph + #OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + return aNewDataFlow + + +aNewDataFlow = DefaNewDataFlow() diff --git a/examples/GraphGeomEssai.xml b/examples/GraphGeomEssai.xml index 766f59c..029943e 100644 --- a/examples/GraphGeomEssai.xml +++ b/examples/GraphGeomEssai.xml @@ -1,318 +1,336 @@ - + + ? - ? - GraphGeomEssai - 1 - ? - -GraphGeomEssai - + ? + aNewDataFlow + 1 + ? + +aNewDataFlow + +long + SetStudyID__theStudyID + double - MakeSphere\x1 - + MakeSphere__theX + double - MakeSphere\y1 - + MakeSphere__theY + double - MakeSphere\z1 - + MakeSphere__theZ + double - MakeSphere\radius - + MakeSphere__theRadius + double - MakeTranslation\x1 - + TranslateDXDYDZ__theDX + double - MakeTranslation\y1 - + TranslateDXDYDZ__theDY + double - MakeTranslation\z1 - + TranslateDXDYDZ__theDZ + -GEOM_Shape - MakeFuse\shape - - - 10/7/2002 - 14:53:2 - 24/9/2003 - 16:13:48 - 1.03 - ? - ? - ? - 0 - 0 - +GEOM_Object + MakeFuse__return + + + 29/10/2004 - 11:8:11 + 11/11/2004 - 12:53:24 + 2.0 + ? + ? + ? + 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_Superv + GEOM_Superv + SetStudyID + 0 + ? + +SetStudyID + -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 - ? - +long + theStudyID + + + + 11/11/2004 - 12:50:30 + 11/11/2004 - 12:50:30 + 2.0 + ? + localhost/FactoryServer + SetStudyID from GEOM_Superv + 13 + 109 + +GEOM_Superv + GEOM_Superv + MakeSphere + 0 + ? + MakeSphere - + double - x1 - + theX + double - y1 - + theY + double - z1 - + theZ + double - radius - + theRadius + -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_Object + return + + + 11/11/2004 - 12:51:22 + 11/11/2004 - 12:51:22 + 2.0 + ? + localhost/FactoryServer + MakeSphere from GEOM_Superv + 210 + 49 + +GEOM_Superv + GEOM_Superv + MakeCopy + 0 + ? + +MakeCopy + -GEOM_Shape - shape1 - +GEOM_Object + theOriginal + + +GEOM_Object + return + + + 11/11/2004 - 12:52:16 + 11/11/2004 - 12:52:16 + 2.0 + ? + localhost/FactoryServer + MakeCopy from GEOM_Superv + 412 + 12 + +GEOM_Superv + GEOM_Superv + MakeCopy_1 + 0 + ? + +MakeCopy + + +GEOM_Object + theOriginal + + +GEOM_Object + return + + + 11/11/2004 - 12:52:31 + 11/11/2004 - 12:52:31 + 2.0 + ? + localhost/FactoryServer + MakeCopy from GEOM_Superv + 414 + 183 + +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 + ? + +TranslateDXDYDZ + + +GEOM_Object + theObject + double - x1 - + theDX + double - y1 - + theDY + double - z1 - + theDZ + -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_Object + return + + + 11/11/2004 - 12:52:54 + 11/11/2004 - 12:52:54 + 2.0 + ? + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 606 + 12 + +GEOM_Superv + GEOM_Superv + MakeFuse + 0 + ? + +MakeFuse + -GEOM_Shape - shape1 - +GEOM_Object + theShape1 + +GEOM_Object + theShape2 + -GEOM_Shape - shape - - - 24/9/2003 - 16:13:48 - 24/9/2003 - 16:13:48 - 1.03 - ? - localhost/FactoryServer - MakeCopy from GEOM - 283 - 391 - +GEOM_Object + return + + + 11/11/2004 - 12:53:16 + 11/11/2004 - 12:53:16 + 2.0 + ? + localhost/FactoryServer + MakeFuse from GEOM_Superv + 801 + 163 + -MakeCopy - shape - MakeTranslation - shape1 - - +SetStudyID + Gate + MakeSphere + Gate + + MakeSphere - shape - MakeCopy - shape1 - - -225 - 165 - -224 - 269 - + return + MakeCopy + theOriginal + + MakeSphere - shape - MakeCopy_1 - shape1 - - -223 - 472 - -224 - 270 - -MakeTranslation - shape - MakeFuse - shape1 - - -688 - 259 - -687 - 165 - + return + MakeCopy_1 + theOriginal + + +MakeCopy + return + TranslateDXDYDZ + theObject + + MakeCopy_1 - shape - MakeFuse - shape2 - - -689 - 289 - -690 - 471 - + return + MakeFuse + theShape2 + + +TranslateDXDYDZ + return + MakeFuse + theShape1 + + -GraphGeomEssai - MakeSphere\x1 - MakeSphere - x1 - +aNewDataFlow + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow + MakeSphere__theX + MakeSphere + theX + 7 - 0 - - -GraphGeomEssai - MakeSphere\y1 - MakeSphere - y1 - + 0 + + +aNewDataFlow + MakeSphere__theY + MakeSphere + theY + 7 - 0 - - -GraphGeomEssai - MakeSphere\z1 - MakeSphere - z1 - + 0 + + +aNewDataFlow + MakeSphere__theZ + MakeSphere + theZ + 7 - 0 - - -GraphGeomEssai - MakeSphere\radius - MakeSphere - radius - + 0 + + +aNewDataFlow + MakeSphere__theRadius + MakeSphere + theRadius + 7 - 20 - - -GraphGeomEssai - MakeTranslation\x1 - MakeTranslation - x1 - + 20 + + +aNewDataFlow + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX + 7 - 10 - - -GraphGeomEssai - MakeTranslation\y1 - MakeTranslation - y1 - + 10 + + +aNewDataFlow + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY + 7 - 10 - - -GraphGeomEssai - MakeTranslation\z1 - MakeTranslation - z1 - + 10 + + +aNewDataFlow + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ + 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/GraphGeomEssai_py.py b/examples/GraphGeomEssai_py.py new file mode 100644 index 0000000..7385ef0 --- /dev/null +++ b/examples/GraphGeomEssai_py.py @@ -0,0 +1,143 @@ + +# Generated python file of Graph GraphGeomEssai_1_1_1_1 + +from SuperV import * + +# Graph creation of GraphGeomEssai_1_1_1_1 +def DefGraphGeomEssai_1_1_1_1() : + GraphGeomEssai_1_1_1_1 = Graph( 'GraphGeomEssai_1_1_1_1' ) + GraphGeomEssai_1_1_1_1.SetName( 'GraphGeomEssai_1_1_1_1' ) + GraphGeomEssai_1_1_1_1.SetAuthor( '' ) + GraphGeomEssai_1_1_1_1.SetComment( '' ) + GraphGeomEssai_1_1_1_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 = GraphGeomEssai_1_1_1_1.INode( 'gag' , Pygag ) + gag.SetName( 'gag' ) + gag.SetAuthor( '' ) + gag.SetComment( 'Compute Node' ) + gag.Coords( 0 , 166 ) + IgagGate = gag.GetInPort( 'Gate' ) + OgagGate = gag.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=MakeSpherePntR(apoint,radius) ' ) + PyMakeSphere_1.append( ' return shape ' ) + MakeSphere_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeSphere_1' , PyMakeSphere_1 ) + MakeSphere_1.SetName( 'MakeSphere_1' ) + MakeSphere_1.SetAuthor( '' ) + MakeSphere_1.SetComment( 'Compute Node' ) + MakeSphere_1.Coords( 181 , 86 ) + 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' ) + + PyMakeCopy_1 = [] + PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' ) + PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' ) + PyMakeCopy_1.append( ' return shape ' ) + MakeCopy_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_1' , PyMakeCopy_1 ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetComment( 'Compute Node' ) + MakeCopy_1.Coords( 386 , 2 ) + 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 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_2' , PyMakeCopy_2 ) + MakeCopy_2.SetName( 'MakeCopy_2' ) + MakeCopy_2.SetAuthor( '' ) + MakeCopy_2.SetComment( 'Compute Node' ) + MakeCopy_2.Coords( 388 , 181 ) + 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' ) + + 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 = GraphGeomEssai_1_1_1_1.INode( 'MakeFuse_1' , PyMakeFuse_1 ) + MakeFuse_1.SetName( 'MakeFuse_1' ) + MakeFuse_1.SetAuthor( '' ) + MakeFuse_1.SetComment( 'Compute Node' ) + MakeFuse_1.Coords( 779 , 161 ) + 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' ) + + 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 = GraphGeomEssai_1_1_1_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 ) + MakeTranslation_1.SetName( 'MakeTranslation_1' ) + MakeTranslation_1.SetAuthor( '' ) + MakeTranslation_1.SetComment( 'Compute Node' ) + MakeTranslation_1.Coords( 580 , 2 ) + 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' ) + + # Creation of Links + LgagGateMakeSphere_1Gate = GraphGeomEssai_1_1_1_1.Link( OgagGate , IMakeSphere_1Gate ) + + LMakeSphere_1shapeMakeCopy_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 ) + + LMakeSphere_1shapeMakeCopy_2shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_2shape1 ) + + LMakeCopy_1shapeMakeTranslation_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 ) + + LMakeCopy_2shapeMakeFuse_1shape2 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 ) + + LMakeTranslation_1shapeMakeFuse_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 ) + + # Input datas + IMakeSphere_1x1.Input( 0 ) + IMakeSphere_1y1.Input( 0 ) + IMakeSphere_1z1.Input( 0 ) + IMakeSphere_1radius.Input( 20 ) + IMakeTranslation_1x1.Input( 10 ) + IMakeTranslation_1y1.Input( 10 ) + IMakeTranslation_1z1.Input( 10 ) + + # Output Ports of the graph + #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' ) + return GraphGeomEssai_1_1_1_1 + + +GraphGeomEssai_1_1_1_1 = DefGraphGeomEssai_1_1_1_1() diff --git a/examples/GraphGeomEssai_py.xml b/examples/GraphGeomEssai_py.xml new file mode 100644 index 0000000..52ca0b5 --- /dev/null +++ b/examples/GraphGeomEssai_py.xml @@ -0,0 +1,361 @@ + + + + + +? + ? + GraphGeomEssai_1_1_1_1 + 1 + ? + +GraphGeomEssai_1_1_1_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 + + + 10/7/2002 - 14:53:2 + 29/10/2004 - 15:7:37 + 1.03 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 29/10/2004 - 14:58:4 + 29/10/2004 - 14:58:4 + 2.0 + ? + ? + Compute Node + 0 + 166 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 29/10/2004 - 14:58:4 + 29/10/2004 - 14:58:4 + 2.0 + ? + ? + Compute Node + 181 + 86 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 29/10/2004 - 14:58:4 + 29/10/2004 - 14:58:4 + 2.0 + ? + ? + Compute Node + 386 + 2 + +? + ? + MakeCopy_2 + 3 + ? + +MakeCopy_2 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_2 + + + + 29/10/2004 - 14:58:4 + 29/10/2004 - 14:58:4 + 2.0 + ? + ? + Compute Node + 388 + 181 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + + + + + + + + 29/10/2004 - 14:58:4 + 29/10/2004 - 14:58:4 + 2.0 + ? + ? + Compute Node + 779 + 161 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 29/10/2004 - 15:1:27 + 29/10/2004 - 15:1:27 + 2.0 + ? + ? + Compute Node + 580 + 2 + + +gag + Gate + MakeSphere_1 + Gate + + +MakeSphere_1 + shape + MakeCopy_1 + shape1 + + +MakeSphere_1 + shape + MakeCopy_2 + shape1 + + +MakeCopy_1 + shape + MakeTranslation_1 + shape1 + + +MakeCopy_2 + shape + MakeFuse_1 + shape2 + + +MakeTranslation_1 + shape + MakeFuse_1 + shape1 + + + +GraphGeomEssai_1_1_1_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + +7 + 0 + + +GraphGeomEssai_1_1_1_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + +7 + 0 + + +GraphGeomEssai_1_1_1_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + +7 + 0 + + +GraphGeomEssai_1_1_1_1 + MakeSphere_1__radius + MakeSphere_1 + radius + +7 + 20 + + +GraphGeomEssai_1_1_1_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + +7 + 10 + + +GraphGeomEssai_1_1_1_1 + MakeTranslation_1__y1 + MakeTranslation_1 + y1 + +7 + 10 + + +GraphGeomEssai_1_1_1_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + +7 + 10 + diff --git a/examples/GraphInLinesUnValid.py b/examples/GraphInLinesUnValid.py index 0b08e95..c888f5e 100755 --- a/examples/GraphInLinesUnValid.py +++ b/examples/GraphInLinesUnValid.py @@ -70,14 +70,18 @@ Adda.AddCoord( 2 , 7 , 332 ) Adda.AddCoord( 3 , 645 , 334 ) Adda.AddCoord( 4 , 645 , 204 ) -GraphInLinesUnValid.IsValid() +statvalid = GraphInLinesUnValid.IsValid() +if statvalid != 0 : + print "ERROR : GraphInLinesUnValid should not be valid" +else : + print "Ok : GraphInLinesUnValid is not valid" # Creation of Output variables -GraphInLinesUnValid.Run() +statrun = GraphInLinesUnValid.Run() +if statrun != 0 : + print "ERROR : GraphInLinesUnValid should not run" +else : + print "Ok : GraphInLinesUnValid does not run" -GraphInLinesUnValid.IsDone() -GraphInLinesUnValid.State() - -GraphInLinesUnValid.PrintPorts() diff --git a/examples/GraphMerge1.py b/examples/GraphMerge1.py index 8ab8fea..39955f4 100755 --- a/examples/GraphMerge1.py +++ b/examples/GraphMerge1.py @@ -8,7 +8,9 @@ from GraphSwitch import * from GraphSwitch1 import * # Merge of GraphSwitch1 in GraphSwitch -GraphSwitch.Merge( GraphSwitch1 ) +statmerge = GraphSwitch.Merge( GraphSwitch1 ) +if statmerge == 0 : + print "Failed to merge GraphSwitch1 in GraphSwitch" # Create a variable for each node of GraphSwitch : # IsOdd,IsOdd_1,InitLoopSwitch,InitLoop,EndOfInitLoopSwitch,EndOfInitLoop,Switch,Switch_1,EndOfSwitch,EndSwitch diff --git a/examples/GraphSwitch.py b/examples/GraphSwitch.py index 51a98e6..8515637 100644 --- a/examples/GraphSwitch.py +++ b/examples/GraphSwitch.py @@ -126,5 +126,5 @@ SwitchEven = Switch.Port( 'Even' ) GraphSwitch.Run() GraphSwitch.DoneW() -GraphSwitch.State() +print GraphSwitch.State() GraphSwitch.PrintPorts() diff --git a/examples/GraphSwitch1.py b/examples/GraphSwitch1.py index fd38739..0af4722 100755 --- a/examples/GraphSwitch1.py +++ b/examples/GraphSwitch1.py @@ -127,5 +127,5 @@ EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) GraphSwitch1.Run() GraphSwitch1.DoneW() -GraphSwitch1.State() +print GraphSwitch1.State() GraphSwitch1.PrintPorts() diff --git a/examples/GraphSwitchCrash.py b/examples/GraphSwitchCrash.py index 42fa59c..f22827a 100755 --- a/examples/GraphSwitchCrash.py +++ b/examples/GraphSwitchCrash.py @@ -233,5 +233,5 @@ EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) GraphSwitchCrash.Run() GraphSwitchCrash.DoneW() -GraphSwitchCrash.State() +print GraphSwitchCrash.State() GraphSwitchCrash.PrintPorts() diff --git a/examples/GraphSwitchs.py b/examples/GraphSwitchs.py index 45c77ac..bf78c81 100755 --- a/examples/GraphSwitchs.py +++ b/examples/GraphSwitchs.py @@ -228,5 +228,5 @@ EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) GraphSwitchs.Run() GraphSwitchs.DoneW() -GraphSwitchs.State() +print GraphSwitchs.State() GraphSwitchs.PrintPorts() diff --git a/examples/GraphSyrControl.py b/examples/GraphSyrControl.py index 5756e84..c1ea545 100644 --- a/examples/GraphSyrControl.py +++ b/examples/GraphSyrControl.py @@ -267,7 +267,7 @@ GraphSyrControl.Run( 7 ) GraphSyrControl.DoneW() -GraphSyrControl.State() +print GraphSyrControl.State() GraphSyrControl.PrintPorts() diff --git a/examples/GraphSyrControl1.py b/examples/GraphSyrControl1.py index 97b63e5..254113c 100755 --- a/examples/GraphSyrControl1.py +++ b/examples/GraphSyrControl1.py @@ -231,7 +231,7 @@ GraphSyrControl1.Run( 7 ) GraphSyrControl1.DoneW() -GraphSyrControl1.State() +print GraphSyrControl1.State() GraphSyrControl1.PrintPorts() diff --git a/examples/GraphSyrControlAve.py b/examples/GraphSyrControlAve.py index 51bd2d8..b039fbf 100644 --- a/examples/GraphSyrControlAve.py +++ b/examples/GraphSyrControlAve.py @@ -387,5 +387,5 @@ EndL_OneEvenAVERAGE = EndL_OneEven.Port( 'AVERAGE' ) GraphSyrControlAve.Run() GraphSyrControlAve.DoneW() -GraphSyrControlAve.State() +print GraphSyrControlAve.State() GraphSyrControlAve.PrintPorts() diff --git a/examples/GraphSyrControlDefault.py b/examples/GraphSyrControlDefault.py index 16c7465..dfafc54 100644 --- a/examples/GraphSyrControlDefault.py +++ b/examples/GraphSyrControlDefault.py @@ -235,3 +235,8 @@ label_beginKB = label_begin.Input( 'KB' , 0) # Creation of Output variables EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) + +GraphSyrControlDefault.Run() +GraphSyrControlDefault.DoneW() +print GraphSyrControlDefault.State() +GraphSyrControlDefault.PrintPorts() diff --git a/examples/GraphSyrControlGUI.py b/examples/GraphSyrControlGUI.py index cf7becd..c8ce801 100644 --- a/examples/GraphSyrControlGUI.py +++ b/examples/GraphSyrControlGUI.py @@ -208,3 +208,8 @@ label_beginKB = label_begin.Input( 'KB' , 0) # Creation of Output variables label_testFinished = label_test.Port( 'Finished' ) + +GraphSyrControlGUI.Run() +GraphSyrControlGUI.DoneW() +print GraphSyrControlGUI.State() +GraphSyrControlGUI.PrintPorts() diff --git a/examples/GraphSyracuseC.py b/examples/GraphSyracuseC.py index 296d36a..7b27496 100644 --- a/examples/GraphSyracuseC.py +++ b/examples/GraphSyracuseC.py @@ -82,7 +82,7 @@ GraphSyracuseC.ThreadsMax() GraphSyracuseC.LevelMax() -GraphSyracuseC.GraphsNumber() +GraphSyracuseC.SubGraphsNumber() GraphSyracuseC.IsExecutable() @@ -165,6 +165,7 @@ incr.Resume() test_ISONE.Resume() test_ISEVEN.Resume() GraphSyracuseC.DoneW() +print GraphSyracuseC.State() GraphSyracuseC.PrintPorts() GraphSyracuseC.PrintThreads() diff --git a/examples/GraphSyracuseCEv.py b/examples/GraphSyracuseCEv.py index 2ee258e..5961ab5 100644 --- a/examples/GraphSyracuseCEv.py +++ b/examples/GraphSyracuseCEv.py @@ -78,7 +78,7 @@ GraphSyracuseCEv.ThreadsMax() GraphSyracuseCEv.LevelMax() -GraphSyracuseCEv.GraphsNumber() +GraphSyracuseCEv.SubGraphsNumber() GraphSyracuseCEv.IsExecutable() @@ -163,5 +163,6 @@ while aNode != None : aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event() GraphSyracuseCEv.DoneW() +print GraphSyracuseCEv.State() GraphSyracuseCEv.PrintThreads() GraphSyracuseCEv.PrintPorts() diff --git a/examples/GraphSyracuseC_Gate.py b/examples/GraphSyracuseC_Gate.py deleted file mode 100644 index 2493180..0000000 --- a/examples/GraphSyracuseC_Gate.py +++ /dev/null @@ -1,203 +0,0 @@ -# Copyright (C) 2003 CEA/DEN, EDF R&D -# -# -# -# File : GraphSyracuseC_Gate.py -# Module : SuperVisionTest - -from SuperV import * -# Graph creation -GraphSyracuseC_Gate = Graph( 'GraphSyracuseC_Gate' ) -GraphSyracuseC_Gate.SetName( 'GraphSyracuseC_Gate' ) -GraphSyracuseC_Gate.SetAuthor( 'JR' ) -GraphSyracuseC_Gate.SetComment( 'Syracuse algorithm' ) -GraphSyracuseC_Gate.Coords( 0 , 0 ) - -# Creation of Factory Nodes -test_ISEVEN = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 5 , 416 ) -test_ISONE = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 7 , 232 ) -m3p1 = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 180 , 417 ) -div2 = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 435 , 7 ) -div2_ISEVEN = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -div2_ISEVEN.SetName( 'div2_ISEVEN' ) -div2_ISEVEN.SetAuthor( '' ) -div2_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -div2_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -div2_ISEVEN.Coords( 663 , 193 ) -div2_ISONE = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -div2_ISONE.SetName( 'div2_ISONE' ) -div2_ISONE.SetAuthor( '' ) -div2_ISONE.SetContainer( 'localhost/FactoryServer' ) -div2_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -div2_ISONE.Coords( 651 , 6 ) -incr = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 434 , 193 ) - -# Creation of intermediate Output variables and of Control Links -test_ISEVENOutGate = test_ISEVEN.Port( 'OutGate' ) -m3p1InGate = GraphSyracuseC_Gate.Link( test_ISEVENOutGate , m3p1.Port( 'InGate' ) ) -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -div2anEvenInteger = GraphSyracuseC_Gate.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 373 , 117 ) -div2anEvenInteger.AddCoord( 2 , 373 , 528 ) -div2anInteger = div2.Port( 'anInteger' ) -div2_ISONEanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) ) -div2_ISEVENanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) ) -div2_ISEVENanInteger.AddCoord( 1 , 626 , 302 ) -div2_ISEVENanInteger.AddCoord( 2 , 626 , 116 ) - -# Creation of Input datas -test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31) -test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31) -m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31) -incraCount = incr.Input( 'aCount' , 0) - -# Creation of Output variables -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' ) -div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' ) -incraNewCount = incr.Port( 'aNewCount' ) - - -GraphSyracuseC_Gate.Start() - -div2InanInteger = div2.Port( 'anEvenInteger' ) - -m3p1.Suspend() - -div2_ISEVEN.SuspendDone() -div2_ISONE.SuspendDone() - -test_ISEVEN.Resume() -test_ISONE.Resume() - -# Attente de fin d'execution de test -test_ISONE.DoneW() -test_ISEVEN.DoneW() - -m3p1.SuspendedW() -incr.SuspendedW() -incr.SuspendDone() - -# Etats et Threads des nodes -GraphSyracuseC_Gate.PrintThreads() - -BoolOne = int( test_ISONEBoolOne.ToString() ) -BoolEven = int( test_ISEVENBoolEven.ToString() ) -while BoolOne == 0 : - if BoolEven == 0 : - sts = div2_ISONE.ReRunAt('m3p1') - if sts == 0 : - print 'div2_ISONE.ReRunAt error' - break - sts = incr.ReRun() - if sts == 0 : - print 'incr.ReRun error' - break - sts = m3p1.DoneW() - if sts == 0 : - print 'm3p1.DoneW error' - break - sts = incr.DoneW() - if sts == 0 : - print 'incr.DoneW error' - break - sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 ) - if sts == 0 : - print 'incraCount.Input error' - break - BoolEven = 1 - BoolOne = 0 - Current = int( m3p1anEvenInteger.ToString() ) - print incraNewCount.ToString(),"m3p1",Current,BoolEven - if Current <= 0 : - break - if Current <= 0 : - break - while BoolEven == 1 : - sts = incr.ReRun() - if sts == 0 : - print 'incr.ReRun error' - break - sts = div2.DoneW() - if sts == 0 : - print 'div2.DoneW error' - break - sts = div2_ISEVEN.DoneW() - if sts == 0 : - print 'div2_ISEVEN.DoneW error' - break - sts = div2_ISONE.DoneW() - if sts == 0 : - print 'div2_ISONE.DoneW error' - break - sts = incr.DoneW() - if sts == 0 : - print 'incr.DoneW error' - break - sts = incraCount.Input( incraNewCount.ToString() ) - if sts == 0 : - print 'incraCount.Input error' - break - BoolOne = int( div2_ISONEBoolOne.ToString() ) - BoolEven = int( div2_ISEVENBoolEven.ToString() ) - Current = int( div2anInteger.ToString() ) - print incraNewCount.ToString(),"div2",Current,BoolEven,BoolOne - if Current <= 0 : - break - if BoolEven == 1 : - sts = div2InanInteger.Input( Current ) - if sts == 0 : - print 'div2InanInteger.Input error' - break - sts = div2_ISONE.ReRunAt('div2') - if sts == 0 : - print 'div2_ISONE.ReRunAt error' - break - if Current <= 0 : - break - sts = m3p1anOddInteger.Input( Current ) - if sts == 0 : - print 'm3p1anOddInteger.Input error' - break - sts = m3p1InGate.InPort().Input( 1 ) - if sts == 0 : - print 'm3p1InGate.InPort error' - break - - -GraphSyracuseC_Gate.PrintThreads() -m3p1.Resume() -div2.Resume() -incr.Resume() -div2_ISONE.Resume() -div2_ISEVEN.Resume() -GraphSyracuseC_Gate.DoneW() -GraphSyracuseC_Gate.PrintPorts() -GraphSyracuseC_Gate.PrintThreads() - diff --git a/examples/GraphSyracuseC_Gate.xml b/examples/GraphSyracuseC_Gate.xml deleted file mode 100644 index 8b87cf7..0000000 --- a/examples/GraphSyracuseC_Gate.xml +++ /dev/null @@ -1,307 +0,0 @@ - - - - -? - ? - GraphSyracuseC_Gate - 1 - ? - -GraphSyracuseC_Gate - - -long - test_ISEVEN\anInteger - -long - test_ISONE\anInteger - -long - m3p1\anOddInteger - -long - incr\aCount - - -long - test_ISEVEN\BoolEven - -long - test_ISONE\BoolOne - -long - div2_ISEVEN\BoolEven - -long - div2_ISONE\BoolOne - -long - incr\aNewCount - - - 11/3/2003 - 16:25:34 - 11/6/2003 - 16:1:11 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - - -SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - -C_ISEVEN - - -long - anInteger - - -long - BoolEven - - - 11/6/2003 - 16:1:10 - 11/6/2003 - 16:1:10 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 5 - 416 - -SyrComponent - SyrComponent - test_ISONE - 0 - ? - -C_ISONE - - -long - anInteger - - -long - BoolOne - - - 11/6/2003 - 16:1:10 - 11/6/2003 - 16:1:10 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 7 - 232 - -SyrComponent - SyrComponent - m3p1 - 0 - ? - -C_M3P1 - - -long - anOddInteger - - -long - anEvenInteger - - - 11/6/2003 - 16:1:10 - 11/6/2003 - 16:1:10 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 180 - 417 - -SyrComponent - SyrComponent - div2 - 0 - ? - -C_DIV2 - - -long - anEvenInteger - - -long - anInteger - - - 11/6/2003 - 16:1:10 - 11/6/2003 - 16:1:10 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 435 - 7 - -SyrComponent - SyrComponent - div2_ISEVEN - 0 - ? - -C_ISEVEN - - -long - anInteger - - -long - BoolEven - - - 11/6/2003 - 16:1:11 - 11/6/2003 - 16:1:11 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 663 - 193 - -SyrComponent - SyrComponent - div2_ISONE - 0 - ? - -C_ISONE - - -long - anInteger - - -long - BoolOne - - - 11/6/2003 - 16:1:11 - 11/6/2003 - 16:1:11 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 651 - 6 - -SyrComponent - SyrComponent - incr - 0 - ? - -C_INCR - - -long - aCount - - -long - aNewCount - - - 11/6/2003 - 16:1:11 - 11/6/2003 - 16:1:11 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 434 - 193 - - -test_ISEVEN - OutGate - m3p1 - InGate - - -m3p1 - anEvenInteger - div2 - anEvenInteger - - -373 - 117 - -373 - 528 - -div2 - anInteger - div2_ISONE - anInteger - - -div2 - anInteger - div2_ISEVEN - anInteger - - -626 - 302 - -626 - 116 - - -GraphSyracuseC_Gate - test_ISEVEN\anInteger - test_ISEVEN - anInteger - -3 - 31 - - -GraphSyracuseC_Gate - test_ISONE\anInteger - test_ISONE - anInteger - -3 - 31 - - -GraphSyracuseC_Gate - m3p1\anOddInteger - m3p1 - anOddInteger - -3 - 31 - - -GraphSyracuseC_Gate - incr\aCount - incr - aCount - -3 - 0 - diff --git a/examples/GraphSyracuseC_Void.py b/examples/GraphSyracuseC_Void.py index b4effae..bb2a62d 100644 --- a/examples/GraphSyracuseC_Void.py +++ b/examples/GraphSyracuseC_Void.py @@ -6,7 +6,6 @@ from SuperV import * GraphSyracuseC_Void = Graph( 'GraphSyracuseC_Void' ) print GraphSyracuseC_Void.SetName( 'GraphSyracuseC_Void' ) print GraphSyracuseC_Void.SetAuthor( 'JR' ) -print GraphSyracuseC_Void.SetContainer( 'localhost/FactoryServer' ) print GraphSyracuseC_Void.SetComment( 'Syracuse algorithm' ) GraphSyracuseC_Void.Coords( 0 , 0 ) @@ -155,6 +154,7 @@ incr.Resume() div2_ISONE.Resume() div2_ISEVEN.Resume() GraphSyracuseC_Void.DoneW() +print GraphSyracuseC_Void.State() GraphSyracuseC_Void.PrintPorts() GraphSyracuseC_Void.PrintThreads() diff --git a/examples/GraphSyracuseControl.py b/examples/GraphSyracuseControl.py index 3e432a7..a46564e 100644 --- a/examples/GraphSyracuseControl.py +++ b/examples/GraphSyracuseControl.py @@ -5,7 +5,6 @@ from SuperV import * GraphSyracuseControl = Graph( 'GraphSyracuseControl' ) print GraphSyracuseControl.SetName( 'GraphSyracuseControl' ) print GraphSyracuseControl.SetAuthor( 'JR' ) -print GraphSyracuseControl.SetContainer( 'localhost/FactoryServer' ) print GraphSyracuseControl.SetComment( 'Syracuse algorithm' ) GraphSyracuseControl.Coords( 0 , 0 ) @@ -118,7 +117,7 @@ GraphSyracuseControl.Run() GraphSyracuseControl.DoneW() -GraphSyracuseControl.State() +print GraphSyracuseControl.State() GraphSyracuseControl.PrintPorts() diff --git a/examples/GraphSyracuseCpp.py b/examples/GraphSyracuseCpp.py index fba4f92..6f4d67f 100644 --- a/examples/GraphSyracuseCpp.py +++ b/examples/GraphSyracuseCpp.py @@ -217,6 +217,7 @@ sts = result_Current.Resume() sts = result_Count.ControlClear() sts = result_Count.Resume() sts = GraphSyracuseCpp.DoneW() +print sts GraphSyracuseCpp.PrintPorts() GraphSyracuseCpp.PrintThreads() diff --git a/examples/GraphUnValid.py b/examples/GraphUnValid.py index 0c113e9..c773582 100755 --- a/examples/GraphUnValid.py +++ b/examples/GraphUnValid.py @@ -73,10 +73,18 @@ Subx.AddCoord( 4 , 565 , 141 ) AddFuncValue = Add.Port( 'FuncValue' ) Divz = Div.Port( 'z' ) -GraphInLinesUnValid.IsValid() +statvalid = GraphInLinesUnValid.IsValid() +if statvalid == 0 : + print "Unvalid graph : Ok" +else : + print "Error : the graph should not be valid" # Creation of Output variables -GraphUnValid.Run() +statrun = GraphUnValid.Run() +if statrun == 0 : + print "Unvalid graph ==> No Run : Ok" +else : + print "Error : the graph is not valid and is running" GraphUnValid.IsDone() diff --git a/examples/MacroWithGeom.py b/examples/MacroWithGeom.py new file mode 100644 index 0000000..45bb132 --- /dev/null +++ b/examples/MacroWithGeom.py @@ -0,0 +1,224 @@ + +# Generated python file of Graph aNewDataFlow + +from SuperV import * + +# Graph creation of aNewDataFlow +def DefaNewDataFlow() : + aNewDataFlow = Graph( 'aNewDataFlow' ) + aNewDataFlow.SetName( 'aNewDataFlow' ) + aNewDataFlow.SetAuthor( '' ) + aNewDataFlow.SetComment( '' ) + aNewDataFlow.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + TranslateDXDYDZ = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetAuthor( '' ) + TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' ) + TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' ) + TranslateDXDYDZ.Coords( 735 , 14 ) + ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' ) + ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' ) + ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' ) + ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' ) + ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' ) + OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' ) + OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' ) + + MakeCopy = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy.SetName( 'MakeCopy' ) + MakeCopy.SetAuthor( '' ) + MakeCopy.SetContainer( 'localhost/FactoryServer' ) + MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy.Coords( 477 , 14 ) + IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' ) + IMakeCopyGate = MakeCopy.GetInPort( 'Gate' ) + OMakeCopyreturn = MakeCopy.GetOutPort( 'return' ) + OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' ) + + MakeBox = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' ) + MakeBox.SetName( 'MakeBox' ) + MakeBox.SetAuthor( '' ) + MakeBox.SetContainer( 'localhost/FactoryServer' ) + MakeBox.SetComment( 'MakeBox from GEOM_Superv' ) + MakeBox.Coords( 219 , 14 ) + IMakeBoxtheX1 = MakeBox.GetInPort( 'theX1' ) + IMakeBoxtheY1 = MakeBox.GetInPort( 'theY1' ) + IMakeBoxtheZ1 = MakeBox.GetInPort( 'theZ1' ) + IMakeBoxtheX2 = MakeBox.GetInPort( 'theX2' ) + IMakeBoxtheY2 = MakeBox.GetInPort( 'theY2' ) + IMakeBoxtheZ2 = MakeBox.GetInPort( 'theZ2' ) + IMakeBoxGate = MakeBox.GetInPort( 'Gate' ) + OMakeBoxreturn = MakeBox.GetOutPort( 'return' ) + OMakeBoxGate = MakeBox.GetOutPort( 'Gate' ) + + MakeCopy_1 = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy_1.SetName( 'MakeCopy_1' ) + MakeCopy_1.SetAuthor( '' ) + MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) + MakeCopy_1.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy_1.Coords( 482 , 306 ) + IMakeCopy_1theOriginal = MakeCopy_1.GetInPort( 'theOriginal' ) + IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' ) + OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' ) + OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) + + MakeFuse = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse.SetName( 'MakeFuse' ) + MakeFuse.SetAuthor( '' ) + MakeFuse.SetContainer( 'localhost/FactoryServer' ) + MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse.Coords( 950 , 121 ) + IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' ) + IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' ) + IMakeFuseGate = MakeFuse.GetInPort( 'Gate' ) + OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' ) + + MakeSphere = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) + MakeSphere.SetName( 'MakeSphere' ) + MakeSphere.SetAuthor( '' ) + MakeSphere.SetContainer( 'localhost/FactoryServer' ) + MakeSphere.SetComment( 'MakeSphere from GEOM_Superv' ) + MakeSphere.Coords( 227 , 409 ) + IMakeSpheretheX = MakeSphere.GetInPort( 'theX' ) + IMakeSpheretheY = MakeSphere.GetInPort( 'theY' ) + IMakeSpheretheZ = MakeSphere.GetInPort( 'theZ' ) + IMakeSpheretheRadius = MakeSphere.GetInPort( 'theRadius' ) + IMakeSphereGate = MakeSphere.GetInPort( 'Gate' ) + OMakeSpherereturn = MakeSphere.GetOutPort( 'return' ) + OMakeSphereGate = MakeSphere.GetOutPort( 'Gate' ) + + MakeFuse_1 = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse_1.SetName( 'MakeFuse_1' ) + MakeFuse_1.SetAuthor( '' ) + MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) + MakeFuse_1.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse_1.Coords( 1217 , 389 ) + IMakeFuse_1theShape1 = MakeFuse_1.GetInPort( 'theShape1' ) + IMakeFuse_1theShape2 = MakeFuse_1.GetInPort( 'theShape2' ) + IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' ) + OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) + OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) + + SetStudyID = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) + SetStudyID.SetName( 'SetStudyID' ) + SetStudyID.SetAuthor( '' ) + SetStudyID.SetContainer( 'localhost/FactoryServer' ) + SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' ) + SetStudyID.Coords( 7 , 269 ) + ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' ) + ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' ) + OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' ) + + # Creation of Macro Nodes + aNewDataFlow_1 = DefaNewDataFlow_1() + Macro_aNewDataFlow_1 = aNewDataFlow.GraphMNode( aNewDataFlow_1 ) + Macro_aNewDataFlow_1.SetCoupled( 'aNewDataFlow_1' ) + Macro_aNewDataFlow_1.SetName( 'Macro_aNewDataFlow_1' ) + Macro_aNewDataFlow_1.SetAuthor( '' ) + Macro_aNewDataFlow_1.SetComment( 'Macro Node' ) + Macro_aNewDataFlow_1.Coords( 480 , 145 ) + IMacro_aNewDataFlow_1sum__a = Macro_aNewDataFlow_1.GetInPort( 'sum__a' ) + IMacro_aNewDataFlow_1sum__b = Macro_aNewDataFlow_1.GetInPort( 'sum__b' ) + IMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetInPort( 'Gate' ) + OMacro_aNewDataFlow_1Mult__b = Macro_aNewDataFlow_1.GetOutPort( 'Mult__b' ) + OMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetOutPort( 'Gate' ) + + # Creation of Links + LMacro_aNewDataFlow_1Mult__bTranslateDXDYDZtheDY = aNewDataFlow.Link( OMacro_aNewDataFlow_1Mult__b , ITranslateDXDYDZtheDY ) + + LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) + + LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) + + LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopytheOriginal ) + + LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopy_1theOriginal ) + + LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow.Link( OMakeCopy_1return , IMakeFusetheShape2 ) + + LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow.Link( OMakeFusereturn , IMakeFuse_1theShape1 ) + + LMakeSpherereturnMakeFuse_1theShape2 = aNewDataFlow.Link( OMakeSpherereturn , IMakeFuse_1theShape2 ) + + LSetStudyIDGateMakeBoxGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeBoxGate ) + + LSetStudyIDGateMakeSphereGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeSphereGate ) + + # Input datas + IMacro_aNewDataFlow_1sum__a.Input( 1 ) + IMacro_aNewDataFlow_1sum__b.Input( 2 ) + ITranslateDXDYDZtheDX.Input( 25 ) + ITranslateDXDYDZtheDZ.Input( 25 ) + IMakeBoxtheX1.Input( 0 ) + IMakeBoxtheY1.Input( 0 ) + IMakeBoxtheZ1.Input( 0 ) + IMakeBoxtheX2.Input( 50 ) + IMakeBoxtheY2.Input( 50 ) + IMakeBoxtheZ2.Input( 50 ) + IMakeSpheretheX.Input( 0 ) + IMakeSpheretheY.Input( 0 ) + IMakeSpheretheZ.Input( 0 ) + IMakeSpheretheRadius.Input( 12 ) + ISetStudyIDtheStudyID.Input( 1 ) + + # Output Ports of the graph + #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) + return aNewDataFlow + +# Graph creation of aNewDataFlow_1 +def DefaNewDataFlow_1() : + aNewDataFlow_1 = Graph( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetCoupled( 'Macro_aNewDataFlow_1' ) + aNewDataFlow_1.SetName( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetAuthor( '' ) + aNewDataFlow_1.SetComment( '' ) + aNewDataFlow_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyMult = [] + PyMult.append( 'def Mult(a): ' ) + PyMult.append( ' b = a*3 ' ) + PyMult.append( ' return b ' ) + Mult = aNewDataFlow_1.INode( 'Mult' , PyMult ) + Mult.SetName( 'Mult' ) + Mult.SetAuthor( '' ) + Mult.SetComment( 'Compute Node' ) + Mult.Coords( 382 , 78 ) + IMulta = Mult.InPort( 'a' , 'double' ) + IMultGate = Mult.GetInPort( 'Gate' ) + OMultb = Mult.OutPort( 'b' , 'double' ) + OMultGate = Mult.GetOutPort( 'Gate' ) + + Pysum = [] + Pysum.append( 'def sum(a, b): ' ) + Pysum.append( ' return a+b' ) + sum = aNewDataFlow_1.INode( 'sum' , Pysum ) + sum.SetName( 'sum' ) + sum.SetAuthor( '' ) + sum.SetComment( 'Compute Node' ) + sum.Coords( 47 , 87 ) + Isuma = sum.InPort( 'a' , 'double' ) + Isumb = sum.InPort( 'b' , 'double' ) + IsumGate = sum.GetInPort( 'Gate' ) + Osums = sum.OutPort( 's' , 'double' ) + OsumGate = sum.GetOutPort( 'Gate' ) + + # Creation of Links + LsumsMulta = aNewDataFlow_1.Link( Osums , IMulta ) + + # Input Ports of the graph + #Isuma = sum.GetInPort( 'a' ) + #Isumb = sum.GetInPort( 'b' ) + + # Output Ports of the graph + #OMultb = Mult.GetOutPort( 'b' ) + return aNewDataFlow_1 + + +aNewDataFlow = DefaNewDataFlow() diff --git a/examples/MacroWithGeom.xml b/examples/MacroWithGeom.xml index ff3ad12..5dce47f 100755 --- a/examples/MacroWithGeom.xml +++ b/examples/MacroWithGeom.xml @@ -5,63 +5,66 @@ ? ? - GeomGraph_3 + aNewDataFlow 1 ? -GeomGraph_3 +aNewDataFlow double - MakeBox__x1 + Macro_aNewDataFlow_1__sum__a double - MakeBox__y1 + Macro_aNewDataFlow_1__sum__b double - MakeBox__z1 + TranslateDXDYDZ__theDX double - MakeBox__x2 + TranslateDXDYDZ__theDZ double - MakeBox__y2 + MakeBox__theX1 double - MakeBox__z2 + MakeBox__theY1 double - MakeTranslation__x1 + MakeBox__theZ1 double - MakeTranslation__z1 + MakeBox__theX2 double - MakeSphere__x1 + MakeBox__theY2 double - MakeSphere__y1 + MakeBox__theZ2 double - MakeSphere__z1 + MakeSphere__theX double - MakeSphere__radius + MakeSphere__theY -long - Macro_aNewDataFlow_1_5_1__sum__a +double + MakeSphere__theZ + +double + MakeSphere__theRadius long - Macro_aNewDataFlow_1_5_1__sum__b + SetStudyID__theStudyID -GEOM_Shape - MakeFuse_1__shape +GEOM_Object + MakeFuse_1__return - 13/3/2003 - 11:46:34 - 2/7/2004 - 11:13:17 - 1.04 + 29/10/2004 - 14:37:33 + 11/11/2004 - 13:15:14 + 2.0 ? ? ? @@ -69,194 +72,197 @@ 0 -GEOM - GEOM - MakeBox - 0 - ? +? + ? + Macro_aNewDataFlow_1 + 10 + aNewDataFlow_1 -MakeBox +aNewDataFlow_1 double - x1 - -double - y1 - -double - z1 - -double - x2 - -double - y2 + sum__a double - z2 + sum__b -GEOM_Shape - shape +double + Mult__b - - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + + +? + + 11/11/2004 - 13:11:17 + 11/11/2004 - 13:11:17 + 2.0 ? - localhost/FactoryServer - MakeBox from Geometry - 5 - 101 + ? + Macro Node + 480 + 145 -GEOM - GEOM - MakeCopy +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ 0 ? -MakeCopy +TranslateDXDYDZ -GEOM_Shape - shape1 +GEOM_Object + theObject + +double + theDX + +double + theDY + +double + theDZ -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:11:58 + 11/11/2004 - 13:11:58 + 2.0 ? localhost/FactoryServer - MakeCopy from Geometry - 235 - 77 + TranslateDXDYDZ from GEOM_Superv + 735 + 14 -GEOM - GEOM - MakeCopy_1 +GEOM_Superv + GEOM_Superv + MakeCopy 0 ? MakeCopy -GEOM_Shape - shape1 +GEOM_Object + theOriginal -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:12:24 + 11/11/2004 - 13:12:24 + 2.0 ? localhost/FactoryServer - MakeCopy from Geometry - 249 - 371 + MakeCopy from GEOM_Superv + 477 + 14 -GEOM - GEOM - MakeTranslation +GEOM_Superv + GEOM_Superv + MakeBox 0 ? -MakeTranslation +MakeBox -GEOM_Shape - shape1 +double + theX1 double - x1 + theY1 double - y1 + theZ1 double - z1 + theX2 + +double + theY2 + +double + theZ2 -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:12:49 + 11/11/2004 - 13:12:49 + 2.0 ? localhost/FactoryServer - MakeTranslation from Geometry - 449 - 86 + MakeBox from GEOM_Superv + 219 + 14 -GEOM - GEOM - MakeFuse +GEOM_Superv + GEOM_Superv + MakeCopy_1 0 ? -MakeFuse +MakeCopy -GEOM_Shape - shape1 - -GEOM_Shape - shape2 +GEOM_Object + theOriginal -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:13:9 + 11/11/2004 - 13:13:9 + 2.0 ? localhost/FactoryServer - MakeFuse from Geometry - 678 - 224 + MakeCopy from GEOM_Superv + 482 + 306 -GEOM - GEOM - MakeFuse_1 +GEOM_Superv + GEOM_Superv + MakeFuse 0 ? MakeFuse -GEOM_Shape - shape1 +GEOM_Object + theShape1 -GEOM_Shape - shape2 +GEOM_Object + theShape2 -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:13:47 + 11/11/2004 - 13:13:47 + 2.0 ? localhost/FactoryServer - MakeFuse from Geometry - 909 - 340 + MakeFuse from GEOM_Superv + 950 + 121 -GEOM - GEOM +GEOM_Superv + GEOM_Superv MakeSphere 0 ? @@ -265,299 +271,304 @@ double - x1 + theX double - y1 + theY double - z1 + theZ double - radius + theRadius -GEOM_Shape - shape +GEOM_Object + return - 2/7/2004 - 11:10:39 - 2/7/2004 - 11:10:39 - 1.04 + 11/11/2004 - 13:14:15 + 11/11/2004 - 13:14:15 + 2.0 ? localhost/FactoryServer - MakeSphere from Geometry - 5 - 449 + MakeSphere from GEOM_Superv + 227 + 409 -? - ? - Macro_aNewDataFlow_1_5_1 - 10 - aNewDataFlow_1_5_1 +GEOM_Superv + GEOM_Superv + MakeFuse_1 + 0 + ? -aNewDataFlow_1_5_1 +MakeFuse -long - sum__a +GEOM_Object + theShape1 -long - sum__b +GEOM_Object + theShape2 -int - Mult__b +GEOM_Object + return - - -? - - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 + + 11/11/2004 - 13:14:36 + 11/11/2004 - 13:14:36 2.0 ? - ? - Macro Node - 237 - 215 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 1217 + 389 + +GEOM_Superv + GEOM_Superv + SetStudyID + 0 + ? + +SetStudyID + + +long + theStudyID + + + + 11/11/2004 - 13:15:1 + 11/11/2004 - 13:15:1 + 2.0 + ? + localhost/FactoryServer + SetStudyID from GEOM_Superv + 7 + 269 +Macro_aNewDataFlow_1 + Mult__b + TranslateDXDYDZ + theDY + + +TranslateDXDYDZ + return + MakeFuse + theShape1 + + +MakeCopy + return + TranslateDXDYDZ + theObject + + MakeBox - shape + return MakeCopy - shape1 - - -198 - 184 - -199 - 209 + theOriginal + MakeBox - shape + return MakeCopy_1 - shape1 - - -198 - 441 - -198 - 209 - -MakeCopy - shape - MakeTranslation - shape1 + theOriginal MakeCopy_1 - shape - MakeFuse - shape2 - - -642 - 362 - -642 - 442 - -MakeTranslation - shape + return MakeFuse - shape1 - - -643 - 330 - -644 - 195 + theShape2 + MakeFuse - shape + return MakeFuse_1 - shape1 - - -872 - 445 - -874 - 333 + theShape1 + MakeSphere - shape + return MakeFuse_1 - shape2 - - -872 - 474 - -871 - 552 + theShape2 + -Macro_aNewDataFlow_1_5_1 - Mult__b - MakeTranslation - y1 +SetStudyID + Gate + MakeBox + Gate + + +SetStudyID + Gate + MakeSphere + Gate -GeomGraph_3 - MakeBox__x1 - MakeBox - x1 +aNewDataFlow + Macro_aNewDataFlow_1__sum__a + Macro_aNewDataFlow_1 + sum__a 7 - 0 + 1 -GeomGraph_3 - MakeBox__y1 - MakeBox - y1 +aNewDataFlow + Macro_aNewDataFlow_1__sum__b + Macro_aNewDataFlow_1 + sum__b 7 - 0 + 2 + + +aNewDataFlow + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX + +7 + 25 -GeomGraph_3 - MakeBox__z1 +aNewDataFlow + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ + +7 + 25 + + +aNewDataFlow + MakeBox__theX1 MakeBox - z1 + theX1 7 0 -GeomGraph_3 - MakeBox__x2 +aNewDataFlow + MakeBox__theY1 MakeBox - x2 + theY1 7 - 50 + 0 -GeomGraph_3 - MakeBox__y2 +aNewDataFlow + MakeBox__theZ1 MakeBox - y2 + theZ1 7 - 50 + 0 -GeomGraph_3 - MakeBox__z2 +aNewDataFlow + MakeBox__theX2 MakeBox - z2 + theX2 7 50 -GeomGraph_3 - MakeTranslation__x1 - MakeTranslation - x1 +aNewDataFlow + MakeBox__theY2 + MakeBox + theY2 7 - 25 + 50 -GeomGraph_3 - MakeTranslation__z1 - MakeTranslation - z1 +aNewDataFlow + MakeBox__theZ2 + MakeBox + theZ2 7 - 25 + 50 -GeomGraph_3 - MakeSphere__x1 +aNewDataFlow + MakeSphere__theX MakeSphere - x1 + theX 7 0 -GeomGraph_3 - MakeSphere__y1 +aNewDataFlow + MakeSphere__theY MakeSphere - y1 + theY 7 0 -GeomGraph_3 - MakeSphere__z1 +aNewDataFlow + MakeSphere__theZ MakeSphere - z1 + theZ 7 0 -GeomGraph_3 - MakeSphere__radius +aNewDataFlow + MakeSphere__theRadius MakeSphere - radius + theRadius 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 +aNewDataFlow + SetStudyID__theStudyID + SetStudyID + theStudyID 3 - 7 + 1 ? ? - aNewDataFlow_1_5_1 + aNewDataFlow_1 1 ? -aNewDataFlow_1_5_1 +aNewDataFlow_1 -long +double sum__a -long +double sum__b -int +double Mult__b - 25/6/2004 - 17:42:12 - 2/7/2004 - 11:11:42 + 29/10/2004 - 14:40:44 + 11/11/2004 - 13:11:18 2.0 ? ? @@ -568,67 +579,67 @@ ? ? - sum + Mult 3 ? -sum +Mult -long - a - -long - b +double + a -long - s +double + b -sum - - - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 +Mult + + + + 11/11/2004 - 13:11:18 + 11/11/2004 - 13:11:18 2.0 ? ? Compute Node - 52 - 80 + 382 + 78 ? ? - Mult + sum 3 ? -Mult +sum -int - a +double + a + +double + b -int - b +double + s -Mult - - - - 2/7/2004 - 11:11:42 - 2/7/2004 - 11:11:42 +sum + + + 11/11/2004 - 13:11:18 + 11/11/2004 - 13:11:18 2.0 ? ? Compute Node - 298 - 72 + 47 + 87 sum 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/MacroWithGeom_py.py b/examples/MacroWithGeom_py.py new file mode 100644 index 0000000..678d694 --- /dev/null +++ b/examples/MacroWithGeom_py.py @@ -0,0 +1,264 @@ + +# Generated python file of Graph aNewDataFlow_1_4_1_1_1_1 + +from SuperV import * + +# Graph creation of aNewDataFlow_1_4_1_1_1_1 +def DefaNewDataFlow_1_4_1_1_1_1() : + aNewDataFlow_1_4_1_1_1_1 = Graph( 'aNewDataFlow_1_4_1_1_1_1' ) + aNewDataFlow_1_4_1_1_1_1.SetName( 'aNewDataFlow_1_4_1_1_1_1' ) + aNewDataFlow_1_4_1_1_1_1.SetAuthor( '' ) + aNewDataFlow_1_4_1_1_1_1.SetComment( '' ) + aNewDataFlow_1_4_1_1_1_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_1_1_1_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_1_1_1_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_1_1_1_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_1_1_1_1.INode( 'MakeCopy_2' , PyMakeCopy_2 ) + MakeCopy_2.SetName( 'MakeCopy_2' ) + MakeCopy_2.SetAuthor( '' ) + MakeCopy_2.SetComment( 'Compute Node' ) + MakeCopy_2.Coords( 391 , 264 ) + 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=MakeSpherePntR(apoint,radius) ' ) + PyMakeSphere_1.append( ' return shape ' ) + MakeSphere_1 = aNewDataFlow_1_4_1_1_1_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' ) + + 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_1_1_1_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_1_1_1_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' ) + + 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_1_1_1_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 ) + MakeTranslation_1.SetName( 'MakeTranslation_1' ) + MakeTranslation_1.SetAuthor( '' ) + MakeTranslation_1.SetComment( 'Compute Node' ) + MakeTranslation_1.Coords( 621 , 12 ) + 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' ) + + # Creation of Macro Nodes + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 = DefaNewDataFlow_1_5_1_1_3_3_1_1_1_3_1() + Macro_aNewDataFlow_1_5_1_1 = aNewDataFlow_1_4_1_1_1_1.GraphMNode( aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 ) + Macro_aNewDataFlow_1_5_1_1.SetCoupled( 'aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1' ) + Macro_aNewDataFlow_1_5_1_1.SetName( 'Macro_aNewDataFlow_1_5_1_1' ) + Macro_aNewDataFlow_1_5_1_1.SetAuthor( '' ) + Macro_aNewDataFlow_1_5_1_1.SetComment( 'Macro Node' ) + Macro_aNewDataFlow_1_5_1_1.Coords( 391 , 121 ) + IMacro_aNewDataFlow_1_5_1_1sum__a = Macro_aNewDataFlow_1_5_1_1.GetInPort( 'sum__a' ) + IMacro_aNewDataFlow_1_5_1_1sum__b = Macro_aNewDataFlow_1_5_1_1.GetInPort( 'sum__b' ) + IMacro_aNewDataFlow_1_5_1_1Gate = Macro_aNewDataFlow_1_5_1_1.GetInPort( 'Gate' ) + OMacro_aNewDataFlow_1_5_1_1Mult__b = Macro_aNewDataFlow_1_5_1_1.GetOutPort( 'Mult__b' ) + OMacro_aNewDataFlow_1_5_1_1Gate = Macro_aNewDataFlow_1_5_1_1.GetOutPort( 'Gate' ) + + # Creation of Links + LgagGateMakeBox1Gate = aNewDataFlow_1_4_1_1_1_1.Link( OgagGate , IMakeBox1Gate ) + + LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_1_1_1_1.Link( OgagGate , IMakeSphere_1Gate ) + LgagGateMakeSphere_1Gate.AddCoord( 1 , 175 , 470 ) + LgagGateMakeSphere_1Gate.AddCoord( 2 , 175 , 198 ) + + LMakeBox1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeBox1shape , IMakeCopy_1shape1 ) + + LMakeBox1shapeMakeCopy_2shape1 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeBox1shape , IMakeCopy_2shape1 ) + LMakeBox1shapeMakeCopy_2shape1.AddCoord( 1 , 373 , 211 ) + + LMakeCopy_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 ) + + LMakeCopy_2shapeMakeFuse_1shape2 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 ) + LMakeCopy_2shapeMakeFuse_1shape2.AddCoord( 1 , 674 , 207 ) + + LMakeSphere_1shapeMakeFuse_2shape2 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeSphere_1shape , IMakeFuse_2shape2 ) + + LMakeFuse_1shapeMakeFuse_2shape1 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeFuse_1shape , IMakeFuse_2shape1 ) + LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 1 , 1017 , 366 ) + LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 2 , 1017 , 187 ) + + LMacro_aNewDataFlow_1_5_1_1Mult__bMakeTranslation_1y1 = aNewDataFlow_1_4_1_1_1_1.Link( OMacro_aNewDataFlow_1_5_1_1Mult__b , IMakeTranslation_1y1 ) + + LMakeTranslation_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_1_1_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 ) + + # 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 ) + IMacro_aNewDataFlow_1_5_1_1sum__a.Input( 1 ) + IMacro_aNewDataFlow_1_5_1_1sum__b.Input( 2 ) + IMakeTranslation_1x1.Input( 25 ) + IMakeTranslation_1z1.Input( 25 ) + + # Output Ports of the graph + #OMakeFuse_2shape = MakeFuse_2.GetOutPort( 'shape' ) + return aNewDataFlow_1_4_1_1_1_1 + +# Graph creation of aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 +def DefaNewDataFlow_1_5_1_1_3_3_1_1_1_3_1() : + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 = Graph( 'aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1' ) + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.SetCoupled( 'Macro_aNewDataFlow_1_5_1_1' ) + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.SetName( 'aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1' ) + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.SetAuthor( '' ) + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.SetComment( '' ) + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + Pysum = [] + Pysum.append( 'def sum(a, b): ' ) + Pysum.append( ' return a+b ' ) + sum = aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.INode( 'sum' , Pysum ) + sum.SetName( 'sum' ) + sum.SetAuthor( '' ) + sum.SetComment( 'Compute Node' ) + sum.Coords( 52 , 80 ) + Isuma = sum.InPort( 'a' , 'double' ) + Isumb = sum.InPort( 'b' , 'double' ) + IsumGate = sum.GetInPort( 'Gate' ) + Osums = sum.OutPort( 's' , 'double' ) + OsumGate = sum.GetOutPort( 'Gate' ) + + PyMult = [] + PyMult.append( 'def Mult(a): ' ) + PyMult.append( ' b = a*3 ' ) + PyMult.append( ' return b ' ) + Mult = aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.INode( 'Mult' , PyMult ) + Mult.SetName( 'Mult' ) + Mult.SetAuthor( '' ) + Mult.SetComment( 'Compute Node' ) + Mult.Coords( 298 , 72 ) + IMulta = Mult.InPort( 'a' , 'double' ) + IMultGate = Mult.GetInPort( 'Gate' ) + OMultb = Mult.OutPort( 'b' , 'double' ) + OMultGate = Mult.GetOutPort( 'Gate' ) + + # Creation of Links + LsumsMulta = aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1.Link( Osums , IMulta ) + + # Input Ports of the graph + #Isuma = sum.GetInPort( 'a' ) + #Isumb = sum.GetInPort( 'b' ) + + # Output Ports of the graph + #OMultb = Mult.GetOutPort( 'b' ) + return aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 + + +aNewDataFlow_1_4_1_1_1_1 = DefaNewDataFlow_1_4_1_1_1_1() diff --git a/examples/MacroWithGeom_py.xml b/examples/MacroWithGeom_py.xml new file mode 100644 index 0000000..f73d935 --- /dev/null +++ b/examples/MacroWithGeom_py.xml @@ -0,0 +1,704 @@ + + + + + +? + ? + aNewDataFlow_1_4_1_1_1_1 + 1 + ? + +aNewDataFlow_1_4_1_1_1_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 + Macro_aNewDataFlow_1_5_1_1__sum__a + +double + Macro_aNewDataFlow_1_5_1_1__sum__b + +double + MakeTranslation_1__x1 + +double + MakeTranslation_1__z1 + + +objref + MakeFuse_2__shape + + + 25/8/2004 - 16:28:50 + 29/10/2004 - 15:25:57 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeBox1 + 3 + ? + +MakeBox1 + + +double + x1 + +double + y1 + +double + z1 + +double + x2 + +double + y2 + +double + z2 + + +objref + shape + + + +MakeBox1 + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 194 + 3 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 389 + 3 + +? + ? + MakeCopy_2 + 3 + ? + +MakeCopy_2 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_2 + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 391 + 264 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 203 + 315 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 823 + 116 + +? + ? + MakeFuse_2 + 3 + ? + +MakeFuse_2 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_2 + + + + + + + + + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 1049 + 295 + +? + ? + Macro_aNewDataFlow_1_5_1_1 + 10 + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 + +aNewDataFlow_1_5_1_1 + + +double + sum__a + +double + sum__b + + +double + Mult__b + + + +? + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Macro Node + 391 + 121 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 29/10/2004 - 15:24:21 + 29/10/2004 - 15:24:21 + 2.0 + ? + ? + Compute Node + 621 + 12 + + +gag + Gate + MakeBox1 + Gate + + +gag + Gate + MakeSphere_1 + Gate + + +175 + 470 + +175 + 198 + +MakeBox1 + shape + MakeCopy_1 + shape1 + + +MakeBox1 + shape + MakeCopy_2 + shape1 + + +373 + 211 + +MakeCopy_1 + shape + MakeTranslation_1 + shape1 + + +MakeCopy_2 + shape + MakeFuse_1 + shape2 + + +674 + 207 + +MakeSphere_1 + shape + MakeFuse_2 + shape2 + + +MakeFuse_1 + shape + MakeFuse_2 + shape1 + + +1017 + 366 + +1017 + 187 + +Macro_aNewDataFlow_1_5_1_1 + Mult__b + MakeTranslation_1 + y1 + + +MakeTranslation_1 + shape + MakeFuse_1 + shape1 + + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__x1 + MakeBox1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__y1 + MakeBox1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__z1 + MakeBox1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__x2 + MakeBox1 + x2 + +7 + 50 + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__y2 + MakeBox1 + y2 + +7 + 50 + + +aNewDataFlow_1_4_1_1_1_1 + MakeBox1__z2 + MakeBox1 + z2 + +7 + 50 + + +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__x1 + MakeSphere_1 + x1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__y1 + MakeSphere_1 + y1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__z1 + MakeSphere_1 + z1 + +7 + 0 + + +aNewDataFlow_1_4_1_1_1_1 + MakeSphere_1__radius + MakeSphere_1 + radius + +7 + 12 + + +aNewDataFlow_1_4_1_1_1_1 + Macro_aNewDataFlow_1_5_1_1__sum__a + Macro_aNewDataFlow_1_5_1_1 + sum__a + +7 + 1 + + +aNewDataFlow_1_4_1_1_1_1 + Macro_aNewDataFlow_1_5_1_1__sum__b + Macro_aNewDataFlow_1_5_1_1 + sum__b + +7 + 2 + + +aNewDataFlow_1_4_1_1_1_1 + MakeTranslation_1__x1 + MakeTranslation_1 + x1 + +7 + 25 + + +aNewDataFlow_1_4_1_1_1_1 + MakeTranslation_1__z1 + MakeTranslation_1 + z1 + +7 + 25 + + + + +? + ? + aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 + 1 + ? + +aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 + + +double + sum__a + +double + sum__b + + +double + Mult__b + + + 25/6/2004 - 17:42:12 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + sum + 3 + ? + +sum + + +double + a + +double + b + + +double + s + + + +sum + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 52 + 80 + +? + ? + Mult + 3 + ? + +Mult + + +double + a + + +double + b + + + +Mult + + + + 29/10/2004 - 15:22:47 + 29/10/2004 - 15:22:47 + 2.0 + ? + ? + Compute Node + 298 + 72 + + +sum + s + Mult + a + + diff --git a/examples/NewGraphGeomEssai.py b/examples/NewGraphGeomEssai.py index ca8ef7a..b851704 100644 --- a/examples/NewGraphGeomEssai.py +++ b/examples/NewGraphGeomEssai.py @@ -1,84 +1,103 @@ -# 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 -# 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 +def DefaNewDataFlow_1() : + aNewDataFlow_1 = Graph( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetName( 'aNewDataFlow_1' ) + aNewDataFlow_1.SetAuthor( '' ) + aNewDataFlow_1.SetComment( '' ) + aNewDataFlow_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + SetStudyID = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) + SetStudyID.SetName( 'SetStudyID' ) + SetStudyID.SetAuthor( '' ) + SetStudyID.SetContainer( 'localhost/FactoryServer' ) + SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' ) + SetStudyID.Coords( 9 , 118 ) + ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' ) + ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' ) + OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' ) + + MakeSphere = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) + MakeSphere.SetName( 'MakeSphere' ) + MakeSphere.SetAuthor( '' ) + MakeSphere.SetContainer( 'localhost/FactoryServer' ) + MakeSphere.SetComment( 'MakeSphere from GEOM_Superv' ) + MakeSphere.Coords( 202 , 58 ) + IMakeSpheretheX = MakeSphere.GetInPort( 'theX' ) + IMakeSpheretheY = MakeSphere.GetInPort( 'theY' ) + IMakeSpheretheZ = MakeSphere.GetInPort( 'theZ' ) + IMakeSpheretheRadius = MakeSphere.GetInPort( 'theRadius' ) + IMakeSphereGate = MakeSphere.GetInPort( 'Gate' ) + OMakeSpherereturn = MakeSphere.GetOutPort( 'return' ) + OMakeSphereGate = MakeSphere.GetOutPort( 'Gate' ) + + MakeCopy = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy.SetName( 'MakeCopy' ) + MakeCopy.SetAuthor( '' ) + MakeCopy.SetContainer( 'localhost/FactoryServer' ) + MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' ) + MakeCopy.Coords( 425 , 11 ) + IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' ) + IMakeCopyGate = MakeCopy.GetInPort( 'Gate' ) + OMakeCopyreturn = MakeCopy.GetOutPort( 'return' ) + OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' ) + + TranslateDXDYDZ = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' ) + TranslateDXDYDZ.SetAuthor( '' ) + TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' ) + TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' ) + TranslateDXDYDZ.Coords( 428 , 197 ) + ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' ) + ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' ) + ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' ) + ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' ) + ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' ) + OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' ) + OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' ) + + MakeFuse = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse.SetName( 'MakeFuse' ) + MakeFuse.SetAuthor( '' ) + MakeFuse.SetContainer( 'localhost/FactoryServer' ) + MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' ) + MakeFuse.Coords( 651 , 103 ) + IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' ) + IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' ) + IMakeFuseGate = MakeFuse.GetInPort( 'Gate' ) + OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' ) + + # Creation of Links + LSetStudyIDGateMakeSphereGate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeSphereGate ) + + LMakeSpherereturnMakeCopytheOriginal = aNewDataFlow_1.Link( OMakeSpherereturn , IMakeCopytheOriginal ) + + LMakeSpherereturnTranslateDXDYDZtheObject = aNewDataFlow_1.Link( OMakeSpherereturn , ITranslateDXDYDZtheObject ) + + LMakeCopyreturnMakeFusetheShape1 = aNewDataFlow_1.Link( OMakeCopyreturn , IMakeFusetheShape1 ) + + LTranslateDXDYDZreturnMakeFusetheShape2 = aNewDataFlow_1.Link( OTranslateDXDYDZreturn , IMakeFusetheShape2 ) + + # Input datas + ISetStudyIDtheStudyID.Input( 1 ) + IMakeSpheretheX.Input( 0 ) + IMakeSpheretheY.Input( 0 ) + IMakeSpheretheZ.Input( 0 ) + IMakeSpheretheRadius.Input( 50 ) + ITranslateDXDYDZtheDX.Input( 80 ) + ITranslateDXDYDZtheDY.Input( 0 ) + ITranslateDXDYDZtheDZ.Input( 0 ) + + # Output Ports of the graph + #OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + return aNewDataFlow_1 -NewGraphGeomEssai.PrintPorts() +aNewDataFlow_1 = DefaNewDataFlow_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..9cbb7e2 100644 --- a/examples/NewGraphGeomEssai.xml +++ b/examples/NewGraphGeomEssai.xml @@ -1,332 +1,304 @@ - - - - - + + - - - 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 + 1 + ? + +aNewDataFlow_1 + + +long + SetStudyID__theStudyID + +double + MakeSphere__theX + +double + MakeSphere__theY + +double + MakeSphere__theZ + +double + MakeSphere__theRadius + +double + TranslateDXDYDZ__theDX + +double + TranslateDXDYDZ__theDY + +double + TranslateDXDYDZ__theDZ + + +GEOM_Object + MakeFuse__return + + + 29/10/2004 - 11:15:45 + 11/11/2004 - 13:5:45 + 2.0 + ? + ? + ? + 0 + 0 + + +GEOM_Superv + GEOM_Superv + SetStudyID + 0 + ? + +SetStudyID + + +long + theStudyID + + + + 11/11/2004 - 13:3:46 + 11/11/2004 - 13:3:46 + 2.0 + ? + localhost/FactoryServer + SetStudyID from GEOM_Superv + 9 + 118 + +GEOM_Superv + GEOM_Superv + MakeSphere + 0 + ? + +MakeSphere + + +double + theX + +double + theY + +double + theZ + +double + theRadius + + +GEOM_Object + return + + + 11/11/2004 - 13:4:18 + 11/11/2004 - 13:4:18 + 2.0 + ? + localhost/FactoryServer + MakeSphere from GEOM_Superv + 202 + 58 + +GEOM_Superv + GEOM_Superv + MakeCopy + 0 + ? + +MakeCopy + + +GEOM_Object + theOriginal + + +GEOM_Object + return + + + 11/11/2004 - 13:4:49 + 11/11/2004 - 13:4:49 + 2.0 + ? + localhost/FactoryServer + MakeCopy from GEOM_Superv + 425 + 11 + +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 + ? + +TranslateDXDYDZ + + +GEOM_Object + theObject + +double + theDX + +double + theDY + +double + theDZ + + +GEOM_Object + return + + + 11/11/2004 - 13:5:12 + 11/11/2004 - 13:5:12 + 2.0 + ? + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 428 + 197 + +GEOM_Superv + GEOM_Superv + MakeFuse + 0 + ? + +MakeFuse + + +GEOM_Object + theShape1 + +GEOM_Object + theShape2 + + +GEOM_Object + return + + + 11/11/2004 - 13:5:36 + 11/11/2004 - 13:5:36 + 2.0 + ? + localhost/FactoryServer + MakeFuse from GEOM_Superv + 651 + 103 + + +SetStudyID + Gate + MakeSphere + Gate + + +MakeSphere + return + MakeCopy + theOriginal + + +MakeSphere + return + TranslateDXDYDZ + theObject + + +MakeCopy + return + MakeFuse + theShape1 + + +TranslateDXDYDZ + return + MakeFuse + theShape2 + + + +aNewDataFlow_1 + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow_1 + MakeSphere__theX + MakeSphere + theX + +7 + 0 + + +aNewDataFlow_1 + MakeSphere__theY + MakeSphere + theY + +7 + 0 + + +aNewDataFlow_1 + MakeSphere__theZ + MakeSphere + theZ + +7 + 0 + + +aNewDataFlow_1 + MakeSphere__theRadius + MakeSphere + theRadius + +7 + 50 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX + +7 + 80 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY + +7 + 0 + + +aNewDataFlow_1 + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ + +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/examples/NewGraphGeomEssai_py.py b/examples/NewGraphGeomEssai_py.py new file mode 100644 index 0000000..94809ba --- /dev/null +++ b/examples/NewGraphGeomEssai_py.py @@ -0,0 +1,127 @@ + +# Generated python file of Graph aNewDataFlow_1_4_2_1 + +from SuperV import * + +# 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=MakeSpherePntR(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 + + +aNewDataFlow_1_4_2_1 = DefaNewDataFlow_1_4_2_1() diff --git a/examples/NewGraphGeomEssai_py.xml b/examples/NewGraphGeomEssai_py.xml new file mode 100644 index 0000000..17ad7ca --- /dev/null +++ b/examples/NewGraphGeomEssai_py.xml @@ -0,0 +1,324 @@ + + + + + +? + ? + 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 + 29/10/2004 - 15:17:44 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + gag + 3 + ? + +gag + + + + + +gag + + + + + 29/10/2004 - 15:17:44 + 29/10/2004 - 15:17:44 + 2.0 + ? + ? + Compute Node + 0 + 123 + +? + ? + MakeCopy_1 + 3 + ? + +MakeCopy_1 + + +objref + shape1 + + +objref + shape + + + +MakeCopy_1 + + + + 29/10/2004 - 15:17:44 + 29/10/2004 - 15:17:44 + 2.0 + ? + ? + Compute Node + 385 + 3 + +? + ? + MakeSphere_1 + 3 + ? + +MakeSphere_1 + + +double + x1 + +double + y1 + +double + z1 + +double + radius + + +objref + shape + + + +MakeSphere_1 + + + + + 29/10/2004 - 15:17:44 + 29/10/2004 - 15:17:44 + 2.0 + ? + ? + Compute Node + 193 + 67 + +? + ? + MakeTranslation_1 + 3 + ? + +MakeTranslation_1 + + +objref + shape1 + +double + x1 + +double + y1 + +double + z1 + + +objref + shape + + + +MakeTranslation_1 + + + + 29/10/2004 - 15:17:44 + 29/10/2004 - 15:17:44 + 2.0 + ? + ? + Compute Node + 388 + 146 + +? + ? + MakeFuse_1 + 3 + ? + +MakeFuse_1 + + +objref + shape1 + +objref + shape2 + + +objref + shape + + + +MakeFuse_1 + + + + + + + + + + + + 29/10/2004 - 15:17:44 + 29/10/2004 - 15:17:44 + 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/SupervRheolefGraph.py b/examples/SupervRheolefGraph.py deleted file mode 100755 index 65c720f..0000000 --- a/examples/SupervRheolefGraph.py +++ /dev/null @@ -1,213 +0,0 @@ - -# Generated python file of Graph aNewDataFlow - -from SuperV import * -# Graph creation -aNewDataFlow = Graph( 'aNewDataFlow' ) -aNewDataFlow.SetName( 'aNewDataFlow' ) -aNewDataFlow.SetAuthor( '' ) -aNewDataFlow.SetComment( '' ) -aNewDataFlow.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -InitCL = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'InitCL' ) -InitCL.SetName( 'InitCL' ) -InitCL.SetAuthor( '' ) -InitCL.SetContainer( 'localhost/FactoryServer' ) -InitCL.SetComment( 'InitCL from CLRheolef' ) -InitCL.Coords( 414 , 334 ) - -MakeBox = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBox' ) -MakeBox.SetName( 'MakeBox' ) -MakeBox.SetAuthor( '' ) -MakeBox.SetContainer( 'localhost/FactoryServer' ) -MakeBox.SetComment( 'MakeBox from Geometry' ) -MakeBox.Coords( 7 , 29 ) - -MeshGeomShapeSup = aNewDataFlow.FNode( 'QMG' , 'QMG' , 'MeshGeomShapeSup' ) -MeshGeomShapeSup.SetName( 'MeshGeomShapeSup' ) -MeshGeomShapeSup.SetAuthor( '' ) -MeshGeomShapeSup.SetContainer( 'localhost/FactoryServer' ) -MeshGeomShapeSup.SetComment( 'MeshGeomShapeSup from QMG' ) -MeshGeomShapeSup.Coords( 372 , 0 ) - -SolveSup = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'SolveSup' ) -SolveSup.SetName( 'SolveSup' ) -SolveSup.SetAuthor( '' ) -SolveSup.SetContainer( 'localhost/FactoryServer' ) -SolveSup.SetComment( 'SolveSup from Rheolef' ) -SolveSup.Coords( 1030 , 304 ) - -ModifyCL = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' ) -ModifyCL.SetName( 'ModifyCL' ) -ModifyCL.SetAuthor( '' ) -ModifyCL.SetContainer( 'localhost/FactoryServer' ) -ModifyCL.SetComment( 'ModifyCL from CLRheolef' ) -ModifyCL.Coords( 602 , 335 ) - -MakeBoolean = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBoolean' ) -MakeBoolean.SetName( 'MakeBoolean' ) -MakeBoolean.SetAuthor( '' ) -MakeBoolean.SetContainer( 'localhost/FactoryServer' ) -MakeBoolean.SetComment( 'MakeBoolean from Geometry' ) -MakeBoolean.Coords( 188 , 30 ) - -MakeBox_1 = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeBox' ) -MakeBox_1.SetName( 'MakeBox_1' ) -MakeBox_1.SetAuthor( '' ) -MakeBox_1.SetContainer( 'localhost/FactoryServer' ) -MakeBox_1.SetComment( 'MakeBox from Geometry' ) -MakeBox_1.Coords( 0 , 325 ) - -MakeTranslation = aNewDataFlow.FNode( 'Geometry' , 'Geometry' , 'MakeTranslation' ) -MakeTranslation.SetName( 'MakeTranslation' ) -MakeTranslation.SetAuthor( '' ) -MakeTranslation.SetContainer( 'localhost/FactoryServer' ) -MakeTranslation.SetComment( 'MakeTranslation from Geometry' ) -MakeTranslation.Coords( 190 , 325 ) - -FindNode = aNewDataFlow.FNode( 'QMG' , 'QMG' , 'FindNode' ) -FindNode.SetName( 'FindNode' ) -FindNode.SetAuthor( '' ) -FindNode.SetContainer( 'localhost/FactoryServer' ) -FindNode.SetComment( 'FindNode from QMG' ) -FindNode.Coords( 621 , 0 ) - -ValueOf = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'ValueOf' ) -ValueOf.SetName( 'ValueOf' ) -ValueOf.SetAuthor( '' ) -ValueOf.SetContainer( 'localhost/FactoryServer' ) -ValueOf.SetComment( 'ValueOf from Rheolef' ) -ValueOf.Coords( 832 , 42 ) - -ModifyCL_1 = aNewDataFlow.FNode( 'CLRheolef' , 'CLRheolef' , 'ModifyCL' ) -ModifyCL_1.SetName( 'ModifyCL_1' ) -ModifyCL_1.SetAuthor( '' ) -ModifyCL_1.SetContainer( 'localhost/FactoryServer' ) -ModifyCL_1.SetComment( 'ModifyCL from CLRheolef' ) -ModifyCL_1.Coords( 800 , 334 ) - -Plot = aNewDataFlow.FNode( 'Rheolef' , 'Rheolef' , 'Plot' ) -Plot.SetName( 'Plot' ) -Plot.SetAuthor( '' ) -Plot.SetContainer( 'localhost/FactoryServer' ) -Plot.SetComment( 'Plot from Rheolef' ) -Plot.Coords( 1029 , 41 ) - -Add = aNewDataFlow.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) -Add.SetName( 'Add' ) -Add.SetAuthor( '' ) -Add.SetContainer( 'localhost/FactoryServer' ) -Add.SetComment( 'Add from AddComponent' ) -Add.Coords( 0 , 610 ) - -# Creation of Links -InitCLreturn = InitCL.Port( 'return' ) -ModifyCLmyRheolefData = aNewDataFlow.Link( InitCLreturn , ModifyCL.Port( 'myRheolefData' ) ) - -MakeBoxshape = MakeBox.Port( 'shape' ) -MakeBooleanshape1 = aNewDataFlow.Link( MakeBoxshape , MakeBoolean.Port( 'shape1' ) ) - -MeshGeomShapeSupreturn = MeshGeomShapeSup.Port( 'return' ) -SolveSupmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , SolveSup.Port( 'myMesh' ) ) -SolveSupmyMesh.AddCoord( 1 , 985 , 442 ) -SolveSupmyMesh.AddCoord( 2 , 984 , 301 ) -SolveSupmyMesh.AddCoord( 3 , 561 , 300 ) -SolveSupmyMesh.AddCoord( 4 , 561 , 83 ) - -InitCLmyMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , InitCL.Port( 'myMesh' ) ) -InitCLmyMesh.AddCoord( 1 , 385 , 502 ) -InitCLmyMesh.AddCoord( 2 , 384 , 301 ) -InitCLmyMesh.AddCoord( 3 , 561 , 300 ) -InitCLmyMesh.AddCoord( 4 , 561 , 81 ) - -FindNodeaMesh = aNewDataFlow.Link( MeshGeomShapeSupreturn , FindNode.Port( 'aMesh' ) ) - -SolveSupreturn = SolveSup.Port( 'return' ) -ValueOfaField = aNewDataFlow.Link( SolveSupreturn , ValueOf.Port( 'aField' ) ) -ValueOfaField.AddCoord( 1 , 818 , 122 ) -ValueOfaField.AddCoord( 2 , 817 , 26 ) -ValueOfaField.AddCoord( 3 , 1216 , 26 ) -ValueOfaField.AddCoord( 4 , 1218 , 385 ) - -ModifyCLreturn = ModifyCL.Port( 'return' ) -ModifyCL_1myRheolefData = aNewDataFlow.Link( ModifyCLreturn , ModifyCL_1.Port( 'myRheolefData' ) ) - -MakeBooleanshape = MakeBoolean.Port( 'shape' ) -MeshGeomShapeSupshape = aNewDataFlow.Link( MakeBooleanshape , MeshGeomShapeSup.Port( 'shape' ) ) - -MakeBox_1shape = MakeBox_1.Port( 'shape' ) -MakeTranslationshape1 = aNewDataFlow.Link( MakeBox_1shape , MakeTranslation.Port( 'shape1' ) ) - -MakeTranslationshape = MakeTranslation.Port( 'shape' ) -MakeBooleanshape2 = aNewDataFlow.Link( MakeTranslationshape , MakeBoolean.Port( 'shape2' ) ) -MakeBooleanshape2.AddCoord( 1 , 182 , 140 ) -MakeBooleanshape2.AddCoord( 2 , 181 , 261 ) -MakeBooleanshape2.AddCoord( 3 , 363 , 260 ) -MakeBooleanshape2.AddCoord( 4 , 363 , 411 ) -MakeBooleanshape2.AddCoord( 5 , 327 , 408 ) - -FindNodereturn = FindNode.Port( 'return' ) -ValueOfnumberOfNode = aNewDataFlow.Link( FindNodereturn , ValueOf.Port( 'numberOfNode' ) ) -ValueOfnumberOfNode.AddCoord( 1 , 799 , 152 ) -ValueOfnumberOfNode.AddCoord( 2 , 798 , 81 ) - -ValueOfreturn = ValueOf.Port( 'return' ) -PlotValue = aNewDataFlow.Link( ValueOfreturn , Plot.Port( 'Value' ) ) - -ModifyCL_1return = ModifyCL_1.Port( 'return' ) -SolveSupmyRheolefData = aNewDataFlow.Link( ModifyCL_1return , SolveSup.Port( 'myRheolefData' ) ) - -Addz = Add.Port( 'z' ) -MakeTranslationy1 = aNewDataFlow.Link( Addz , MakeTranslation.Port( 'y1' ) ) -MakeTranslationy1.AddCoord( 1 , 181 , 464 ) -MakeTranslationy1.AddCoord( 2 , 182 , 720 ) - -FindNodey = aNewDataFlow.Link( Addz , FindNode.Port( 'y' ) ) -FindNodey.AddCoord( 1 , 592 , 139 ) -FindNodey.AddCoord( 2 , 593 , 720 ) - -PlotPosition = aNewDataFlow.Link( Addz , Plot.Port( 'Position' ) ) -PlotPosition.AddCoord( 1 , 1010 , 150 ) -PlotPosition.AddCoord( 2 , 1011 , 720 ) - -# Creation of Input datas -InitCLstudyId = InitCL.Input( 'studyId' , 1) -InitCLdataName = InitCL.Input( 'dataName' , 'BoxData') -InitCLsource = InitCL.Input( 'source' , 0) -MakeBoxx1 = MakeBox.Input( 'x1' , 0) -MakeBoxy1 = MakeBox.Input( 'y1' , 0) -MakeBoxz1 = MakeBox.Input( 'z1' , 0) -MakeBoxx2 = MakeBox.Input( 'x2' , 100) -MakeBoxy2 = MakeBox.Input( 'y2' , 500) -MakeBoxz2 = MakeBox.Input( 'z2' , 50) -MeshGeomShapeSupstudyId = MeshGeomShapeSup.Input( 'studyId' , 1) -MeshGeomShapeSupsizeControl = MeshGeomShapeSup.Input( 'sizeControl' , 999999) -MeshGeomShapeSupcurveControl = MeshGeomShapeSup.Input( 'curveControl' , 0.5) -MeshGeomShapeSuptolmesh = MeshGeomShapeSup.Input( 'tolmesh' , 1e-05) -MeshGeomShapeSuptolskin = MeshGeomShapeSup.Input( 'tolskin' , 0) -SolveSupstudyId = SolveSup.Input( 'studyId' , 1) -ModifyCLfaceToModify = ModifyCL.Input( 'faceToModify' , 3) -ModifyCLnewFaceCLtype = ModifyCL.Input( 'newFaceCLtype' , 1) -ModifyCLnewFaceValue = ModifyCL.Input( 'newFaceValue' , 0) -MakeBooleanoperation = MakeBoolean.Input( 'operation' , 2) -MakeBox_1x1 = MakeBox_1.Input( 'x1' , 0) -MakeBox_1y1 = MakeBox_1.Input( 'y1' , 0) -MakeBox_1z1 = MakeBox_1.Input( 'z1' , 0) -MakeBox_1x2 = MakeBox_1.Input( 'x2' , 40) -MakeBox_1y2 = MakeBox_1.Input( 'y2' , 40) -MakeBox_1z2 = MakeBox_1.Input( 'z2' , 70) -MakeTranslationx1 = MakeTranslation.Input( 'x1' , 30) -MakeTranslationz1 = MakeTranslation.Input( 'z1' , -10) -FindNodex = FindNode.Input( 'x' , 50) -FindNodez = FindNode.Input( 'z' , 25) -ModifyCL_1faceToModify = ModifyCL_1.Input( 'faceToModify' , 5) -ModifyCL_1newFaceCLtype = ModifyCL_1.Input( 'newFaceCLtype' , 1) -ModifyCL_1newFaceValue = ModifyCL_1.Input( 'newFaceValue' , 1) -PlotFilename = Plot.Input( 'Filename' , 'Result.plt') -Addx = Add.Input( 'x' , 0) -Addy = Add.Input( 'y' , 10) - -# Creation of Output variables -AddFuncValue = Add.Port( 'FuncValue' ) diff --git a/examples/SupervRheolefGraph.xml b/examples/SupervRheolefGraph.xml deleted file mode 100755 index 0203403..0000000 --- a/examples/SupervRheolefGraph.xml +++ /dev/null @@ -1,1072 +0,0 @@ - - - - -? - ? - aNewDataFlow - 1 - ? - -aNewDataFlow - - -long - InitCL\studyId - -string - InitCL\dataName - -double - InitCL\source - -double - MakeBox\x1 - -double - MakeBox\y1 - -double - MakeBox\z1 - -double - MakeBox\x2 - -double - MakeBox\y2 - -double - MakeBox\z2 - -long - MeshGeomShapeSup\studyId - -double - MeshGeomShapeSup\sizeControl - -double - MeshGeomShapeSup\curveControl - -double - MeshGeomShapeSup\tolmesh - -double - MeshGeomShapeSup\tolskin - -long - SolveSup\studyId - -long - ModifyCL\faceToModify - -long - ModifyCL\newFaceCLtype - -double - ModifyCL\newFaceValue - -long - MakeBoolean\operation - -double - MakeBox_1\x1 - -double - MakeBox_1\y1 - -double - MakeBox_1\z1 - -double - MakeBox_1\x2 - -double - MakeBox_1\y2 - -double - MakeBox_1\z2 - -double - MakeTranslation\x1 - -double - MakeTranslation\z1 - -double - FindNode\x - -double - FindNode\z - -long - ModifyCL_1\faceToModify - -long - ModifyCL_1\newFaceCLtype - -double - ModifyCL_1\newFaceValue - -string - Plot\Filename - -double - Add\x - -double - Add\y - - -double - Add\FuncValue - - - 14/7/2002 - 21:1:52 - 19/9/2003 - 15:24:7 - 1.03 - ? - ? - ? - 0 - 0 - - -CLRheolef - CLRheolef - InitCL - 0 - ? - -InitCL - - -long - studyId - -string - dataName - -double - source - -QMG_Mesh - myMesh - - -Rheolef_Data - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - InitCL from CLRheolef - 414 - 334 - -Geometry - Geometry - MakeBox - 0 - ? - -MakeBox - - -double - x1 - -double - y1 - -double - z1 - -double - x2 - -double - y2 - -double - z2 - - -GEOM_Shape - shape - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - MakeBox from Geometry - 7 - 29 - -QMG - QMG - MeshGeomShapeSup - 0 - ? - -MeshGeomShapeSup - - -long - studyId - -GEOM_Shape - shape - -double - sizeControl - -double - curveControl - -double - tolmesh - -double - tolskin - - -QMG_Mesh - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - MeshGeomShapeSup from QMG - 372 - 0 - -Rheolef - Rheolef - SolveSup - 0 - ? - -SolveSup - - -long - studyId - -Rheolef_Data - myRheolefData - -QMG_Mesh - myMesh - - -Rheolef_Field - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - SolveSup from Rheolef - 1030 - 304 - -CLRheolef - CLRheolef - ModifyCL - 0 - ? - -ModifyCL - - -Rheolef_Data - myRheolefData - -long - faceToModify - -long - newFaceCLtype - -double - newFaceValue - - -Rheolef_Data - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - ModifyCL from CLRheolef - 602 - 335 - -Geometry - Geometry - MakeBoolean - 0 - ? - -MakeBoolean - - -GEOM_Shape - shape1 - -GEOM_Shape - shape2 - -long - operation - - -GEOM_Shape - shape - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - MakeBoolean from Geometry - 188 - 30 - -Geometry - Geometry - MakeBox_1 - 0 - ? - -MakeBox - - -double - x1 - -double - y1 - -double - z1 - -double - x2 - -double - y2 - -double - z2 - - -GEOM_Shape - shape - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - MakeBox from Geometry - 0 - 325 - -Geometry - Geometry - MakeTranslation - 0 - ? - -MakeTranslation - - -GEOM_Shape - shape1 - -double - x1 - -double - y1 - -double - z1 - - -GEOM_Shape - shape - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - MakeTranslation from Geometry - 190 - 325 - -QMG - QMG - FindNode - 0 - ? - -FindNode - - -QMG_Mesh - aMesh - -double - x - -double - y - -double - z - - -long - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - FindNode from QMG - 621 - 0 - -Rheolef - Rheolef - ValueOf - 0 - ? - -ValueOf - - -Rheolef_Field - aField - -long - numberOfNode - - -double - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - ValueOf from Rheolef - 832 - 42 - -CLRheolef - CLRheolef - ModifyCL_1 - 0 - ? - -ModifyCL - - -Rheolef_Data - myRheolefData - -long - faceToModify - -long - newFaceCLtype - -double - newFaceValue - - -Rheolef_Data - return - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - ModifyCL from CLRheolef - 800 - 334 - -Rheolef - Rheolef - Plot - 0 - ? - -Plot - - -double - Value - -double - Position - -string - Filename - - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - Plot from Rheolef - 1029 - 41 - -AddComponent - AddComponent - Add - 0 - ? - -Add - - -double - x - -double - y - - -double - FuncValue - -double - z - - - 19/9/2003 - 15:24:7 - 19/9/2003 - 15:24:7 - 1.03 - ? - localhost/FactoryServer - Add from AddComponent - 0 - 610 - - -InitCL - return - ModifyCL - myRheolefData - - -MakeBox - shape - MakeBoolean - shape1 - - -MeshGeomShapeSup - return - SolveSup - myMesh - - -985 - 442 - -984 - 301 - -561 - 300 - -561 - 83 - -MeshGeomShapeSup - return - InitCL - myMesh - - -385 - 502 - -384 - 301 - -561 - 300 - -561 - 81 - -MeshGeomShapeSup - return - FindNode - aMesh - - -SolveSup - return - ValueOf - aField - - -818 - 122 - -817 - 26 - -1216 - 26 - -1218 - 385 - -ModifyCL - return - ModifyCL_1 - myRheolefData - - -MakeBoolean - shape - MeshGeomShapeSup - shape - - -MakeBox_1 - shape - MakeTranslation - shape1 - - -MakeTranslation - shape - MakeBoolean - shape2 - - -182 - 140 - -181 - 261 - -363 - 260 - -363 - 411 - -327 - 408 - -FindNode - return - ValueOf - numberOfNode - - -799 - 152 - -798 - 81 - -ValueOf - return - Plot - Value - - -ModifyCL_1 - return - SolveSup - myRheolefData - - -Add - z - MakeTranslation - y1 - - -181 - 464 - -182 - 720 - -Add - z - FindNode - y - - -592 - 139 - -593 - 720 - -Add - z - Plot - Position - - -1010 - 150 - -1011 - 720 - - -aNewDataFlow - InitCL\studyId - InitCL - studyId - -3 - 1 - - -aNewDataFlow - InitCL\dataName - InitCL - dataName - -18 - BoxData - - -aNewDataFlow - InitCL\source - InitCL - source - -7 - 0 - - -aNewDataFlow - MakeBox\x1 - MakeBox - x1 - -7 - 0 - - -aNewDataFlow - MakeBox\y1 - MakeBox - y1 - -7 - 0 - - -aNewDataFlow - MakeBox\z1 - MakeBox - z1 - -7 - 0 - - -aNewDataFlow - MakeBox\x2 - MakeBox - x2 - -7 - 100 - - -aNewDataFlow - MakeBox\y2 - MakeBox - y2 - -7 - 500 - - -aNewDataFlow - MakeBox\z2 - MakeBox - z2 - -7 - 50 - - -aNewDataFlow - MeshGeomShapeSup\studyId - MeshGeomShapeSup - studyId - -3 - 1 - - -aNewDataFlow - MeshGeomShapeSup\sizeControl - MeshGeomShapeSup - sizeControl - -7 - 999999 - - -aNewDataFlow - MeshGeomShapeSup\curveControl - MeshGeomShapeSup - curveControl - -7 - 0.5 - - -aNewDataFlow - MeshGeomShapeSup\tolmesh - MeshGeomShapeSup - tolmesh - -7 - 1e-05 - - -aNewDataFlow - MeshGeomShapeSup\tolskin - MeshGeomShapeSup - tolskin - -7 - 0 - - -aNewDataFlow - SolveSup\studyId - SolveSup - studyId - -3 - 1 - - -aNewDataFlow - ModifyCL\faceToModify - ModifyCL - faceToModify - -3 - 3 - - -aNewDataFlow - ModifyCL\newFaceCLtype - ModifyCL - newFaceCLtype - -3 - 1 - - -aNewDataFlow - ModifyCL\newFaceValue - ModifyCL - newFaceValue - -7 - 0 - - -aNewDataFlow - MakeBoolean\operation - MakeBoolean - operation - -3 - 2 - - -aNewDataFlow - MakeBox_1\x1 - MakeBox_1 - x1 - -7 - 0 - - -aNewDataFlow - MakeBox_1\y1 - MakeBox_1 - y1 - -7 - 0 - - -aNewDataFlow - MakeBox_1\z1 - MakeBox_1 - z1 - -7 - 0 - - -aNewDataFlow - MakeBox_1\x2 - MakeBox_1 - x2 - -7 - 40 - - -aNewDataFlow - MakeBox_1\y2 - MakeBox_1 - y2 - -7 - 40 - - -aNewDataFlow - MakeBox_1\z2 - MakeBox_1 - z2 - -7 - 70 - - -aNewDataFlow - MakeTranslation\x1 - MakeTranslation - x1 - -7 - 30 - - -aNewDataFlow - MakeTranslation\z1 - MakeTranslation - z1 - -7 - -10 - - -aNewDataFlow - FindNode\x - FindNode - x - -7 - 50 - - -aNewDataFlow - FindNode\z - FindNode - z - -7 - 25 - - -aNewDataFlow - ModifyCL_1\faceToModify - ModifyCL_1 - faceToModify - -3 - 5 - - -aNewDataFlow - ModifyCL_1\newFaceCLtype - ModifyCL_1 - newFaceCLtype - -3 - 1 - - -aNewDataFlow - ModifyCL_1\newFaceValue - ModifyCL_1 - newFaceValue - -7 - 1 - - -aNewDataFlow - Plot\Filename - Plot - Filename - -18 - Result.plt - - -aNewDataFlow - Add\x - Add - x - -7 - 0 - - -aNewDataFlow - Add\y - Add - y - -7 - 10 - diff --git a/examples/myFactorialPy.py b/examples/myFactorialPy.py index 1c57f13..67f8e2a 100644 --- a/examples/myFactorialPy.py +++ b/examples/myFactorialPy.py @@ -20,6 +20,6 @@ myPy.Run( 3 ) myPy.DoneW() -myPy.State() +print myPy.State() myPy.PrintPorts() diff --git a/resources/SUPERVCatalog.xml b/resources/SUPERVCatalog.xml index 7e8c036..03a7017 100644 --- a/resources/SUPERVCatalog.xml +++ b/resources/SUPERVCatalog.xml @@ -16,7 +16,7 @@ Supervisor SUPERV ARS - 1.0 + 2.1.0 Supervision control GUI 1 ModuleSupervision.png diff --git a/resources/SUPERV_en.xml b/resources/SUPERV_en.xml index c268509..e65d8b9 100755 --- a/resources/SUPERV_en.xml +++ b/resources/SUPERV_en.xml @@ -23,9 +23,9 @@ - + - + @@ -35,12 +35,12 @@ - - - - - - + + + + + + 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..46c4407 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,16 +351,7 @@ 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 " -// << theInPort->GetOutPort() << endl ; RetVal = theInPort->IsDataConnected() ; } else { @@ -534,7 +528,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 +1142,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() << ".SetCoupled( '" + << ((GraphBase::GOTONode * ) this)->CoupledNodeName() << "' )" << endl ; + } + } else if ( IsDataStreamNode() && HasDataStream() != 0 ) { f << " " << Name() << " = StreamGraph( '" << Name() << "' )" << endl ; long Timeout ; @@ -1189,6 +1235,7 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName , else { f << " " << Name() << " = " << aGraphName << ".GraphMNode( ? )" << endl ; } + f << " " << Name() << ".SetCoupled( '" << 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_DataNode.cxx b/src/GraphBase/DataFlowBase_DataNode.cxx index 2ffb9ba..fa2e10f 100644 --- a/src/GraphBase/DataFlowBase_DataNode.cxx +++ b/src/GraphBase/DataFlowBase_DataNode.cxx @@ -119,8 +119,6 @@ int GraphBase::DataNode::CheckDataServerNodes() const { else { cdebug << "InPort " << anOutPort->PortName() << " " << anOutPort->PortType() << " " << anOutPort->PortStatus() << " of DataFlow " << Name() << " has Data : " -// << _DataFlowDataPorts->GetNodeOutPort(i)->Value() << " kind " -// << _DataFlowDataPorts->GetNodeOutPort(i)->Kind() << endl ; } } diff --git a/src/GraphBase/DataFlowBase_FactoryNode.cxx b/src/GraphBase/DataFlowBase_FactoryNode.cxx index 3f44450..d13d2d7 100644 --- a/src/GraphBase/DataFlowBase_FactoryNode.cxx +++ b/src/GraphBase/DataFlowBase_FactoryNode.cxx @@ -167,7 +167,7 @@ bool GraphBase::FactoryNode::Computer(const char *c) { if ( _Computer != FACTORYSERVER ) delete [] _Computer ; _Computer = my_strdup(c); - cdebug_in << "GraphBase::FactoryNode::Computer('" << _Computer << "')" << endl; + cdebug << "GraphBase::FactoryNode::Computer('" << _Computer << "')" << endl; cdebug_out << "GraphBase::FactoryNode::Computer" << endl; return true ; } 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..1d057a0 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 ; @@ -601,14 +599,14 @@ bool GraphBase::Graph::ReNameNode( const char* OldNodeName , RetVal = true ; } else { - cdebug << "Node not found" << endl ; + cdebug << "ERROR Node not found" << endl ; } } else { RetVal = Name( NewNodeName ) ; } - cdebug_out << "GraphBase::Graph::ReNameNode" << endl; + cdebug_out << "GraphBase::Graph::ReNameNode RetVal " << RetVal << endl; return RetVal ; } @@ -642,7 +640,8 @@ bool GraphBase::Graph::RemoveNode( const char* aNodeName ) { } else { GraphBase::ComputingNode * FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ; - if ( !FromNode->IsGOTONode() ) { + // asv : 04.11.04 : IsGOTO -> IsOneOfGOTO, I believe that it fixes the bug 7120. + if ( !FromNode->IsOneOfGOTONodes() ) { if ( anInPort->IsDataStream() ) { RetVal = FromNode->RemoveStreamLinkedNode( aNode ) ; } @@ -753,22 +752,22 @@ bool GraphBase::Graph::AddLink( const char* FromNodeName , if ( fromNode ) { fromPort = fromNode->GetChangeOutPort( FromServiceParameterName ) ; if ( !fromPort ) { - cdebug << "AddLink fromPort " << FromServiceParameterName << " FromNode(" + cdebug << "ERROR AddLink fromPort " << FromServiceParameterName << " FromNode(" << FromNodeName << ") not found." << endl ; } } else { - cdebug << "AddLink FromNode " << FromNodeName << " not found." << endl ; + cdebug << "ERROR AddLink FromNode " << FromNodeName << " not found." << endl ; } if ( toNode ) { toPort = toNode->GetChangeInPort( ToServiceParameterName ) ; if ( !toPort ) { - cdebug << "AddLink toPort " << ToServiceParameterName << " ToNode(" + cdebug << "ERROR AddLink toPort " << ToServiceParameterName << " ToNode(" << ToNodeName << ") not found." << endl ; } } else { - cdebug << "AddLink toNode " << ToNodeName << " not found." << endl ; + cdebug << "ERROR AddLink toNode " << ToNodeName << " not found." << endl ; } RetVal = AddLink( fromNode , fromPort , toNode , toPort ) ; @@ -786,7 +785,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 ; } @@ -797,20 +796,20 @@ bool GraphBase::Graph::AddLink( GraphBase::ComputingNode *fromNode , // bool RetVal ; if ( !fromNode ) { - cdebug << "AddLink fromNode not found." << endl ; + cdebug << "ERROR AddLink fromNode not found." << endl ; return false ; } if ( !fromPort ) { - cdebug << "AddLink fromPort not found." << endl ; + cdebug << "ERROR AddLink fromPort not found." << endl ; return false ; } if ( !toNode ) { - cdebug << "AddLink toNode not found." << endl ; + cdebug << "ERROR AddLink toNode not found." << endl ; return false ; } if ( !toPort ) { - cdebug << "AddLink toPort not found." << endl ; + cdebug << "ERROR AddLink toPort not found." << endl ; return false ; } if ( ( fromPort->IsDataStream() && !toPort->IsDataStream() ) || @@ -1115,7 +1114,7 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName , break; } cdebug << " ) in Graph " << Name() << endl; - + GraphBase::ComputingNode *toNode ; GraphBase::InPort *toPort ; char *aNodeName ; @@ -1135,10 +1134,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 ) { @@ -1158,7 +1157,7 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName , } } else { - cdebug << "Node and/or Port not found : " << aNodeName << " " << aPortName << endl ; + cdebug << "ERROR Node and/or Port not found : " << aNodeName << " " << aPortName << endl ; } delete aNodeName ; delete aPortName ; @@ -1197,17 +1196,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 ) ; @@ -1215,15 +1216,15 @@ bool GraphBase::Graph::ChangeInputData( const char * ToNodeName , toPort->State( SUPERV::ReadyState ) ; } else { - cdebug << "ChangeInputData fromPort not found" << endl ; + cdebug << "ERROR ChangeInputData fromPort not found" << endl ; } } else { - cdebug << "ChangeInputData toPort not found" << endl ; + cdebug << "ERROR ChangeInputData toPort not found" << endl ; } } else { - cdebug << "ChangeInputData Node not found : " << ToNodeName << endl ; + cdebug << "ERROR ChangeInputData Node not found : " << ToNodeName << endl ; } cdebug_out << "GraphBase::Graph::ChangeInputData" << endl; @@ -1280,7 +1281,7 @@ bool GraphBase::Graph::AddInputData( const char* ToNodeName , } } else { - cdebug << "Node not found " << ToNodeName << " ERROR. Known nodes :" << endl ; + cdebug << "ERROR Node not found " << ToNodeName << " ERROR. Known nodes :" << endl ; map< string , int >::iterator aMapOfGraphNodesIterator ; int i = 0 ; for ( aMapOfGraphNodesIterator = _MapOfGraphNodes.begin() ; @@ -1313,11 +1314,13 @@ 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 { - cdebug << "Node not found" << endl ; + cdebug << "ERROR Node not found" << endl ; RetVal = false ; } cdebug_out << "GraphBase::Graph::AddOutputData " << RetVal << endl; @@ -1703,7 +1706,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++ ) { @@ -2002,10 +2009,10 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) { (_SortedNodes[ i ])[ j ]->SubGraph( 0 ) ; if ( (_SortedNodes[ i ])[ j ]->HasDataStream() ) { (_SortedNodes[ i ])[ j ]->SubStreamGraph( 0 ) ; - } + } else { (_SortedNodes[ i ])[ j ]->SubStreamGraph( -1 ) ; - } + } } } @@ -2014,50 +2021,58 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) { bool Graphs = true ; while ( Graphs ) { for ( i = 0 ; i <= _LevelsNumber ; i++ ) { + cdebug << endl << "LevelsNumber " << _LevelsNumber << " " << _NodesNumber[ i ] + << " Nodes :" << endl ; for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) { GraphBase::ComputingNode * aNode = (_SortedNodes[ i ])[ j ] ; -// cdebug << "SubGraph " << aNode->SubGraph() << " " << aNode->Name() -// << endl ; + cdebug << " " << aNode->Name() << " SubGraph " << aNode->SubGraph() << endl ; int k ; for ( k = 0 ; k < aNode->LinkedNodesSize() ; k++ ) { - if ( aNode->LinkedNodes( k )->SubGraph() ) { - if ( aNode->LinkedNodes( k )->SubGraph() != aNode->SubGraph() && - aNode->LinkedNodes( k )->Level() == aNode->Level()+1 ) { - aNode->SubGraph( aNode->LinkedNodes( k )->SubGraph() ) ; -// cdebug << " Linked " << aNode->LinkedNodes( k )->Name() -// << " SubGraph(" << aNode->LinkedNodes( k )->SubGraph() -// << ") ==>" << endl ; -// cdebug << " SubGraph " << aNode->SubGraph() << " for " -// << aNode->Name() << " ==> again" << endl ; + if ( aNode->LinkedNodes( k )->SubGraph() ) { + if ( aNode->LinkedNodes( k )->SubGraph() != aNode->SubGraph() ) { +// && aNode->LinkedNodes( k )->Level() == aNode->Level()+1 ) { +// aNode->SubGraph( aNode->LinkedNodes( k )->SubGraph() ) ; + int OldSub = aNode->SubGraph() ; + int NewSub = aNode->LinkedNodes( k )->SubGraph() ; + cdebug << " " << aNode->Name() << " changed SubGraph " + << aNode->LinkedNodes( k )->SubGraph() << endl ; int l ; - for ( l = 0 ; l < aNode->LinkedNodesSize() ; l++ ) { - aNode->LinkedNodes( l )->SubGraph( aNode->SubGraph() ) ; + for ( l = 0 ; l <= _LevelsNumber ; l++ ) { + int m ; + for ( m = 0 ; m <= _NodesNumber[ l ] ; m++ ) { + if ( (_SortedNodes[ l ])[ m ]->SubGraph() == OldSub ) { + GraphBase::ComputingNode * aSubNode = (_SortedNodes[ l ])[ m ] ; + aSubNode->SubGraph( NewSub ) ; } + } + } Graphs = false ; break ; - } + } else { -// cdebug << " Linked " << aNode->LinkedNodes( k )->Name() -// << " SubGraph(" << aNode->LinkedNodes( k )->SubGraph() -// << ") distance > 1 ignored" << endl ; - } + cdebug << " Linked " << aNode->LinkedNodes( k )->Name() + << " same SubGraph " << aNode->LinkedNodes( k )->SubGraph() << endl ; } + } else { -// cdebug << " Linked " << aNode->LinkedNodes( k )->Name() -// << " GraphInit to " << aNode->SubGraph() << " from " -// << aNode->Name() << endl ; + cdebug << " LinkedNode " << aNode->LinkedNodes( k )->Name() + << " initial SubGraph " << aNode->SubGraph() << endl ; aNode->LinkedNodes( k )->SubGraph( aNode->SubGraph() ) ; - } } } - if ( !Graphs ) + if ( !Graphs ) { + break ; + } + } + if ( !Graphs ) { break ; + } } if ( Graphs ) { -// cdebug << endl << "SubGraphs result : " << endl ; + cdebug << endl << "SubGraphs result : " << endl ; break ; } -// cdebug << endl << "One more time" << endl ; + cdebug << endl << "One more time" << endl ; Graphs = true ; } // Make a sequential renumbering of SubGraphs : @@ -2072,12 +2087,12 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) { for ( j = 0 ; j <= _NodesNumber[ i ] ; j++ ) { if ( (_SortedNodes[ i ])[ j ]->SubGraph() == CurrGraphsNumber ) { (_SortedNodes[ i ])[ j ]->SubGraph( _SubGraphsNumber ) ; -// cdebug << "SubGraphsNumber " << _SubGraphsNumber << " " << " Level " -// << i << " : " << (_SortedNodes[ i ])[ j ]->Name() -// << endl ; + cdebug << "SubGraphsNumber " << _SubGraphsNumber << " " << " Level " + << i << " : " << (_SortedNodes[ i ])[ j ]->Name() + << endl ; } } - } + } } } @@ -2188,7 +2203,9 @@ bool GraphBase::Graph::Sort( int & SubStreamGraphsNumber ) { // } } +#ifdef _DEBUG_ ListPorts( *_Graph_fdebug , 0 ) ; +#endif cdebug_out << "GraphBase::Graph::Sort" << endl; return true ; @@ -2296,15 +2313,15 @@ bool GraphBase::Graph::LinkLoopNodes(bool & NewLink ) { GraphBase::GOTONode * aGOTONode = (GraphBase::GOTONode * ) aNode ; GraphBase::OutPort *anOutGate = aGOTONode->GetChangeNodeOutGate() ; if ( anOutGate->IsNotConnected() ) { - if ( !AddLink( aGOTONode , anOutGate , - aGOTONode->CoupledNode() , aGOTONode->CoupledNode()->GetChangeNodeInGate() ) ) { -// cdebug << "GraphBase::Graph::CreateService AddLink ERROR " << aGOTONode->Name() << "( " -// << anOutGate->PortName() << " ) --> " << aGOTONode->CoupledNode()->Name() << "( " -// << aGOTONode->CoupledNode()->GetChangeNodeInGate()->PortName() << " )" << endl ; - RetVal = false ; - } - else { - NewLink = true ; + RetVal = aGOTONode->CoupledNode() != NULL; + if ( RetVal ) { + RetVal = AddLink( aGOTONode , anOutGate , + aGOTONode->CoupledNode() , aGOTONode->CoupledNode()->GetChangeNodeInGate() ); + // cdebug << "GraphBase::Graph::CreateService AddLink ERROR " << aGOTONode->Name() << "( " + // << anOutGate->PortName() << " ) --> " << aGOTONode->CoupledNode()->Name() << "( " + // << aGOTONode->CoupledNode()->GetChangeNodeInGate()->PortName() << " )" << endl ; + if ( !RetVal ) + NewLink = true; } } } @@ -2448,7 +2465,7 @@ SUPERV::GraphState GraphBase::Graph::PortState( if ( anInPort ) anOutPort = anInPort->GetOutPort() ; else { - cdebug << "GraphBase::Graph::PortState OutPort/InPort not found --> " + cdebug << "ERROR GraphBase::Graph::PortState OutPort/InPort not found --> " << aRet << endl ; } } @@ -2458,7 +2475,7 @@ SUPERV::GraphState GraphBase::Graph::PortState( } } else { - cdebug << "GraphBase::Graph::PortState Node not found --> " << aRet + cdebug << "ERROR GraphBase::Graph::PortState Node not found --> " << aRet << endl ; } delete theNode ; @@ -2484,9 +2501,9 @@ const CORBA::Any * GraphBase::Graph::PortInData( const char* ToNodeName , anOutPort = anInPort->GetOutPort() ; if ( anOutPort ) { aRet = anOutPort->Value() ; -// cdebug << "OutPort value " << anOutPort->NodeName() << "(" -// << anOutPort->PortName() << ") --> InPort " << anInPort->NodeName() -// << "(" << anInPort->PortName() << ")" << endl ; + cdebug << "OutPort value " << anOutPort->NodeName() << "(" + << anOutPort->PortName() << ") --> InPort " << anInPort->NodeName() + << "(" << anInPort->PortName() << ") " << anInPort->PortStatus() << endl ; } else { cdebug << "GraphBase::Graph::PortInData " << ToNodeName << " " @@ -2584,4 +2601,3 @@ bool GraphBase::Graph::StartComponent(const int aThread , cdebug_out << aThread << " GraphBase::Graph::StartComponent" << endl; return RetVal ; } - 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_LoadXml.cxx b/src/GraphBase/DataFlowBase_LoadXml.cxx index 8cfa68d..795fb6b 100644 --- a/src/GraphBase/DataFlowBase_LoadXml.cxx +++ b/src/GraphBase/DataFlowBase_LoadXml.cxx @@ -84,7 +84,6 @@ bool GraphBase::Graph::LoadXml( CORBA::ORB_ptr _Orb , cdebug << "Graph::LoadXml " << ListOfDataFlows.size() << " Graphs" << endl ; } else { - delete myXmlHandler ; cdebug << "Graph::LoadXml Graph status " << status << endl ; RetVal = false ; } 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_OutPort.hxx b/src/GraphBase/DataFlowBase_OutPort.hxx index f708c27..ecc9e2a 100644 --- a/src/GraphBase/DataFlowBase_OutPort.hxx +++ b/src/GraphBase/DataFlowBase_OutPort.hxx @@ -75,7 +75,10 @@ namespace GraphBase { // Even if an OutPort may be connected to several ports the PortStatus is unique const StatusOfPort PortStatus() const { return _Connected; } ; - void PortStatus(StatusOfPort c) { _Connected = c; } ; + void PortStatus( StatusOfPort PortSts ) { +// cdebug << "OutPort::PortStatus " << NodeName() << " " << PortName() << " " +// << _Connected << " --> " << PortSts << endl ; + _Connected = PortSts ; } ; const bool IsNotConnected() const { return ( _Connected == NotConnected ) ; } ; // const bool IsConnected() const { 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..336a9e3 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,10 +213,11 @@ namespace GraphEditor { bool IsValid() ; bool IsExecutable() ; - void Executing() ; + void Executing( bool b = true ) ; bool IsExecuting() ; void Editing() ; bool IsEditing() ; + bool UnValid() ; void EditedAfterExecution(bool EditedAfterExecution ) ; bool EditedAfterExecution() ; diff --git a/src/GraphEditor/DataFlowEditor_DataFlow.lxx b/src/GraphEditor/DataFlowEditor_DataFlow.lxx index 1f82bf0..e09bb9f 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 ; @@ -479,6 +466,12 @@ inline bool GraphEditor::DataFlow::EditedAfterExecution() { return _EditedAfterExecution ; } +inline bool GraphEditor::DataFlow::UnValid() { + Editing() ; + EditedAfterExecution( true ) ; + return GraphEditor::OutNode::UnValid() ; +} + inline bool GraphEditor::DataFlow::IsReadOnly() { return _ReadOnly ; } 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..0b4f09d 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -32,8 +32,28 @@ 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 > _MapOfGraphNames; + +string 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 ; +} + // Implementation de la classe GraphEditor::Graph @@ -65,19 +85,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 +118,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 +129,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 +138,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 +149,7 @@ GraphEditor::OutNode::OutNode( } ; GraphEditor::OutNode::~OutNode() { -// theAutomaton->EraseGraph( Graph->Name() ) ; +// EraseGraph( Graph->Name() ) ; // delete _DataFlowNode ; // delete _DataFlowDatas ; // delete _GT ; @@ -148,14 +157,14 @@ GraphEditor::OutNode::~OutNode() { bool GraphEditor::OutNode::Name( const char * aName ) { bool RetVal = false ; - if ( !theAutomaton->GraphName( aName ) ) { - char * aGraphName = Graph()->Name() ; +// if ( !GraphName( aName ) ) { +// char * aGraphName = Graph()->Name() ; RetVal = Graph()->Name( aName ) ; - if ( RetVal ) { - theAutomaton->EraseGraph( aGraphName ) ; - theAutomaton->MapGraph( Graph() , aName ) ; - } - } +// if ( RetVal ) { +// EraseGraph( aGraphName ) ; +// MapGraph( Graph() , aName ) ; +// } +// } return RetVal ; } @@ -208,8 +217,9 @@ 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( Graph()->Name() ) ; + Name( GraphInstanceName( Graph()->Name() ).c_str() ) ; +// MapGraph( Graph() , Graph()->Name() ) ; cdebug << "GraphEditor::OutNode::LoadXml() " << aDataFlowName << " --> " << Graph()->Name() << endl; RetVal = true ; } @@ -250,8 +260,9 @@ 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( aDataFlowInfo.theName.c_str() ) ; + 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() ) { @@ -394,21 +405,36 @@ bool GraphEditor::OutNode::LoadNodes(map< string , int > & aMapOfNodes , return false ; } } + + // setting coupled pairs of nodes: Loop-EndLoop, Switch-EndSwitch, InLine-GOTO, MacroNode-Graph for ( i = 0 ; i < (int ) aListOfNodes.size() ; i++ ) { GraphBase::SNode aNode = aListOfNodes[ i ] ; cdebug << "GraphEditor::OutNode::LoadNodes " << aNode.theName.c_str() << " Coupled to " << aNode.theCoupledNode.c_str() << endl ; - anInNode = (GraphEditor::InNode * ) Graph()->GetChangeGraphNode( aNode.theName.c_str() )->GetInNode() ; + anInNode = (GraphEditor::InNode * ) Graph()->GetChangeGraphNode( aMapOfNodes[ aNode.theName.c_str() ] )->GetInNode() ; + if ( anInNode->IsOneOfGOTONodes() && strlen( aNode.theCoupledNode.c_str() ) ) { - GraphBase::GOTONode * aCoupledNode ; - aCoupledNode = (GraphBase::GOTONode * ) Graph()->GetGraphNode( aNode.theName.c_str() ) ; - GraphBase::GOTONode * aCoupledCoupledNode ; - aCoupledCoupledNode = (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ; - if ( aCoupledCoupledNode != NULL ) { - aCoupledNode->CoupledNode( aCoupledCoupledNode ) ; + GraphBase::GOTONode * aGOTONode; + aGOTONode = (GraphBase::GOTONode * ) anInNode->ComputingNode() ; + + // asv : 25.10.04 : if aNode is a MacroNode, then its coupled node (another Graph) is NOT in aMapOfNodes + // and we must couple MacroNode only with name to its subgraph + if ( aGOTONode->IsMacroNode() ) { + cdebug << "GraphEditor::OutNode::LoadNodes MacroNode " << aNode.theName.c_str() + << " is Coupled ONLY WITH NAME to its subgraph " << aNode.theCoupledNode.c_str() << endl; + aGOTONode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ; } - else { - aCoupledNode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ; + else { // coupling Loop-EndLoop, Switch-EndSwitch, InLine-GOTO + // asv : fix for 6822 : using map because if aNode's name is the same as some existing node's name + // aMap will give the correct index any way (aMap has already a different name for aNode, SNode still has old name) + int aCoupledNodeIndex = aMapOfNodes[ aNode.theCoupledNode.c_str() ] ; + cdebug << "GraphEditor::OutNode::LoadNodes " << aNode.theCoupledNode.c_str() + << " index " << aCoupledNodeIndex << endl ; + GraphBase::GOTONode * aCoupledNode ; + aCoupledNode = (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aCoupledNodeIndex ) ; + cdebug << "GraphEditor::OutNode::LoadNodes " << aNode.theName.c_str() + << " is now Coupled to " << aNode.theCoupledNode.c_str() << endl ; + aGOTONode->CoupledNode( aCoupledNode ) ; } } } @@ -548,9 +574,11 @@ GraphBase::ListOfSGraphs * GraphEditor::OutNode::GetDataFlows( GraphBase::ListOf } int i ; 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() ) ; + const GraphBase::ComputingNode * aNode = Graph()->GetGraphNode( (*aListOfDataFlows)[ index ].Nodes[i].theName.c_str() ) ; + if ( aNode->IsMacroNode() ) { +// string aCoupledNodeName = (*aListOfDataFlows)[ index ].Nodes[i].theCoupledNode ; + GraphBase::Graph * aGraph = (GraphBase::Graph * ) ((GraphBase::GOTONode * ) aNode )->CoupledNode() ; +// GraphBase::Graph * aGraph = MapGraph( aCoupledNodeName.c_str() ) ; aGraph->GraphEditor()->GraphEditor::OutNode::GetDataFlows( aListOfDataFlows ) ; } } @@ -694,8 +722,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,10 +1725,27 @@ 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 ] ; +} +*/ diff --git a/src/GraphEditor/DataFlowEditor_OutNode.hxx b/src/GraphEditor/DataFlowEditor_OutNode.hxx index 4c14b83..d5da3be 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..a1da842 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,85 +126,114 @@ 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 ; } bool GraphExecutor::DataFlow::Kill() { cdebug_in << "GraphExecutor::DataFlow::Kill()" << endl; bool RetVal = GraphExecutor::OutNode::Kill() ; - cdebug_out << "GraphExecutor::DataFlow::Kill()" << endl; + cdebug_out << "GraphExecutor::DataFlow::Kill() " << 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..e044c34 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,32 +632,37 @@ string GraphExecutor::FiniteStateMachine::GraphInstanceName( const char * aGraph // << theGraphInstanceName << endl ; return theGraphInstanceName ; } +*/ void GraphExecutor::FiniteStateMachine::JoinThread() { if ( pthread_mutex_lock( &_MutexJoinWait ) ) { - perror("Join pthread_mutex_lock ") ; + perror("FiniteStateMachine:JoinThread pthread_mutex_lock ") ; exit( 0 ) ; } while ( _JoinThread ) { while ( _ThreadList.size() == 0) { -// MESSAGE( pthread_self() << " Join pthread_cond_wait" ); +// MESSAGE( pthread_self() << " FiniteStateMachine:Join pthread_cond_wait" ); if ( pthread_cond_wait( &_JoinWait , &_MutexJoinWait ) ) { - perror("Join pthread_cond_wait ") ; + perror("FiniteStateMachine:JoinThread pthread_cond_wait ") ; } } pthread_t _Thread = _ThreadList.front() ; -// MESSAGE( pthread_self() << " Join pthread_cond_waited : " << _Thread ) - _ThreadList.pop_front() ; -// MESSAGE( pthread_self() << " Join pthread_join : " << _Thread ); +// MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_cond_waited : " << _Thread ) +// MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_join : " << _Thread ); int joinsts = pthread_join( _Thread , NULL ) ; -// MESSAGE( pthread_self() << " Join pthread_joined : " << _Thread ); if ( joinsts ) { - perror("Join pthread_join ") ; -// exit( 0 ) ; + perror("FiniteStateMachine:JoinThread pthread_join ") ; + MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_join : " << _Thread + << " Error" ); + exit( 0 ) ; + } + else { + MESSAGE( pthread_self() << " FiniteStateMachine:JoinThread pthread_joined : " << _Thread ); + _ThreadList.pop_front() ; } } if ( pthread_mutex_unlock( &_MutexJoinWait ) ) { - perror("Join pthread_mutex_unlock ") ; + perror("FiniteStateMachine:JoinThread pthread_mutex_unlock ") ; exit( 0 ) ; } } 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..485e76d 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.cxx @@ -459,13 +459,15 @@ void GraphExecutor::InNode::ExitThread() { bool GraphExecutor::InNode::Suspend() { cdebug_in << "GraphExecutor::InNode::Suspend " << Name() << " " << ThreadNo() << endl; - bool RetVal ; + bool RetVal = false ; if ( IsDone() ) { - ControlState( SUPERV::VoidState ) ; +//If loop we need to suspend also ControlState( SUPERV::VoidState ) ; + ControlState( SUPERV::ToSuspendState ) ; + RetVal = true ; if ( _OutNode->IsDone() ) { ControlState( SUPERV::VoidState ) ; + RetVal = false ; } - RetVal = false ; } else if ( IsWaiting() || IsReady() ) { ControlState( SUPERV::ToSuspendState ) ; @@ -536,7 +538,8 @@ bool GraphExecutor::InNode::ContainerKill() { bool GraphExecutor::InNode::Kill() { cdebug_in << "GraphExecutor::InNode::Kill " << Name() << " " << ThreadNo() << " " - << Automaton()->StateName( State() ) << endl; + << Automaton()->StateName( State() ) << " Threads " << _OutNode->Threads() + << " SuspendedThreads " << _OutNode->SuspendedThreads() << endl; bool RetVal ; if ( IsDone() ) { ControlState( SUPERV::ToKillState ) ; // if loop @@ -599,14 +602,19 @@ bool GraphExecutor::InNode::Kill() { else if ( IsWaiting() ) { RetVal = true ; } + else if ( IsReady() ) { + RetVal = true ; + } else { - cdebug << "Kill and !IsDone and !IsRunning and !IsWaiting ?" + cdebug << "Kill and !IsDone and !IsRunning and !IsWaiting and !IsReady ?" << endl ; RetVal = false ; } } } - cdebug_out << "GraphExecutor::InNode::Kill" << endl ; + cdebug_out << "GraphExecutor::InNode::Kill" << Name() << " " << ThreadNo() << " " + << Automaton()->StateName( State() ) << " Threads " << _OutNode->Threads() + << " SuspendedThreads " << _OutNode->SuspendedThreads() << endl ; return RetVal ; } @@ -1139,33 +1147,46 @@ 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-- ; + cdebug << "InPort" << i << " " << anInPort->PortName() << " Not connected Pc " << Pc << endl ; } else if ( anOutPort ) { if ( anOutPort->IsDataConnected() || anOutPort->IsDataStream() ) { Pc-- ; - } - if ( anOutPort->IsDataConnected() || anOutPort->IsDataStream() ) { anOutPort->State( SUPERV::ReadyState ) ; anOutPort->Done( true ) ; + cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus() + << " " << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ; } else if ( anOutPort->IsPortConnected() ) { anOutPort->State( SUPERV::WaitingState ) ; anOutPort->Done( false ) ; + cdebug << "InPort" << i << " " << anInPort->PortName() << " " << " " << anInPort->PortStatus() + << " " << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ; } + else { + cdebug << "InPort" << i << " " << anInPort->PortName() << " " << anInPort->PortStatus() + << " OutPort " << anOutPort->NodeName() << " " << anOutPort->PortName() << " " + << theAutomaton->StateName( anOutPort->State() ) << " Pc " << Pc << endl ; + } + } + else { + cdebug << "InPort" << i << " " << anInPort->PortName() << " " << " " << anInPort->PortStatus() + << " no corresponding OutPort Pc " << Pc << endl ; } if ( anOutPort ) { if ( !anOutPort->IsDataStream() || anInPort->IsDataStream() ) { diff --git a/src/GraphExecutor/DataFlowExecutor_InNode.hxx b/src/GraphExecutor/DataFlowExecutor_InNode.hxx index ca7ec68..0100701 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNode.hxx +++ b/src/GraphExecutor/DataFlowExecutor_InNode.hxx @@ -43,7 +43,7 @@ #include "DataFlowExecutor_FiniteStateMachine.hxx" -#define MAXSTACKTHREADSIZE 8191 +#define MAXSTACKTHREADSIZE 127 void * run_function(void *p); @@ -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 ; @@ -464,6 +464,8 @@ namespace GraphExecutor { long PyCpuUsed( bool tot = false ) ; void SetPyCpuUsed() ; long PyCpu() ; + + bool PyRunSimpleString( char* thePyString ); } ; } ; diff --git a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx index 835c0e1..18b6ade 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,8 +1520,9 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { SendEvent( NewEvent ) ; } else { - GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphExecutor() ; - cdebug << ThreadNo() << " DataReady_ExecuteAction " << aMacroGraph->Graph()->Name() << " ->DoneWait()" + GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ; + cdebug << ThreadNo() << " DataReady_ExecuteAction " << aMacroGraph << " " + << aMacroGraph->Graph()->Name() << " ->DoneWait()" << " State " << aMacroGraph->State() << endl; aMacroGraph->DoneWait() ; cdebug << ThreadNo() << " DataReady_ExecuteAction " << Name() << " State " << aMacroGraph->State() << endl; @@ -1575,7 +1578,7 @@ int GraphExecutor::InNode::SuspendedExecuting_ResumeAction() { } int GraphExecutor::InNode::Executing_KillAction() { - cdebug << ThreadNo() << " Executing_KillAction " << Name() << endl; + cdebug << ThreadNo() << " Executing_KillAction " << Name() << " Thread " << ThreadNo()<< endl; int RetVal = 0 ; if ( pthread_self() == ThreadNo() ) { cdebug << "Executing_KillAction would pthread_canceled itself" << endl ; @@ -1588,10 +1591,10 @@ int GraphExecutor::InNode::Executing_KillAction() { perror("Executing_KillAction pthread_cancel error") ; } else { - cdebug << "Executing_KillAction : ThreadId " << ThreadNo() + cdebug << pthread_self() << " Executing_KillAction : ThreadId " << ThreadNo() << " pthread_canceled" << endl ; KillAction() ; - _OutNode->ExitThread() ; + _OutNode->ExitThread( ThreadNo() ) ; _OutNode->PushEvent( this , GraphExecutor::KilledExecutingEvent , GraphExecutor::KilledExecutingState ) ; } @@ -1599,16 +1602,16 @@ int GraphExecutor::InNode::Executing_KillAction() { } int GraphExecutor::InNode::Executing_StopAction() { - cdebug << ThreadNo() << " Executing_StopAction " << Name() << endl; + cdebug << ThreadNo() << " Executing_StopAction " << Name() << " Thread " << ThreadNo() << endl; int RetVal = 0 ; if ( pthread_cancel( ThreadNo() ) ) { perror("Executing_KillAction pthread_cancel error") ; } else { - cdebug << "Executing_KillAction : ThreadId " << ThreadNo() + cdebug << pthread_self() << " Executing_KillAction : ThreadId " << ThreadNo() << " pthread_canceled" << endl ; StopAction() ; - _OutNode->ExitThread() ; + _OutNode->ExitThread( ThreadNo() ) ; _OutNode->PushEvent( this , GraphExecutor::StoppedExecutingEvent , GraphExecutor::StoppedExecutingState ) ; } @@ -1736,11 +1739,22 @@ void GraphExecutor::InNode::SetWaitingStates(GraphExecutor::InNode * EndNode ) { !anOutPort->ChangeInPorts( j )->IsDataStream() && !anOutPort->ChangeInPorts( j )->IsExternConnected() ) { cdebug << ThreadNo() - << " GraphExecutor::InNodeThreads::SetWaitingStates " - << Name() << "( " << anOutPort->PortName() << " " << anOutPort->PortStatus() << " ) --> InPort " + << " InNodeThreads::SetWaitingStates OutPort " + << Name() << "/" << anOutPort->ChangeInPorts( j )->NodeName() << "( " + << anOutPort->PortName() << " " << anOutPort->PortStatus() << " ) --> InPort " + << anOutPort->ChangeInPorts( j )->NodeName() << "( " << anOutPort->ChangeInPorts( j )->PortName() << " " - << anOutPort->ChangeInPorts( j )->PortStatus() << " from Node " - << anOutPort->ChangeInPorts( j )->NodeName() << endl; + << anOutPort->ChangeInPorts( j )->PortStatus() << " )" << endl; + if ( strcmp( anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() , Name() ) ) { +// After EndLoopNode or GOTONode the Input Ports of LoopNode or LabelNode have their values from +// EndLoopNode or GOTONode. But if there is several nested loops we should re-establish. + cdebug << ThreadNo() + << " InNodeThreads::SetWaitingStates OutPort->ChangeInPorts( j )->OutPort()->NodeName " + << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << " != " + << Name() << " : Restored to " << anOutPort->NodeName() << "( " + << anOutPort->PortName() << " )" << endl ; + anOutPort->ChangeInPorts( j )->ChangeOutPort( anOutPort ) ; + } GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetInNode() ; if ( aNode != EndNode ) { aNode->SetWaitingStates( EndNode ) ; @@ -2791,9 +2805,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..810a7c5 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx @@ -30,7 +30,7 @@ using namespace std; #include "DataFlowExecutor_OutNode.hxx" -// Implementation de la classe GraphEditor::GraphControl +#include "DataFlowEditor_DataFlow.hxx" extern GraphExecutor::FiniteStateMachine * theAutomaton ; @@ -67,7 +67,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, const SUPERV::KindOfNode aKindOfNode ) { // Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) { Set_prof_debug( ORB , DebugFileName ) ; - cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << " , " << aKindOfNode << ")" << endl; + cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowName << " , " << aKindOfNode << ")" << endl; if ( aKindOfNode == SUPERV::DataFlowGraph ) { _StreamGraph = NULL ; // _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , DebugFileName ) ; @@ -98,7 +98,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, perror("pthread_cond_init( &_JoinWait , NULL )") ; exit( 0 ) ; } - cdebug_out << "GraphEditor::OutNode::OutNode" << endl; + cdebug_out << "GraphExecutor::OutNode::OutNode" << endl; } GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, @@ -122,7 +122,7 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, // DataFlowComputer , DataFlowComment , DebugFileName ) { Set_prof_debug( ORB , DebugFileName ) ; - cdebug_in << "GraphEditor::OutNode::OutNode(" << DataFlowName << " , " << DataFlowkind << ")" << endl; + cdebug_in << "GraphExecutor::OutNode::OutNode(" << DataFlowName << " , " << DataFlowkind << ")" << endl; if ( DataFlowkind == SUPERV::DataFlowGraph ) { _StreamGraph = NULL ; _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName , @@ -212,7 +212,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 ; } @@ -346,7 +347,6 @@ bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfSNodes &aListOfNod else { aCoupledNode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ; } - aCoupledNode->SetGraphExecutor( (GraphExecutor::DataFlow * ) this ) ; } } return RetVal ; @@ -484,7 +484,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 +492,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() ; @@ -521,25 +522,26 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { } } } - + /* asv : 29.09.04 : commented out because it does not do anything useful 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 +622,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 ; } @@ -706,6 +709,8 @@ void GraphExecutor::OutNode::CheckAllDone() { Done( true ) ; _JustStarted = false ; } + cdebug << Graph()->Name() << " alivenodes " << alivenodes << " OutNodeState " << OutNodeState + << endl ; PushEvent( NULL , GraphExecutor::EndExecuteEvent , OutNodeState ) ; // Py_Finalize() ; @@ -721,15 +726,16 @@ 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 ; - } - cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() - << " GraphAutomatonState " << theAutomaton->StateName( AutomatonState() ) + + // asv : fix for 6798 and other bugs: "sift" the event queue after execution + siftEvents(); + + // asv : 25.10.04 : calling Editing() to indicate stop of execution + Graph()->GraphEditor()->Editing(); + } + cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() << " this " << this << " " + << Graph()->Name() << " GraphAutomatonState " + << theAutomaton->StateName( AutomatonState() ) << " State " << State() << " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads << " EventQSize " << EventQSize() << endl ; } @@ -795,19 +801,22 @@ void GraphExecutor::OutNode::NewThread() { } } -void GraphExecutor::OutNode::ExitThread() { +void GraphExecutor::OutNode::ExitThread( pthread_t ThreadNumber ) { if ( pthread_mutex_lock( &_MutexWait ) ) { perror("pthread_mutex_lock _ExitThread") ; exit( 0 ) ; } + if ( ThreadNumber == 0 ) { + ThreadNumber = pthread_self() ; + } _Threads -= 1 ; - theAutomaton->JoinThread( pthread_self() ) ; + cdebug << pthread_self() << " ExitThread( " << ThreadNumber << " ) " << _Threads << " running threads " + << _SuspendedThreads << " suspended threads" + << endl ; + theAutomaton->JoinThread( ThreadNumber ) ; if ( pthread_cond_signal( &_JoinWait ) ) { perror("ExitThread pthread_cond_signal ") ; } - cdebug << "ExitThread : " << _Threads << " running threads " - << _SuspendedThreads << " suspended threads" - << endl ; if ( pthread_mutex_unlock( &_MutexWait ) ) { perror("pthread_mutex_unlock _ExitThread") ; exit( 0 ) ; @@ -1177,15 +1186,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 ) @@ -1224,6 +1232,13 @@ bool GraphExecutor::OutNode::Event( char ** aNodeName , SUPERV::GraphEvent & anEvent , SUPERV::GraphState & aState , bool WithWait ) { + // asv : fixing problem of loops with large number of iterations (>5000) + // experimentally was found that number of non-handled by GUI events = (number_of_nodes x 7) + // or 7 events for each node - so what we want to do here is remove "old" events for nodes + // "on the fly". Once again it is done in Stop(), Kill(), Done() functions. + if ( _EventNodes.size() > (unsigned int)Graph()->GraphNodesSize()*7 ) + siftEvents(); + int ThreadsNumber ; int SuspendedThreadsNumber ; if ( _EventNodes.size() > 0 ) { @@ -1287,7 +1302,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 +1538,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 +1558,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 +1577,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 ; } @@ -1586,7 +1614,7 @@ bool GraphExecutor::OutNode::IsDone() { bool GraphExecutor::OutNode::IsSuspended() { // cdebug_in << "GraphExecutor::OutNode::IsSuspended" << endl; bool aret = false ; - if ( _SuspendedThreads == _Threads ) { + if ( _SuspendedThreads == _Threads && _Threads != 0 ) { aret = true ; } // cdebug_out << "GraphExecutor::OutNode::IsSuspended" << endl ; @@ -1839,7 +1867,15 @@ bool GraphExecutor::OutNode::Kill() { MESSAGE( Graph()->Name() << " IS NOT KILLED" ) ; MESSAGE("================================================================================") ; } - cdebug_out << "GraphExecutor::OutNode::Kill " << RetVal << endl ; + cdebug_out << "GraphExecutor::OutNode::Kill " << RetVal + << " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads << endl ; + + // remove "extra" events from the event queue + siftEvents(); + + // asv : 25.10.04 : calling Editing() to indicate stop of execution + Graph()->GraphEditor()->Editing(); + return RetVal ; } @@ -1916,7 +1952,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 +1960,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 +2091,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..a882cf3 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() ; @@ -152,7 +156,7 @@ namespace GraphExecutor { void PyThreadUnLock() ; void NewThread() ; - void ExitThread() ; + void ExitThread( pthread_t ThreadNumber = 0 ) ; void SuspendThread() ; void ResumeThread() ; long Threads() { return _Threads ; } ; diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 22ac4d0..0d39581 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -15,6 +15,9 @@ using namespace std; #include #include "DataFlowExecutor_InNode.hxx" +#include "DataFlowExecutor_OutNode.hxx" + +#include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC using namespace CORBA ; @@ -128,8 +131,8 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName , aPyFunc += PyFuncName ; aPyFunc += " )\n" ; /*cdebug *///cout<< "InitPyDynInvoke PyRun_SimpleString " << endl << aPyFunc << endl ; - if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) { - cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ; + if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) { + cdebug << ThreadNo() << " " << Name() << " PyRunSimpleString ERROR " << endl << aPyFunc << endl ; RetVal = false ; Err = true ; } @@ -138,7 +141,7 @@ PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName , thePyRunMethod = MyPyRunMethod ; Automaton()->PyFunction( PyFuncName , thePyRunMethod ) ; - cdebug << ThreadNo() << "PyRun_SimpleString( " << (*aPythonFunction)[ 0 ] << " ) " << endl ; + cdebug << ThreadNo() << "PyRunSimpleString( " << (*aPythonFunction)[ 0 ] << " ) " << endl ; } } if ( RetVal ) { @@ -552,3 +555,31 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , return RetVal ; } + +// This method was created in order to wrap PyRun_SimpleString() with exception handling wrapper. +// Python does not throw usual C++ style exceptions, so try-catch construct does not work for this +// purpose. Instead Python raises signals. If these signals are not caught by the application +// it will be caught by the OS and the application will be terminated : BUG PAL6869 +// Declaring CASCatch_SignalsHandler object redefines (!) standard C++ reserved words "try" and "catch". +// Standard_Failure "exception" is a signal in fact, and it will be caught in the catch section. +// Why do we finalize and re-initialize Python after catching the signal? Because the Python stack +// is corrupted after that. +// Declaration of CASCatch_SignalsHandler forces us to add linkage with CASCADE libraries.. See Makefile.in. +bool GraphExecutor::InNode::PyRunSimpleString( char* thePyString ) +{ + CASCatch_SignalsHandler aSignalsHandler; + const bool ErrorValue = true; + bool aRet; + try { + aRet = PyRun_SimpleString( thePyString ); + } catch( Standard_Failure ) { + MESSAGE( "ERROR: Exception caught running Python method." ); + MESSAGE( " Python was reinitialized. Previous Python definitions are lost" ); + Py_Finalize(); + Py_Initialize(); + Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ); + _OutNode->PyInitialized( false ); + aRet = ErrorValue; + } + return aRet; +} diff --git a/src/GraphExecutor/Makefile.in b/src/GraphExecutor/Makefile.in index ccf0b54..10707c9 100644 --- a/src/GraphExecutor/Makefile.in +++ b/src/GraphExecutor/Makefile.in @@ -45,11 +45,11 @@ LIB_CLIENT_IDL = SALOME_ModuleCatalog.idl \ BIN_SRC = BIN_SERVER_IDL = -CPPFLAGS+= $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) \ +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+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lOpUtil -lSALOMELocalTrace \ +LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace -lCASCatch\ -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..e4c6bf3 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -108,10 +108,10 @@ QAD_StudyFrame* SUPERVGUI::createGraph() { QAD_StudyFrame* aStudyFrame = study->newWindow3d(study->getNextStudyFrameName(), VIEW_GRAPHSUPERV, false); if (aStudyFrame) { - connect(aStudyFrame, - SIGNAL(sfStudyFrameClosing(QAD_StudyFrame*)), + connect(study, + SIGNAL(supervStudyFrameClosing(QAD_ViewFrame*)), &Supervision, - SLOT(onGraphClosed(QAD_StudyFrame*))); + SLOT(onGraphClosed(QAD_ViewFrame*))); } return aStudyFrame; } @@ -199,14 +199,50 @@ bool SUPERVGUI::isContains(QAD_Study* theStudy, const QString theKey) { } -void SUPERVGUI::onGraphClosed(QAD_StudyFrame* theStudyFrame) { - QAD_ViewFrame* viewFrame = theStudyFrame->getRightFrame()->getViewFrame(); - if(SUPERVGraph_ViewFrame* supervFrame = dynamic_cast(viewFrame)){ - disconnect(theStudyFrame, 0 , this, 0); +void SUPERVGUI::onGraphClosed(QAD_ViewFrame* theViewFrame) { + if(SUPERVGraph_ViewFrame* supervFrame = dynamic_cast(theViewFrame)){ + disconnect(study, 0 , this, 0); SUPERVGraph_View* view = supervFrame->getViewWidget(); SUPERVGUI_Main* aGraph = dynamic_cast(view); if (aGraph) { unregisterGraph(aGraph); + SUPERV_Graph aDataFlow = aGraph->getDataflow(); + if ( !SUPERV_isNull( aDataFlow ) ) { + if ( aDataFlow->IsExecuting() ) { + const int aMsgResult = QMessageBox::warning(QAD_Application::getDesktop(), + tr("WARNING"), + tr("MSG_DF_RUNNING"), + tr("MSG_DF_EXECUTION"), + tr("MSG_DF_KILL")); + if ( aMsgResult == 1 ) { + // KILL EXECUTION + if ( aDataFlow->Kill() ) { + // Kill() sends KillEvent and KillState to SUPERVGUI_Thread + // while sets myIsActive flag to false when it receives such event/state + // after myIsActive is false it calls QThread::exit() to terminate. + + // why while() { qApp->processEvents() } ? + // because: SUPERVGUI_Thread::run() receives events, and calls myMain->execute() + // method using SALOME_Event paradigm, ProcessVoidEvent() function - + // it puts this event to the main application event loop, in which we are being now. + // So if we block main GUI application thread (by calling aGraph->getMyThread()->wait() here) + // then we will have a deadlock of 2 threads waiting for one another + while (aGraph->getMyThread()->running()) + qApp->processEvents(); + } + } + else { // BACKGROUND EXECUTION + emit KillMainThread(true); // set SUPERVGUI_Thread::myIsActive to false + while ( aGraph->getMyThread()->running() ) + qApp->processEvents(); + } + } + else { // EXECUTION IS FINISHED, JUST DESTROY THE SUPERVGUI_Thread object and return. + emit KillMainThread(true); + while ( aGraph->getMyThread()->running() ) + qApp->processEvents(); + } + } } } } @@ -222,8 +258,10 @@ void SUPERVGUI::setMain(QWidget* w) { QAD_ViewFrame* viewFrame = aStudyFrame->getRightFrame()->getViewFrame(); if(SUPERVGraph_ViewFrame* supervFrame = dynamic_cast(viewFrame)){ SUPERVGraph_View* view = supervFrame->getViewWidget(); - if (view) + if (view) { main = dynamic_cast(view); + connect(&Supervision, SIGNAL(KillMainThread(bool)), main->getMyThread(), SLOT(KillThread(bool))); + } } Trace("SUPERVGUI::setMain - main: "<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; } + /* ASV: 20.10.04: fix for 6896 + 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 @@ -315,7 +364,6 @@ void SUPERVGUI::renameDataflow() { if (obj->FindAttribute(anAttr, "AttributeName")) { aName = SALOMEDS::AttributeName::_narrow(anAttr); QString nm = QString( aName->Value() ); - bool ok = FALSE; nm = SALOMEGUI_NameDlg::getName( QAD_Application::getDesktop(), nm ); if ( !nm.isEmpty() ) { QApplication::setOverrideCursor( Qt::waitCursor ); @@ -349,11 +397,22 @@ void SUPERVGUI::exportDataflow() { void SUPERVGUI::newDataflow() { Trace("SUPERVGUI::editDataflow"); + + //asv 20.10.04: removed 2 SUPERVGUI_Main constructors. there is only ONE way + //to create a Main object now: with a non-null DataFlow as a 3d parameter + //1. create a Graph object + SUPERV_Graph aNewDataFlow = engine->StreamGraph( MAIN_NEW ); + if (SUPERV_isNull( aNewDataFlow )) { + QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_DF")); + return; + } + //2. create a ViewFrame object QAD_StudyFrame* aStudyFrame = createGraph(); SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast (aStudyFrame->getRightFrame()->getViewFrame()); if(aViewFrame){ - main = new SUPERVGUI_Main(aViewFrame, desktop, false); + //3. bind Graph and ViewFrame -> create Main + main = new SUPERVGUI_Main(aViewFrame, desktop, aNewDataFlow ); main->addNode(); study->showFrame(aStudyFrame); } @@ -526,9 +585,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.h b/src/SUPERVGUI/SUPERVGUI.h index 977e719..06c87a5 100644 --- a/src/SUPERVGUI/SUPERVGUI.h +++ b/src/SUPERVGUI/SUPERVGUI.h @@ -100,12 +100,15 @@ class SUPERVGUI: public SALOMEGUI { */ void whatIsSelected(const Handle(SALOME_InteractiveObject)& theObj, bool& theIsOwner, bool& theIsDataflow); + signals: + void KillMainThread(bool theValue); + private slots: void setMain(QWidget* w); void displayDataflow(); void renameDataflow(); void deleteObject(); - void onGraphClosed(QAD_StudyFrame* ); + void onGraphClosed(QAD_ViewFrame* ); private: void loadEngine(SALOME_NamingService* namingService); 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_CanvasControlNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx index 21991ae..400fa1e 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx @@ -185,8 +185,10 @@ void SUPERVGUI_CanvasGotoNode::linkToNode() { SUPERVGUI_SelectInlineDlg* aDlg = new SUPERVGUI_SelectInlineDlg(getMain()); if (aDlg->exec()) { QString aNodeName = aDlg->getName(); - getGotoNode()->SetCoupled(aNodeName.latin1()); - getMain()->getCanvas()->sync(); + if (!aNodeName.isEmpty()) { //implement additional check from GUI side for bug PAL7007 + getGotoNode()->SetCoupled(aNodeName.latin1()); + getMain()->getCanvas()->sync(); + } } delete aDlg; } diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx index 4ed27d1..74b6b76 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx @@ -522,6 +522,12 @@ void SUPERVGUI_CanvasPointPrs::moveBy(double dx, double dy) QCanvasEllipse::moveBy(dx, dy); if (myInEdge) myInEdge->setFromPoint((int)x(), (int)y()); if (myOutEdge) myOutEdge->setToPoint((int)x(), (int)y()); + //resize canvas view if mouse is outside + int w = (int)(x()+dx) + width() + GRAPH_MARGIN; + int h = (int)(y()+dy) + height() + GRAPH_MARGIN; + if (canvas()->width() > w) w = canvas()->width(); + if (canvas()->height() > h) h = canvas()->height(); + if (canvas()->width() < w || canvas()->height() < h) canvas()->resize(w, h); if (myIndex > 0 && isMoving()) { myLink->getEngine()->ChangeCoord(myIndex, (int)x(), (int)y()); } diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx index ce06ff8..273f161 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()) { @@ -486,26 +484,31 @@ bool SUPERVGUI_CanvasNode::eventFilter( QObject* o, QEvent* e ) return QObject::eventFilter(o, e); } -SUPERV_Port SUPERVGUI_CanvasNode::createInPort() +QStringList SUPERVGUI_CanvasNode::getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts) { - SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(); - if (aDlg->exec()) { - if (aDlg->getName().isEmpty() || aDlg->getType().isEmpty()) { - QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) ); - return NULL; - } - SUPERV_INode aNode = getInlineNode(); - if (SUPERV_isNull(aNode)) { - MESSAGE("SUPERVGUI_CanvasNode::createInPort: Node is wrong type"); - return NULL; - } - SUPERV_Ports aPorts = aNode->Ports(); + QStringList aPNList; + if (!SUPERV_isNull(theNode)) { + SUPERV_Ports aPorts = theNode->Ports(); for (int i=0; ilength(); i++) { - if (aPorts[i]->IsInput() && aDlg->getName() == QString(aPorts[i]->Name())){ - QMessageBox::warning(0, tr("ERROR"), tr("MSG_PORT_EXIST")); - return NULL; + if (theInputPorts) { + if (aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name())); } + else + if (!aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name())); } + } + return aPNList; +} + +SUPERV_Port SUPERVGUI_CanvasNode::createInPort() +{ + SUPERV_INode aNode = getInlineNode(); + if (SUPERV_isNull(aNode)) { + MESSAGE("SUPERVGUI_CanvasNode::createInPort: Node is wrong type"); + return NULL; + } + SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,true)); + if (aDlg->exec()) { SUPERV_Port aPort = aNode->InPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; @@ -517,20 +520,14 @@ SUPERV_Port SUPERVGUI_CanvasNode::createInPort() SUPERV_Port SUPERVGUI_CanvasNode::createOutPort() { - SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(); + SUPERV_INode aNode = getInlineNode(); + if (SUPERV_isNull(aNode)) { + MESSAGE("SUPERVGUI_CanvasNode::createOutPort: Node is wrong type"); + return NULL; + } + + SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,false)); if (aDlg->exec()) { - SUPERV_INode aNode = getInlineNode(); - if (SUPERV_isNull(aNode)) { - MESSAGE("SUPERVGUI_CanvasNode::createOutPort: Node is wrong type"); - return NULL; - } - SUPERV_Ports aPorts = aNode->Ports(); - for (int i=0; ilength(); i++) { - if (!aPorts[i]->IsInput() && aDlg->getName() == QString(aPorts[i]->Name())){ - QMessageBox::warning(0, tr("ERROR"), tr("MSG_PORT_EXIST")); - return NULL; - } - } SUPERV_Port aPort = aNode->OutPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasNode.h b/src/SUPERVGUI/SUPERVGUI_CanvasNode.h index 9cf391c..f33d6ce 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.h +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.h @@ -12,6 +12,7 @@ using namespace std; #include "SUPERVGUI_Def.h" #include "SUPERVGUI_BrowseNodeDlg.h" +#include class SUPERVGUI_Main; class SUPERVGUI_CanvasNodePrs; @@ -61,6 +62,7 @@ class SUPERVGUI_CanvasNode : public QObject { SUPERV_Port createInPort(); SUPERV_Port createOutPort(); + QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts); virtual QPopupMenu* getPopupMenu(QWidget* theParent); 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..dd0e981 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx @@ -77,6 +77,7 @@ SUPERVGUI_CanvasView::SUPERVGUI_CanvasView(SUPERVGUI_Canvas* theCanvas, SUPERVGU { setName("CanvasView"); + myIsPanBtnClicked = false; myIsPanActivated = false; myIsZoomActivated = false; myIsLinkCreating = false; @@ -143,7 +144,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; @@ -153,7 +154,7 @@ void SUPERVGUI_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent) if (((theEvent->button() == Qt::MidButton) && (theEvent->state() == Qt::ControlButton)) || - myIsPanActivated) { + myIsPanBtnClicked) { myIsPanActivated = true; myCursor = cursor(); setCursor(pan2Cursor); @@ -364,7 +365,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) { @@ -381,6 +382,7 @@ void SUPERVGUI_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) if (myIsPanActivated) { myIsPanActivated = false; + myIsPanBtnClicked = false; setCursor(myCursor); } @@ -392,7 +394,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 @@ -461,7 +463,7 @@ void SUPERVGUI_CanvasView::changeBackground() void SUPERVGUI_CanvasView::ActivatePanning() { - myIsPanActivated = true; + myIsPanBtnClicked = true; } void SUPERVGUI_CanvasView::ResetView() @@ -482,7 +484,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_CanvasView.h b/src/SUPERVGUI/SUPERVGUI_CanvasView.h index 7e19640..564e28a 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasView.h +++ b/src/SUPERVGUI/SUPERVGUI_CanvasView.h @@ -70,6 +70,7 @@ class SUPERVGUI_CanvasView: public QCanvasView { int myDelPntItem; int myOrtoItem; + bool myIsPanBtnClicked; bool myIsPanActivated; bool myIsZoomActivated; bool myIsLinkCreating; diff --git a/src/SUPERVGUI/SUPERVGUI_ControlNode.cxx b/src/SUPERVGUI/SUPERVGUI_ControlNode.cxx index a97a43e..0d40243 100644 --- a/src/SUPERVGUI/SUPERVGUI_ControlNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_ControlNode.cxx @@ -397,6 +397,7 @@ SUPERVGUI_SelectInlineDlg::SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain) aMainLayout->addWidget(aLabel, 0, 0); myCombo = new QComboBox(this); + myCombo->clear(); //for the additional check from GUI side for bug PAL7007 SUPERV_Nodes aNodesList = theMain->getDataflow()->Nodes(); int i; for (i = 0; i < aNodesList->INodes.length(); i++) { diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index ce4f2e2..59344f1 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -51,6 +51,9 @@ using namespace std; #include "SUPERVGUI_CanvasControlNode.h" #include +/* +asv 20.10.04: removed 2 SUPERVGUI_Main constructors. there is only ONE way +to create a Main object now: with a non-null DataFlow as a 3d parameter SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, bool fromIOR) : SUPERVGraph_View(theParent), myLogged( false ), @@ -125,8 +128,9 @@ SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* th init(theDesktop); } } +*/ -SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, SUPERV_Graph cp) +SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, SUPERV_Graph theDataFlow ) : SUPERVGraph_View(theParent), myLogged( false ), myFiltered( false ), @@ -139,8 +143,7 @@ SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* th { Trace("SUPERVGUI_Main::SUPERVGUI_Main (copy)"); theParent->setViewWidget(this); - // dataflow = cp->Copy(); - dataflow = cp; + dataflow = theDataFlow; if (SUPERV_isNull(dataflow)) { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_COPY")); close(); @@ -159,12 +162,9 @@ void SUPERVGUI_Main::init(QAD_Desktop* theDesktop) { myThread = new SUPERVGUI_Thread(); myThread->setMain(this); - connect(this, SIGNAL(KillMyThread(bool)), myThread, SLOT(KillThread(bool))); myIsKilled = false; - //myIsRunned = false; myCurrentView = CANVAS; - // myCurrentView = GRAPH; myIsFromStudy = false; myLastGraph = 0; study = theDesktop->getActiveStudy(); @@ -183,7 +183,6 @@ void SUPERVGUI_Main::init(QAD_Desktop* theDesktop) { father = builder->NewComponent(STUDY_SUPERVISION); anAttr = builder->FindOrCreateAttribute(father, "AttributeName"); aName = SALOMEDS::AttributeName::_narrow(anAttr); - //aName->SetValue("Supervision"); aName->SetValue(QAD_Application::getDesktop()->getComponentUserName( "SUPERV" ) ); anAttr = builder->FindOrCreateAttribute(father, "AttributePixMap"); @@ -230,14 +229,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(); @@ -253,33 +255,11 @@ SUPERVGUI_Main::~SUPERVGUI_Main() { fclose( myLogFile ); } graph->removeLinks(); - delete myCanvas; + //delete myCanvas; // delete notification; // kloss : nota bene : quand un datalow est detruit : verifier que les canaux de notification sont aussi detruit notification->_remove_ref(); // kloss : nota bene : quand un datalow est detruit : verifier que les canaux de notification sont aussi detruit - if (!SUPERV_isNull(dataflow)) { - if (dataflow->IsExecuting()) { - if (QMessageBox::warning(QAD_Application::getDesktop(), - tr("WARNING"), - tr("MSG_DF_RUNNING"), - tr("MSG_DF_EXECUTION"), - tr("MSG_DF_KILL")) == 1) { - if (dataflow->Kill()) { - if (myThread->running()) - myThread->wait(); - } - } - else { - emit KillMyThread(true); - if (myThread->running()) - myThread->wait(); - } - } - else { - emit KillMyThread(true); - if (myThread->running()) - myThread->wait(); - } - } + + delete myCanvas; } void SUPERVGUI_Main::filterNotification() { @@ -349,7 +329,6 @@ void SUPERVGUI_Main::execute(char * theNodeName, SUPERV::GraphState theNodeStat aGraphNodePrs->sync(); } else if (aNodePrs) { - //aNodePrs->sync(); aNodePrs->syncOnEvent(theNodeState); } } @@ -507,7 +486,7 @@ void SUPERVGUI_Main::copy() { QString aNewName(tr("MSG_COPY_PREFIX").arg(++myCopyNum)); aNewName += dataflow->Name(); aNewGraph->SetName(aNewName); - SUPERVGUI_Main* m = new SUPERVGUI_Main(aViewFrame, + /*SUPERVGUI_Main* m = */new SUPERVGUI_Main(aViewFrame, Supervision.getDesktop(), aNewGraph); study->showFrame(aStudyFrame); @@ -516,8 +495,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 +513,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(); @@ -547,7 +523,7 @@ void SUPERVGUI_Main::openSubGraph(SUPERV_CNode theNode, bool correct) SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast (aStudyFrame->getRightFrame()->getViewFrame()); if(aViewFrame) { - SUPERVGUI_Main* m = new SUPERVGUI_Main(aViewFrame, + /*SUPERVGUI_Main* m = */new SUPERVGUI_Main(aViewFrame, Supervision.getDesktop(), aGraph); // connect(aStudyFrame, SIGNAL(sfStudyFrameClosing(QAD_StudyFrame*)), @@ -1334,9 +1310,13 @@ bool SUPERVGUI_Main::isFiltered(char* graph, char* node, char* type, char* me return( b ); } +void SUPERVGUI_Main::closeEvent(QCloseEvent* e) { + e->accept(); +} void SUPERVGUI_Main::setPaletteBackgroundColor(const QColor& color) { + array->setPaletteBackgroundColor(color); graph->setPaletteBackgroundColor(color); myCanvas->setBackgroundColor(color); @@ -1380,6 +1360,7 @@ void SUPERVGUI_Main::startTimer() { void SUPERVGUI_Main::executionFinished() { getStudy()->updateObjBrowser(); + myCanvas->update(); } void SUPERVGUI_Main::checkExecution() { @@ -1405,7 +1386,8 @@ void SUPERVGUI_Thread::startThread(const char* m) { if (!myIsActive) { myIsActive = true; - QThread::start(); + //QThread::start(); + this->start(); myMain->getMessage()->setMessage(m); myMain->sync(); } @@ -1449,26 +1431,27 @@ void SUPERVGUI_Thread::run() myMain->startTimer(); while(myIsActive) { myMain->getDataflow()->Event(aNode, aEvent, aState); - + if (aEvent == SUPERV::UndefinedEvent && aState == SUPERV::UndefinedState || aEvent == SUPERV::NoEvent && aState == SUPERV::NoState || aEvent == SUPERV::KillEvent && aState == SUPERV::KillState) { + if (myMain->getEventNodes().count()) { myMain->removeEventNodes(); - } + } if (myMain->getStates().count()) { myMain->removeStates(); - } + } myIsActive = false; } - else { - if ( aNode != NULL) { + else { + 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); @@ -1501,10 +1484,10 @@ void SUPERVGUI_Thread::run() myMain->setStates(aStates); } } - } + } if (!myIsActive) { switch (myMain->getDataflow()->State()) { - case SUPERV_Editing : + case SUPERV_Editing : stopThread(myMain->getDataflow()->IsReadOnly()? tr("MSG_GRAPH_READONLY"): tr("MSG_GRAPH_EDITING")); break; @@ -1516,7 +1499,7 @@ void SUPERVGUI_Thread::run() stopThread(tr("MSG_GRAPH_FINISHED")); break; - case SUPERV_Error : + case SUPERV_Error : stopThread(tr("MSG_GRAPH_ABORTED")); break; @@ -1527,24 +1510,26 @@ void SUPERVGUI_Thread::run() break; } - - if (myMain->getEventNodes().count()) { + if ( myMain->getEventNodes().count() ) { //if list not empty call execute() -> sync() char * aNodeName = *(myMain->getEventNodes().getFirst()); SUPERV::GraphState aNodeState = *(myMain->getStates().getFirst()); // It is PROHIBITED to deal with widgets in a secondary thread, so event posting is used here ProcessVoidEvent( new TNodeSyncEvent( myMain, &SUPERVGUI_Main::execute, aNodeName, aNodeState ) ); - + myMain->removeFirstEN(); myMain->removeFirstS(); - } 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); @@ -1553,7 +1538,8 @@ void SUPERVGUI_Thread::run() // qApp->lock(); // myMain->getStudy()->updateObjBrowser(); // qApp->unlock(); - // VSR: 04/12/03 <--- + // VSR: 04/12/03 <--- + QThread::exit(); } diff --git a/src/SUPERVGUI/SUPERVGUI_Main.h b/src/SUPERVGUI/SUPERVGUI_Main.h index b8140ec..043a915 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.h +++ b/src/SUPERVGUI/SUPERVGUI_Main.h @@ -51,8 +51,8 @@ class SUPERVGUI_Main: public SUPERVGraph_View { Q_OBJECT public: - SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool fromIOR); - SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool isModify, const char* filename); + //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool fromIOR); + //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool isModify, const char* filename); SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, SUPERV_Graph); virtual ~SUPERVGUI_Main(); @@ -156,6 +156,7 @@ class SUPERVGUI_Main: public SUPERVGraph_View { void init(QAD_Desktop* parent); void syncNotification(); bool isFiltered(char* graph, char* node, char* type, char* message, char* sender, long counter, char* date, long stamp); + void closeEvent(QCloseEvent*); SUPERV_Graph dataflow; diff --git a/src/SUPERVGUI/SUPERVGUI_Node.cxx b/src/SUPERVGUI/SUPERVGUI_Node.cxx index 1d5a39c..74cf9ea 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); @@ -418,26 +417,31 @@ void SUPERVGUI_Node::setNodeName(QString aName) { QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_RENAMENODE" ) ); } - -SUPERV_Port SUPERVGUI_Node::createInPort() { - SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(); - if (aDlg->exec()) { - if (aDlg->getName().isEmpty() || aDlg->getType().isEmpty()) { - QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) ); - return NULL; - } - SUPERV_INode aNode = getInlineNode(); - if (SUPERV_isNull(aNode)) { - MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type"); - return NULL; - } - SUPERV_Ports aPorts = aNode->Ports(); +QStringList SUPERVGUI_Node::getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts) +{ + QStringList aPNList; + if (!SUPERV_isNull(theNode)) { + SUPERV_Ports aPorts = theNode->Ports(); for (int i=0; ilength(); i++) { - if (aDlg->getName() == QString(aPorts[i]->Name())){ - QMessageBox::warning(0, tr("ERROR"), tr("MSG_PORT_EXIST")); - return NULL; + if (theInputPorts) { + if (aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name())); } + else + if (!aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name())); } + } + return aPNList; +} + +SUPERV_Port SUPERVGUI_Node::createInPort() { + SUPERV_INode aNode = getInlineNode(); + if (SUPERV_isNull(aNode)) { + MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type"); + return NULL; + } + + SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,true)); + if (aDlg->exec()) { SUPERV_Port aPort = aNode->InPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; @@ -449,20 +453,14 @@ SUPERV_Port SUPERVGUI_Node::createInPort() { SUPERV_Port SUPERVGUI_Node::createOutPort() { - SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(); + SUPERV_INode aNode = getInlineNode(); + if (SUPERV_isNull(aNode)) { + MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type"); + return NULL; + } + + SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,false)); if (aDlg->exec()) { - SUPERV_INode aNode = getInlineNode(); - if (SUPERV_isNull(aNode)) { - MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type"); - return NULL; - } - SUPERV_Ports aPorts = aNode->Ports(); - for (int i=0; ilength(); i++) { - if (aDlg->getName() == QString(aPorts[i]->Name())){ - QMessageBox::warning(0, tr("ERROR"), tr("MSG_PORT_EXIST")); - return NULL; - } - } SUPERV_Port aPort = aNode->OutPort(aDlg->getName().latin1(), aDlg->getType().latin1()); delete aDlg; @@ -520,8 +518,9 @@ void SUPERVGUI_Node::editFunction() { static const char* MyTypeStrings[] = {"string", "boolean", "char", "short", "int", "long", "float", "double", "objref"}; -SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg() - : QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ) +SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames) + : QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), + myPortsNames(thePortsNames) { setSizeGripEnabled( true ); setCaption("Port parameters"); @@ -554,7 +553,7 @@ SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg() aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 1 ); QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox ); - connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) ); + connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) ); aBtnLayout->addWidget( aOKBtn ); aBtnLayout->addStretch(); @@ -563,3 +562,13 @@ SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg() connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) ); aBtnLayout->addWidget( aCancelBtn ); } + +void SUPERVGUI_PortParamsDlg::clickOnOk() +{ + if (getName().isEmpty() || getType().isEmpty()) + QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) ); + else if (myPortsNames.contains(getName())) + QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") ); + else + accept(); +} diff --git a/src/SUPERVGUI/SUPERVGUI_Node.h b/src/SUPERVGUI/SUPERVGUI_Node.h index 4acd05c..05ca410 100644 --- a/src/SUPERVGUI/SUPERVGUI_Node.h +++ b/src/SUPERVGUI/SUPERVGUI_Node.h @@ -35,6 +35,7 @@ using namespace std; #include "SUPERVGUI_BrowseNodeDlg.h" #include #include "SUPERVGUI_Port.h" +#include class SUPERVGUI_Main; @@ -95,6 +96,7 @@ class SUPERVGUI_Node: public QFrame { SUPERV_Port createInPort(); SUPERV_Port createOutPort(); + QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts); protected: void mousePressEvent(QMouseEvent* e); @@ -160,15 +162,20 @@ class SUPERVGUI_PortParamsDlg: public QDialog { Q_OBJECT public: - SUPERVGUI_PortParamsDlg(); + SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames); ~SUPERVGUI_PortParamsDlg() {}; QString getName() { return myNameTxt->text(); } QString getType() { return myTypeTxt->currentText(); } + public slots: + void clickOnOk(); + + private: QLineEdit* myNameTxt; QComboBox* myTypeTxt; + QStringList myPortsNames; }; diff --git a/src/SUPERVGUI/SUPERVGUI_Service.cxx b/src/SUPERVGUI/SUPERVGUI_Service.cxx index 017ddeb..026c1ae 100644 --- a/src/SUPERVGUI/SUPERVGUI_Service.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Service.cxx @@ -395,7 +395,10 @@ void SUPERVGUI_Service::addComputeNode() { QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - node->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + int cx, cy; + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + node->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addComputeNode(SUPERV::CNode::_narrow(node)); @@ -441,13 +444,16 @@ void SUPERVGUI_Service::addFactoryNode() { MESSAGE ( " myService->TypeOfNode == " << myService->TypeOfNode ) + int cx, cy; if ( myService->TypeOfNode == 0 ) { // ComputeNode SUPERV_CNode node = aMain->getDataflow()->CNode(*myService); if (CORBA::is_nil(node)) { QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - node->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + node->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addComputeNode(SUPERV::CNode::_narrow(node)); @@ -457,7 +463,9 @@ void SUPERVGUI_Service::addFactoryNode() { QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - node->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + node->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addComputeNode(SUPERV::CNode::_narrow(node)); @@ -492,6 +500,7 @@ void SUPERVGUI_Service::addInlineNode() { QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); } else { int aSel = myTypeCombo->currentItem(); + int cx, cy; switch (aSel) { case 0: // Computation if (myScriptPane->isDefined()) { @@ -501,7 +510,9 @@ void SUPERVGUI_Service::addInlineNode() { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - aNode->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + aNode->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addComputeNode(SUPERV::CNode::_narrow(aNode)); @@ -518,8 +529,10 @@ void SUPERVGUI_Service::addInlineNode() { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - aStartNode->Coords(myX, myY); - aEndNode->Coords(myX + LABEL_WIDTH*2, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + aStartNode->Coords(cx, cy); + aEndNode->Coords(cx + LABEL_WIDTH*2, cy); myX += NODE_DX; myY += NODE_DY; aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true); @@ -537,8 +550,10 @@ void SUPERVGUI_Service::addInlineNode() { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - aStartNode->Coords(myX, myY); - aEndNode->Coords(myX + LABEL_WIDTH*2, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + aStartNode->Coords(cx, cy); + aEndNode->Coords(cx + LABEL_WIDTH*2, cy); myX += NODE_DX; myY += NODE_DY; aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true); @@ -557,7 +572,9 @@ void SUPERVGUI_Service::addInlineNode() { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - aGotoNode->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + aGotoNode->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addGOTONode(SUPERV::GNode::_narrow(aGotoNode)); @@ -591,7 +608,10 @@ void SUPERVGUI_Service::addMacroNode() { QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE")); return; } - aNode->Coords(myX, myY); + //to appear a new node in the top-left corner of the current viewport + int cx, cy; + aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy); + aNode->Coords(cx, cy); myX += NODE_DX; myY += NODE_DY; aMain->addMacroNode(SUPERV::CNode::_narrow(aNode)); @@ -606,7 +626,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; } @@ -807,7 +827,10 @@ SUPERV_Strings SUPERVGUI_PythonEditPane::getFunction() { SUPERV_Strings aStrings = new SUPERV::ListOfStrings(); aStrings->length(myText->paragraphs()); for (int i=0; i < myText->paragraphs(); i++) { - aStrings[i] = CORBA::string_dup(myText->text(i).latin1()); + QString aLine = myText->text(i); + if (!aLine.right(1).compare(" ")) + aLine = aLine.remove(aLine.length()-1,1); + aStrings[i] = CORBA::string_dup(aLine.latin1()); } return aStrings._retn(); } diff --git a/src/SUPERVGUI/SUPERV_msg_en.po b/src/SUPERVGUI/SUPERV_msg_en.po index 5832601..72c0451 100644 --- a/src/SUPERVGUI/SUPERV_msg_en.po +++ b/src/SUPERVGUI/SUPERV_msg_en.po @@ -85,7 +85,7 @@ msgstr "Ortho Mode" #:SUPERVGUI_Main.cxx:146 msgid "WARNING" -msgstr "Supervision Warning" +msgstr "Supervisor Warning" #:SUPERVGUI_Main.cxx:147 msgid "MSG_DF_RUNNING" @@ -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..1175c00 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,14 +1724,15 @@ 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() ) ; + MESSAGE( "Node " << Name() << " execution was killed : " << RetVal ) ; } else { - RetVal = _DataFlowExecutor->Kill() ; - MESSAGE( "Graph execution was killed " << RetVal ) ; + RetVal = aDataFlowExecutor->Kill() ; + MESSAGE( "Graph execution was killed : " << RetVal ) ; } } endService( "CNode_Impl::Kill" ); @@ -1822,10 +1741,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 +1752,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 +1776,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,33 +1791,35 @@ 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" ); return RetVal ; } +// Old method used in the past for initial study about GOTO and Loop +// Should not be used 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,29 +1829,35 @@ 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 ) ; } +// The GUI calls directly that method instead of calling Graph_Impl::Run() : +// I redirect the call to Graph_Impl::Run() 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" ); return RetVal ; } +// Old method used in the past for initial study about GOTO and Loop +// Should not be used 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,26 +1867,33 @@ 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 ) ; + } +// The GUI calls directly that method instead of calling Graph_Impl::Start() : +// I redirect the call to Graph_Impl::Start() + else if ( DataFlowEditor()->IsEditing() ) { + RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Start() ; } else { - RetVal = _DataFlowExecutor->Run( true ) ; + RetVal = aDataFlowExecutor->Run( true ) ; } } endService( "CNode_Impl::ReStart" ); return RetVal ; } +// Old method used in the past for initial study about GOTO and Loop +// Should not be used 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 +1902,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/ELNode_Impl.cxx b/src/Supervision/ELNode_Impl.cxx index e5913bd..04bc8da 100644 --- a/src/Supervision/ELNode_Impl.cxx +++ b/src/Supervision/ELNode_Impl.cxx @@ -72,13 +72,10 @@ ELNode_Impl::~ELNode_Impl() { } void ELNode_Impl::destroy() { -// MESSAGE("--------> ELNode_Impl::destroy() BEGIN"); -// beginService( "ELNode_Impl::Destroy" ); + beginService( "ELNode_Impl::Destroy" ); if ( DataFlowEditor()->IsEditing() ) { - MESSAGE("--------> Editing dataflow"); SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ; if ( Delete() ) { - MESSAGE("--------> Delete return true"); _poa->deactivate_object(*_id) ; CORBA::release(_poa) ; delete(_id) ; @@ -89,26 +86,19 @@ void ELNode_Impl::destroy() { aCoupled->destroy() ; } } -// endService( "ELNode_Impl::Destroy" ); -// MESSAGE("--------> ELNode_Impl::destroy() END"); + endService( "ELNode_Impl::Destroy" ); } bool ELNode_Impl::Delete() { -// beginService( "ELNode_Impl::Delete" ); - MESSAGE("--------> ELNode_Impl::Delete() BEGIN"); + beginService( "ELNode_Impl::Delete" ); bool RetVal = false ; if ( DataFlowEditor()->IsEditing() ) { DeletePorts() ; - MESSAGE("--------> In Delete: Editing dataflow"); RetVal = DataFlowEditor()->RemoveNode( Name() ) ; - MESSAGE("--------> RetVal = "< Before IsValid"); RetVal = DataFlowEditor()->IsValid() ; - MESSAGE("--------> After IsValid"); } } -// endService( "ELNode_Impl::Delete" ); - MESSAGE("--------> ELNode_Impl::Delete() END"); + endService( "ELNode_Impl::Delete" ); return RetVal ; } diff --git a/src/Supervision/FNode_Impl.cxx b/src/Supervision/FNode_Impl.cxx index 290df45..9fbd6d4 100644 --- a/src/Supervision/FNode_Impl.cxx +++ b/src/Supervision/FNode_Impl.cxx @@ -111,9 +111,7 @@ char * FNode_Impl::GetComponentName() { bool FNode_Impl::SetComponentName( const char * aComponentName ) { // beginService( "FNode_Impl::SetComponentName" ); bool RetVal = false ; - if ( DataFlowEditor()->IsEditing() ) { - RetVal = DataFlowNode()->ComponentName( aComponentName ) ; - } + RetVal = DataFlowNode()->ComponentName( aComponentName ) ; // endService( "FNode_Impl::SetComponentName" ); return RetVal ; } @@ -126,9 +124,7 @@ char * FNode_Impl::GetInterfaceName() { bool FNode_Impl::SetInterfaceName( const char * anInterfaceName ) { // beginService( "FNode_Impl::SetInterfaceName" ); bool RetVal = false ; - if ( DataFlowEditor()->IsEditing() ) { RetVal = DataFlowNode()->InterfaceName( anInterfaceName ) ; - } // endService( "FNode_Impl::SetInterfaceName" ); return RetVal ; } @@ -141,16 +137,17 @@ char * FNode_Impl::GetContainer() { bool FNode_Impl::SetContainer( const char * aDataFlowContainer ) { // beginService( "FNode_Impl::SetContainer" ); bool RetVal = false ; - GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ; - if ( DataFlowEditor()->IsEditing() ) { +// GraphExecutor::DataFlow * _DataFlowExecutor = DataFlowEditor()->Executor() ; +// if ( DataFlowEditor()->IsEditing() ) { RetVal = DataFlowNode()->Computer( aDataFlowContainer ) ; - } - else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() || - _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) { - if ( _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() ) ) { - RetVal = ((GraphEditor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() )->GetInNode())->Computer( aDataFlowContainer ) ; - } - } +// } +// else if ( _DataFlowExecutor && ( _DataFlowExecutor->IsSuspended() || +// _DataFlowExecutor->IsSuspended( DataFlowNode()->Name() ) ) ) { +// if ( _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() ) ) { +// RetVal = ((GraphEditor::InNode * ) _DataFlowExecutor->Graph()->GetChangeGraphNode( DataFlowNode()->Name() )->GetInNode())->Computer( aDataFlowContainer ) ; + DataFlowEditor()->UnValid() ; +// } +// } // endService( "FNode_Impl::SetContainer" ); return RetVal ; } diff --git a/src/Supervision/GNode_Impl.cxx b/src/Supervision/GNode_Impl.cxx index 6d7cd4a..9299a97 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 ) @@ -227,3 +214,31 @@ SUPERV::INode_ptr GNode_Impl::Coupled() { return SUPERV::INode::_duplicate( iobject ) ; } +bool GNode_Impl::SetCoupled( const char * anInLineNode ) +{ + GraphBase::InLineNode * CoupledINode = (GraphBase::InLineNode * ) DataFlowEditor()->Graph()->GetGraphNode( anInLineNode ) ; + if ( !CoupledINode ) { + + // asv : 2.11.04 : nullify Coupled node if anInLineNode == "" (bug 7113) + if ( anInLineNode==NULL || !strlen( anInLineNode ) ) { + DataFlowNode()->CoupledNode( NULL ); + } + + return false; + } + if ( ( IsGOTO() && ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() || CoupledINode->IsSwitchNode() ) ) || + ( !IsGOTO() && ( IsLoop() || IsSwitch() || IsEndLoop() || IsEndSwitch() ) ) ) { + DataFlowNode()->CoupledNode( CoupledINode ) ; + if ( CoupledINode && IsSwitch() ) { + DataFlowEditor()->AddLink( Name() , "Default" ,CoupledINode->Name() , "Default" ) ; + } + else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) { + DataFlowEditor()->AddLink( Name() , "DoLoop" , CoupledINode->Name() , "DoLoop" ) ; + } + else if ( CoupledINode && IsGOTO() ) { + DataFlowEditor()->AddLink( Name() , "OutGate" ,CoupledINode->Name() , "InGate" ) ; + } + return true ; + } + return false ; +} diff --git a/src/Supervision/GNode_Impl.hxx b/src/Supervision/GNode_Impl.hxx index 52ddcc1..b5f87bb 100644 --- a/src/Supervision/GNode_Impl.hxx +++ b/src/Supervision/GNode_Impl.hxx @@ -68,49 +68,12 @@ 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() ; - virtual bool SetCoupled( const char * anInLineNode ) { - GraphBase::InLineNode * CoupledINode = (GraphBase::InLineNode * ) DataFlowEditor()->Graph()->GetGraphNode( anInLineNode ) ; -// cout << Name() << ".SetCoupled " << anInLineNode << endl ; -// if ( CoupledINode && ( IsGOTO() && - if ( ( IsGOTO() && - ( CoupledINode->IsInLineNode() || CoupledINode->IsLoopNode() || - CoupledINode->IsSwitchNode() ) ) || - ( !IsGOTO() && ( IsLoop() || IsSwitch() || - IsEndLoop() || IsEndSwitch() ) ) ) { - DataFlowNode()->CoupledNode( CoupledINode ) ; - if ( CoupledINode && IsSwitch() ) { - DataFlowEditor()->AddLink( Name() , "Default" , - CoupledINode->Name() , "Default" ) ; - } - else if ( CoupledINode && ( IsLoop() || IsEndLoop() ) ) { - DataFlowEditor()->AddLink( Name() , "DoLoop" , - CoupledINode->Name() , "DoLoop" ) ; - } - else if ( CoupledINode && IsGOTO() ) { - DataFlowEditor()->AddLink( Name() , "OutGate" , - CoupledINode->Name() , "InGate" ) ; - } -// cout << "SetCoupled " << CoupledINode->Name() << endl ; - return true ; - } -// cout << Name() << ".SetCoupled ERROR " << anInLineNode << " " << CoupledINode -// << " of " << Kind() ; -// if ( CoupledINode ) { -// cout << " kinfOkCoupled " << CoupledINode->Kind() ; -// } -// cout << endl ; - return false ; } ; + virtual bool SetCoupled( const char * anInLineNode ); + virtual SUPERV::INode_ptr Coupled() ; virtual GraphBase::GOTONode * BaseNode() { diff --git a/src/Supervision/Graph_Impl.cxx b/src/Supervision/Graph_Impl.cxx index 31358d7..3af8ebd 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,262 @@ 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 : 05.11.04 : fix of bug - "insert file" into existing graph with MacroNodes worked incorrectly! + // aMacroNode is an "old" node, and here we must analize only "new" nodes, that + // came from aListOfDataFlows and were loaded by aDataFlowEditor->LoadDataFlow( &(*aListOfDataFlows)[ index ] ) + // so here we check if the node is "new" or "old" + if ( aMacroNode->GraphEditor() && aMacroNode->CoupledNode() ) + continue; + // 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 : - else if ( !aDataFlowExecutor->Graph()->HasDataStream() ) { + + // That graph is not a StreamGraph : + else { 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" ) ; + anExecutorGraph->GraphEditor( aDataFlowEditor ) ; + + if ( !aDataFlowExecutor->Graph()->HasDataStream() ) { + // 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 ) ; + + // 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() ) { + const char* aMacroGraphInPortName = aMacroGraph->GetNodeInPort( q )->PortName(); + if ( !aMacroGraphExecutor->InputOfAny( aMacroGraphInPortName, *anInPort->GetOutPort()->Value(),false ) ) { + return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; } - 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 ) ) ; + else { + MESSAGE( "LoadDataFlows(Executor) " << aMacroGraph->Name() << "->InputOfAny( " + << aMacroGraphInPortName << " , Value )" ) ; + } + } + } // end of init MacroNode's InPorts -// Set the GraphMacroNode ObjRef in the MacroNode - aMacroNode->CoupledNode( aMacroGraph ) ; - aMacroNode->MacroObject( SUPERV::Graph::_duplicate( iobject ) ) ; + aMacroGraphImpl->Run() ; - iobject->Run() ; - } - break ; - } - } - } + } + } // 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 +851,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 +868,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 +902,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 +918,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 +930,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 +948,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 +958,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 +980,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 +1010,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 +1019,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 +1092,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 +1511,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 +1627,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() { @@ -1670,44 +1732,28 @@ bool Graph_Impl::Begin() { } if ( DataFlowExecutor() ) { MESSAGE( "Graph_Impl::Begin " << DataFlowExecutor()->Threads() << " threads" ) - if ( DataFlowExecutor()->Threads() ) { - DataFlowExecutor()->JoinedWait() ; - } +// if ( DataFlowExecutor()->Threads() ) { +// 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") ; @@ -1719,7 +1765,7 @@ bool Graph_Impl::Begin() { bool Graph_Impl::Run() { beginService( "Graph_Impl::Run" ); bool RetVal = false ; - if ( DataFlowEditor()->IsEditing() && !IsMacro() ) { + if ( ( DataFlowEditor()->IsEditing() || IsDone() ) && !IsMacro() ) { MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() << " IsEditing" ); if ( DataFlowEditor()->Graph()->GraphMacroLevel() ) { MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel " @@ -1737,34 +1783,50 @@ bool Graph_Impl::Run() { RetVal = CNode_Impl::Run() ; } } - else if ( !IsMacro() ) { - MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() - << " IsNOTEditing --> CNode_Impl::ReRun" ); - DataFlowEditor()->Executing() ; - RetVal = CNode_Impl::ReRun() ; - } +// It is necessary to reload the dataflow because of ports with input initial values changed +// during execution to values of outport of EndLoopNode or GOTONode +// else if ( !IsMacro() && IsDone() ) { +// MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() +// << " IsNOTEditing --> CNode_Impl::ReRun" ); +// DataFlowEditor()->Executing() ; +// RetVal = CNode_Impl::ReRun() ; +// } + MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " RetVal " << RetVal ) ; endService( "Graph_Impl::Run" ); return RetVal ; } bool Graph_Impl::Start() { beginService( "Graph_Impl::Start" ); bool RetVal = false ; - if ( !IsMacro() ) { - if ( DataFlowEditor()->IsEditing() ) { - MESSAGE( "Graph_Impl::Start IsEditing" ); - RetVal = Begin() ; + if ( ( DataFlowEditor()->IsEditing() || IsDone() ) && !IsMacro() ) { + MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() << " IsEditing" ); + if ( DataFlowEditor()->Graph()->GraphMacroLevel() ) { + MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel " + << DataFlowEditor()->Graph()->GraphMacroLevel() ) ; + RetVal = true ; } else { - RetVal = true ; + MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel " + << DataFlowEditor()->Graph()->GraphMacroLevel() << " --> Begin()" ) ; + RetVal = Begin() ; } if ( RetVal ) { - MESSAGE( "Graph_Impl::(Re)Start " ); - // Added by NKV to fix PAL6222 --> to be confirm by JR + // Added by NKV to fix PAL6222 --> to be confirm by JR ; JR confirmed DataFlowEditor()->Executing() ; // End of NKV's correction + MESSAGE( "Graph_Impl::(Re)Start " ); RetVal = ReStart() ; } } +// It is necessary to reload the dataflow because of ports with input initial values changed +// during execution to values of outport of EndLoopNode or GOTONode +// else if ( !IsMacro() && IsDone() ) { +// MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() +// << " IsNOTEditing --> CNode_Impl::ReStart" ); +// DataFlowEditor()->Executing() ; +// RetVal = CNode_Impl::ReStart() ; +// } + MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " RetVal " << RetVal ) ; endService( "Graph_Impl::Start" ); return RetVal ; } 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/LNode_Impl.cxx b/src/Supervision/LNode_Impl.cxx index ce4f467..d258747 100644 --- a/src/Supervision/LNode_Impl.cxx +++ b/src/Supervision/LNode_Impl.cxx @@ -91,12 +91,12 @@ void LNode_Impl::destroy() { aCoupled->destroy() ; } } -// endService( "LNode_Impl::Destroy" ); + endService( "LNode_Impl::Destroy" ); } bool LNode_Impl::Delete() { beginService( "LNode_Impl::Delete" ); - bool RetVal = false ; + bool RetVal = false ; if ( DataFlowEditor()->IsEditing() ) { DeletePorts() ; RetVal = DataFlowEditor()->RemoveNode( Name() ) ; 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/StreamGraph_Impl.cxx b/src/Supervision/StreamGraph_Impl.cxx index 315560d..6602d2c 100644 --- a/src/Supervision/StreamGraph_Impl.cxx +++ b/src/Supervision/StreamGraph_Impl.cxx @@ -60,9 +60,9 @@ StreamGraph_Impl::StreamGraph_Impl( CORBA::ORB_ptr orb , GraphEditor::DataFlow * aDataFlowEditor , GraphEditor::InNode * aDataFlowNode ) : Graph_Impl( orb , poa , contId , instanceName , interfaceName , aDataFlowEditor , aDataFlowNode ) { - MESSAGE( aDataFlowNode->Name() << " " ); beginService( "StreamGraph_Impl::StreamGraph_Impl" ); - if ( aDataFlowNode->IsMacroNode() ) { + if ( aDataFlowEditor->Graph()->IsDataStreamNode() || + ( aDataFlowNode && aDataFlowNode->IsMacroNode() ) ) { MESSAGE( "StreamGraph_Impl::StreamGraph_Impl _poa->activate_object" ); _thisObj = this ; _id = _poa->activate_object(_thisObj); diff --git a/src/Supervision/SuperV.py b/src/Supervision/SuperV.py index 7055d82..613f6c6 100644 --- a/src/Supervision/SuperV.py +++ b/src/Supervision/SuperV.py @@ -37,6 +37,7 @@ except : import os import re from types import * +import readline #try : # SuperVision = SuperV_Swig( len(sys.argv) , sys.argv ) 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..bdc6441 100644 --- a/src/Supervision/batchmode_SuperV.py +++ b/src/Supervision/batchmode_SuperV.py @@ -15,12 +15,16 @@ try : from batchmode_salome import naming_service from batchmode_salome import CORBA from batchmode_salome import myStudy + import SALOME_ModuleCatalog + import SUPERV + import SUPERV_idl except : import curses from LifeCycleCORBA import * from SALOME_NamingServicePy import * import SUPERV import SUPERV_idl + import SALOME_ModuleCatalog from batchmode_salome import * # try : # from libSuperVision_Swig import SuperV_Swig @@ -28,11 +32,15 @@ except : # except : # SuperV_Swig = None orb = CORBA.ORB_init([''], CORBA.ORB_ID) - lcc = LifeCycleCORBA(orb) + #lcc = LifeCycleCORBA(orb) + while lcc._catalog == None: + lcc = LifeCycleCORBA(orb) naming_service = SALOME_NamingServicePy_i(orb) +import os import re from types import * +import readline import SALOMEDS import SALOMEDS_Attributes_idl #try : @@ -45,9 +53,11 @@ import SALOMEDS_Attributes_idl # print 'Supervision Component loaded' SuperVision = lcc.FindOrLoadComponent("SuperVisionContainer","SUPERV") -SuperVision.Swig = 0 +#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") @@ -241,6 +251,11 @@ class CNode: if self.N.IsFactory() : print "ComponentName ",self.N.GetComponentName() print "InterfaceName ",self.N.GetInterfaceName() + if self.N.IsStreamGraph() : + Timeout,DataStreamTrace,DeltaTime = self.G.StreamParams() + print "Timeout",Timeout + print "DataStreamTrace",DataStreamTrace + print "DeltaTime",DeltaTime aService = self.N.Service() print "Service Name ",aService.ServiceName lenin = len( aService.ServiceinParameter ) @@ -301,6 +316,54 @@ class CNode: # inp = Port( inp , self.N.Verbose ) # outp = Port( outp , self.N.Verbose ) # return sts,inp,outp + def InStreamPort( self , aParameterName , aParameterType , aDependency ): + aPort = self.N.InStreamPort( aParameterName , aParameterType , aDependency ) + if aPort != None : + myPort = StreamPort( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None + def OutStreamPort( self , aParameterName , aParameterType , aDependency ): + aPort = self.N.OutStreamPort( aParameterName , aParameterType , aDependency ) + if aPort != None : + myPort = StreamPort( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None + def GetInPort( self , aParameterName ): + aPort = self.N.GetInPort( aParameterName ) + if aPort != None : + myPort = Port( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None + def GetOutPort( self , aParameterName ): + aPort = self.N.GetOutPort( aParameterName ) + if aPort != None : + myPort = Port( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None + def GetInStreamPort( self , aParameterName ): + aPort = self.N.GetInStreamPort( aParameterName ) + if aPort != None : + myPort = StreamPort( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None + def GetOutStreamPort( self , aParameterName ): + aPort = self.N.GetOutStreamPort( aParameterName ) + if aPort != None : + myPort = StreamPort( aPort , self.N.Verbose ) + return myPort + if self.N.Verbose : + print "Error while creating the Port : ",aParameterName + return None def Ports( self ): ports = self.N.Ports() i = 0 @@ -308,13 +371,34 @@ class CNode: ports[ i ] = Port( ports[i] , self.N.Verbose ) i = i + 1 return ports + def StreamPorts( self ): + ports = self.N.StreamPorts() + i = 0 + while i < len( ports ) : + ports[ i ] = StreamPort( ports[i] , self.N.Verbose ) + i = i + 1 + return ports + def AllPorts( self ): + allports = self.N.Ports() + lenports = len( allports ) + i = 0 + while i < lenports : + allports[ i ] = Port( allports[i] , self.N.Verbose ) + i = i + 1 + ports = self.N.StreamPorts() + i = 0 + while i < len( ports ) : + allports.append( StreamPort( ports[i] , self.N.Verbose ) ) + i = i + 1 + return allports def ListPorts( self , *args ): if len( args ) == 0 : aName = self.N.Name() else : aName = args[ 0 ] - ports = self.N.Ports() + ports = self.AllPorts() listofports = "" + ilst = 0 if len( ports ) : portsname = ports[ 0 ].Name() bs = portsname.find('\\') @@ -322,9 +406,9 @@ class CNode: portsname1,portsname2 = portsname.split('\\') portsname = portsname1 + portsname2 if ports[ 0 ].IsInput(): - listofports = aName + 'In' + portsname + listofports = 'I' + aName + portsname else : - listofports = aName + 'Out' + portsname + listofports = 'O' + aName + portsname i = 1 while i < len( ports ) : portsname = ports[ i ].Name() @@ -333,24 +417,32 @@ class CNode: portsname1,portsname2 = portsname.split('\\') portsname = portsname1 + portsname2 if ports[ i ].IsInput(): - listofports = listofports + ',' + aName + 'In' + portsname + listofports = listofports + ',' + 'I' + aName + portsname else : - listofports = listofports + ',' + aName + 'Out' + portsname + listofports = listofports + ',' + 'O' + aName + portsname i = i + 1 print listofports if len( ports ) == 1 : - listofports = "[" + listofports + "] = " + aName + ".Ports()" + listofports = "[" + listofports + "] = " + aName + ".AllPorts()" else : - listofports = listofports + " = " + aName + ".Ports()" + listofports = listofports + " = " + aName + ".AllPorts()" return listofports def PrintPorts( self ): - ports = self.N.Ports() + ports = self.AllPorts() i = 0 while i < len( ports ) : Direction = "Out" if ports[ i ].IsInput() : Direction = "In" - print Direction,self.N.Name(),'(',ports[ i ].Name(),ports[ i ].Kind(),ports[ i ].Type(),') = ',ports[ i ].ToString() + if ( ports[ i ].IsDataStream() ) & ( self.N.IsStreamGraph() == 0 ) : + if ports[ i ].IsInput() : + sts,aKindOfSchema,aKindOfInterpolation,aKindOfExtrapolation = ports[ i ].Params() + print Direction,self.N.Name(),'(',ports[ i ].Name(),ports[ i ].Kind(),ports[ i ].Type(),') = ',ports[ i ].ToString(),ports[ i ].Dependency(),aKindOfSchema,aKindOfInterpolation,aKindOfExtrapolation + else : + numberofvalues = ports[ i ].NumberOfValues() + print Direction,self.N.Name(),'(',ports[ i ].Name(),ports[ i ].Kind(),ports[ i ].Type(),') = ',ports[ i ].ToString(),ports[ i ].Dependency(),'NumberOfValues',numberofvalues + else : + print Direction,self.N.Name(),'(',ports[ i ].Name(),ports[ i ].Kind(),ports[ i ].Type(),') = ',ports[ i ].ToString() i = i + 1 def Links( self ) : links = self.N.Links() @@ -359,14 +451,66 @@ class CNode: links[ i ] = Link( links[i] , self.N.Verbose ) i = i + 1 return links + def StreamLinks( self ) : + links = self.N.StreamLinks() + i = 0 + while i < len( links ) : + links[ i ] = StreamLink( links[i] , self.N.Verbose ) + i = i + 1 + return links + def AllLinks( self ) : + alllinks = self.N.Links() + lenlinks = len( alllinks ) + i = 0 + while i < lenlinks : + alllinks[ i ] = Link( alllinks[i] , self.N.Verbose ) + i = i + 1 + links = self.N.StreamLinks() + i = 0 + while i < len( links ) : + alllinks.append( StreamLink( links[i] , self.N.Verbose ) ) + i = i + 1 + return alllinks + def ListLinks( self , *args ): + links = self.AllLinks() + if len( links ) : + listoflinks = 'L' + links[ 0 ].OutPort().Node().Name() + listoflinks = listoflinks + links[ 0 ].OutPort().Name() + listoflinks = listoflinks + links[ 0 ].InPort().Node().Name() + listoflinks = listoflinks + links[ 0 ].InPort().Name() + i = 1 + while i < len( links ) : + listoflinks = listoflinks + ',' + 'L' + links[ i ].OutPort().Node().Name() + listoflinks = listoflinks + links[ i ].OutPort().Name() + listoflinks = listoflinks + links[ i ].InPort().Node().Name() + listoflinks = listoflinks + links[ i ].InPort().Name() + i = i + 1 + print listoflinks + if len( args ) == 0 : + aName = self.N.Name() + else : + aName = args[ 0 ] + if len( links ) == 1 : + listoflinks = "[" + listoflinks + "] = " + aName + ".AllLinks()" + else : + listoflinks = listoflinks + " = " + aName + ".AllLinks()" + return listoflinks def PrintLinks( self ): - links = self.Links() + links = self.AllLinks() i = 0 while i < len( links ) : links[i].Print() i = i + 1 + def IsStreamGraph( self ): + return self.N.IsStreamGraph() def IsGraph( self ): return self.N.IsGraph() + def IsMacro( self ): + return self.N.IsMacro() + def IsFlowMacro( self ): + return self.N.IsFlowMacro() + def IsStreamMacro( self ): + return self.N.IsStreamMacro() def IsComputing( self ): return self.N.IsComputing() def IsFactory( self ): @@ -383,8 +527,12 @@ class CNode: return self.N.IsSwitch() def IsEndSwitch( self ): return self.N.IsEndSwitch() + def GraphLevel( self ) : + return self.N.GraphLevel() def SubGraph( self ): return self.N.SubGraph() + def SubStreamGraph( self ): + return self.N.SubStreamGraph() def Thread( self ): return self.N.Thread() def IsWaiting( self ): @@ -401,8 +549,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 ): @@ -509,10 +655,6 @@ class INode(CNode): return self.N.PyFunction() def PyFuncName( self ): return self.N.PyFuncName() - def EPyFunc( self ): - PyFunc = self.N.PyFunction() - PyFunc = self.Edit( self.N.PyFuncName() , PyFunc ) - self.N.SetPyFunction( self.N.PyFuncName() , PyFunc ) def InPort( self , aParameterName , aParameterType ): aPort = self.N.InPort( aParameterName , aParameterType ) @@ -531,6 +673,10 @@ class INode(CNode): if self.N.Verbose : print "Error while creating the Port : ",aParameterName return None + def EPyFunc( self ): + PyFunc = self.N.PyFunction() + PyFunc = self.Edit( self.N.PyFuncName() , PyFunc ) + self.N.SetPyFunction( self.N.PyFuncName() , PyFunc ) ########################################################## class GNode(INode): @@ -625,7 +771,7 @@ class ESNode(GNode): # self.Parametername = aServicesParameter.Parametername ########################################################## -class Graph(INode): +class Graph(GNode): ########################################################## def __init__( self , aName ): try: @@ -634,8 +780,14 @@ class Graph(INode): try: graph = aName.G.Copy() except: - graph = None + graph = aName if graph != None : + if graph.IsStreamGraph() : + aGraph = graph.ToStreamGraph() + if aGraph != None : + graph = StreamGraph( aGraph ) + else : + print "Graph creation failed" self.G = graph self.G.Verbose = 1 self.N = graph @@ -660,14 +812,14 @@ class Graph(INode): print ErrMsg return aNode def Node( self , aComponent , anInterface , aService ): - if SuperVision.Swig : - aService = Service_Swig( aService ) + #if SuperVision.Swig : + #aService = Service_Swig( aService ) return self.FNode( aComponent , anInterface , aService ) def FNode( self , aComponent , anInterface , aService ): NodeComponent = modulecatalog.GetComponent( aComponent ) aService = NodeComponent.GetService( anInterface , aService ) - if SuperVision.Swig : - aService = Service_Swig( aService ) + #if SuperVision.Swig : + #aService = Service_Swig( aService ) aNode = self.G.FNode( aComponent , anInterface , aService ) if aNode != None : myNode = FNode( aNode , self.G.Verbose ) @@ -786,6 +938,36 @@ class Graph(INode): # if self.G.Verbose : # print ErrMsg # return aNode + def MNode( self , aGraphXml ): + aMNode = self.G.MNode( aGraphXml ) + if aMNode != None : + myMNode = MNode( aMNode , self.G.Verbose ) + return myMNode + ErrMsg = "Failed to create a MNode" + if self.G.Verbose : + print ErrMsg + return aMNode + def GraphMNode( self , aGraph ): + aGraphMNode = self.G.GraphMNode( aGraph.G ) + if aGraphMNode != None : + myMNode = MNode( aGraphMNode , self.G.Verbose ) + return myMNode + ErrMsg = "Failed to create a MNode" + if self.G.Verbose : + print ErrMsg + return aGraphMNode + def FlowObjRef( self ) : + aGraph = self.G.FlowObjRef() + if aGraph != None : + myGraph = Graph( aGraph ) + return myGraph + return aGraph + def StreamObjRef( self ) : + aGraph = self.G.StreamObjRef() + if aGraph != None : + myGraph = StreamGraph( aGraph ) + return myGraph + return aGraph def PrintService( self , aComponent , anInterface , aService ): NodeComponent = modulecatalog.GetComponent( aComponent ) aService = NodeComponent.GetService( anInterface , aService ) @@ -831,8 +1013,8 @@ class Graph(INode): return self.G.LevelMax() def ThreadsMax( self ): return self.G.ThreadsMax() - def GraphsNumber( self ): - return self.G.GraphsNumber() + def SubGraphsNumber( self ): + return self.G.SubGraphsNumber() def LevelNodes( self , aLevel ): nodes = self.G.LevelNodes( aLevel ) return self.nodesTuple( nodes ) @@ -940,6 +1122,12 @@ class Graph(INode): pynodes.append( GNode( nodes.ESNodes[i] , self.G.Verbose ) ) i = i + 1 j = j + 1 + n = len( nodes.Graphs ) + i = 0 + while i < n : + pynodes.append( MNode( nodes.Graphs[i] , self.G.Verbose ) ) + i = i + 1 + j = j + 1 return pynodes def ListNodes( self , *args ): nodes = self.Nodes() @@ -966,29 +1154,56 @@ class Graph(INode): i = 0 while i < n : print ' ' - nodes[i].Print() + nodes[ i ].Print() i = i + 1 def PrintThreads( self ): 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(),nodes[i] i = i + 1 def GLinks( self ): links = self.G.GLinks() i = 0 - while i < len( links ) : + linkslen = len( links ) + #print 'GLinks ',linkslen,'Links' + while i < linkslen : links[ i ] = Link( links[i] , self.G.Verbose ) i = i + 1 - return links + def GStreamLinks( self ): + streamlinks = self.G.GStreamLinks() + i = 0 + #print 'GStreamLinks ',len( streamlinks ),'StreamLinks' + while i < len( streamlinks ) : + streamlinks[ i ] = StreamLink( streamlinks[i] , self.G.Verbose ) + i = i + 1 + return streamlinks + def GAllLinks( self ) : + alllinks = self.G.GLinks() + lenlinks = len( alllinks ) + i = 0 + while i < lenlinks : + alllinks[ i ] = Link( alllinks[i] , self.N.Verbose ) + i = i + 1 + links = self.G.StreamLinks() + j = 0 + while j < len(links) : + alllinks.append( StreamLink( links[j] , self.N.Verbose ) ) + i = i + 1 + j = j + 1 + return alllinks def ListLinks( self , *args ): - links = self.G.GLinks() + links = self.GAllLinks() if len( links ) : - listoflinks = links[ 0 ].InPort().Node().Name() + listoflinks = 'L' + links[ 0 ].OutPort().Node().Name() + listoflinks = listoflinks + links[ 0 ].OutPort().Name() + listoflinks = listoflinks + links[ 0 ].InPort().Node().Name() listoflinks = listoflinks + links[ 0 ].InPort().Name() i = 1 while i < len( links ) : - listoflinks = listoflinks + ',' + links[ i ].InPort().Node().Name() + listoflinks = listoflinks + ',' + 'L' + links[ i ].OutPort().Node().Name() + listoflinks = listoflinks + links[ i ].OutPort().Name() + listoflinks = listoflinks + links[ i ].InPort().Node().Name() listoflinks = listoflinks + links[ i ].InPort().Name() i = i + 1 print listoflinks @@ -997,18 +1212,18 @@ class Graph(INode): else : aName = args[ 0 ] if len( links ) == 1 : - listoflinks = "[" + listoflinks + "] = " + aName + ".GLinks()" + listoflinks = "[" + listoflinks + "] = " + aName + ".GAllLinks()" else : - listoflinks = listoflinks + " = " + aName + ".GLinks()" + listoflinks = listoflinks + " = " + aName + ".GAllLinks()" return listoflinks def PrintLinks( self ): - links = self.G.GLinks() + links = self.GAllLinks() i = 0 while i < len( links ) : - Link( links[ i ] , self.G.Verbose ).Print() + links[ i ].Print() i = i + 1 - def Graphs( self ): - graphs = self.G.Graphs() + def SubGraphsNodes( self , ): + graphs = self.G.SubGraphsNodes() outgraphs = graphs i = 0 while i < len( graphs ) : @@ -1025,6 +1240,14 @@ class Graph(INode): if self.G.Verbose : print ErrMsg return aCopy + def ToStreamGraph( self ): + aGraph = self.G.ToStreamGraph() + if aGraph != None : + return StreamGraph( aGraph ) + return None + def SubGraphsNodes( self , aSubGraphsNumber ): + nodes = self.G.SubGraphsNodes( aSubGraphsNumber ) + return self.nodesTuple( nodes ) def Merge( self , aGraph ): return self.G.Merge( aGraph.G ) def Destroy( self ): @@ -1039,6 +1262,81 @@ class GraphE(Graph): self.G.Verbose = 1 self.N = graph self.N.Verbose = 1 + def ToStreamGraph( self ): + aGraph = self.G.ToStreamGraph() + if aGraph != None : + return StreamGraphE( aGraph ) + return None + +########################################################## +class MNode(Graph): +########################################################## + def __init__( self , aMNode , Verbose ): + self.G = aMNode + self.G.Verbose = Verbose + self.N = aMNode + self.N.Verbose = Verbose + +########################################################## +class StreamGraph(Graph): +########################################################## + def __init__( self , aName ): + try: + graph = SuperVision.StreamGraph( aName ) + except: + try: + graph = aName.G.StreamCopy() + except: + graph = aName + if graph != None : + self.G = graph + self.G.Verbose = 1 + self.N = graph + self.N.Verbose = 1 + else : + print "StreamGraph creation failed" + def StreamCopy( self ): + aCopy = self.G.StreamCopy() + if aCopy != None: + myCopy = StreamGraph( aCopy ) + return myCopy + ErrMsg = "Failed to get a Copy of " + self.G.Name() + if self.G.Verbose : + print ErrMsg + return aCopy + def StreamLink( self , anOutStreamPort , anInStreamPort ) : + aStreamLink = self.G.StreamLink( anOutStreamPort.P , anInStreamPort.P ) + if aStreamLink!= None: + myStreamLink = StreamLink( aStreamLink , self.G.Verbose ) + return myStreamLink + ErrMsg = "Failed to make a StreamLink in " + self.G.Name() + if self.G.Verbose : + print ErrMsg + return aStreamLink + def SetStreamParams( self , Timeout , DataStreamTrace , DeltaTime ): + return self.G.SetStreamParams( Timeout , DataStreamTrace , DeltaTime ) + def StreamParams( self ): + Timeout,DataStreamTrace,DeltaTime = self.G.StreamParams() + return Timeout,DataStreamTrace,DeltaTime + def ToFlowGraph( self ): + return self.G.ToFlowGraph() + def SubStreamGraphsNumber( self ): + return self.G.SubStreamGraphsNumber() + def SubStreamGraphsNodes( self , aSubStreamGraphsNumber ): + nodes = self.G.SubStreamGraphsNodes( aSubStreamGraphsNumber ) + return self.nodesTuple( nodes ) + def StreamMerge( self , aStreamGraph ): + return self.G.StreamMerge( aStreamGraph.G ) + +########################################################## +class StreamGraphE(StreamGraph): +########################################################## + def __init__( self , aName ): + graph = SuperVision.StreamGraphE( aName ) + self.G = graph + self.G.Verbose = 1 + self.N = graph + self.N.Verbose = 1 ########################################################## class Value: @@ -1133,6 +1431,8 @@ class Port: return self.P.IsSwitch() def IsEndSwitch( self ): return self.P.IsEndSwitch() + def IsDataStream( self ): + return self.P.IsDataStream() # def IsBus( self ): # return self.P.IsBus() def Done( self ): @@ -1154,6 +1454,28 @@ class Port: def Destroy( self ): self.P.destroy() +########################################################## +class StreamPort(Port): +########################################################## + def __init__( self , aPort , Verbose ): + self.P = aPort + self.P.Verbose = Verbose + def StreamLink( self ) : + return self.P.StreamLink() + def Dependency( self ) : + return self.P.Dependency() + def SetDependency( self , aDependency ) : + return self.P.SetDependency( aDependency ) + def Params( self ) : + sts,aKindOfSchema,aKindOfInterpolation,aKindOfExtrapolation = self.P.Params() + return sts,aKindOfSchema,aKindOfInterpolation,aKindOfExtrapolation + def SetParams( self , aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) : + return self.P.SetParams( aKindOfSchema , aKindOfInterpolation , aKindOfExtrapolation ) + def NumberOfValues( self ) : + return self.P.NumberOfValues() + def SetNumberOfValues( self , aNumberOfValues ) : + return self.P.SetNumberOfValues( aNumberOfValues ) + ########################################################## class Link: ########################################################## @@ -1178,8 +1500,17 @@ class Link: return None def Print( self ): anOutPort = self.L.OutPort() + anOutPortName = anOutPort.Name() + anOutPortKind = anOutPort.Kind() + anOutPortValue = anOutPort.ToString() + anOutNode = anOutPort.Node() + anOutNodeName = anOutNode.Name() anInPort = self.L.InPort() - print anOutPort.Node().Name(),'(',anOutPort.Name(),' ',anOutPort.Kind(),') =',anOutPort.ToString(),' --> ',anInPort.Node().Name(),'(',anInPort.Name(),')',' ',anInPort.Kind() + anInPortName = anInPort.Name() + anInPortKind = anInPort.Kind() + anInNode = anInPort.Node() + anInNodeName = anInNode.Name() + print anOutNodeName,'(',anOutPortName,' ',anOutPortKind,') =',anOutPortValue,' --> ',anInNodeName,'(',anInPortName,')',' ',anInPortKind def CoordsSize( self ): return self.L.CoordsSize() def AddCoord( self , index , X , Y ): @@ -1194,3 +1525,26 @@ class Link: self.L.destroy() + +########################################################## +class StreamLink(Link): +########################################################## + def __init__( self , aLink , Verbose ): + self.L = aLink + self.L.Verbose = Verbose + def OutStreamPort( self ): + aPort = self.L.OutStreamPort() + if aPort != None : + myPort = StreamPort( aPort , self.L.Verbose ) + return myPort + if self.L.Verbose : + print "Error while getting the Port : " + return None + def InStreamPort( self ): + aPort = self.L.InStreamPort() + if aPort != None : + myPort = StreamPort( aPort , self.L.Verbose ) + return myPort + if self.L.Verbose : + print "Error while getting the Port : " + return None