From: admin Date: Wed, 24 Nov 2004 12:04:58 +0000 (+0000) Subject: Merge with PAL/SALOME 2.1.0d X-Git-Tag: OCC-V2_1_0d X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0338ca937b96bba0c28315910d66790edb7cc99b;p=modules%2Fsuperv.git Merge with PAL/SALOME 2.1.0d --- diff --git a/examples/GeomGraph.py b/examples/GeomGraph.py index 9f68efe..0553d96 100644 --- a/examples/GeomGraph.py +++ b/examples/GeomGraph.py @@ -1,196 +1,156 @@ -# Generated python file of Graph aNewDataFlow_1_4_2_1_1_2_2_1 +# Generated python file of Graph aNewDataFlow_1 from SuperV import * -# Graph creation of aNewDataFlow_1_4_2_1_1_2_2_1 -def DefaNewDataFlow_1_4_2_1_1_2_2_1() : - aNewDataFlow_1_4_2_1_1_2_2_1 = Graph( 'aNewDataFlow_1_4_2_1_1_2_2_1' ) - aNewDataFlow_1_4_2_1_1_2_2_1.SetName( 'aNewDataFlow_1_4_2_1_1_2_2_1' ) - aNewDataFlow_1_4_2_1_1_2_2_1.SetAuthor( '' ) - aNewDataFlow_1_4_2_1_1_2_2_1.SetComment( '' ) - aNewDataFlow_1_4_2_1_1_2_2_1.Coords( 0 , 0 ) +# 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 - # Creation of InLine Nodes - Pygag = [] - Pygag.append( 'from batchmode_geompy import * ' ) - Pygag.append( 'def gag(): ' ) - Pygag.append( ' # This is a gag ' ) - Pygag.append( ' return 1 ' ) - gag = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'gag' , Pygag ) - gag.SetName( 'gag' ) - gag.SetAuthor( '' ) - gag.SetComment( 'Compute Node' ) - gag.Coords( 0 , 123 ) - IgagGate = gag.GetInPort( 'Gate' ) - OgagGate = gag.GetOutPort( 'Gate' ) - - PyMakeBox1 = [] - PyMakeBox1.append( 'def MakeBox1(x1,y1,z1,x2,y2,z2): ' ) - PyMakeBox1.append( ' aBox = MakeBox(x1,y1,z1,x2,y2,z2) ' ) - PyMakeBox1.append( ' return aBox ' ) - MakeBox1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeBox1' , PyMakeBox1 ) - MakeBox1.SetName( 'MakeBox1' ) - MakeBox1.SetAuthor( '' ) - MakeBox1.SetComment( 'Compute Node' ) - MakeBox1.Coords( 194 , 3 ) - IMakeBox1x1 = MakeBox1.InPort( 'x1' , 'double' ) - IMakeBox1y1 = MakeBox1.InPort( 'y1' , 'double' ) - IMakeBox1z1 = MakeBox1.InPort( 'z1' , 'double' ) - IMakeBox1x2 = MakeBox1.InPort( 'x2' , 'double' ) - IMakeBox1y2 = MakeBox1.InPort( 'y2' , 'double' ) - IMakeBox1z2 = MakeBox1.InPort( 'z2' , 'double' ) - IMakeBox1Gate = MakeBox1.GetInPort( 'Gate' ) - OMakeBox1shape = MakeBox1.OutPort( 'shape' , 'objref' ) - OMakeBox1Gate = MakeBox1.GetOutPort( 'Gate' ) - - PyMakeCopy_1 = [] - PyMakeCopy_1.append( 'def MakeCopy_1(shape1): ' ) - PyMakeCopy_1.append( ' shape=MakeCopy(shape1) ' ) - PyMakeCopy_1.append( ' return shape ' ) - MakeCopy_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeCopy_1' , PyMakeCopy_1 ) + 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.SetComment( 'Compute Node' ) - MakeCopy_1.Coords( 389 , 3 ) - IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' ) + 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_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' ) + OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' ) OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) - PyMakeCopy_2 = [] - PyMakeCopy_2.append( 'def MakeCopy_2(shape1): ' ) - PyMakeCopy_2.append( ' shape=MakeCopy(shape1) ' ) - PyMakeCopy_2.append( ' return shape ' ) - MakeCopy_2 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeCopy_2' , PyMakeCopy_2 ) - MakeCopy_2.SetName( 'MakeCopy_2' ) - MakeCopy_2.SetAuthor( '' ) - MakeCopy_2.SetComment( 'Compute Node' ) - MakeCopy_2.Coords( 389 , 136 ) - IMakeCopy_2shape1 = MakeCopy_2.InPort( 'shape1' , 'objref' ) - IMakeCopy_2Gate = MakeCopy_2.GetInPort( 'Gate' ) - OMakeCopy_2shape = MakeCopy_2.OutPort( 'shape' , 'objref' ) - OMakeCopy_2Gate = MakeCopy_2.GetOutPort( 'Gate' ) - - PyMakeSphere_1 = [] - PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' ) - PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' ) - PyMakeSphere_1.append( ' shape=MakeSphere(apoint,radius) ' ) - PyMakeSphere_1.append( ' return shape ' ) - MakeSphere_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 ) + MakeSphere_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) 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' ) + 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_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' ) + OMakeSphere_1return = MakeSphere_1.GetOutPort( 'return' ) OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) - PyMakeTranslation_1 = [] - PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1): ' ) - PyMakeTranslation_1.append( ' shape = MakeTranslation(shape1,x1,y1,z1) ' ) - PyMakeTranslation_1.append( ' return shape ' ) - MakeTranslation_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 ) - MakeTranslation_1.SetName( 'MakeTranslation_1' ) - MakeTranslation_1.SetAuthor( '' ) - MakeTranslation_1.SetComment( 'Compute Node' ) - MakeTranslation_1.Coords( 596 , 3 ) - IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' ) - IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' ) - IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' ) - IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' ) - IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' ) - OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' ) - OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' ) - - PyMakeFuse_1 = [] - PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2): ' ) - PyMakeFuse_1.append( ' # fuse operation 3 ' ) - PyMakeFuse_1.append( ' shape = MakeBoolean(shape1,shape2,3) ' ) - PyMakeFuse_1.append( ' return shape ' ) - MakeFuse_1 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeFuse_1' , PyMakeFuse_1 ) + MakeFuse = 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.SetComment( 'Compute Node' ) - MakeFuse_1.Coords( 823 , 116 ) - IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' ) - IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' ) + 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_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' ) + OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) - PyMakeFuse_2 = [] - PyMakeFuse_2.append( 'def MakeFuse_2(shape1,shape2): ' ) - PyMakeFuse_2.append( ' # fuse operation 3 ' ) - PyMakeFuse_2.append( ' shape = MakeBoolean(shape1,shape2,3) ' ) - PyMakeFuse_2.append( ' from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' ) - PyMakeFuse_2.append( ' myNamingService = SALOME_NamingServicePy_i(orb) ' ) - PyMakeFuse_2.append( ' aSession = myNamingService.Resolve('/Kernel/Session') ' ) - PyMakeFuse_2.append( ' aStudyId = aSession.GetActiveStudyId() ' ) - PyMakeFuse_2.append( ' myStudyManager = myNamingService.Resolve('/myStudyManager') ' ) - PyMakeFuse_2.append( ' aStudy = myStudyManager.GetStudyByID(aStudyId) ' ) - PyMakeFuse_2.append( ' aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' ) - PyMakeFuse_2.append( ' return shape ' ) - MakeFuse_2 = aNewDataFlow_1_4_2_1_1_2_2_1.INode( 'MakeFuse_2' , PyMakeFuse_2 ) - MakeFuse_2.SetName( 'MakeFuse_2' ) - MakeFuse_2.SetAuthor( '' ) - MakeFuse_2.SetComment( 'Compute Node' ) - MakeFuse_2.Coords( 1049 , 295 ) - IMakeFuse_2shape1 = MakeFuse_2.InPort( 'shape1' , 'objref' ) - IMakeFuse_2shape2 = MakeFuse_2.InPort( 'shape2' , 'objref' ) - IMakeFuse_2Gate = MakeFuse_2.GetInPort( 'Gate' ) - OMakeFuse_2shape = MakeFuse_2.OutPort( 'shape' , 'objref' ) - OMakeFuse_2Gate = MakeFuse_2.GetOutPort( 'Gate' ) - # Creation of Links - LgagGateMakeBox1Gate = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OgagGate , IMakeBox1Gate ) + LSetStudyIDGateMakeBoxGate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeBoxGate ) - LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OgagGate , IMakeSphere_1Gate ) - LgagGateMakeSphere_1Gate.AddCoord( 1 , 164 , 470 ) - LgagGateMakeSphere_1Gate.AddCoord( 2 , 164 , 265 ) + LSetStudyIDGateMakeSphere_1Gate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeSphere_1Gate ) - LMakeBox1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeBox1shape , IMakeCopy_1shape1 ) + LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopytheOriginal ) - LMakeBox1shapeMakeCopy_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeBox1shape , IMakeCopy_2shape1 ) - LMakeBox1shapeMakeCopy_2shape1.AddCoord( 1 , 384 , 207 ) + LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopy_1theOriginal ) - LMakeCopy_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 ) + LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow_1.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) - LMakeCopy_2shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 ) - LMakeCopy_2shapeMakeFuse_1shape2.AddCoord( 1 , 674 , 207 ) + LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow_1.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) - LMakeSphere_1shapeMakeFuse_2shape2 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeSphere_1shape , IMakeFuse_2shape2 ) + LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow_1.Link( OMakeCopy_1return , IMakeFusetheShape2 ) - LMakeTranslation_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 ) + LMakeSphere_1returnMakeFuse_1theShape2 = aNewDataFlow_1.Link( OMakeSphere_1return , IMakeFuse_1theShape2 ) - LMakeFuse_1shapeMakeFuse_2shape1 = aNewDataFlow_1_4_2_1_1_2_2_1.Link( OMakeFuse_1shape , IMakeFuse_2shape1 ) - LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 1 , 1017 , 366 ) - LMakeFuse_1shapeMakeFuse_2shape1.AddCoord( 2 , 1017 , 187 ) + LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow_1.Link( OMakeFusereturn , IMakeFuse_1theShape1 ) # 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 ) + 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_2shape = MakeFuse_2.GetOutPort( 'shape' ) - return aNewDataFlow_1_4_2_1_1_2_2_1 + #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) + return aNewDataFlow_1 -aNewDataFlow_1_4_2_1_1_2_2_1 = DefaNewDataFlow_1_4_2_1_1_2_2_1() +aNewDataFlow_1 = DefaNewDataFlow_1() diff --git a/examples/GeomGraph.xml b/examples/GeomGraph.xml index eb77edc..663002d 100644 --- a/examples/GeomGraph.xml +++ b/examples/GeomGraph.xml @@ -5,59 +5,62 @@ ? ? - aNewDataFlow_1_4_2_1_1_2_2_1 + aNewDataFlow_1 1 ? -aNewDataFlow_1_4_2_1_1_2_2_1 +aNewDataFlow_1 +long + SetStudyID__theStudyID + double - MakeBox1__x1 + MakeBox__theX1 double - MakeBox1__y1 + MakeBox__theY1 double - MakeBox1__z1 + MakeBox__theZ1 double - MakeBox1__x2 + MakeBox__theX2 double - MakeBox1__y2 + MakeBox__theY2 double - MakeBox1__z2 + MakeBox__theZ2 double - MakeSphere_1__x1 + TranslateDXDYDZ__theDX double - MakeSphere_1__y1 + TranslateDXDYDZ__theDY double - MakeSphere_1__z1 + TranslateDXDYDZ__theDZ double - MakeSphere_1__radius + MakeSphere_1__theX double - MakeTranslation_1__x1 + MakeSphere_1__theY double - MakeTranslation_1__y1 + MakeSphere_1__theZ double - MakeTranslation_1__z1 + MakeSphere_1__theRadius -objref - MakeFuse_2__shape +GEOM_Object + MakeFuse_1__return - 25/8/2004 - 16:28:50 - 30/8/2004 - 9:41:28 + 29/10/2004 - 10:52:34 + 11/11/2004 - 11:41:31 2.0 ? ? @@ -66,485 +69,428 @@ 0 -? - ? - gag - 3 +GEOM_Superv + GEOM_Superv + SetStudyID + 0 ? -gag - +SetStudyID + + +long + theStudyID - - -gag - - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:16:35 + 11/11/2004 - 11:16:35 2.0 ? - ? - Compute Node - 0 - 123 + localhost/FactoryServer + SetStudyID from GEOM_Superv + 14 + 241 -? - ? - MakeBox1 - 3 +GEOM_Superv + GEOM_Superv + MakeBox + 0 ? -MakeBox1 +MakeBox double - x1 + theX1 double - y1 + theY1 double - z1 + theZ1 double - x2 + theX2 double - y2 + theY2 double - z2 + theZ2 -objref - shape +GEOM_Object + return - - -MakeBox1 - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:17:44 + 11/11/2004 - 11:17:44 2.0 ? - ? - Compute Node - 194 - 3 + localhost/FactoryServer + MakeBox from GEOM_Superv + 198 + 46 -? - ? - MakeCopy_1 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy + 0 ? -MakeCopy_1 +MakeCopy -objref - shape1 +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeCopy_1 - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:36:29 + 11/11/2004 - 11:36:29 2.0 ? - ? - Compute Node - 389 - 3 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 383 + 46 -? - ? - MakeCopy_2 - 3 +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 ? -MakeCopy_2 +TranslateDXDYDZ -objref - shape1 +GEOM_Object + theObject + +double + theDX + +double + theDY + +double + theDZ -objref - shape +GEOM_Object + return - - -MakeCopy_2 - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:37:10 + 11/11/2004 - 11:37:10 2.0 ? - ? - Compute Node - 389 - 136 + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 579 + 46 -? - ? - MakeSphere_1 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy_1 + 0 ? -MakeSphere_1 +MakeCopy -double - x1 - -double - y1 - -double - z1 - -double - radius +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeSphere_1 - - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:38:45 + 11/11/2004 - 11:38:45 2.0 ? - ? - Compute Node - 203 - 315 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 384 + 168 -? - ? - MakeTranslation_1 - 3 +GEOM_Superv + GEOM_Superv + MakeSphere_1 + 0 ? -MakeTranslation_1 +MakeSphere -objref - shape1 +double + theX double - x1 + theY double - y1 + theZ double - z1 + theRadius -objref - shape +GEOM_Object + return - - -MakeTranslation_1 - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:38:54 + 11/11/2004 - 11:38:54 2.0 ? - ? - Compute Node - 596 - 3 + localhost/FactoryServer + MakeSphere from GEOM_Superv + 201 + 332 -? - ? - MakeFuse_1 - 3 +GEOM_Superv + GEOM_Superv + MakeFuse + 0 ? -MakeFuse_1 +MakeFuse -objref - shape1 +GEOM_Object + theShape1 -objref - shape2 +GEOM_Object + theShape2 -objref - shape +GEOM_Object + return - - -MakeFuse_1 - - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:39:55 + 11/11/2004 - 11:39:55 2.0 ? - ? - Compute Node - 823 - 116 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 790 + 148 -? - ? - MakeFuse_2 - 3 +GEOM_Superv + GEOM_Superv + MakeFuse_1 + 0 ? -MakeFuse_2 +MakeFuse -objref - shape1 +GEOM_Object + theShape1 -objref - shape2 +GEOM_Object + theShape2 -objref - shape +GEOM_Object + return - - -MakeFuse_2 - - - - - - - - - - - - 30/8/2004 - 9:41:28 - 30/8/2004 - 9:41:28 + + 11/11/2004 - 11:40:15 + 11/11/2004 - 11:40:15 2.0 ? - ? - Compute Node - 1049 - 295 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 993 + 312 -gag +SetStudyID Gate - MakeBox1 + MakeBox Gate -gag +SetStudyID Gate MakeSphere_1 Gate - - -164 - 470 - -164 - 265 + -MakeBox1 - shape - MakeCopy_1 - shape1 +MakeBox + return + MakeCopy + theOriginal -MakeBox1 - shape - MakeCopy_2 - shape1 - - -384 - 207 +MakeBox + return + MakeCopy_1 + theOriginal + -MakeCopy_1 - shape - MakeTranslation_1 - shape1 +MakeCopy + return + TranslateDXDYDZ + theObject -MakeCopy_2 - shape - MakeFuse_1 - shape2 - - -674 - 207 +TranslateDXDYDZ + return + MakeFuse + theShape1 + -MakeSphere_1 - shape - MakeFuse_2 - shape2 +MakeCopy_1 + return + MakeFuse + theShape2 -MakeTranslation_1 - shape +MakeSphere_1 + return MakeFuse_1 - shape1 + theShape2 -MakeFuse_1 - shape - MakeFuse_2 - shape1 - - -1017 - 366 - -1017 - 187 +MakeFuse + return + MakeFuse_1 + theShape1 + -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__x1 - MakeBox1 - x1 +aNewDataFlow_1 + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow_1 + MakeBox__theX1 + MakeBox + theX1 7 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__y1 - MakeBox1 - y1 +aNewDataFlow_1 + MakeBox__theY1 + MakeBox + theY1 7 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__z1 - MakeBox1 - z1 +aNewDataFlow_1 + MakeBox__theZ1 + MakeBox + theZ1 7 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__x2 - MakeBox1 - x2 +aNewDataFlow_1 + MakeBox__theX2 + MakeBox + theX2 7 50 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__y2 - MakeBox1 - y2 +aNewDataFlow_1 + MakeBox__theY2 + MakeBox + theY2 7 50 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeBox1__z2 - MakeBox1 - z2 +aNewDataFlow_1 + MakeBox__theZ2 + MakeBox + theZ2 7 50 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeSphere_1__x1 - MakeSphere_1 - x1 +aNewDataFlow_1 + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX 7 - 0 + 10 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeSphere_1__y1 - MakeSphere_1 - y1 +aNewDataFlow_1 + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY 7 - 0 + 10 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeSphere_1__z1 - MakeSphere_1 - z1 +aNewDataFlow_1 + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ 7 - 0 + 10 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeSphere_1__radius +aNewDataFlow_1 + MakeSphere_1__theX MakeSphere_1 - radius + theX 7 - 12 + 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeTranslation_1__x1 - MakeTranslation_1 - x1 +aNewDataFlow_1 + MakeSphere_1__theY + MakeSphere_1 + theY 7 - 25 + 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeTranslation_1__y1 - MakeTranslation_1 - y1 +aNewDataFlow_1 + MakeSphere_1__theZ + MakeSphere_1 + theZ 7 - 25 + 0 -aNewDataFlow_1_4_2_1_1_2_2_1 - MakeTranslation_1__z1 - MakeTranslation_1 - z1 +aNewDataFlow_1 + MakeSphere_1__theRadius + MakeSphere_1 + theRadius 7 - 25 + 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 ff75b20..029943e 100644 --- a/examples/GraphGeomEssai.xml +++ b/examples/GraphGeomEssai.xml @@ -5,42 +5,45 @@ ? ? - GraphGeomEssai_1_1_1 + aNewDataFlow 1 ? -GraphGeomEssai_1_1_1 +aNewDataFlow +long + SetStudyID__theStudyID + double - MakeSphere_1__x1 + MakeSphere__theX double - MakeSphere_1__y1 + MakeSphere__theY double - MakeSphere_1__z1 + MakeSphere__theZ double - MakeSphere_1__radius + MakeSphere__theRadius double - MakeTranslation_1__x1 + TranslateDXDYDZ__theDX double - MakeTranslation_1__y1 + TranslateDXDYDZ__theDY double - MakeTranslation_1__z1 + TranslateDXDYDZ__theDZ -objref - MakeFuse_1__shape +GEOM_Object + MakeFuse__return - 10/7/2002 - 14:53:2 - 30/8/2004 - 10:8:1 - 1.03 + 29/10/2004 - 11:8:11 + 11/11/2004 - 12:53:24 + 2.0 ? ? ? @@ -48,313 +51,285 @@ 0 -? - ? - gag - 3 +GEOM_Superv + GEOM_Superv + SetStudyID + 0 ? -gag - +SetStudyID + + +long + theStudyID - - -gag - - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:50:30 + 11/11/2004 - 12:50:30 2.0 ? - ? - Compute Node - 0 - 166 + localhost/FactoryServer + SetStudyID from GEOM_Superv + 13 + 109 -? - ? - MakeSphere_1 - 3 +GEOM_Superv + GEOM_Superv + MakeSphere + 0 ? -MakeSphere_1 +MakeSphere double - x1 + theX double - y1 + theY double - z1 + theZ double - radius + theRadius -objref - shape +GEOM_Object + return - - -MakeSphere_1 - - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:51:22 + 11/11/2004 - 12:51:22 2.0 ? - ? - Compute Node - 181 - 86 + localhost/FactoryServer + MakeSphere from GEOM_Superv + 210 + 49 -? - ? - MakeCopy_1 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy + 0 ? -MakeCopy_1 +MakeCopy -objref - shape1 +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeCopy_1 - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:52:16 + 11/11/2004 - 12:52:16 2.0 ? - ? - Compute Node - 386 - 2 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 412 + 12 -? - ? - MakeCopy_2 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy_1 + 0 ? -MakeCopy_2 +MakeCopy -objref - shape1 +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeCopy_2 - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:52:31 + 11/11/2004 - 12:52:31 2.0 ? - ? - Compute Node - 388 - 181 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 414 + 183 -? - ? - MakeTranslation_1 - 3 +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 ? -MakeTranslation_1 +TranslateDXDYDZ -double - x1 +GEOM_Object + theObject double - y1 + theDX double - z1 + theDY -objref - shape1 +double + theDZ -objref - shape +GEOM_Object + return - - -MakeTranslation_1 - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:52:54 + 11/11/2004 - 12:52:54 2.0 ? - ? - Compute Node - 581 - 1 + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 606 + 12 -? - ? - MakeFuse_1 - 3 +GEOM_Superv + GEOM_Superv + MakeFuse + 0 ? -MakeFuse_1 +MakeFuse -objref - shape1 +GEOM_Object + theShape1 -objref - shape2 +GEOM_Object + theShape2 -objref - shape +GEOM_Object + return - - -MakeFuse_1 - - - - - - - - - - - - 30/8/2004 - 10:8:1 - 30/8/2004 - 10:8:1 + + 11/11/2004 - 12:53:16 + 11/11/2004 - 12:53:16 2.0 ? - ? - Compute Node - 779 - 161 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 801 + 163 -gag +SetStudyID Gate - MakeSphere_1 + MakeSphere Gate -MakeSphere_1 - shape - MakeCopy_1 - shape1 +MakeSphere + return + MakeCopy + theOriginal -MakeSphere_1 - shape - MakeCopy_2 - shape1 +MakeSphere + return + MakeCopy_1 + theOriginal -MakeCopy_1 - shape - MakeTranslation_1 - shape1 +MakeCopy + return + TranslateDXDYDZ + theObject -MakeCopy_2 - shape - MakeFuse_1 - shape2 +MakeCopy_1 + return + MakeFuse + theShape2 -MakeTranslation_1 - shape - MakeFuse_1 - shape1 +TranslateDXDYDZ + return + MakeFuse + theShape1 -GraphGeomEssai_1_1_1 - MakeSphere_1__x1 - MakeSphere_1 - x1 +aNewDataFlow + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow + MakeSphere__theX + MakeSphere + theX 7 0 -GraphGeomEssai_1_1_1 - MakeSphere_1__y1 - MakeSphere_1 - y1 +aNewDataFlow + MakeSphere__theY + MakeSphere + theY 7 0 -GraphGeomEssai_1_1_1 - MakeSphere_1__z1 - MakeSphere_1 - z1 +aNewDataFlow + MakeSphere__theZ + MakeSphere + theZ 7 0 -GraphGeomEssai_1_1_1 - MakeSphere_1__radius - MakeSphere_1 - radius +aNewDataFlow + MakeSphere__theRadius + MakeSphere + theRadius 7 20 -GraphGeomEssai_1_1_1 - MakeTranslation_1__x1 - MakeTranslation_1 - x1 +aNewDataFlow + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX 7 10 -GraphGeomEssai_1_1_1 - MakeTranslation_1__y1 - MakeTranslation_1 - y1 +aNewDataFlow + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY 7 10 -GraphGeomEssai_1_1_1 - MakeTranslation_1__z1 - MakeTranslation_1 - z1 +aNewDataFlow + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ 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 0191126..5dce47f 100755 --- a/examples/MacroWithGeom.xml +++ b/examples/MacroWithGeom.xml @@ -5,62 +5,65 @@ ? ? - aNewDataFlow_1_4_1_1_1_1 + aNewDataFlow 1 ? -aNewDataFlow_1_4_1_1_1_1 +aNewDataFlow double - MakeBox1__x1 + Macro_aNewDataFlow_1__sum__a double - MakeBox1__y1 + Macro_aNewDataFlow_1__sum__b double - MakeBox1__z1 + TranslateDXDYDZ__theDX double - MakeBox1__x2 + TranslateDXDYDZ__theDZ double - MakeBox1__y2 + MakeBox__theX1 double - MakeBox1__z2 + MakeBox__theY1 double - MakeSphere_1__x1 + MakeBox__theZ1 double - MakeSphere_1__y1 + MakeBox__theX2 double - MakeSphere_1__z1 + MakeBox__theY2 double - MakeSphere_1__radius + MakeBox__theZ2 double - MakeTranslation_1__x1 + MakeSphere__theX double - MakeTranslation_1__z1 + MakeSphere__theY double - Macro_aNewDataFlow_1_5_1_1__sum__a + MakeSphere__theZ double - Macro_aNewDataFlow_1_5_1_1__sum__b + MakeSphere__theRadius + +long + SetStudyID__theStudyID -objref - MakeFuse_2__shape +GEOM_Object + MakeFuse_1__return - 25/8/2004 - 16:28:50 - 30/8/2004 - 10:16:9 + 29/10/2004 - 14:37:33 + 11/11/2004 - 13:15:14 2.0 ? ? @@ -71,525 +74,486 @@ ? ? - gag - 3 - ? - -gag - - - - - -gag - - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 - 2.0 - ? - ? - Compute Node - 0 - 123 - -? - ? - MakeBox1 - 3 - ? + Macro_aNewDataFlow_1 + 10 + aNewDataFlow_1 -MakeBox1 +aNewDataFlow_1 double - x1 - -double - y1 - -double - z1 - -double - x2 - -double - y2 + sum__a double - z2 + sum__b -objref - shape +double + Mult__b -MakeBox1 - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 +? + + 11/11/2004 - 13:11:17 + 11/11/2004 - 13:11:17 2.0 ? ? - Compute Node - 194 - 3 + Macro Node + 480 + 145 -? - ? - MakeCopy_1 - 3 +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 ? -MakeCopy_1 +TranslateDXDYDZ -objref - shape1 +GEOM_Object + theObject + +double + theDX + +double + theDY + +double + theDZ -objref - shape +GEOM_Object + return - - -MakeCopy_1 - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:11:58 + 11/11/2004 - 13:11:58 2.0 ? - ? - Compute Node - 389 - 3 + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 735 + 14 -? - ? - MakeCopy_2 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy + 0 ? -MakeCopy_2 +MakeCopy -objref - shape1 +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeCopy_2 - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:12:24 + 11/11/2004 - 13:12:24 2.0 ? - ? - Compute Node - 391 - 264 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 477 + 14 -? - ? - MakeSphere_1 - 3 +GEOM_Superv + GEOM_Superv + MakeBox + 0 ? -MakeSphere_1 +MakeBox double - x1 + theX1 double - y1 + theY1 double - z1 + theZ1 double - radius + theX2 + +double + theY2 + +double + theZ2 -objref - shape +GEOM_Object + return - - -MakeSphere_1 - - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:12:49 + 11/11/2004 - 13:12:49 2.0 ? - ? - Compute Node - 203 - 315 + localhost/FactoryServer + MakeBox from GEOM_Superv + 219 + 14 -? - ? - MakeTranslation_1 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy_1 + 0 ? -MakeTranslation_1 +MakeCopy -objref - shape1 - -double - x1 - -objref - y1 - -double - z1 +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeTranslation_1 - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:13:9 + 11/11/2004 - 13:13:9 2.0 ? - ? - Compute Node - 596 - 3 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 482 + 306 -? - ? - MakeFuse_1 - 3 +GEOM_Superv + GEOM_Superv + MakeFuse + 0 ? -MakeFuse_1 +MakeFuse -objref - shape1 +GEOM_Object + theShape1 -objref - shape2 +GEOM_Object + theShape2 -objref - shape +GEOM_Object + return - - -MakeFuse_1 - - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:13:47 + 11/11/2004 - 13:13:47 2.0 ? - ? - Compute Node - 823 - 116 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 950 + 121 -? - ? - MakeFuse_2 - 3 +GEOM_Superv + GEOM_Superv + MakeSphere + 0 ? -MakeFuse_2 +MakeSphere -objref - shape1 +double + theX + +double + theY + +double + theZ -objref - shape2 +double + theRadius -objref - shape +GEOM_Object + return - - -MakeFuse_2 - - - - - - - - - - - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:14:15 + 11/11/2004 - 13:14:15 2.0 ? - ? - Compute Node - 1049 - 295 + localhost/FactoryServer + MakeSphere from GEOM_Superv + 227 + 409 -? - ? - Macro_aNewDataFlow_1_5_1_1 - 10 - aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 +GEOM_Superv + GEOM_Superv + MakeFuse_1 + 0 + ? -aNewDataFlow_1_5_1_1 +MakeFuse -double - sum__a +GEOM_Object + theShape1 -double - sum__b +GEOM_Object + theShape2 -int - Mult__b +GEOM_Object + return - - -? - - 30/8/2004 - 10:16:9 - 30/8/2004 - 10:16:9 + + 11/11/2004 - 13:14:36 + 11/11/2004 - 13:14:36 2.0 ? - ? - Macro Node - 391 - 121 + 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 -gag - Gate - MakeBox1 - Gate +Macro_aNewDataFlow_1 + Mult__b + TranslateDXDYDZ + theDY -gag - Gate - MakeSphere_1 - Gate - - -175 - 470 - -175 - 198 +TranslateDXDYDZ + return + MakeFuse + theShape1 + -MakeBox1 - shape - MakeCopy_1 - shape1 +MakeCopy + return + TranslateDXDYDZ + theObject -MakeBox1 - shape - MakeCopy_2 - shape1 - - -373 - 211 +MakeBox + return + MakeCopy + theOriginal + + +MakeBox + return + MakeCopy_1 + theOriginal + MakeCopy_1 - shape - MakeTranslation_1 - shape1 + return + MakeFuse + theShape2 -MakeCopy_2 - shape +MakeFuse + return MakeFuse_1 - shape2 - - -674 - 207 - -MakeSphere_1 - shape - MakeFuse_2 - shape2 + theShape1 -MakeTranslation_1 - shape +MakeSphere + return MakeFuse_1 - shape1 + theShape2 -MakeFuse_1 - shape - MakeFuse_2 - shape1 - - -1017 - 366 - -1017 - 187 +SetStudyID + Gate + MakeBox + Gate + -Macro_aNewDataFlow_1_5_1_1 - Mult__b - MakeTranslation_1 - y1 +SetStudyID + Gate + MakeSphere + Gate -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__x1 - MakeBox1 - x1 +aNewDataFlow + Macro_aNewDataFlow_1__sum__a + Macro_aNewDataFlow_1 + sum__a 7 - 0 + 1 -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__y1 - MakeBox1 - y1 +aNewDataFlow + Macro_aNewDataFlow_1__sum__b + Macro_aNewDataFlow_1 + sum__b + +7 + 2 + + +aNewDataFlow + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX + +7 + 25 + + +aNewDataFlow + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ + +7 + 25 + + +aNewDataFlow + MakeBox__theX1 + MakeBox + theX1 7 0 -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__z1 - MakeBox1 - z1 +aNewDataFlow + MakeBox__theY1 + MakeBox + theY1 7 0 -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__x2 - MakeBox1 - x2 +aNewDataFlow + MakeBox__theZ1 + MakeBox + theZ1 7 - 50 + 0 -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__y2 - MakeBox1 - y2 +aNewDataFlow + MakeBox__theX2 + MakeBox + theX2 7 50 -aNewDataFlow_1_4_1_1_1_1 - MakeBox1__z2 - MakeBox1 - z2 +aNewDataFlow + MakeBox__theY2 + MakeBox + theY2 7 50 -aNewDataFlow_1_4_1_1_1_1 - MakeSphere_1__x1 - MakeSphere_1 - x1 +aNewDataFlow + MakeBox__theZ2 + MakeBox + theZ2 7 - 0 + 50 -aNewDataFlow_1_4_1_1_1_1 - MakeSphere_1__y1 - MakeSphere_1 - y1 +aNewDataFlow + MakeSphere__theX + MakeSphere + theX 7 0 -aNewDataFlow_1_4_1_1_1_1 - MakeSphere_1__z1 - MakeSphere_1 - z1 +aNewDataFlow + MakeSphere__theY + MakeSphere + theY 7 0 -aNewDataFlow_1_4_1_1_1_1 - MakeSphere_1__radius - MakeSphere_1 - radius +aNewDataFlow + MakeSphere__theZ + MakeSphere + theZ 7 - 12 + 0 -aNewDataFlow_1_4_1_1_1_1 - MakeTranslation_1__x1 - MakeTranslation_1 - x1 +aNewDataFlow + MakeSphere__theRadius + MakeSphere + theRadius 7 - 25 + 12 -aNewDataFlow_1_4_1_1_1_1 - MakeTranslation_1__z1 - MakeTranslation_1 - z1 +aNewDataFlow + SetStudyID__theStudyID + SetStudyID + theStudyID -7 - 25 +3 + 1 ? ? - aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 + aNewDataFlow_1 1 ? -aNewDataFlow_1_5_1_1_3_3_1_1_1_3_1 +aNewDataFlow_1 double @@ -599,12 +563,12 @@ sum__b -int +double Mult__b - 25/6/2004 - 17:42:12 - 30/8/2004 - 10:16:10 + 29/10/2004 - 14:40:44 + 11/11/2004 - 13:11:18 2.0 ? ? @@ -615,67 +579,67 @@ ? ? - sum + Mult 3 ? -sum +Mult double - a - -double - b + a -long - s +double + b -sum - - - 30/8/2004 - 10:16:10 - 30/8/2004 - 10:16:10 +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 - - - - 30/8/2004 - 10:16:10 - 30/8/2004 - 10:16:10 +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_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 461035f..b851704 100644 --- a/examples/NewGraphGeomEssai.py +++ b/examples/NewGraphGeomEssai.py @@ -1,127 +1,103 @@ -# Generated python file of Graph aNewDataFlow_1_4_2_1 +# Generated python file of Graph aNewDataFlow_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 ) +# 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 - # 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' ) + 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' ) - 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' ) + 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' ) - PyMakeSphere_1 = [] - PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius): ' ) - PyMakeSphere_1.append( ' apoint=MakeVertex(x1,y1,z1) ' ) - PyMakeSphere_1.append( ' shape=MakeSphere(apoint,radius) ' ) - PyMakeSphere_1.append( ' return shape ' ) - MakeSphere_1 = aNewDataFlow_1_4_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 ) - MakeSphere_1.SetName( 'MakeSphere_1' ) - MakeSphere_1.SetAuthor( '' ) - MakeSphere_1.SetComment( 'Compute Node' ) - MakeSphere_1.Coords( 193 , 67 ) - IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' ) - IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' ) - IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' ) - IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' ) - IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' ) - OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' ) - OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) + 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' ) - 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' ) + 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' ) - 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' ) + 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 - LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1.Link( OgagGate , IMakeSphere_1Gate ) + LSetStudyIDGateMakeSphereGate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeSphereGate ) - LMakeCopy_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeCopy_1shape , IMakeFuse_1shape1 ) + LMakeSpherereturnMakeCopytheOriginal = aNewDataFlow_1.Link( OMakeSpherereturn , IMakeCopytheOriginal ) - LMakeSphere_1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 ) + LMakeSpherereturnTranslateDXDYDZtheObject = aNewDataFlow_1.Link( OMakeSpherereturn , ITranslateDXDYDZtheObject ) - LMakeSphere_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeTranslation_1shape1 ) + LMakeCopyreturnMakeFusetheShape1 = aNewDataFlow_1.Link( OMakeCopyreturn , IMakeFusetheShape1 ) - LMakeTranslation_1shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape2 ) + LTranslateDXDYDZreturnMakeFusetheShape2 = aNewDataFlow_1.Link( OTranslateDXDYDZreturn , IMakeFusetheShape2 ) # 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 ) + 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 - #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' ) - return aNewDataFlow_1_4_2_1 + #OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) + return aNewDataFlow_1 -aNewDataFlow_1_4_2_1 = DefaNewDataFlow_1_4_2_1() +aNewDataFlow_1 = DefaNewDataFlow_1() diff --git a/examples/NewGraphGeomEssai.xml b/examples/NewGraphGeomEssai.xml index 4f6b8b5..9cbb7e2 100644 --- a/examples/NewGraphGeomEssai.xml +++ b/examples/NewGraphGeomEssai.xml @@ -5,41 +5,44 @@ ? ? - aNewDataFlow_1_4_2_1 + aNewDataFlow_1 1 ? -aNewDataFlow_1_4_2_1 +aNewDataFlow_1 +long + SetStudyID__theStudyID + double - MakeSphere_1__x1 + MakeSphere__theX double - MakeSphere_1__y1 + MakeSphere__theY double - MakeSphere_1__z1 + MakeSphere__theZ double - MakeSphere_1__radius + MakeSphere__theRadius double - MakeTranslation_1__x1 + TranslateDXDYDZ__theDX double - MakeTranslation_1__y1 + TranslateDXDYDZ__theDY double - MakeTranslation_1__z1 + TranslateDXDYDZ__theDZ -objref - MakeFuse_1__shape +GEOM_Object + MakeFuse__return - 25/8/2004 - 16:28:50 - 30/8/2004 - 10:10:8 + 29/10/2004 - 11:15:45 + 11/11/2004 - 13:5:45 2.0 ? ? @@ -48,276 +51,253 @@ 0 -? - ? - gag - 3 +GEOM_Superv + GEOM_Superv + SetStudyID + 0 ? -gag - +SetStudyID + + +long + theStudyID - - -gag - - - - - 30/8/2004 - 10:10:8 - 30/8/2004 - 10:10:8 + + 11/11/2004 - 13:3:46 + 11/11/2004 - 13:3:46 2.0 ? - ? - Compute Node - 0 - 123 + localhost/FactoryServer + SetStudyID from GEOM_Superv + 9 + 118 -? - ? - MakeCopy_1 - 3 +GEOM_Superv + GEOM_Superv + MakeSphere + 0 ? -MakeCopy_1 +MakeSphere -objref - shape1 +double + theX + +double + theY + +double + theZ + +double + theRadius -objref - shape +GEOM_Object + return - - -MakeCopy_1 - - - - 30/8/2004 - 10:10:8 - 30/8/2004 - 10:10:8 + + 11/11/2004 - 13:4:18 + 11/11/2004 - 13:4:18 2.0 ? - ? - Compute Node - 385 - 3 + localhost/FactoryServer + MakeSphere from GEOM_Superv + 202 + 58 -? - ? - MakeSphere_1 - 3 +GEOM_Superv + GEOM_Superv + MakeCopy + 0 ? -MakeSphere_1 +MakeCopy -double - x1 - -double - y1 - -double - z1 - -double - radius +GEOM_Object + theOriginal -objref - shape +GEOM_Object + return - - -MakeSphere_1 - - - - - 30/8/2004 - 10:10:8 - 30/8/2004 - 10:10:8 + + 11/11/2004 - 13:4:49 + 11/11/2004 - 13:4:49 2.0 ? - ? - Compute Node - 193 - 67 + localhost/FactoryServer + MakeCopy from GEOM_Superv + 425 + 11 -? - ? - MakeTranslation_1 - 3 +GEOM_Superv + GEOM_Superv + TranslateDXDYDZ + 0 ? -MakeTranslation_1 +TranslateDXDYDZ -objref - shape1 +GEOM_Object + theObject double - x1 + theDX double - y1 + theDY double - z1 + theDZ -objref - shape +GEOM_Object + return - - -MakeTranslation_1 - - - - 30/8/2004 - 10:10:8 - 30/8/2004 - 10:10:8 + + 11/11/2004 - 13:5:12 + 11/11/2004 - 13:5:12 2.0 ? - ? - Compute Node - 388 - 146 + localhost/FactoryServer + TranslateDXDYDZ from GEOM_Superv + 428 + 197 -? - ? - MakeFuse_1 - 3 +GEOM_Superv + GEOM_Superv + MakeFuse + 0 ? -MakeFuse_1 +MakeFuse -objref - shape1 +GEOM_Object + theShape1 -objref - shape2 +GEOM_Object + theShape2 -objref - shape +GEOM_Object + return - - -MakeFuse_1 - - - - - - - - - - - - 30/8/2004 - 10:10:8 - 30/8/2004 - 10:10:8 + + 11/11/2004 - 13:5:36 + 11/11/2004 - 13:5:36 2.0 ? - ? - Compute Node - 618 - 64 + localhost/FactoryServer + MakeFuse from GEOM_Superv + 651 + 103 -gag +SetStudyID Gate - MakeSphere_1 + MakeSphere Gate -MakeCopy_1 - shape - MakeFuse_1 - shape1 +MakeSphere + return + MakeCopy + theOriginal -MakeSphere_1 - shape - MakeCopy_1 - shape1 +MakeSphere + return + TranslateDXDYDZ + theObject -MakeSphere_1 - shape - MakeTranslation_1 - shape1 +MakeCopy + return + MakeFuse + theShape1 -MakeTranslation_1 - shape - MakeFuse_1 - shape2 +TranslateDXDYDZ + return + MakeFuse + theShape2 -aNewDataFlow_1_4_2_1 - MakeSphere_1__x1 - MakeSphere_1 - x1 +aNewDataFlow_1 + SetStudyID__theStudyID + SetStudyID + theStudyID + +3 + 1 + + +aNewDataFlow_1 + MakeSphere__theX + MakeSphere + theX 7 0 -aNewDataFlow_1_4_2_1 - MakeSphere_1__y1 - MakeSphere_1 - y1 +aNewDataFlow_1 + MakeSphere__theY + MakeSphere + theY 7 0 -aNewDataFlow_1_4_2_1 - MakeSphere_1__z1 - MakeSphere_1 - z1 +aNewDataFlow_1 + MakeSphere__theZ + MakeSphere + theZ 7 0 -aNewDataFlow_1_4_2_1 - MakeSphere_1__radius - MakeSphere_1 - radius +aNewDataFlow_1 + MakeSphere__theRadius + MakeSphere + theRadius 7 50 -aNewDataFlow_1_4_2_1 - MakeTranslation_1__x1 - MakeTranslation_1 - x1 +aNewDataFlow_1 + TranslateDXDYDZ__theDX + TranslateDXDYDZ + theDX 7 80 -aNewDataFlow_1_4_2_1 - MakeTranslation_1__y1 - MakeTranslation_1 - y1 +aNewDataFlow_1 + TranslateDXDYDZ__theDY + TranslateDXDYDZ + theDY 7 0 -aNewDataFlow_1_4_2_1 - MakeTranslation_1__z1 - MakeTranslation_1 - z1 +aNewDataFlow_1 + TranslateDXDYDZ__theDZ + TranslateDXDYDZ + theDZ 7 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_ComputingNode.cxx b/src/GraphBase/DataFlowBase_ComputingNode.cxx index 71ffd00..46c4407 100644 --- a/src/GraphBase/DataFlowBase_ComputingNode.cxx +++ b/src/GraphBase/DataFlowBase_ComputingNode.cxx @@ -352,9 +352,6 @@ bool GraphBase::ComputingNode::HasInput(const char * ToServiceParameterName ) { bool RetVal = false ; const GraphBase::InPort * theInPort = GetInPort( ToServiceParameterName ) ; if ( theInPort ) { -// cout << "GraphBase::ComputingNode::HasInput theInPort " << theInPort << " " << theInPort->PortName() << " of " -// << theInPort->NodeName() << " IsDataConnected " << theInPort->IsDataConnected() << " OutPort " -// << theInPort->GetOutPort() << endl ; RetVal = theInPort->IsDataConnected() ; } else { @@ -1146,7 +1143,7 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName , if ( IsDataFlowNode() || ( IsDataStreamNode() && HasDataStream() == 0 ) ) { f << " " << Name() << " = Graph( '" << Name() << "' )" << endl ; if ( GraphMacroLevel() ) { - f << " " << Name() << ".SetCoupledName( '" + f << " " << Name() << ".SetCoupled( '" << ((GraphBase::GOTONode * ) this)->CoupledNodeName() << "' )" << endl ; } } @@ -1238,7 +1235,7 @@ bool GraphBase::ComputingNode::SavePY( ostream &f , const char * aGraphName , else { f << " " << Name() << " = " << aGraphName << ".GraphMNode( ? )" << endl ; } - f << " " << Name() << ".SetCoupledName( '" << aCoupledNode->Name() << "' )" << endl ; + f << " " << Name() << ".SetCoupled( '" << aCoupledNode->Name() << "' )" << endl ; } else { // char * EndName = NULL ; 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_Graph.cxx b/src/GraphBase/DataFlowBase_Graph.cxx index 0c6d41a..1d057a0 100644 --- a/src/GraphBase/DataFlowBase_Graph.cxx +++ b/src/GraphBase/DataFlowBase_Graph.cxx @@ -599,7 +599,7 @@ bool GraphBase::Graph::ReNameNode( const char* OldNodeName , RetVal = true ; } else { - cdebug << "Node not found" << endl ; + cdebug << "ERROR Node not found" << endl ; } } else { @@ -640,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 ) ; } @@ -751,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 ) ; @@ -795,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() ) || @@ -1156,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 ; @@ -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() ; @@ -1319,7 +1320,7 @@ bool GraphBase::Graph::AddOutputData( const char* FromNodeName , cdebug << endl ; } else { - cdebug << "Node not found" << endl ; + cdebug << "ERROR Node not found" << endl ; RetVal = false ; } cdebug_out << "GraphBase::Graph::AddOutputData " << RetVal << endl; @@ -2008,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 ) ; - } + } } } @@ -2020,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 : @@ -2078,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 ; } } - } + } } } @@ -2304,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; } } } @@ -2456,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 ; } } @@ -2466,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 ; @@ -2492,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 << " " @@ -2592,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_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.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/GraphEditor/DataFlowEditor_DataFlow.hxx b/src/GraphEditor/DataFlowEditor_DataFlow.hxx index ea8212a..336a9e3 100644 --- a/src/GraphEditor/DataFlowEditor_DataFlow.hxx +++ b/src/GraphEditor/DataFlowEditor_DataFlow.hxx @@ -217,6 +217,7 @@ namespace GraphEditor { 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 e4ae58c..e09bb9f 100644 --- a/src/GraphEditor/DataFlowEditor_DataFlow.lxx +++ b/src/GraphEditor/DataFlowEditor_DataFlow.lxx @@ -466,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_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index 8d11d63..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" -map< string , GraphBase::Graph * > GraphEditor::OutNode::_MapOfGraphs; -map< string , int > GraphEditor::OutNode::_MapOfGraphNames; +//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 @@ -67,13 +87,13 @@ GraphEditor::OutNode::OutNode( CORBA::ORB_ptr ORB , _StreamGraph = NULL ; _Graph = new GraphBase::Graph( ORB , ptrNamingService , DataFlowName , aKindOfNode , _prof_debug , _fdebug ) ; - MapGraph( _Graph , _Graph->Name() ) ; +// MapGraph( _Graph , _Graph->Name() ) ; } else if ( aKindOfNode == SUPERV::DataStreamGraph ) { _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowName , aKindOfNode , _prof_debug , _fdebug ) ; _Graph = _StreamGraph ; - MapGraph( _Graph , _Graph->Name() ) ; +// MapGraph( _Graph , _Graph->Name() ) ; } _Orb = CORBA::ORB::_duplicate( ORB ) ; _Imported = false ; @@ -109,7 +129,7 @@ GraphEditor::OutNode::OutNode( DataFlowEditorRelease , DataFlowAuthor , DataFlowComputer , DataFlowComment , _prof_debug , _fdebug ) ; - MapGraph( _Graph , _Graph->Name() ) ; +// MapGraph( _Graph , _Graph->Name() ) ; } else if ( DataFlowkind == SUPERV::DataStreamGraph ) { _StreamGraph = new GraphBase::StreamGraph( ORB , ptrNamingService , DataFlowService , DataFlowComponentName , @@ -119,7 +139,7 @@ GraphEditor::OutNode::OutNode( DataFlowComputer , DataFlowComment , _prof_debug , _fdebug ) ; _Graph = _StreamGraph ; - MapGraph( _Graph , _Graph->Name() ) ; +// MapGraph( _Graph , _Graph->Name() ) ; } _Orb = CORBA::ORB::_duplicate( ORB ) ; _Imported = false ; @@ -137,14 +157,14 @@ GraphEditor::OutNode::~OutNode() { bool GraphEditor::OutNode::Name( const char * aName ) { bool RetVal = false ; - if ( !GraphName( aName ) ) { - char * aGraphName = Graph()->Name() ; +// if ( !GraphName( aName ) ) { +// char * aGraphName = Graph()->Name() ; RetVal = Graph()->Name( aName ) ; - if ( RetVal ) { - EraseGraph( aGraphName ) ; - MapGraph( Graph() , aName ) ; - } - } +// if ( RetVal ) { +// EraseGraph( aGraphName ) ; +// MapGraph( Graph() , aName ) ; +// } +// } return RetVal ; } @@ -197,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( Graph()->Name() ) ; Name( GraphInstanceName( Graph()->Name() ).c_str() ) ; - MapGraph( Graph() , Graph()->Name() ) ; +// MapGraph( Graph() , Graph()->Name() ) ; cdebug << "GraphEditor::OutNode::LoadXml() " << aDataFlowName << " --> " << Graph()->Name() << endl; RetVal = true ; } @@ -239,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( aDataFlowInfo.theName.c_str() ) ; Graph()->Name( GraphInstanceName( aDataFlowInfo.theName.c_str() ).c_str() ) ; - MapGraph( Graph() , Graph()->Name() ) ; +// MapGraph( Graph() , Graph()->Name() ) ; cdebug << "GraphEditor::OutNode::LoadInfo " << aDataFlowName << " --> " << Graph()->Name() << " aDataFlowInfo.Kind " << aDataFlowInfo.theKind << " Kind() " << Graph()->Kind() << endl ; if ( Graph()->IsDataStreamNode() ) { @@ -383,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 ) ; } } } @@ -537,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 = 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 ) ; } } @@ -1686,6 +1725,7 @@ 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 ; @@ -1706,29 +1746,6 @@ void GraphEditor::OutNode::EraseGraph( const char * aGraphName ) { bool GraphEditor::OutNode::GraphName( const char * aGraphName ) { return _MapOfGraphNames[ aGraphName ] ; } - -string GraphEditor::OutNode::GraphInstanceName( const char * aGraphName ) { - int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ; - if ( GraphInstanceNumber ) { - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } - else { - GraphInstanceNumber = 0 ; - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } - string theGraphInstanceName = string( aGraphName ) ; - if ( GraphInstanceNumber ) { - theGraphInstanceName += "_" ; - ostringstream astr ; - astr << GraphInstanceNumber ; - theGraphInstanceName += astr.str() ; - } - return theGraphInstanceName ; -} - - - - - +*/ diff --git a/src/GraphEditor/DataFlowEditor_OutNode.hxx b/src/GraphEditor/DataFlowEditor_OutNode.hxx index ec96d7f..d5da3be 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.hxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.hxx @@ -79,14 +79,14 @@ 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 ) ; +// 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 diff --git a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx index f7c89e2..a1da842 100644 --- a/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx +++ b/src/GraphExecutor/DataFlowExecutor_DataFlow.cxx @@ -157,7 +157,7 @@ bool GraphExecutor::DataFlow::InputOfAny( const char * ToServiceParameterName , anInNode->ThreadNo( 0 ) ; anInNode->CreateNewThread( true ) ; anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ; - State( GraphExecutor::ExecutingState ) ; +// State( GraphExecutor::ExecutingState ) ; } } } @@ -233,7 +233,7 @@ bool GraphExecutor::DataFlow::OutputOfAny( const char * aNodeName , 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_FiniteStateMachine.cxx b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx index af0e086..e044c34 100644 --- a/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx +++ b/src/GraphExecutor/DataFlowExecutor_FiniteStateMachine.cxx @@ -636,29 +636,33 @@ string GraphExecutor::FiniteStateMachine::GraphInstanceName( const char * aGraph 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_InNode.cxx b/src/GraphExecutor/DataFlowExecutor_InNode.cxx index 87f1960..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 ; } @@ -1154,19 +1162,31 @@ void GraphExecutor::InNode::InitialState( GraphExecutor::OutNode * theOutNode ) } 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 9745f94..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); @@ -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 83d4c53..18b6ade 100644 --- a/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx +++ b/src/GraphExecutor/DataFlowExecutor_InNodeThreads.cxx @@ -1521,7 +1521,8 @@ int GraphExecutor::InNode::DataReady_ExecuteAction() { } else { GraphExecutor::DataFlow * aMacroGraph = GraphMacroNode()->CoupledNode()->GraphEditor()->Executor() ; - cdebug << ThreadNo() << " DataReady_ExecuteAction " << aMacroGraph->Graph()->Name() << " ->DoneWait()" + cdebug << ThreadNo() << " DataReady_ExecuteAction " << aMacroGraph << " " + << aMacroGraph->Graph()->Name() << " ->DoneWait()" << " State " << aMacroGraph->State() << endl; aMacroGraph->DoneWait() ; cdebug << ThreadNo() << " DataReady_ExecuteAction " << Name() << " State " << aMacroGraph->State() << endl; @@ -1577,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 ; @@ -1590,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 ) ; } @@ -1601,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 ) ; } @@ -1738,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 ) ; diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.cxx b/src/GraphExecutor/DataFlowExecutor_OutNode.cxx index 090d9a8..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 ) ; @@ -80,7 +80,6 @@ GraphExecutor::OutNode::OutNode( CORBA::ORB_ptr ORB, _prof_debug , _fdebug ) ; _Graph = _StreamGraph ; } -//_Graph->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; _Valid = false ; _Executable = false ; _Done = false ; @@ -99,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, @@ -123,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 , @@ -344,7 +343,6 @@ bool GraphExecutor::OutNode::LoadNodes(const GraphBase::ListOfSNodes &aListOfNod aCoupledCoupledNode = (GraphBase::GOTONode * ) Graph()->GetChangeGraphNode( aNode.theCoupledNode.c_str() ) ; if ( aCoupledCoupledNode != NULL ) { aCoupledNode->CoupledNode( aCoupledCoupledNode ) ; -//aCoupledNode->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; } else { aCoupledNode->CoupledNodeName( aNode.theCoupledNode.c_str() ) ; @@ -428,7 +426,6 @@ GraphExecutor::InNode *GraphExecutor::OutNode::AddNode( NodeComputer , NodeComment , false , NodeX , NodeY , _prof_debug , _fdebug ) ; Graph()->AddNode( Nd->ComputingNode() ) ; -//Nd->ComputingNode()->GraphEditor()->Executor( (GraphExecutor::DataFlow * ) this ) ; cdebug_out << "GraphExecutor::OutNode::AddNode" << endl; return Nd ; } @@ -525,7 +522,7 @@ 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 ( RetVal && anInNode->IsMacroNode() ) { @@ -542,7 +539,7 @@ bool GraphExecutor::OutNode::Run( const bool AndSuspend ) { } } } - + */ if ( Graph()->GraphMacroLevel() != 0 ) { cdebug << "GraphExecutor::OutNode::Run Execution starting GraphExecutor::Action_DataOk_RunService Node " << Graph()->Name() << " GraphMacroLevel " << Graph()->GraphMacroLevel() << endl ; @@ -712,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() ; @@ -729,12 +728,14 @@ void GraphExecutor::OutNode::CheckAllDone() { cdebug << "================================================================================" << endl ; // asv : fix for 6798 and other bugs: "sift" the event queue after execution - //cout << "Before siftEvents() event count = " << _EventNodes.size(); siftEvents(); - //cout << ". After event count = " << _EventNodes.size() << endl; + + // asv : 25.10.04 : calling Editing() to indicate stop of execution + Graph()->GraphEditor()->Editing(); } - cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() - << " GraphAutomatonState " << theAutomaton->StateName( AutomatonState() ) + cdebug_out << "GraphExecutor::OutNode::CheckAllDone " << IsDone() << " this " << this << " " + << Graph()->Name() << " GraphAutomatonState " + << theAutomaton->StateName( AutomatonState() ) << " State " << State() << " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads << " EventQSize " << EventQSize() << endl ; } @@ -800,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 ) ; @@ -1228,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 ) { @@ -1603,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 ; @@ -1856,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 ; } diff --git a/src/GraphExecutor/DataFlowExecutor_OutNode.hxx b/src/GraphExecutor/DataFlowExecutor_OutNode.hxx index c5b7c9a..a882cf3 100644 --- a/src/GraphExecutor/DataFlowExecutor_OutNode.hxx +++ b/src/GraphExecutor/DataFlowExecutor_OutNode.hxx @@ -156,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 9438f6d..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__x86__ -D__linux__ -ftemplate-depth-42 -Wall \ -I${KERNEL_ROOT_DIR}/include/salome -LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -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/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 83498b5..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: "<IsStreamGraph()) { SUPERV_StreamGraph aDataFlowStream = aDataFlow->ToStreamGraph(); if (SUPERV_isNull(aDataFlowStream)) { @@ -297,6 +336,7 @@ void SUPERVGUI::displayDataflow() { } aDataFlow = aDataFlowStream; } + */ } QAD_StudyFrame* aStudyFrame = createGraph(); SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast @@ -324,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 ); @@ -358,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); } 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_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 3277349..273f161 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx @@ -484,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; @@ -515,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_CanvasView.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasView.cxx index 5e9ffd3..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; @@ -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); @@ -381,6 +382,7 @@ void SUPERVGUI_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent) if (myIsPanActivated) { myIsPanActivated = false; + myIsPanBtnClicked = false; setCursor(myCursor); } @@ -461,7 +463,7 @@ void SUPERVGUI_CanvasView::changeBackground() void SUPERVGUI_CanvasView::ActivatePanning() { - myIsPanActivated = true; + myIsPanBtnClicked = true; } void SUPERVGUI_CanvasView::ResetView() 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 f4009e7..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"); @@ -256,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() { @@ -352,7 +329,6 @@ void SUPERVGUI_Main::execute(char * theNodeName, SUPERV::GraphState theNodeStat aGraphNodePrs->sync(); } else if (aNodePrs) { - //aNodePrs->sync(); aNodePrs->syncOnEvent(theNodeState); } } @@ -510,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); @@ -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); @@ -1406,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(); } @@ -1450,21 +1431,22 @@ 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 { + else { if ( aNode != NULL && !CORBA::is_nil( aNode ) ) { aName = aNode->Name(); } @@ -1502,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; @@ -1528,29 +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; - if ( aPrevNode == NULL || CORBA::is_nil( aPrevNode ) ) { + + if ( aPrevNode == NULL || CORBA::is_nil( aPrevNode ) ) aPrevName = ""; - } - else { + else aPrevName = aPrevNode->Name(); - } //usleep(10); //msleep(5); @@ -1559,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 563dcab..74cf9ea 100644 --- a/src/SUPERVGUI/SUPERVGUI_Node.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Node.cxx @@ -417,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; @@ -448,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; @@ -519,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"); @@ -553,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(); @@ -562,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 4345b0d..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)); @@ -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 d22a5b4..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" diff --git a/src/Supervision/CNode_Impl.cxx b/src/Supervision/CNode_Impl.cxx index 9457225..1175c00 100644 --- a/src/Supervision/CNode_Impl.cxx +++ b/src/Supervision/CNode_Impl.cxx @@ -1728,10 +1728,11 @@ bool CNode_Impl::Kill() { if ( aDataFlowExecutor ) { if ( _IsNode ) { RetVal = aDataFlowExecutor->Kill( Name() ) ; + MESSAGE( "Node " << Name() << " execution was killed : " << RetVal ) ; } else { RetVal = aDataFlowExecutor->Kill() ; - MESSAGE( "Graph execution was killed " << RetVal ) ; + MESSAGE( "Graph execution was killed : " << RetVal ) ; } } endService( "CNode_Impl::Kill" ); @@ -1805,6 +1806,8 @@ bool 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 ; @@ -1832,6 +1835,8 @@ bool CNode_Impl::ReRun() { if ( _IsNode ) { 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 = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ; } @@ -1843,6 +1848,8 @@ bool 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 ; @@ -1865,6 +1872,11 @@ bool CNode_Impl::ReStart() { if ( _IsNode ) { 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 = aDataFlowExecutor->Run( true ) ; } @@ -1873,6 +1885,8 @@ bool 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 ; 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 fcad1e7..9299a97 100644 --- a/src/Supervision/GNode_Impl.cxx +++ b/src/Supervision/GNode_Impl.cxx @@ -214,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 ea87b67..b5f87bb 100644 --- a/src/Supervision/GNode_Impl.hxx +++ b/src/Supervision/GNode_Impl.hxx @@ -72,38 +72,8 @@ class GNode_Impl : public INode_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 1a2350a..3af8ebd 100644 --- a/src/Supervision/Graph_Impl.cxx +++ b/src/Supervision/Graph_Impl.cxx @@ -598,10 +598,17 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphEditor::DataFlow * aDataFlowEd if ( aGraph->GraphNodes( i )->IsMacroNode() ) { GraphBase::GOTONode * aMacroNode = (GraphBase::GOTONode * ) aGraph->GraphNodes( i ) ; -// asv: set Editor for the graph itself and for all its macro nodes + // 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 ObjRef in the current editor + // Creation of a GraphMacroNode ObjRef in the current editor SUPERV::Graph_var macroiobject = SUPERV::Graph::_nil() ; Graph_Impl * myMacroNode ; myMacroNode = new Graph_Impl( _Orb , _Poa, _ContId, @@ -716,7 +723,7 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow } // That graph is not a StreamGraph : - else if ( !aDataFlowExecutor->Graph()->HasDataStream() ) { + else { aDataFlowExecutor->Graph()->Kind( SUPERV::DataFlowGraph ) ; GraphEditor::DataFlow * aDataFlowEditor ; aDataFlowEditor = DataFlowEditor() ; @@ -730,84 +737,76 @@ SUPERV::Graph_var Graph_Impl::LoadDataFlows( GraphExecutor::DataFlow * aDataFlow aDataFlowEditor->Executor( aDataFlowExecutor ) ; 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 ) ; + 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() ; + 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 ). + 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 , + 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 ); + 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 \"" <Graph()->ObjImpl(); + MESSAGE( "RECURSIVE IMPORT OF GRAPHS OF MACRONODES : " << aMacroGraphName ) ; + if ( CORBA::is_nil( aMacroGraphImpl->LoadDataFlows( aMacroGraphExecutor, aListOfDataFlows , index ) ) ) { + MESSAGE("Graph_Impl::LoadDataFlows(Executor) failed, could not LoadDataFlow( MacroNodeGraph \"" < MacroGraph - aMacroGraphExe->CoupledNode( aMacroNode ) ; - aMacroNode->CoupledNode( aMacroGraphExe ) ; - - // set MacroObject pair ???? - /* - PortableServer::ObjectId * id = aMacroNode->ObjImpl()->getId(); - CORBA::Object_var obj = _poa->id_to_reference( *id ); - SUPERV::Graph_var aMacroNodeImpl = SUPERV::Graph::_narrow( obj ) ; - - aMacroGraphExe->MacroObject( SUPERV::Graph::_duplicate( aMacroNodeImpl ) ) ; - aMacroNode->MacroObject( SUPERV::Graph::_duplicate( SUPERV::Graph::_narrow( aMacroGraphExecutor->Graph()->ObjRef() ) ) ) ; - */ - // initialize MacroNode's InPorts with corresponding "external" values - int q ; - for ( q = 0 ; q < aMacroNode->GetNodeInPortsSize() ; q++ ) { - const GraphBase::InPort * anInPort = aMacroNode->GetNodeInPort( q ) ; - if ( anInPort->IsDataConnected() ) { - if ( !aMacroGraphExecutor->InputOfAny( aMacroGraph->GetNodeInPort( q )->PortName() , - *anInPort->GetOutPort()->Value() , - false ) ) { - return SUPERV::Graph::_duplicate( SUPERV::Graph::_nil() ) ; - } - else { - MESSAGE( "LoadDataFlows(Executor) " << aMacroGraph->Name() << "->InputOfAny( " - << aMacroGraph->GetNodeInPort( i )->PortName() << " , Value )" ) ; + // set coupled pair MacroNode <--> 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() ) ; + } + else { + MESSAGE( "LoadDataFlows(Executor) " << aMacroGraph->Name() << "->InputOfAny( " + << aMacroGraphInPortName << " , Value )" ) ; + } } - } - } // end of init MacroNode's InPorts + } // end of init MacroNode's InPorts - aMacroGraphImpl->Run() ; + aMacroGraphImpl->Run() ; - } - } // end of for( get nodes of the graph...) + } + } // end of for( get nodes of the graph...) + } } // end of setting initial graph's structure.. endService( "Graph_Impl::ExecutorLoadDataFlows" ); @@ -1733,9 +1732,9 @@ 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() ; DataFlowEditor()->Executor( NULL ) ; } @@ -1766,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 " @@ -1784,12 +1783,14 @@ 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 ; @@ -1797,22 +1798,35 @@ bool Graph_Impl::Run() { 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 ) { - // 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/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/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/batchmode_SuperV.py b/src/Supervision/batchmode_SuperV.py index e341afb..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,13 +32,15 @@ except : # except : # SuperV_Swig = None orb = CORBA.ORB_init([''], CORBA.ORB_ID) + #lcc = LifeCycleCORBA(orb) while lcc._catalog == None: lcc = LifeCycleCORBA(orb) - #lcc = LifeCycleCORBA(orb) naming_service = SALOME_NamingServicePy_i(orb) +import os import re from types import * +import readline import SALOMEDS import SALOMEDS_Attributes_idl #try : @@ -47,7 +53,8 @@ import SALOMEDS_Attributes_idl # print 'Supervision Component loaded' SuperVision = lcc.FindOrLoadComponent("SuperVisionContainer","SUPERV") -SuperVision.Swig = 0 +#SuperVision.Swig = 0 + modulecatalog = None while modulecatalog == None: modulecatalog = naming_service.Resolve("/Kernel/ModulCatalog") @@ -244,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 ) @@ -304,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 @@ -311,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('\\') @@ -325,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() @@ -336,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() @@ -362,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 ): @@ -386,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 ): @@ -510,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 ) @@ -532,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): @@ -626,7 +771,7 @@ class ESNode(GNode): # self.Parametername = aServicesParameter.Parametername ########################################################## -class Graph(INode): +class Graph(GNode): ########################################################## def __init__( self , aName ): try: @@ -635,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 @@ -661,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 ) @@ -787,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 ) @@ -832,7 +1013,7 @@ class Graph(INode): return self.G.LevelMax() def ThreadsMax( self ): return self.G.ThreadsMax() - def GraphsNumber( self ): + def SubGraphsNumber( self ): return self.G.SubGraphsNumber() def LevelNodes( self , aLevel ): nodes = self.G.LevelNodes( aLevel ) @@ -941,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() @@ -967,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() + 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 @@ -998,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 ) : @@ -1026,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 ): @@ -1040,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: @@ -1134,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 ): @@ -1155,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: ########################################################## @@ -1179,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 ): @@ -1195,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