From 5310f24fcfa72eac903136266e46e53b25c9a010 Mon Sep 17 00:00:00 2001 From: asv Date: Fri, 28 Jan 2005 11:44:47 +0000 Subject: [PATCH] Updated example graphs from Jean Rahuel. Switch nodes in the graphs were modified. --- examples/GraphSyrControl.py | 546 ++++----- examples/GraphSyrControl.xml | 1012 +++++++++-------- examples/GraphSyrControl1.py | 473 ++++---- examples/GraphSyrControl1.xml | 888 ++++++++------- examples/GraphSyrControlAve.py | 792 ++++++------- examples/GraphSyrControlAve.xml | 1590 +++++++++++++-------------- examples/GraphSyrControlDefault.py | 504 +++++---- examples/GraphSyrControlDefault.xml | 982 +++++++++-------- examples/GraphSyrControlGUI.py | 449 ++++---- examples/GraphSyrControlGUI.xml | 880 ++++++++------- 10 files changed, 4092 insertions(+), 4024 deletions(-) diff --git a/examples/GraphSyrControl.py b/examples/GraphSyrControl.py index c1ea545..08efc0d 100644 --- a/examples/GraphSyrControl.py +++ b/examples/GraphSyrControl.py @@ -2,274 +2,280 @@ # Generated python file of Graph GraphSyrControl from SuperV import * -# Graph creation -GraphSyrControl = Graph( 'GraphSyrControl' ) -GraphSyrControl.SetName( 'GraphSyrControl' ) -GraphSyrControl.SetAuthor( 'JR' ) -GraphSyrControl.SetComment( 'Syracuse algorithm' ) -GraphSyrControl.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControl.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( 190 , 338 ) - -test_ISONE = GraphSyrControl.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( 196 , 131 ) - -m3p1 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 788 , 22 ) - -div2 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 794 , 427 ) - -incr = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 790 , 158 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ):' ) -Pylabel_begin.append( ' print "label_begin",NB,KB' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControl.INode( 'label_begin' , Pylabel_begin ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 7 , 216 ) - -Pylabel_test = [] -Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) -Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) -Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) -label_test = GraphSyrControl.INode( 'label_test' , Pylabel_test ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.OutPort( 'ValEven' , 'long' ) -label_test.OutPort( 'ValOne' , 'long' ) -label_test.OutPort( 'NT' , 'long' ) -label_test.OutPort( 'KT' , 'long' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( 'Python function' ) -label_test.Coords( 385 , 159 ) - -# Creation of Switch Nodes -Pytest = [] -Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) -Pytest.append( ' Finished = ValOne' ) -Pytest.append( ' if Finished == 0 :' ) -Pytest.append( ' Incr = 1' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' if Even == 0 :' ) -Pytest.append( ' Odd = 1' ) -Pytest.append( ' else :' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' else :' ) -Pytest.append( ' Incr = 0' ) -Pytest.append( ' Even = 0' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -test,EndSwitch_OneEven = GraphSyrControl.SNode( 'Switch_OneEven' , Pytest ) -EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) -EndSwitch_OneEven.SetAuthor( '' ) -EndSwitch_OneEven.SetComment( '' ) -EndSwitch_OneEven.Coords( 1065 , 321 ) -PyEndSwitch_OneEven = [] -PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' ) -PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' ) -PyEndSwitch_OneEven.append( ' return Finished,K' ) -EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) -EndSwitch_OneEven.InPort( 'Finished' , 'long' ) -EndSwitch_OneEven.InPort( 'K' , 'long' ) -EndSwitch_OneEven.OutPort( 'Finished' , 'long' ) -EndSwitch_OneEven.OutPort( 'K' , 'long' ) -test.InPort( 'ValOne' , 'long' ) -test.InPort( 'ValEven' , 'long' ) -test.InPort( 'NT' , 'long' ) -test.InPort( 'KT' , 'long' ) -test.OutPort( 'Finished' , 'long' ) -test.OutPort( 'Incr' , 'long' ) -test.OutPort( 'Even' , 'long' ) -test.OutPort( 'Odd' , 'long' ) -test.OutPort( 'N' , 'long' ) -test.OutPort( 'K' , 'long' ) -test.SetName( 'test' ) -test.SetAuthor( '' ) -test.SetComment( '' ) -test.Coords( 592 , 205 ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControl.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1012 , 68 ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) -Pycontrol_div2.append( ' return N,NB' ) -control_div2 = GraphSyrControl.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1010 , 473 ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControl.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 380 , 236 ) -label_testValEven.AddCoord( 2 , 379 , 419 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControl.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 367 , 269 ) -label_testValOne.AddCoord( 2 , 367 , 213 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControl.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControl.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_m3p1K = GraphSyrControl.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 978 , 132 ) -control_m3p1K.AddCoord( 2 , 978 , 239 ) - -control_div2K = GraphSyrControl.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 979 , 536 ) -control_div2K.AddCoord( 2 , 978 , 240 ) - -label_beginNT = label_begin.Port( 'NT' ) -label_testNT = GraphSyrControl.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControl.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 184 , 416 ) -test_ISEVENanInteger.AddCoord( 2 , 185 , 298 ) - -test_ISONEanInteger = GraphSyrControl.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 186 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 185 , 297 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControl.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testValEven = label_test.Port( 'ValEven' ) -testValEven = GraphSyrControl.Link( label_testValEven , test.Port( 'ValEven' ) ) - -label_testValOne = label_test.Port( 'ValOne' ) -testValOne = GraphSyrControl.Link( label_testValOne , test.Port( 'ValOne' ) ) - -label_testNT = label_test.Port( 'NT' ) -testNT = GraphSyrControl.Link( label_testNT , test.Port( 'NT' ) ) - -label_testKT = label_test.Port( 'KT' ) -testKT = GraphSyrControl.Link( label_testKT , test.Port( 'KT' ) ) - -testFinished = test.Port( 'Finished' ) -EndSwitch_OneEvenFinished = GraphSyrControl.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) ) - -testIncr = test.Port( 'Incr' ) -incrInGate = GraphSyrControl.Link( testIncr , incr.Port( 'InGate' ) ) - -testEven = test.Port( 'Even' ) -div2InGate = GraphSyrControl.Link( testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 764 , 536 ) -div2InGate.AddCoord( 2 , 763 , 297 ) - -testOdd = test.Port( 'Odd' ) -m3p1InGate = GraphSyrControl.Link( testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 773 , 133 ) -m3p1InGate.AddCoord( 2 , 773 , 326 ) - -testN = test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControl.Link( testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 753 , 102 ) -m3p1anOddInteger.AddCoord( 2 , 752 , 355 ) - -div2anEvenInteger = GraphSyrControl.Link( testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 753 , 508 ) -div2anEvenInteger.AddCoord( 2 , 752 , 356 ) - -testK = test.Port( 'K' ) -EndSwitch_OneEvenK = GraphSyrControl.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) - -incraCount = GraphSyrControl.Link( testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 779 , 239 ) -incraCount.AddCoord( 2 , 780 , 385 ) - -testDefault = test.Port( 'Default' ) -EndSwitch_OneEvenDefault = GraphSyrControl.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControl.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 373 , 354 ) -label_testInGate.AddCoord( 2 , 372 , 10 ) -label_testInGate.AddCoord( 3 , 1180 , 9 ) -label_testInGate.AddCoord( 4 , 1181 , 217 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControl.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 5 , 355 ) -label_beginInGate.AddCoord( 2 , 4 , 608 ) -label_beginInGate.AddCoord( 3 , 1177 , 608 ) -label_beginInGate.AddCoord( 4 , 1177 , 563 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -EndSwitch_OneEvenFinished = EndSwitch_OneEven.Port( 'Finished' ) -EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) - -GraphSyrControl.Run( 7 ) - -GraphSyrControl.DoneW() - -print GraphSyrControl.State() - -GraphSyrControl.PrintPorts() - -label_begin.EPyFunc() +# Graph creation of GraphSyrControl +def DefGraphSyrControl() : + GraphSyrControl = Graph( 'GraphSyrControl' ) + GraphSyrControl.SetName( 'GraphSyrControl' ) + GraphSyrControl.SetAuthor( 'JR' ) + GraphSyrControl.SetComment( 'Syracuse algorithm' ) + GraphSyrControl.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControl.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( 190 , 338 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControl.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( 196 , 131 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 788 , 22 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 794 , 427 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 158 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + Pylabel_begin = [] + Pylabel_begin.append( 'def label_begin( NB , KB ):' ) + Pylabel_begin.append( ' print "label_begin",NB,KB' ) + Pylabel_begin.append( ' return NB,KB' ) + label_begin = GraphSyrControl.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 7 , 216 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + Pylabel_test = [] + Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) + Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) + Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) + label_test = GraphSyrControl.INode( 'label_test' , Pylabel_test ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Python function' ) + label_test.Coords( 385 , 159 ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' ) + Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' ) + Olabel_testNT = label_test.OutPort( 'NT' , 'long' ) + Olabel_testKT = label_test.OutPort( 'KT' , 'long' ) + Olabel_testGate = label_test.GetOutPort( 'Gate' ) + + # Creation of Switch Nodes + Pytest = [] + Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) + Pytest.append( ' Finished = ValOne' ) + Pytest.append( ' if Finished == 0 :' ) + Pytest.append( ' Incr = 1' ) + Pytest.append( ' Even = ValEven' ) + Pytest.append( ' if Even == 0 :' ) + Pytest.append( ' Odd = 1' ) + Pytest.append( ' else :' ) + Pytest.append( ' Odd = 0' ) + Pytest.append( ' else :' ) + Pytest.append( ' Incr = 0' ) + Pytest.append( ' Even = 0' ) + Pytest.append( ' Odd = 0' ) + Pytest.append( ' Even = ValEven' ) + Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) + test,EndSwitch_OneEven = GraphSyrControl.SNode( 'Switch_OneEven' , Pytest ) + EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) + EndSwitch_OneEven.SetAuthor( '' ) + EndSwitch_OneEven.SetComment( 'Compute Node' ) + EndSwitch_OneEven.Coords( 1065 , 321 ) + PyEndSwitch_OneEven = [] + PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' ) + PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' ) + PyEndSwitch_OneEven.append( ' return Finished,K' ) + EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) + IEndSwitch_OneEvenFinished = EndSwitch_OneEven.InPort( 'Finished' , 'long' ) + IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' ) + IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' ) + OEndSwitch_OneEvenFinished = EndSwitch_OneEven.OutPort( 'Finished' , 'long' ) + OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' ) + OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' ) + test.SetName( 'test' ) + test.SetAuthor( '' ) + test.SetComment( 'Compute Node' ) + test.Coords( 592 , 205 ) + ItestValOne = test.InPort( 'ValOne' , 'long' ) + ItestValEven = test.InPort( 'ValEven' , 'long' ) + ItestNT = test.InPort( 'NT' , 'long' ) + ItestKT = test.InPort( 'KT' , 'long' ) + ItestGate = test.GetInPort( 'Gate' ) + OtestFinished = test.OutPort( 'Finished' , 'long' ) + OtestIncr = test.OutPort( 'Incr' , 'long' ) + OtestEven = test.OutPort( 'Even' , 'long' ) + OtestOdd = test.OutPort( 'Odd' , 'long' ) + OtestN = test.OutPort( 'N' , 'long' ) + OtestK = test.OutPort( 'K' , 'long' ) + OtestDefault = test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControl.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1012 , 68 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) + Pycontrol_div2.append( ' return N,NB' ) + control_div2 = GraphSyrControl.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1010 , 473 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControl.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 380 , 236 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 379 , 419 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControl.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 367 , 269 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 367 , 213 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControl.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControl.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphSyrControl.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 978 , 132 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 978 , 239 ) + + LincraNewCountcontrol_div2K = GraphSyrControl.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 979 , 536 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 978 , 240 ) + + Llabel_beginNTlabel_testNT = GraphSyrControl.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControl.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 184 , 416 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 185 , 298 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControl.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 186 , 211 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 185 , 297 ) + + Llabel_beginKTlabel_testKT = GraphSyrControl.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphSyrControl.Link( Olabel_testValEven , ItestValEven ) + + Llabel_testValOnetestValOne = GraphSyrControl.Link( Olabel_testValOne , ItestValOne ) + + Llabel_testNTtestNT = GraphSyrControl.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphSyrControl.Link( Olabel_testKT , ItestKT ) + + LtestFinishedEndSwitch_OneEvenFinished = GraphSyrControl.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + + LtestEvendiv2Gate = GraphSyrControl.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 764 , 536 ) + LtestEvendiv2Gate.AddCoord( 2 , 763 , 297 ) + + LtestOddm3p1Gate = GraphSyrControl.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 773 , 133 ) + LtestOddm3p1Gate.AddCoord( 2 , 773 , 326 ) + + LtestNm3p1anOddInteger = GraphSyrControl.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 753 , 102 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 752 , 355 ) + + LtestNdiv2anEvenInteger = GraphSyrControl.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 753 , 508 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 752 , 356 ) + + LtestKEndSwitch_OneEvenK = GraphSyrControl.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphSyrControl.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 779 , 239 ) + LtestKincraCount.AddCoord( 2 , 780 , 385 ) + + LtestDefaultEndSwitch_OneEvenDefault = GraphSyrControl.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControl.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 373 , 354 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 372 , 10 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1180 , 9 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1181 , 217 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControl.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 5 , 355 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 4 , 608 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1177 , 608 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1177 , 563 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #OtestIncr = test.GetOutPort( 'Incr' ) + #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) + #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) + return GraphSyrControl + + +GraphSyrControl = DefGraphSyrControl() diff --git a/examples/GraphSyrControl.xml b/examples/GraphSyrControl.xml index 1d1c489..7736162 100644 --- a/examples/GraphSyrControl.xml +++ b/examples/GraphSyrControl.xml @@ -1,694 +1,692 @@ - + + ? - ? - GraphSyrControl - 1 - ? - + ? + GraphSyrControl + 1 + ? + GraphSyrControl - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - EndSwitch_OneEven\Finished - + test__Incr + long - EndSwitch_OneEven\K - - - 11/3/2003 - 18:34:21 - 19/9/2003 - 15:2:2 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + EndSwitch_OneEven__Finished + +long + EndSwitch_OneEven__K + + + 11/3/2003 - 18:34:21 + 20/1/2005 - 13:5:41 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 190 - 338 - + BoolEven + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 196 - 131 - + BoolOne + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 788 - 22 - + anEvenInteger + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 788 + 22 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 794 - 427 - + anInteger + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 794 + 427 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 790 - 158 - + aNewCount + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 158 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - Python function - 7 - 216 - + + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Python function + 7 + 216 + ? - ? - label_test - 3 - ? - + ? + label_test + 3 + ? + label_test - + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - + KT + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - - + KT + + label_test - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - Python function - 385 - 159 - + + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Python function + 385 + 159 + ? - ? - test - 6 - EndSwitch_OneEven - + ? + test + 6 + EndSwitch_OneEven + test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + Switch_OneEven - - - - - - - - - - - - - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 592 - 205 - + + + + + + + + + + + + + + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Compute Node + 592 + 205 + ? - ? - EndSwitch_OneEven - 7 - test - + ? + EndSwitch_OneEven + 7 + test + EndSwitch_OneEven - + long - Finished - + Finished + long - K - + K + long - Finished - + Finished + long - K - - + K + + EndSwitch_OneEven - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1065 - 321 - + + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Compute Node + 1065 + 321 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + control_m3p1 - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1012 - 68 - + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Compute Node + 1012 + 68 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1010 - 473 - + + + 20/1/2005 - 13:5:14 + 20/1/2005 - 13:5:14 + 1.04 + ? + ? + Compute Node + 1010 + 473 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 380 - 236 - + 236 + 379 - 419 - + 419 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 367 - 269 - + 269 + 367 - 213 - + 213 + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 978 - 132 - + 132 + 978 - 239 - + 239 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 979 - 536 - + 536 + 978 - 240 - + 240 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 184 - 416 - + 416 + 185 - 298 - + 298 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 186 - 211 - + 211 + 185 - 297 - + 297 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - ValEven - test - ValEven - - + ValEven + test + ValEven + + label_test - ValOne - test - ValOne - - + ValOne + test + ValOne + + label_test - NT - test - NT - - + NT + test + NT + + label_test - KT - test - KT - - -test - Finished - EndSwitch_OneEven - Finished - - + KT + test + KT + + test - Incr - incr - InGate - - + Finished + EndSwitch_OneEven + Finished + + test - Even - div2 - InGate - + Even + div2 + Gate + 764 - 536 - + 536 + 763 - 297 - + 297 + test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 773 - 133 - + 133 + 773 - 326 - + 326 + test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 753 - 102 - + 102 + 752 - 355 - + 355 + test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 753 - 508 - + 508 + 752 - 356 - + 356 + test - K - EndSwitch_OneEven - K - - + K + EndSwitch_OneEven + K + + test - K - incr - aCount - + K + incr + aCount + 779 - 239 - + 239 + 780 - 385 - + 385 + test - Default - EndSwitch_OneEven - Default - - + Default + EndSwitch_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 373 - 354 - + 354 + 372 - 10 - + 10 + 1180 - 9 - + 9 + 1181 - 217 - + 217 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 5 - 355 - + 355 + 4 - 608 - + 608 + 1177 - 608 - + 608 + 1177 - 563 - + 563 + GraphSyrControl - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControl - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControl1.py b/examples/GraphSyrControl1.py index 254113c..77c385d 100755 --- a/examples/GraphSyrControl1.py +++ b/examples/GraphSyrControl1.py @@ -2,236 +2,245 @@ # Generated python file of Graph GraphSyrControlGUI from SuperV import * -# Graph creation -GraphSyrControl1 = Graph( 'GraphSyrControl1' ) -GraphSyrControl1.SetName( 'GraphSyrControl1' ) -GraphSyrControl1.SetAuthor( 'JR' ) -GraphSyrControl1.SetComment( 'Syracuse algorithm' ) -GraphSyrControl1.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControl1.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( 190 , 338 ) - -test_ISONE = GraphSyrControl1.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( 196 , 131 ) - -m3p1 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 615 , 30 ) - -div2 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 624 , 391 ) - -incr = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 623 , 206 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControl1.INode( 'label_begin' , Pylabel_begin ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 5 , 190 ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -label_test,EndL_OneEven = GraphSyrControl1.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1017 , 247 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.OutPort( 'Finished' , 'long' ) -label_test.OutPort( 'Incr' , 'long' ) -label_test.OutPort( 'Even' , 'long' ) -label_test.OutPort( 'Odd' , 'long' ) -label_test.OutPort( 'N' , 'long' ) -label_test.OutPort( 'K' , 'long' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 399 , 177 ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControl1.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 821 , 28 ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , K ) :' ) -Pycontrol_div2.append( ' return N,K' ) -control_div2 = GraphSyrControl1.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 818 , 358 ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControl1.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 383 , 239 ) -label_testValEven.AddCoord( 2 , 382 , 417 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControl1.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControl1.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) -control_m3p1N.AddCoord( 1 , 793 , 62 ) -control_m3p1N.AddCoord( 2 , 792 , 111 ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControl1.Link( div2anInteger , control_div2.Port( 'N' ) ) -control_div2N.AddCoord( 1 , 797 , 392 ) -control_div2N.AddCoord( 2 , 798 , 471 ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControl1.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 809 , 420 ) -control_div2K.AddCoord( 2 , 808 , 288 ) - -control_m3p1K = GraphSyrControl1.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 807 , 91 ) -control_m3p1K.AddCoord( 2 , 808 , 286 ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControl1.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 180 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 179 , 269 ) - -label_testNT = GraphSyrControl1.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControl1.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 179 , 417 ) -test_ISEVENanInteger.AddCoord( 2 , 179 , 271 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControl1.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControl1.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 565 , 315 ) -incrInGate.AddCoord( 2 , 564 , 240 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControl1.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 583 , 500 ) -div2InGate.AddCoord( 2 , 582 , 269 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControl1.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 571 , 138 ) -m3p1InGate.AddCoord( 2 , 573 , 298 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControl1.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 604 , 110 ) -m3p1anOddInteger.AddCoord( 2 , 605 , 328 ) - -div2anEvenInteger = GraphSyrControl1.Link( label_testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 606 , 471 ) -div2anEvenInteger.AddCoord( 2 , 605 , 328 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControl1.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 594 , 287 ) -incraCount.AddCoord( 2 , 595 , 356 ) - -label_testDefault = label_test.Port( 'Default' ) -EndL_OneEvenDefault = GraphSyrControl1.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) -EndL_OneEvenDefault.AddCoord( 1 , 1008 , 281 ) -EndL_OneEvenDefault.AddCoord( 2 , 1008 , 560 ) -EndL_OneEvenDefault.AddCoord( 3 , 565 , 559 ) -EndL_OneEvenDefault.AddCoord( 4 , 564 , 385 ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControl1.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 368 , 327 ) -label_testInGate.AddCoord( 2 , 369 , 7 ) -label_testInGate.AddCoord( 3 , 1009 , 8 ) -label_testInGate.AddCoord( 4 , 1009 , 179 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControl1.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 3 , 327 ) -label_beginInGate.AddCoord( 2 , 2 , 582 ) -label_beginInGate.AddCoord( 3 , 991 , 583 ) -label_beginInGate.AddCoord( 4 , 991 , 451 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -label_testFinished = label_test.Port( 'Finished' ) - -GraphSyrControl1.Run( 7 ) - -GraphSyrControl1.DoneW() - -print GraphSyrControl1.State() - -GraphSyrControl1.PrintPorts() +# Graph creation of GraphSyrControlGUI +def DefGraphSyrControlGUI() : + GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) + GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) + GraphSyrControlGUI.SetAuthor( 'JR' ) + GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) + GraphSyrControlGUI.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlGUI.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( 190 , 338 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlGUI.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( 196 , 131 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 615 , 30 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 624 , 391 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 623 , 206 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + Pylabel_begin = [] + Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) + Pylabel_begin.append( ' return NB,KB' ) + label_begin = GraphSyrControlGUI.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 5 , 190 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # Creation of Switch Nodes + Pylabel_test = [] + Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) + Pylabel_test.append( ' Finished = ValOne' ) + Pylabel_test.append( ' if Finished == 0 :' ) + Pylabel_test.append( ' Incr = 1' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' if Even == 0 :' ) + Pylabel_test.append( ' Odd = 1' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Incr = 0' ) + Pylabel_test.append( ' Even = 0' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) + label_test,EndL_OneEven = GraphSyrControlGUI.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1017 , 247 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 399 , 177 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlGUI.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 821 , 28 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , K ) :' ) + Pycontrol_div2.append( ' return N,K' ) + control_div2 = GraphSyrControlGUI.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 818 , 358 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlGUI.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 383 , 239 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 382 , 417 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 793 , 62 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 792 , 111 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 797 , 392 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 798 , 471 ) + + LincraNewCountcontrol_div2K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 809 , 420 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 808 , 288 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 807 , 91 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 808 , 286 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 180 , 211 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 179 , 269 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlGUI.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 179 , 417 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 179 , 271 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlGUI.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testEvendiv2Gate = GraphSyrControlGUI.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 583 , 500 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 582 , 269 ) + + Llabel_testOddm3p1Gate = GraphSyrControlGUI.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 571 , 138 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 573 , 298 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlGUI.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 604 , 110 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 605 , 328 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI.Link( Olabel_testN , Idiv2anEvenInteger ) + Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 606 , 471 ) + Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 605 , 328 ) + + Llabel_testKincraCount = GraphSyrControlGUI.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 594 , 287 ) + Llabel_testKincraCount.AddCoord( 2 , 595 , 356 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 1 , 1008 , 281 ) + Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 2 , 1008 , 560 ) + Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 3 , 565 , 559 ) + Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 4 , 564 , 385 ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 368 , 327 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 369 , 7 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1009 , 8 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1009 , 179 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 3 , 327 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 2 , 582 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 991 , 583 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 991 , 451 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + return GraphSyrControlGUI + + +GraphSyrControlGUI = DefGraphSyrControlGUI() diff --git a/examples/GraphSyrControl1.xml b/examples/GraphSyrControl1.xml index aa184bf..cca254f 100755 --- a/examples/GraphSyrControl1.xml +++ b/examples/GraphSyrControl1.xml @@ -1,613 +1,607 @@ - + + ? - ? - GraphSyrControlGUI - 1 - ? - + ? + GraphSyrControlGUI + 1 + ? + GraphSyrControlGUI - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_test\Finished - - - 11/3/2003 - 18:28:48 - 19/9/2003 - 15:3:50 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + label_test__Finished + +long + label_test__Incr + + + 11/3/2003 - 18:28:48 + 20/1/2005 - 13:12:50 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 190 - 338 - + BoolEven + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 196 - 131 - + BoolOne + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 615 - 30 - + anEvenInteger + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 615 + 30 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 624 - 391 - + anInteger + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 623 - 206 - + aNewCount + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 623 + 206 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - Python function - 5 - 190 - + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + ? + Python function + 5 + 190 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + L_OneEven - - - - - - - - - - - - - - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 399 - 177 - + + + + + + + + + + + + + + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + ? + Compute Node + 399 + 177 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - - - - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 1017 - 247 - + + + + + +? + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + ? + Compute Node + 1017 + 247 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + C_NotOneIsEven - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 821 - 28 - + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + ? + Compute Node + 821 + 28 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 818 - 358 - + + + 20/1/2005 - 13:12:30 + 20/1/2005 - 13:12:30 + 1.04 + ? + ? + Compute Node + 818 + 358 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 383 - 239 - + 239 + 382 - 417 - + 417 + test_ISONE - BoolOne - label_test - ValOne - - + BoolOne + label_test + ValOne + + m3p1 - anEvenInteger - control_m3p1 - N - + anEvenInteger + control_m3p1 + N + 793 - 62 - + 62 + 792 - 111 - + 111 + div2 - anInteger - control_div2 - N - + anInteger + control_div2 + N + 797 - 392 - + 392 + 798 - 471 - + 471 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 809 - 420 - + 420 + 808 - 288 - + 288 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 807 - 91 - + 91 + 808 - 286 - + 286 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 180 - 211 - + 211 + 179 - 269 - + 269 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 179 - 417 - + 417 + 179 - 271 - + 271 + label_begin - KT - label_test - KT - - -label_test - Incr - incr - InGate - - -565 - 315 - -564 - 240 - + KT + label_test + KT + + label_test - Even - div2 - InGate - + Even + div2 + Gate + 583 - 500 - + 500 + 582 - 269 - + 269 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 571 - 138 - + 138 + 573 - 298 - + 298 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 604 - 110 - + 110 + 605 - 328 - + 328 + label_test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 606 - 471 - + 471 + 605 - 328 - + 328 + label_test - K - incr - aCount - + K + incr + aCount + 594 - 287 - + 287 + 595 - 356 - + 356 + label_test - Default - EndL_OneEven - Default - + Default + EndL_OneEven + Default + 1008 - 281 - + 281 + 1008 - 560 - + 560 + 565 - 559 - + 559 + 564 - 385 - + 385 + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 368 - 327 - + 327 + 369 - 7 - + 7 + 1009 - 8 - + 8 + 1009 - 179 - + 179 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 3 - 327 - + 327 + 2 - 582 - + 582 + 991 - 583 - + 583 + 991 - 451 - + 451 + GraphSyrControlGUI - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControlGUI - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControlAve.py b/examples/GraphSyrControlAve.py index b039fbf..e32ea72 100644 --- a/examples/GraphSyrControlAve.py +++ b/examples/GraphSyrControlAve.py @@ -2,390 +2,410 @@ # Generated python file of Graph GraphSyrControlAve from SuperV import * -# Graph creation -GraphSyrControlAve = Graph( 'GraphSyrControlAve' ) -GraphSyrControlAve.SetName( 'GraphSyrControlAve' ) -GraphSyrControlAve.SetAuthor( 'JR' ) -GraphSyrControlAve.SetComment( 'Syracuse algorithm' ) -GraphSyrControlAve.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlAve.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( 370 , 455 ) - -test_ISONE = GraphSyrControlAve.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( 370 , 127 ) - -m3p1 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 789 , 0 ) - -div2 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 789 , 276 ) - -incr = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 790 , 136 ) - -C_MIN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MIN' ) -C_MIN.SetName( 'C_MIN' ) -C_MIN.SetAuthor( '' ) -C_MIN.SetContainer( 'localhost/FactoryServer' ) -C_MIN.SetComment( 'C_MIN from SyrComponent' ) -C_MIN.Coords( 798 , 833 ) - -C_MAX = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MAX' ) -C_MAX.SetName( 'C_MAX' ) -C_MAX.SetAuthor( '' ) -C_MAX.SetContainer( 'localhost/FactoryServer' ) -C_MAX.SetComment( 'C_MAX from SyrComponent' ) -C_MAX.Coords( 798 , 668 ) - -C_AVERAGE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_AVERAGE' ) -C_AVERAGE.SetName( 'C_AVERAGE' ) -C_AVERAGE.SetAuthor( '' ) -C_AVERAGE.SetContainer( 'localhost/FactoryServer' ) -C_AVERAGE.SetComment( 'C_AVERAGE from SyrComponent' ) -C_AVERAGE.Coords( 784 , 476 ) - -C_LISTOFSYR = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_LISTOFSYR' ) -C_LISTOFSYR.SetName( 'C_LISTOFSYR' ) -C_LISTOFSYR.SetAuthor( '' ) -C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) -C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) -C_LISTOFSYR.Coords( 4 , 363 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB , MINB , MAXB , AVERAGEB , SYRLISTB ) :' ) -Pylabel_begin.append( ' return NB,KB,MINB,MAXB,AVERAGEB,SYRLISTB' ) -label_begin = GraphSyrControlAve.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 183 , 219 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.InPort( 'MINB' , 'long' ) -label_begin.InPort( 'MAXB' , 'long' ) -label_begin.InPort( 'AVERAGEB' , 'double' ) -label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.OutPort( 'MIN' , 'long' ) -label_begin.OutPort( 'MAX' , 'long' ) -label_begin.OutPort( 'AVERAGE' , 'double' ) -label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT , MIN , MAX , AVERAGE , SYRLIST ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT,MIN,MAX,AVERAGE,SYRLIST' ) -label_test,EndL_OneEven = GraphSyrControlAve.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1064 , 379 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -EndL_OneEven.InPort( 'MIN' , 'long' ) -EndL_OneEven.InPort( 'MAX' , 'long' ) -EndL_OneEven.InPort( 'AVERAGE' , 'double' ) -EndL_OneEven.OutPort( 'MIN' , 'long' ) -EndL_OneEven.OutPort( 'MAX' , 'long' ) -EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 563 , 206 ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.InPort( 'MIN' , 'long' ) -label_test.InPort( 'MAX' , 'long' ) -label_test.InPort( 'AVERAGE' , 'double' ) -label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) -label_test.OutPort( 'Finished' , 'long' ) -label_test.OutPort( 'Incr' , 'long' ) -label_test.OutPort( 'Even' , 'long' ) -label_test.OutPort( 'Odd' , 'long' ) -label_test.OutPort( 'N' , 'long' ) -label_test.OutPort( 'K' , 'long' ) -label_test.OutPort( 'MINT' , 'long' ) -label_test.OutPort( 'MAXT' , 'long' ) -label_test.OutPort( 'AVERAGET' , 'double' ) -label_test.OutPort( 'SYRLISTT' , 'ListOfSyr' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K , MINT , MAXT , AVERAGET , SYRLISTT ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) -control_m3p1 = GraphSyrControlAve.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1058 , 8 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.InPort( 'MINT' , 'long' ) -control_m3p1.InPort( 'MAXT' , 'long' ) -control_m3p1.InPort( 'AVERAGET' , 'double' ) -control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.OutPort( 'MIN' , 'long' ) -control_m3p1.OutPort( 'MAX' , 'long' ) -control_m3p1.OutPort( 'AVERAGE' , 'double' ) -control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , K , MINT , MAXT , AVERAGET , SYRLISTT ) :' ) -Pycontrol_div2.append( ' return N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) -control_div2 = GraphSyrControlAve.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1048 , 555 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.InPort( 'MINT' , 'long' ) -control_div2.InPort( 'MAXT' , 'long' ) -control_div2.InPort( 'AVERAGET' , 'double' ) -control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.OutPort( 'MINB' , 'long' ) -control_div2.OutPort( 'MAXB' , 'long' ) -control_div2.OutPort( 'AVERAGEB' , 'double' ) -control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlAve.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 545 , 269 ) -label_testValEven.AddCoord( 2 , 545 , 535 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlAve.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 546 , 241 ) -label_testValOne.AddCoord( 2 , 545 , 208 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlAve.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) -control_m3p1N.AddCoord( 1 , 977 , 43 ) -control_m3p1N.AddCoord( 2 , 976 , 81 ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlAve.Link( div2anInteger , control_div2.Port( 'N' ) ) -control_div2N.AddCoord( 1 , 1011 , 590 ) -control_div2N.AddCoord( 2 , 1010 , 357 ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControlAve.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 964 , 618 ) -control_div2K.AddCoord( 2 , 966 , 217 ) - -control_m3p1K = GraphSyrControlAve.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 966 , 70 ) -control_m3p1K.AddCoord( 2 , 966 , 216 ) - -C_AVERAGEaCount = GraphSyrControlAve.Link( incraNewCount , C_AVERAGE.Port( 'aCount' ) ) -C_AVERAGEaCount.AddCoord( 1 , 778 , 615 ) -C_AVERAGEaCount.AddCoord( 2 , 779 , 462 ) -C_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) -C_AVERAGEaCount.AddCoord( 4 , 966 , 216 ) - -C_MINaNewMinVal = C_MIN.Port( 'aNewMinVal' ) -control_m3p1MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_m3p1.Port( 'MINT' ) ) -control_m3p1MINT.AddCoord( 1 , 991 , 100 ) -control_m3p1MINT.AddCoord( 2 , 991 , 913 ) - -control_div2MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_div2.Port( 'MINT' ) ) -control_div2MINT.AddCoord( 1 , 990 , 646 ) -control_div2MINT.AddCoord( 2 , 991 , 912 ) - -C_MAXaNewMaxVal = C_MAX.Port( 'aNewMaxVal' ) -control_m3p1MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_m3p1.Port( 'MAXT' ) ) -control_m3p1MAXT.AddCoord( 1 , 974 , 130 ) -control_m3p1MAXT.AddCoord( 2 , 974 , 747 ) - -control_div2MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_div2.Port( 'MAXT' ) ) -control_div2MAXT.AddCoord( 1 , 973 , 676 ) -control_div2MAXT.AddCoord( 2 , 974 , 747 ) - -C_AVERAGEaNewListOfSyr = C_AVERAGE.Port( 'aNewListOfSyr' ) -control_m3p1SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_m3p1.Port( 'SYRLISTT' ) ) -control_m3p1SYRLISTT.AddCoord( 1 , 1037 , 188 ) -control_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) - -control_div2SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_div2.Port( 'SYRLISTT' ) ) -control_div2SYRLISTT.AddCoord( 1 , 1038 , 735 ) -control_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) - -C_AVERAGEanAverage = C_AVERAGE.Port( 'anAverage' ) -control_m3p1AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_m3p1.Port( 'AVERAGET' ) ) -control_m3p1AVERAGET.AddCoord( 1 , 1027 , 158 ) -control_m3p1AVERAGET.AddCoord( 2 , 1026 , 584 ) - -control_div2AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_div2.Port( 'AVERAGET' ) ) -control_div2AVERAGET.AddCoord( 1 , 1027 , 706 ) -control_div2AVERAGET.AddCoord( 2 , 1027 , 584 ) - -C_LISTOFSYRaListOfSyr = C_LISTOFSYR.Port( 'aListOfSyr' ) -label_beginSYRLISTB = GraphSyrControlAve.Link( C_LISTOFSYRaListOfSyr , label_begin.Port( 'SYRLISTB' ) ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 362 , 207 ) -test_ISONEanInteger.AddCoord( 2 , 362 , 299 ) - -label_testNT = GraphSyrControlAve.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 361 , 534 ) -test_ISEVENanInteger.AddCoord( 2 , 362 , 299 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlAve.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_beginMIN = label_begin.Port( 'MIN' ) -label_testMIN = GraphSyrControlAve.Link( label_beginMIN , label_test.Port( 'MIN' ) ) - -label_beginMAX = label_begin.Port( 'MAX' ) -label_testMAX = GraphSyrControlAve.Link( label_beginMAX , label_test.Port( 'MAX' ) ) - -label_beginAVERAGE = label_begin.Port( 'AVERAGE' ) -label_testAVERAGE = GraphSyrControlAve.Link( label_beginAVERAGE , label_test.Port( 'AVERAGE' ) ) - -label_beginSYRLIST = label_begin.Port( 'SYRLIST' ) -label_testSYRLIST = GraphSyrControlAve.Link( label_beginSYRLIST , label_test.Port( 'SYRLIST' ) ) - -label_testFinished = label_test.Port( 'Finished' ) -EndL_OneEvenDefault = GraphSyrControlAve.Link( label_testFinished , EndL_OneEven.Port( 'Default' ) ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControlAve.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 779 , 250 ) -incrInGate.AddCoord( 2 , 780 , 269 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControlAve.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 780 , 387 ) -div2InGate.AddCoord( 2 , 779 , 299 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlAve.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 756 , 115 ) -m3p1InGate.AddCoord( 2 , 756 , 328 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlAve.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 740 , 80 ) -m3p1anOddInteger.AddCoord( 2 , 741 , 356 ) - -div2anEvenInteger = GraphSyrControlAve.Link( label_testN , div2.Port( 'anEvenInteger' ) ) - -C_MINanInteger = GraphSyrControlAve.Link( label_testN , C_MIN.Port( 'anInteger' ) ) -C_MINanInteger.AddCoord( 1 , 741 , 943 ) -C_MINanInteger.AddCoord( 2 , 740 , 357 ) - -C_MAXanInteger = GraphSyrControlAve.Link( label_testN , C_MAX.Port( 'anInteger' ) ) -C_MAXanInteger.AddCoord( 1 , 742 , 778 ) -C_MAXanInteger.AddCoord( 2 , 741 , 359 ) - -C_AVERAGEanInteger = GraphSyrControlAve.Link( label_testN , C_AVERAGE.Port( 'anInteger' ) ) -C_AVERAGEanInteger.AddCoord( 1 , 742 , 584 ) -C_AVERAGEanInteger.AddCoord( 2 , 741 , 357 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControlAve.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 765 , 217 ) -incraCount.AddCoord( 2 , 764 , 385 ) - -label_testMINT = label_test.Port( 'MINT' ) -C_MINaMinVal = GraphSyrControlAve.Link( label_testMINT , C_MIN.Port( 'aMinVal' ) ) -C_MINaMinVal.AddCoord( 1 , 759 , 914 ) -C_MINaMinVal.AddCoord( 2 , 758 , 414 ) - -EndL_OneEvenMIN = GraphSyrControlAve.Link( label_testMINT , EndL_OneEven.Port( 'MIN' ) ) - -label_testMAXT = label_test.Port( 'MAXT' ) -C_MAXaMaxVal = GraphSyrControlAve.Link( label_testMAXT , C_MAX.Port( 'aMaxVal' ) ) -C_MAXaMaxVal.AddCoord( 1 , 729 , 749 ) -C_MAXaMaxVal.AddCoord( 2 , 728 , 444 ) - -EndL_OneEvenMAX = GraphSyrControlAve.Link( label_testMAXT , EndL_OneEven.Port( 'MAX' ) ) - -label_testAVERAGET = label_test.Port( 'AVERAGET' ) -EndL_OneEvenAVERAGE = GraphSyrControlAve.Link( label_testAVERAGET , EndL_OneEven.Port( 'AVERAGE' ) ) - -label_testSYRLISTT = label_test.Port( 'SYRLISTT' ) -C_AVERAGEaListOfSyr = GraphSyrControlAve.Link( label_testSYRLISTT , C_AVERAGE.Port( 'aListOfSyr' ) ) -C_AVERAGEaListOfSyr.AddCoord( 1 , 771 , 557 ) -C_AVERAGEaListOfSyr.AddCoord( 2 , 770 , 502 ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlAve.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 553 , 536 ) -label_testInGate.AddCoord( 2 , 554 , 1025 ) -label_testInGate.AddCoord( 3 , 1242 , 1026 ) -label_testInGate.AddCoord( 4 , 1243 , 279 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlAve.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 176 , 476 ) -label_beginInGate.AddCoord( 2 , 176 , 997 ) -label_beginInGate.AddCoord( 3 , 1217 , 996 ) -label_beginInGate.AddCoord( 4 , 1218 , 768 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 31) -label_beginKB = label_begin.Input( 'KB' , 0) -label_beginMINB = label_begin.Input( 'MINB' , 0) -label_beginMAXB = label_begin.Input( 'MAXB' , 0) -label_beginAVERAGEB = label_begin.Input( 'AVERAGEB' , 0) - -# Creation of Output variables -EndL_OneEvenMIN = EndL_OneEven.Port( 'MIN' ) -EndL_OneEvenMAX = EndL_OneEven.Port( 'MAX' ) -EndL_OneEvenAVERAGE = EndL_OneEven.Port( 'AVERAGE' ) - -GraphSyrControlAve.Run() -GraphSyrControlAve.DoneW() -print GraphSyrControlAve.State() -GraphSyrControlAve.PrintPorts() +# Graph creation of GraphSyrControlAve +def DefGraphSyrControlAve() : + GraphSyrControlAve = Graph( 'GraphSyrControlAve' ) + GraphSyrControlAve.SetName( 'GraphSyrControlAve' ) + GraphSyrControlAve.SetAuthor( 'JR' ) + GraphSyrControlAve.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAve.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAve.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( 370 , 455 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAve.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( 370 , 127 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 789 , 0 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 789 , 276 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 136 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + C_MIN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MIN' ) + C_MIN.SetName( 'C_MIN' ) + C_MIN.SetAuthor( '' ) + C_MIN.SetContainer( 'localhost/FactoryServer' ) + C_MIN.SetComment( 'C_MIN from SyrComponent' ) + C_MIN.Coords( 798 , 833 ) + IC_MINaMinVal = C_MIN.GetInPort( 'aMinVal' ) + IC_MINanInteger = C_MIN.GetInPort( 'anInteger' ) + IC_MINGate = C_MIN.GetInPort( 'Gate' ) + OC_MINaNewMinVal = C_MIN.GetOutPort( 'aNewMinVal' ) + OC_MINGate = C_MIN.GetOutPort( 'Gate' ) + + C_MAX = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MAX' ) + C_MAX.SetName( 'C_MAX' ) + C_MAX.SetAuthor( '' ) + C_MAX.SetContainer( 'localhost/FactoryServer' ) + C_MAX.SetComment( 'C_MAX from SyrComponent' ) + C_MAX.Coords( 798 , 668 ) + IC_MAXaMaxVal = C_MAX.GetInPort( 'aMaxVal' ) + IC_MAXanInteger = C_MAX.GetInPort( 'anInteger' ) + IC_MAXGate = C_MAX.GetInPort( 'Gate' ) + OC_MAXaNewMaxVal = C_MAX.GetOutPort( 'aNewMaxVal' ) + OC_MAXGate = C_MAX.GetOutPort( 'Gate' ) + + C_AVERAGE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_AVERAGE' ) + C_AVERAGE.SetName( 'C_AVERAGE' ) + C_AVERAGE.SetAuthor( '' ) + C_AVERAGE.SetContainer( 'localhost/FactoryServer' ) + C_AVERAGE.SetComment( 'C_AVERAGE from SyrComponent' ) + C_AVERAGE.Coords( 784 , 476 ) + IC_AVERAGEaListOfSyr = C_AVERAGE.GetInPort( 'aListOfSyr' ) + IC_AVERAGEanInteger = C_AVERAGE.GetInPort( 'anInteger' ) + IC_AVERAGEaCount = C_AVERAGE.GetInPort( 'aCount' ) + IC_AVERAGEGate = C_AVERAGE.GetInPort( 'Gate' ) + OC_AVERAGEaNewListOfSyr = C_AVERAGE.GetOutPort( 'aNewListOfSyr' ) + OC_AVERAGEanAverage = C_AVERAGE.GetOutPort( 'anAverage' ) + OC_AVERAGEGate = C_AVERAGE.GetOutPort( 'Gate' ) + + C_LISTOFSYR = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_LISTOFSYR' ) + C_LISTOFSYR.SetName( 'C_LISTOFSYR' ) + C_LISTOFSYR.SetAuthor( '' ) + C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) + C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) + C_LISTOFSYR.Coords( 4 , 363 ) + IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) + OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) + OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + Pylabel_begin = [] + Pylabel_begin.append( 'def label_begin( NB , KB , MINB , MAXB , AVERAGEB , SYRLISTB ) :' ) + Pylabel_begin.append( ' return NB,KB,MINB,MAXB,AVERAGEB,SYRLISTB' ) + label_begin = GraphSyrControlAve.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 183 , 219 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) + Ilabel_beginMAXB = label_begin.InPort( 'MAXB' , 'long' ) + Ilabel_beginAVERAGEB = label_begin.InPort( 'AVERAGEB' , 'double' ) + Ilabel_beginSYRLISTB = label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginMIN = label_begin.OutPort( 'MIN' , 'long' ) + Olabel_beginMAX = label_begin.OutPort( 'MAX' , 'long' ) + Olabel_beginAVERAGE = label_begin.OutPort( 'AVERAGE' , 'double' ) + Olabel_beginSYRLIST = label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # Creation of Switch Nodes + Pylabel_test = [] + Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT , MIN , MAX , AVERAGE , SYRLIST ):' ) + Pylabel_test.append( ' Finished = ValOne' ) + Pylabel_test.append( ' if Finished == 0 :' ) + Pylabel_test.append( ' Incr = 1' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' if Even == 0 :' ) + Pylabel_test.append( ' Odd = 1' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Incr = 0' ) + Pylabel_test.append( ' Even = 0' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT,MIN,MAX,AVERAGE,SYRLIST' ) + label_test,EndL_OneEven = GraphSyrControlAve.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1064 , 379 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenMIN = EndL_OneEven.InPort( 'MIN' , 'long' ) + IEndL_OneEvenMAX = EndL_OneEven.InPort( 'MAX' , 'long' ) + IEndL_OneEvenAVERAGE = EndL_OneEven.InPort( 'AVERAGE' , 'double' ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) + OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) + OEndL_OneEvenAVERAGE = EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 563 , 206 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testMIN = label_test.InPort( 'MIN' , 'long' ) + Ilabel_testMAX = label_test.InPort( 'MAX' , 'long' ) + Ilabel_testAVERAGE = label_test.InPort( 'AVERAGE' , 'double' ) + Ilabel_testSYRLIST = label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testMINT = label_test.OutPort( 'MINT' , 'long' ) + Olabel_testMAXT = label_test.OutPort( 'MAXT' , 'long' ) + Olabel_testAVERAGET = label_test.OutPort( 'AVERAGET' , 'double' ) + Olabel_testSYRLISTT = label_test.OutPort( 'SYRLISTT' , 'ListOfSyr' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K , MINT , MAXT , AVERAGET , SYRLISTT ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) + control_m3p1 = GraphSyrControlAve.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1058 , 8 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1MINT = control_m3p1.InPort( 'MINT' , 'long' ) + Icontrol_m3p1MAXT = control_m3p1.InPort( 'MAXT' , 'long' ) + Icontrol_m3p1AVERAGET = control_m3p1.InPort( 'AVERAGET' , 'double' ) + Icontrol_m3p1SYRLISTT = control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1MIN = control_m3p1.OutPort( 'MIN' , 'long' ) + Ocontrol_m3p1MAX = control_m3p1.OutPort( 'MAX' , 'long' ) + Ocontrol_m3p1AVERAGE = control_m3p1.OutPort( 'AVERAGE' , 'double' ) + Ocontrol_m3p1SYRLIST = control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , K , MINT , MAXT , AVERAGET , SYRLISTT ) :' ) + Pycontrol_div2.append( ' return N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) + control_div2 = GraphSyrControlAve.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1048 , 555 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2MINT = control_div2.InPort( 'MINT' , 'long' ) + Icontrol_div2MAXT = control_div2.InPort( 'MAXT' , 'long' ) + Icontrol_div2AVERAGET = control_div2.InPort( 'AVERAGET' , 'double' ) + Icontrol_div2SYRLISTT = control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2MINB = control_div2.OutPort( 'MINB' , 'long' ) + Ocontrol_div2MAXB = control_div2.OutPort( 'MAXB' , 'long' ) + Ocontrol_div2AVERAGEB = control_div2.OutPort( 'AVERAGEB' , 'double' ) + Ocontrol_div2SYRLISTB = control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAve.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 545 , 269 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 545 , 535 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAve.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 241 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 545 , 208 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAve.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 977 , 43 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAve.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1011 , 590 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1010 , 357 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 964 , 618 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 966 , 217 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 966 , 70 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 216 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAve.Link( OincraNewCount , IC_AVERAGEaCount ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 778 , 615 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 779 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 966 , 216 ) + + LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAve.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 100 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 913 ) + + LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAve.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 990 , 646 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 912 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAve.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 974 , 130 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 747 ) + + LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAve.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 973 , 676 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 747 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAve.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 188 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) + + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAve.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 735 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAve.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1027 , 158 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1026 , 584 ) + + LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAve.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 706 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1027 , 584 ) + + LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAve.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAve.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 362 , 207 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 362 , 299 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAve.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAve.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 361 , 534 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 362 , 299 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAve.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAve.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAve.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAve.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAve.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testFinishedEndL_OneEvenDefault = GraphSyrControlAve.Link( Olabel_testFinished , IEndL_OneEvenDefault ) + + Llabel_testEvendiv2Gate = GraphSyrControlAve.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 780 , 387 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 779 , 299 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAve.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 756 , 115 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 756 , 328 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAve.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 740 , 80 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 356 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlAve.Link( Olabel_testN , Idiv2anEvenInteger ) + + Llabel_testNC_MINanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_MINanInteger ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 741 , 943 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 740 , 357 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_MAXanInteger ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 778 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 741 , 359 ) + + Llabel_testNC_AVERAGEanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_AVERAGEanInteger ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 742 , 584 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 741 , 357 ) + + Llabel_testKincraCount = GraphSyrControlAve.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 765 , 217 ) + Llabel_testKincraCount.AddCoord( 2 , 764 , 385 ) + + Llabel_testMINTC_MINaMinVal = GraphSyrControlAve.Link( Olabel_testMINT , IC_MINaMinVal ) + Llabel_testMINTC_MINaMinVal.AddCoord( 1 , 759 , 914 ) + Llabel_testMINTC_MINaMinVal.AddCoord( 2 , 758 , 414 ) + + Llabel_testMINTEndL_OneEvenMIN = GraphSyrControlAve.Link( Olabel_testMINT , IEndL_OneEvenMIN ) + + Llabel_testMAXTC_MAXaMaxVal = GraphSyrControlAve.Link( Olabel_testMAXT , IC_MAXaMaxVal ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 1 , 729 , 749 ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 2 , 728 , 444 ) + + Llabel_testMAXTEndL_OneEvenMAX = GraphSyrControlAve.Link( Olabel_testMAXT , IEndL_OneEvenMAX ) + + Llabel_testAVERAGETEndL_OneEvenAVERAGE = GraphSyrControlAve.Link( Olabel_testAVERAGET , IEndL_OneEvenAVERAGE ) + + Llabel_testSYRLISTTC_AVERAGEaListOfSyr = GraphSyrControlAve.Link( Olabel_testSYRLISTT , IC_AVERAGEaListOfSyr ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 1 , 771 , 557 ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 2 , 770 , 502 ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAve.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 536 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1243 , 279 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAve.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 476 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1218 , 768 ) + + # Input datas + Ilabel_beginNB.Input( 31 ) + Ilabel_beginKB.Input( 0 ) + Ilabel_beginMINB.Input( 0 ) + Ilabel_beginMAXB.Input( 0 ) + Ilabel_beginAVERAGEB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) + #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) + #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) + return GraphSyrControlAve + + +GraphSyrControlAve = DefGraphSyrControlAve() diff --git a/examples/GraphSyrControlAve.xml b/examples/GraphSyrControlAve.xml index e94ce93..a9c6b0d 100644 --- a/examples/GraphSyrControlAve.xml +++ b/examples/GraphSyrControlAve.xml @@ -1,1107 +1,1101 @@ - + + ? - ? - GraphSyrControlAve - 1 - ? - + ? + GraphSyrControlAve + 1 + ? + GraphSyrControlAve - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_begin\MINB - + label_begin__MINB + long - label_begin\MAXB - + label_begin__MAXB + double - label_begin\AVERAGEB - + label_begin__AVERAGEB + long - EndL_OneEven\MIN - + label_test__Incr + long - EndL_OneEven\MAX - + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + double - EndL_OneEven\AVERAGE - - - 2/10/2003 - 11:17:14 - 2/10/2003 - 11:36:18 - 1.05 - JR - ? - Syracuse algorithm - 0 - 0 - + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 19/1/2005 - 17:52:49 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 370 - 455 - + BoolEven + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 370 - 127 - + BoolOne + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 789 - 0 - + anEvenInteger + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 789 - 276 - + anInteger + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 276 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 790 - 136 - + aNewCount + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + SyrComponent - SyrComponent - C_MIN - 0 - ? - + SyrComponent + C_MIN + 0 + ? + C_MIN - + long - aMinVal - + aMinVal + long - anInteger - + anInteger + long - aNewMinVal - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_MIN from SyrComponent - 798 - 833 - + aNewMinVal + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + SyrComponent - SyrComponent - C_MAX - 0 - ? - + SyrComponent + C_MAX + 0 + ? + C_MAX - + long - aMaxVal - + aMaxVal + long - anInteger - + anInteger + long - aNewMaxVal - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_MAX from SyrComponent - 798 - 668 - + aNewMaxVal + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + SyrComponent - SyrComponent - C_AVERAGE - 0 - ? - + SyrComponent + C_AVERAGE + 0 + ? + C_AVERAGE - + ListOfSyr - aListOfSyr - + aListOfSyr + long - anInteger - + anInteger + long - aCount - + aCount + ListOfSyr - aNewListOfSyr - + aNewListOfSyr + double - anAverage - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_AVERAGE from SyrComponent - 784 - 476 - + anAverage + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + SyrComponent - SyrComponent - C_LISTOFSYR - 0 - ? - + SyrComponent + C_LISTOFSYR + 0 + ? + C_LISTOFSYR - - + + ListOfSyr - aListOfSyr - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_LISTOFSYR from SyrComponent - 4 - 363 - + aListOfSyr + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 4 + 363 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - MINB - + MINB + long - MAXB - + MAXB + double - AVERAGEB - + AVERAGEB + ListOfSyr - SYRLISTB - + SYRLISTB + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - - + SYRLIST + + label_begin - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - Python function - 183 - 219 - + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + ? + Python function + 183 + 219 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - + SYRLIST + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - - + SYRLISTT + + L_OneEven - - - - - - - - - - - - - - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 563 - 206 - + + + + + + + + + + + + + + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + ? + Compute Node + 563 + 206 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1064 - 379 - + AVERAGE + + + +? + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + ? + Compute Node + 1064 + 379 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - + SYRLISTT + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - - + SYRLIST + + C_NotOneIsEven - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1058 - 8 - + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + ? + Compute Node + 1058 + 8 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - + SYRLISTT + long - NB - + NB + long - KB - + KB + long - MINB - + MINB + long - MAXB - + MAXB + double - AVERAGEB - + AVERAGEB + ListOfSyr - SYRLISTB - - + SYRLISTB + + control_div2 - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1048 - 555 - + + + 19/1/2005 - 17:44:31 + 19/1/2005 - 17:44:31 + 1.05 + ? + ? + Compute Node + 1048 + 555 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 545 - 269 - + 269 + 545 - 535 - + 535 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 546 - 241 - + 241 + 545 - 208 - + 208 + m3p1 - anEvenInteger - control_m3p1 - N - + anEvenInteger + control_m3p1 + N + 977 - 43 - + 43 + 976 - 81 - + 81 + div2 - anInteger - control_div2 - N - + anInteger + control_div2 + N + 1011 - 590 - + 590 + 1010 - 357 - + 357 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 964 - 618 - + 618 + 966 - 217 - + 217 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 966 - 70 - + 70 + 966 - 216 - + 216 + incr - aNewCount - C_AVERAGE - aCount - + aNewCount + C_AVERAGE + aCount + 778 - 615 - + 615 + 779 - 462 - + 462 + 965 - 462 - + 462 + 966 - 216 - + 216 + C_MIN - aNewMinVal - control_m3p1 - MINT - + aNewMinVal + control_m3p1 + MINT + 991 - 100 - + 100 + 991 - 913 - + 913 + C_MIN - aNewMinVal - control_div2 - MINT - + aNewMinVal + control_div2 + MINT + 990 - 646 - + 646 + 991 - 912 - + 912 + C_MAX - aNewMaxVal - control_m3p1 - MAXT - + aNewMaxVal + control_m3p1 + MAXT + 974 - 130 - + 130 + 974 - 747 - + 747 + C_MAX - aNewMaxVal - control_div2 - MAXT - + aNewMaxVal + control_div2 + MAXT + 973 - 676 - + 676 + 974 - 747 - + 747 + C_AVERAGE - aNewListOfSyr - control_m3p1 - SYRLISTT - + aNewListOfSyr + control_m3p1 + SYRLISTT + 1037 - 188 - + 188 + 1038 - 556 - + 556 + C_AVERAGE - aNewListOfSyr - control_div2 - SYRLISTT - + aNewListOfSyr + control_div2 + SYRLISTT + 1038 - 735 - + 735 + 1038 - 555 - + 555 + C_AVERAGE - anAverage - control_m3p1 - AVERAGET - + anAverage + control_m3p1 + AVERAGET + 1027 - 158 - + 158 + 1026 - 584 - + 584 + C_AVERAGE - anAverage - control_div2 - AVERAGET - + anAverage + control_div2 + AVERAGET + 1027 - 706 - + 706 + 1027 - 584 - + 584 + C_LISTOFSYR - aListOfSyr - label_begin - SYRLISTB - - + aListOfSyr + label_begin + SYRLISTB + + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 362 - 207 - + 207 + 362 - 299 - + 299 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 361 - 534 - + 534 + 362 - 299 - + 299 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_begin - MIN - label_test - MIN - - + MIN + label_test + MIN + + label_begin - MAX - label_test - MAX - - + MAX + label_test + MAX + + label_begin - AVERAGE - label_test - AVERAGE - - + AVERAGE + label_test + AVERAGE + + label_begin - SYRLIST - label_test - SYRLIST - - -label_test - Finished - EndL_OneEven - Default - - + SYRLIST + label_test + SYRLIST + + label_test - Incr - incr - InGate - - -779 - 250 - -780 - 269 - + Finished + EndL_OneEven + Default + + label_test - Even - div2 - InGate - + Even + div2 + Gate + 780 - 387 - + 387 + 779 - 299 - + 299 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 756 - 115 - + 115 + 756 - 328 - + 328 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 740 - 80 - + 80 + 741 - 356 - + 356 + label_test - N - div2 - anEvenInteger - - + N + div2 + anEvenInteger + + label_test - N - C_MIN - anInteger - + N + C_MIN + anInteger + 741 - 943 - + 943 + 740 - 357 - + 357 + label_test - N - C_MAX - anInteger - + N + C_MAX + anInteger + 742 - 778 - + 778 + 741 - 359 - + 359 + label_test - N - C_AVERAGE - anInteger - + N + C_AVERAGE + anInteger + 742 - 584 - + 584 + 741 - 357 - + 357 + label_test - K - incr - aCount - + K + incr + aCount + 765 - 217 - + 217 + 764 - 385 - + 385 + label_test - MINT - C_MIN - aMinVal - + MINT + C_MIN + aMinVal + 759 - 914 - + 914 + 758 - 414 - + 414 + label_test - MINT - EndL_OneEven - MIN - - + MINT + EndL_OneEven + MIN + + label_test - MAXT - C_MAX - aMaxVal - + MAXT + C_MAX + aMaxVal + 729 - 749 - + 749 + 728 - 444 - + 444 + label_test - MAXT - EndL_OneEven - MAX - - + MAXT + EndL_OneEven + MAX + + label_test - AVERAGET - EndL_OneEven - AVERAGE - - + AVERAGET + EndL_OneEven + AVERAGE + + label_test - SYRLISTT - C_AVERAGE - aListOfSyr - + SYRLISTT + C_AVERAGE + aListOfSyr + 771 - 557 - + 557 + 770 - 502 - + 502 + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 553 - 536 - + 536 + 554 - 1025 - + 1025 + 1242 - 1026 - + 1026 + 1243 - 279 - + 279 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 176 - 476 - + 476 + 176 - 997 - + 997 + 1217 - 996 - + 996 + 1218 - 768 - + 768 + GraphSyrControlAve - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 31 - - + 31 + + GraphSyrControlAve - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\MINB - label_begin - MINB - + label_begin__MINB + label_begin + MINB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\MAXB - label_begin - MAXB - + label_begin__MAXB + label_begin + MAXB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\AVERAGEB - label_begin - AVERAGEB - + label_begin__AVERAGEB + label_begin + AVERAGEB + 7 - 0 - + 0 + diff --git a/examples/GraphSyrControlDefault.py b/examples/GraphSyrControlDefault.py index dfafc54..daf2626 100644 --- a/examples/GraphSyrControlDefault.py +++ b/examples/GraphSyrControlDefault.py @@ -2,241 +2,271 @@ # Generated python file of Graph GraphSyrControlDefault from SuperV import * -# Graph creation -GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' ) -GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' ) -GraphSyrControlDefault.SetAuthor( 'JR' ) -GraphSyrControlDefault.SetComment( 'Syracuse algorithm' ) -GraphSyrControlDefault.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlDefault.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( 204 , 444 ) - -test_ISONE = GraphSyrControlDefault.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( 201 , 52 ) - -m3p1 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 806 , 19 ) - -div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 803 , 451 ) - -incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 802 , 170 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ):' ) -Pylabel_begin.append( ' print "label_begin",NB,KB' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 12 , 264 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) - -Pylabel_test = [] -Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) -Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) -Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) -label_test = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( 'Python function' ) -label_test.Coords( 415 , 206 ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) - -# Creation of Switch Nodes -Pytest = [] -Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) -Pytest.append( ' Finished = ValOne' ) -Pytest.append( ' if Finished == 0 :' ) -Pytest.append( ' Incr = 1' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' if Even == 0 :' ) -Pytest.append( ' Odd = 1' ) -Pytest.append( ' else :' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' else :' ) -Pytest.append( ' Incr = 0' ) -Pytest.append( ' Even = 0' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' return Incr,Even,Odd,NT,KT' ) -test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest ) -EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) -EndSwitch_OneEven.SetAuthor( '' ) -EndSwitch_OneEven.SetComment( '' ) -EndSwitch_OneEven.Coords( 1074 , 367 ) -PyEndSwitch_OneEven = [] -EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) -EndSwitch_OneEven.InPort( 'K' , 'long' ) -EndSwitch_OneEven.OutPort( 'K' , 'long' ) -test.SetName( 'test' ) -test.SetAuthor( '' ) -test.SetComment( '' ) -test.Coords( 597 , 251 ) -test.InPort( 'ValOne' , 'long' ) -test.InPort( 'ValEven' , 'long' ) -test.InPort( 'NT' , 'long' ) -test.InPort( 'KT' , 'long' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1002 , 64 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) -Pycontrol_div2.append( ' return N,NB' ) -control_div2 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1013 , 496 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlDefault.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 381 , 286 ) -label_testValEven.AddCoord( 2 , 382 , 524 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlDefault.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 393 , 314 ) -label_testValOne.AddCoord( 2 , 393 , 133 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlDefault.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlDefault.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_m3p1K = GraphSyrControlDefault.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 985 , 128 ) -control_m3p1K.AddCoord( 2 , 985 , 250 ) - -control_div2K = GraphSyrControlDefault.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 987 , 559 ) -control_div2K.AddCoord( 2 , 985 , 250 ) - -label_beginNT = label_begin.Port( 'NT' ) -label_testNT = GraphSyrControlDefault.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 191 , 524 ) -test_ISEVENanInteger.AddCoord( 2 , 192 , 345 ) - -test_ISONEanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 192 , 131 ) -test_ISONEanInteger.AddCoord( 2 , 193 , 345 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlDefault.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testValEven = label_test.Port( 'ValEven' ) -testValEven = GraphSyrControlDefault.Link( label_testValEven , test.Port( 'ValEven' ) ) - -label_testValOne = label_test.Port( 'ValOne' ) -testValOne = GraphSyrControlDefault.Link( label_testValOne , test.Port( 'ValOne' ) ) - -label_testNT = label_test.Port( 'NT' ) -testNT = GraphSyrControlDefault.Link( label_testNT , test.Port( 'NT' ) ) - -label_testKT = label_test.Port( 'KT' ) -testKT = GraphSyrControlDefault.Link( label_testKT , test.Port( 'KT' ) ) - -testIncr = test.Port( 'Incr' ) -incrInGate = GraphSyrControlDefault.Link( testIncr , incr.Port( 'InGate' ) ) - -testEven = test.Port( 'Even' ) -div2InGate = GraphSyrControlDefault.Link( testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 793 , 567 ) -div2InGate.AddCoord( 2 , 792 , 314 ) - -testOdd = test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlDefault.Link( testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 786 , 132 ) -m3p1InGate.AddCoord( 2 , 785 , 343 ) - -testN = test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlDefault.Link( testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 767 , 100 ) -m3p1anOddInteger.AddCoord( 2 , 767 , 371 ) - -div2anEvenInteger = GraphSyrControlDefault.Link( testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 768 , 531 ) -div2anEvenInteger.AddCoord( 2 , 767 , 371 ) - -testK = test.Port( 'K' ) -EndSwitch_OneEvenK = GraphSyrControlDefault.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) - -incraCount = GraphSyrControlDefault.Link( testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 773 , 251 ) -incraCount.AddCoord( 2 , 774 , 400 ) - -testDefault = test.Port( 'Default' ) -EndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlDefault.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 402 , 406 ) -label_testInGate.AddCoord( 2 , 403 , 4 ) -label_testInGate.AddCoord( 3 , 1174 , 5 ) -label_testInGate.AddCoord( 4 , 1175 , 219 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlDefault.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 3 , 409 ) -label_beginInGate.AddCoord( 2 , 2 , 671 ) -label_beginInGate.AddCoord( 3 , 1199 , 670 ) -label_beginInGate.AddCoord( 4 , 1198 , 592 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -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() +# Graph creation of GraphSyrControlDefault +def DefGraphSyrControlDefault() : + GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' ) + GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' ) + GraphSyrControlDefault.SetAuthor( 'JR' ) + GraphSyrControlDefault.SetComment( 'Syracuse algorithm' ) + GraphSyrControlDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlDefault.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( 204 , 444 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlDefault.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( 201 , 52 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 806 , 19 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 803 , 451 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 802 , 170 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + Pylabel_begin = [] + Pylabel_begin.append( 'def label_begin( NB , KB ):' ) + Pylabel_begin.append( ' print "label_begin",NB,KB' ) + Pylabel_begin.append( ' return NB,KB' ) + label_begin = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 12 , 264 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + Pylabel_test = [] + Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) + Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) + Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) + label_test = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Python function' ) + label_test.Coords( 415 , 206 ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' ) + Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' ) + Olabel_testNT = label_test.OutPort( 'NT' , 'long' ) + Olabel_testKT = label_test.OutPort( 'KT' , 'long' ) + Olabel_testGate = label_test.GetOutPort( 'Gate' ) + + # Creation of Switch Nodes + Pytest = [] + Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) + Pytest.append( ' Finished = ValOne' ) + Pytest.append( ' if Finished == 0 :' ) + Pytest.append( ' Incr = 1' ) + Pytest.append( ' Even = ValEven' ) + Pytest.append( ' if Even == 0 :' ) + Pytest.append( ' Odd = 1' ) + Pytest.append( ' else :' ) + Pytest.append( ' Odd = 0' ) + Pytest.append( ' else :' ) + Pytest.append( ' Incr = 0' ) + Pytest.append( ' Even = 0' ) + Pytest.append( ' Odd = 0' ) + Pytest.append( ' Even = ValEven' ) + Pytest.append( ' return Incr,Even,Odd,NT,KT' ) + test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest ) + EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) + EndSwitch_OneEven.SetAuthor( '' ) + EndSwitch_OneEven.SetComment( 'Compute Node' ) + EndSwitch_OneEven.Coords( 1074 , 367 ) + PyEndSwitch_OneEven = [] + EndSwitch_OneEven.SetPyFunction( '' , PyEndSwitch_OneEven ) + IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' ) + IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' ) + OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' ) + OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' ) + test.SetName( 'test' ) + test.SetAuthor( '' ) + test.SetComment( 'Compute Node' ) + test.Coords( 597 , 251 ) + ItestValOne = test.InPort( 'ValOne' , 'long' ) + ItestValEven = test.InPort( 'ValEven' , 'long' ) + ItestNT = test.InPort( 'NT' , 'long' ) + ItestKT = test.InPort( 'KT' , 'long' ) + ItestGate = test.GetInPort( 'Gate' ) + OtestIncr = test.OutPort( 'Incr' , 'long' ) + OtestEven = test.OutPort( 'Even' , 'long' ) + OtestOdd = test.OutPort( 'Odd' , 'long' ) + OtestN = test.OutPort( 'N' , 'long' ) + OtestK = test.OutPort( 'K' , 'long' ) + OtestDefault = test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1002 , 64 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) + Pycontrol_div2.append( ' return N,NB' ) + control_div2 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1013 , 496 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlDefault.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 381 , 286 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 382 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlDefault.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 393 , 314 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 393 , 133 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlDefault.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlDefault.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 985 , 128 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 985 , 250 ) + + LincraNewCountcontrol_div2K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 987 , 559 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 985 , 250 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlDefault.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 524 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 345 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 131 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 193 , 345 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlDefault.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphSyrControlDefault.Link( Olabel_testValEven , ItestValEven ) + + Llabel_testValOnetestValOne = GraphSyrControlDefault.Link( Olabel_testValOne , ItestValOne ) + + Llabel_testNTtestNT = GraphSyrControlDefault.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphSyrControlDefault.Link( Olabel_testKT , ItestKT ) + + LtestEvendiv2Gate = GraphSyrControlDefault.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 793 , 567 ) + LtestEvendiv2Gate.AddCoord( 2 , 792 , 314 ) + + LtestOddm3p1Gate = GraphSyrControlDefault.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 786 , 132 ) + LtestOddm3p1Gate.AddCoord( 2 , 785 , 343 ) + + LtestNm3p1anOddInteger = GraphSyrControlDefault.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 767 , 100 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 767 , 371 ) + + LtestNdiv2anEvenInteger = GraphSyrControlDefault.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 768 , 531 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 767 , 371 ) + + LtestKEndSwitch_OneEvenK = GraphSyrControlDefault.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphSyrControlDefault.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 773 , 251 ) + LtestKincraCount.AddCoord( 2 , 774 , 400 ) + + LtestDefaultEndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlDefault.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 402 , 406 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 403 , 4 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1174 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1175 , 219 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlDefault.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 3 , 409 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 2 , 671 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1199 , 670 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1198 , 592 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #OtestIncr = test.GetOutPort( 'Incr' ) + #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) + return GraphSyrControlDefault + + +GraphSyrControlDefault = DefGraphSyrControlDefault() diff --git a/examples/GraphSyrControlDefault.xml b/examples/GraphSyrControlDefault.xml index 8cf9d4d..639df18 100644 --- a/examples/GraphSyrControlDefault.xml +++ b/examples/GraphSyrControlDefault.xml @@ -1,674 +1,672 @@ - + + ? - ? - GraphSyrControlDefault - 1 - ? - + ? + GraphSyrControlDefault + 1 + ? + GraphSyrControlDefault - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - EndSwitch_OneEven\K - - - 19/3/2003 - 16:49:51 - 18/3/2004 - 13:59:54 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + test__Incr + +long + EndSwitch_OneEven__K + + + 19/3/2003 - 16:49:51 + 20/1/2005 - 13:15:44 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 204 - 444 - + BoolEven + + + 20/1/2005 - 13:15:28 + 20/1/2005 - 13:15:28 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 204 + 444 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 201 - 52 - + BoolOne + + + 20/1/2005 - 13:15:28 + 20/1/2005 - 13:15:28 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 201 + 52 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 806 - 19 - + anEvenInteger + + + 20/1/2005 - 13:15:28 + 20/1/2005 - 13:15:28 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 806 + 19 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 803 - 451 - + anInteger + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 803 + 451 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 802 - 170 - + aNewCount + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 802 + 170 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - Python function - 12 - 264 - + + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Python function + 12 + 264 + ? - ? - label_test - 3 - ? - + ? + label_test + 3 + ? + label_test - + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - + KT + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - - + KT + + label_test - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - Python function - 415 - 206 - + + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Python function + 415 + 206 + ? - ? - test - 6 - EndSwitch_OneEven - + ? + test + 6 + EndSwitch_OneEven + test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + Switch_OneEven - - - - - - - - - - - - - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 597 - 251 - + + + + + + + + + + + + + + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Compute Node + 597 + 251 + ? - ? - EndSwitch_OneEven - 7 - test - + ? + EndSwitch_OneEven + 7 + test + EndSwitch_OneEven - + long - K - + K + long - K - - + K + + ? - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1074 - 367 - + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Compute Node + 1074 + 367 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + control_m3p1 - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1002 - 64 - + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Compute Node + 1002 + 64 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1013 - 496 - + + + 20/1/2005 - 13:15:29 + 20/1/2005 - 13:15:29 + 1.04 + ? + ? + Compute Node + 1013 + 496 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 381 - 286 - + 286 + 382 - 524 - + 524 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 393 - 314 - + 314 + 393 - 133 - + 133 + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 985 - 128 - + 128 + 985 - 250 - + 250 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 987 - 559 - + 559 + 985 - 250 - + 250 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 191 - 524 - + 524 + 192 - 345 - + 345 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 192 - 131 - + 131 + 193 - 345 - + 345 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - ValEven - test - ValEven - - + ValEven + test + ValEven + + label_test - ValOne - test - ValOne - - + ValOne + test + ValOne + + label_test - NT - test - NT - - + NT + test + NT + + label_test - KT - test - KT - - -test - Incr - incr - InGate - - + KT + test + KT + + test - Even - div2 - InGate - + Even + div2 + Gate + 793 - 567 - + 567 + 792 - 314 - + 314 + test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 786 - 132 - + 132 + 785 - 343 - + 343 + test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 767 - 100 - + 100 + 767 - 371 - + 371 + test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 768 - 531 - + 531 + 767 - 371 - + 371 + test - K - EndSwitch_OneEven - K - - + K + EndSwitch_OneEven + K + + test - K - incr - aCount - + K + incr + aCount + 773 - 251 - + 251 + 774 - 400 - + 400 + test - Default - EndSwitch_OneEven - Default - - + Default + EndSwitch_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 402 - 406 - + 406 + 403 - 4 - + 4 + 1174 - 5 - + 5 + 1175 - 219 - + 219 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 3 - 409 - + 409 + 2 - 671 - + 671 + 1199 - 670 - + 670 + 1198 - 592 - + 592 + GraphSyrControlDefault - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControlDefault - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControlGUI.py b/examples/GraphSyrControlGUI.py index c8ce801..fd493c0 100644 --- a/examples/GraphSyrControlGUI.py +++ b/examples/GraphSyrControlGUI.py @@ -1,215 +1,242 @@ -# Generated python file of Graph GraphSyrControlGUI +# Generated python file of Graph GraphSyrControlGUI_2 from SuperV import * -# Graph creation -GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) -GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) -GraphSyrControlGUI.SetAuthor( 'JR' ) -GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) -GraphSyrControlGUI.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlGUI.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( 288 , 337 ) - -test_ISONE = GraphSyrControlGUI.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( 293 , 130 ) - -m3p1 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 761 , 19 ) - -div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 770 , 384 ) - -incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 764 , 179 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControlGUI.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 58 , 189 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -label_test,EndL_OneEven = GraphSyrControlGUI.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1068 , 258 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 516 , 175 ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControlGUI.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 972 , 64 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , K ) :' ) -Pycontrol_div2.append( ' return N,K' ) -control_div2 = GraphSyrControlGUI.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 972 , 430 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlGUI.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 493 , 238 ) -label_testValEven.AddCoord( 2 , 493 , 418 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlGUI.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlGUI.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlGUI.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControlGUI.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 954 , 494 ) -control_div2K.AddCoord( 2 , 954 , 259 ) - -control_m3p1K = GraphSyrControlGUI.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 955 , 128 ) -control_m3p1K.AddCoord( 2 , 954 , 258 ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 275 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 275 , 270 ) - -label_testNT = GraphSyrControlGUI.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 274 , 417 ) -test_ISEVENanInteger.AddCoord( 2 , 275 , 270 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlGUI.Link( label_beginKT , label_test.Port( 'KT' ) ) -label_testKT.AddCoord( 1 , 476 , 294 ) -label_testKT.AddCoord( 2 , 475 , 515 ) -label_testKT.AddCoord( 3 , 260 , 515 ) -label_testKT.AddCoord( 4 , 260 , 298 ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControlGUI.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 712 , 292 ) -incrInGate.AddCoord( 2 , 711 , 238 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControlGUI.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 724 , 498 ) -div2InGate.AddCoord( 2 , 723 , 268 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlGUI.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 698 , 132 ) -m3p1InGate.AddCoord( 2 , 697 , 297 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlGUI.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 748 , 100 ) -m3p1anOddInteger.AddCoord( 2 , 747 , 325 ) - -div2anEvenInteger = GraphSyrControlGUI.Link( label_testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 746 , 463 ) -div2anEvenInteger.AddCoord( 2 , 747 , 327 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControlGUI.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 732 , 260 ) -incraCount.AddCoord( 2 , 732 , 354 ) - -label_testDefault = label_test.Port( 'Default' ) -EndL_OneEvenDefault = GraphSyrControlGUI.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlGUI.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 503 , 388 ) -label_testInGate.AddCoord( 2 , 505 , 5 ) -label_testInGate.AddCoord( 3 , 1149 , 5 ) -label_testInGate.AddCoord( 4 , 1150 , 219 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlGUI.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 34 , 332 ) -label_beginInGate.AddCoord( 2 , 34 , 592 ) -label_beginInGate.AddCoord( 3 , 1145 , 586 ) -label_beginInGate.AddCoord( 4 , 1144 , 527 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -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() +# Graph creation of GraphSyrControlGUI_2 +def DefGraphSyrControlGUI_2() : + GraphSyrControlGUI_2 = Graph( 'GraphSyrControlGUI_2' ) + GraphSyrControlGUI_2.SetName( 'GraphSyrControlGUI_2' ) + GraphSyrControlGUI_2.SetAuthor( 'JR' ) + GraphSyrControlGUI_2.SetComment( 'Syracuse algorithm' ) + GraphSyrControlGUI_2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlGUI_2.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( 288 , 337 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlGUI_2.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( 293 , 130 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 761 , 19 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 770 , 384 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 764 , 179 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + Pylabel_begin = [] + Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) + Pylabel_begin.append( ' return NB,KB' ) + label_begin = GraphSyrControlGUI_2.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 58 , 189 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # Creation of Switch Nodes + Pylabel_test = [] + Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) + Pylabel_test.append( ' Finished = ValOne' ) + Pylabel_test.append( ' if Finished == 0 :' ) + Pylabel_test.append( ' Incr = 1' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' if Even == 0 :' ) + Pylabel_test.append( ' Odd = 1' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Incr = 0' ) + Pylabel_test.append( ' Even = 0' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) + label_test,EndL_OneEven = GraphSyrControlGUI_2.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1068 , 258 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 516 , 175 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlGUI_2.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 972 , 64 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , K ) :' ) + Pycontrol_div2.append( ' return N,K' ) + control_div2 = GraphSyrControlGUI_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 972 , 430 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlGUI_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 493 , 238 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 493 , 418 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI_2.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_div2K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 954 , 494 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 954 , 259 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 955 , 128 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 954 , 258 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 275 , 211 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 275 , 270 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlGUI_2.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 274 , 417 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 275 , 270 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlGUI_2.Link( Olabel_beginKT , Ilabel_testKT ) + Llabel_beginKTlabel_testKT.AddCoord( 1 , 476 , 294 ) + Llabel_beginKTlabel_testKT.AddCoord( 2 , 475 , 515 ) + Llabel_beginKTlabel_testKT.AddCoord( 3 , 260 , 515 ) + Llabel_beginKTlabel_testKT.AddCoord( 4 , 260 , 298 ) + + Llabel_testEvendiv2Gate = GraphSyrControlGUI_2.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 724 , 498 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 723 , 268 ) + + Llabel_testOddm3p1Gate = GraphSyrControlGUI_2.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 698 , 132 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 697 , 297 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 748 , 100 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 747 , 325 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Idiv2anEvenInteger ) + Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 746 , 463 ) + Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 747 , 327 ) + + Llabel_testKincraCount = GraphSyrControlGUI_2.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 732 , 260 ) + Llabel_testKincraCount.AddCoord( 2 , 732 , 354 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI_2.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 503 , 388 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 505 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1149 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1150 , 219 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI_2.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 34 , 332 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 34 , 592 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1145 , 586 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1144 , 527 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + return GraphSyrControlGUI_2 + + +GraphSyrControlGUI_2 = DefGraphSyrControlGUI_2() diff --git a/examples/GraphSyrControlGUI.xml b/examples/GraphSyrControlGUI.xml index 14986c9..f855cc7 100644 --- a/examples/GraphSyrControlGUI.xml +++ b/examples/GraphSyrControlGUI.xml @@ -1,603 +1,595 @@ - + + ? - ? - GraphSyrControlGUI - 1 - ? - -GraphSyrControlGUI - + ? + GraphSyrControlGUI_2 + 1 + ? + +GraphSyrControlGUI_2 + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_test\Finished - - - 11/3/2003 - 18:28:48 - 18/3/2004 - 14:22:38 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + label_test__Finished + +long + label_test__Incr + + + 11/3/2003 - 18:28:48 + 20/1/2005 - 13:18:12 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 288 - 337 - + BoolEven + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 288 + 337 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 293 - 130 - + BoolOne + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 293 + 130 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 761 - 19 - + anEvenInteger + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 761 + 19 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 770 - 384 - + anInteger + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 770 + 384 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 764 - 179 - + aNewCount + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 764 + 179 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - Python function - 58 - 189 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Python function + 58 + 189 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + L_OneEven - - - - - - - - - - - - - - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 516 - 175 - + + + + + + + + + + + + + + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 516 + 175 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - - - - + + + + ? - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 1068 - 258 - + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 1068 + 258 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + C_NotOneIsEven - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 972 - 64 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 972 + 64 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 972 - 430 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 972 + 430 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 493 - 238 - + 238 + 493 - 418 - + 418 + test_ISONE - BoolOne - label_test - ValOne - - + BoolOne + label_test + ValOne + + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 954 - 494 - + 494 + 954 - 259 - + 259 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 955 - 128 - + 128 + 954 - 258 - + 258 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 275 - 211 - + 211 + 275 - 270 - + 270 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 274 - 417 - + 417 + 275 - 270 - + 270 + label_begin - KT - label_test - KT - + KT + label_test + KT + 476 - 294 - + 294 + 475 - 515 - + 515 + 260 - 515 - + 515 + 260 - 298 - -label_test - Incr - incr - InGate - - -712 - 292 - -711 - 238 - + 298 + label_test - Even - div2 - InGate - + Even + div2 + Gate + 724 - 498 - + 498 + 723 - 268 - + 268 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 698 - 132 - + 132 + 697 - 297 - + 297 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 748 - 100 - + 100 + 747 - 325 - + 325 + label_test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 746 - 463 - + 463 + 747 - 327 - + 327 + label_test - K - incr - aCount - + K + incr + aCount + 732 - 260 - + 260 + 732 - 354 - + 354 + label_test - Default - EndL_OneEven - Default - - + Default + EndL_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 503 - 388 - + 388 + 505 - 5 - + 5 + 1149 - 5 - + 5 + 1150 - 219 - + 219 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 34 - 332 - + 332 + 34 - 592 - + 592 + 1145 - 586 - + 586 + 1144 - 527 - + 527 + -GraphSyrControlGUI - label_begin\NB - label_begin - NB - +GraphSyrControlGUI_2 + label_begin__NB + label_begin + NB + 3 - 7 - - -GraphSyrControlGUI - label_begin\KB - label_begin - KB - + 7 + + +GraphSyrControlGUI_2 + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + -- 2.30.2