--- /dev/null
+
+# Generated python file of Graph GraphBadInputInLoop
+
+from SuperV import *
+
+# Graph creation of GraphBadInputInLoop
+def DefGraphBadInputInLoop() :
+ GraphBadInputInLoop = Graph( 'GraphBadInputInLoop' )
+ GraphBadInputInLoop.SetName( 'GraphBadInputInLoop' )
+ GraphBadInputInLoop.SetAuthor( '' )
+ GraphBadInputInLoop.SetComment( '' )
+ GraphBadInputInLoop.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadInputInLoop.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadInputOfLoop = []
+ PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
+ PyBadInputOfLoop.append( ' return 1 ' )
+ PyBadInputOfLoop.append( '' )
+ BadInputOfLoop = GraphBadInputInLoop.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
+ BadInputOfLoop.SetName( 'BadInputOfLoop' )
+ BadInputOfLoop.SetAuthor( '' )
+ BadInputOfLoop.SetComment( 'Compute Node' )
+ BadInputOfLoop.Coords( 15 , 307 )
+ IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
+ OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
+ OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadInputInLoop.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadInputInLoop.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadInputInLoop.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadInputInLoop.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadInputInLoop.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadInputInLoop.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadInputInLoop.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadInputInLoop.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ LBadInputOfLoopInputInLoopSwitchGate = GraphBadInputInLoop.Link( OBadInputOfLoopInputInLoop , ISwitchGate )
+
+ # Input datas
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadInputInLoop
+
+
+GraphBadInputInLoop = DefGraphBadInputInLoop()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadInputInLoop</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadInputInLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadInputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadInputOfLoop</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>InputInLoop</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadInputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadInputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:56:35</creation-date>
+ <lastmodification-date>14/12/2004 - 15:56:35</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>15</x-position>
+ <y-position>307</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>BadInputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InputInLoop</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadInputInLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadInputInLoop1
+
+from SuperV import *
+
+# Graph creation of GraphBadInputInLoop1
+def DefGraphBadInputInLoop1() :
+ GraphBadInputInLoop1 = Graph( 'GraphBadInputInLoop1' )
+ GraphBadInputInLoop1.SetName( 'GraphBadInputInLoop1' )
+ GraphBadInputInLoop1.SetAuthor( '' )
+ GraphBadInputInLoop1.SetComment( '' )
+ GraphBadInputInLoop1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadInputInLoop1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadInputOfLoop = []
+ PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
+ PyBadInputOfLoop.append( ' return 1 ' )
+ PyBadInputOfLoop.append( '' )
+ BadInputOfLoop = GraphBadInputInLoop1.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
+ BadInputOfLoop.SetName( 'BadInputOfLoop' )
+ BadInputOfLoop.SetAuthor( '' )
+ BadInputOfLoop.SetComment( 'Compute Node' )
+ BadInputOfLoop.Coords( 15 , 307 )
+ IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
+ OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
+ OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadInputInLoop1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadInputInLoop1.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadInputInLoop1.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadInputInLoop1.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop1.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadInputInLoop1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadInputInLoop1.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadInputInLoop1.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadInputInLoop1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ LBadInputOfLoopInputInLoopEndOfInitLoopGate = GraphBadInputInLoop1.Link( OBadInputOfLoopInputInLoop , IEndOfInitLoopGate )
+
+ # Input datas
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadInputInLoop1
+
+
+GraphBadInputInLoop1 = DefGraphBadInputInLoop1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadInputInLoop1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadInputInLoop1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadInputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadInputOfLoop</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>InputInLoop</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadInputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadInputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:27</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:27</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>15</x-position>
+ <y-position>307</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>BadInputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InputInLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadInputInLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop1</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadInputInLoop2
+
+from SuperV import *
+
+# Graph creation of GraphBadInputInLoop2
+def DefGraphBadInputInLoop2() :
+ GraphBadInputInLoop2 = Graph( 'GraphBadInputInLoop2' )
+ GraphBadInputInLoop2.SetName( 'GraphBadInputInLoop2' )
+ GraphBadInputInLoop2.SetAuthor( '' )
+ GraphBadInputInLoop2.SetComment( '' )
+ GraphBadInputInLoop2.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadInputInLoop2.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadInputOfLoop = []
+ PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
+ PyBadInputOfLoop.append( ' return 1 ' )
+ PyBadInputOfLoop.append( '' )
+ BadInputOfLoop = GraphBadInputInLoop2.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
+ BadInputOfLoop.SetName( 'BadInputOfLoop' )
+ BadInputOfLoop.SetAuthor( '' )
+ BadInputOfLoop.SetComment( 'Compute Node' )
+ BadInputOfLoop.Coords( 15 , 307 )
+ IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
+ OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
+ OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadInputInLoop2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadInputInLoop2.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadInputInLoop2.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadInputInLoop2.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop2.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadInputInLoop2.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadInputInLoop2.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadInputInLoop2.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadInputInLoop2.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ LBadInputOfLoopInputInLoopIsOddInputInLoop = GraphBadInputInLoop2.Link( OBadInputOfLoopInputInLoop , IIsOddInputInLoop )
+
+ # Input datas
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadInputInLoop2
+
+
+GraphBadInputInLoop2 = DefGraphBadInputInLoop2()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadInputInLoop2</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadInputInLoop2</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>InputInLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,InputInLoop) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadInputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadInputOfLoop</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>InputInLoop</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadInputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadInputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:57:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:57:56</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>15</x-position>
+ <y-position>307</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>BadInputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InputInLoop</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>InputInLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadInputInLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop2</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadInputInLoop3
+
+from SuperV import *
+
+# Graph creation of GraphBadInputInLoop3
+def DefGraphBadInputInLoop3() :
+ GraphBadInputInLoop3 = Graph( 'GraphBadInputInLoop3' )
+ GraphBadInputInLoop3.SetName( 'GraphBadInputInLoop3' )
+ GraphBadInputInLoop3.SetAuthor( '' )
+ GraphBadInputInLoop3.SetComment( '' )
+ GraphBadInputInLoop3.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadInputInLoop3.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadInputOfLoop = []
+ PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
+ PyBadInputOfLoop.append( ' return 1 ' )
+ PyBadInputOfLoop.append( '' )
+ BadInputOfLoop = GraphBadInputInLoop3.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
+ BadInputOfLoop.SetName( 'BadInputOfLoop' )
+ BadInputOfLoop.SetAuthor( '' )
+ BadInputOfLoop.SetComment( 'Compute Node' )
+ BadInputOfLoop.Coords( 359 , 318 )
+ IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
+ OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
+ OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadInputInLoop3.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadInputInLoop3.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadInputInLoop3.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop3.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadInputInLoop3.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadInputInLoop3.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ LBadInputOfLoopGateEndOfInitLoopGate = GraphBadInputInLoop3.Link( OBadInputOfLoopGate , IEndOfInitLoopGate )
+
+ # Input datas
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Input Ports of the graph
+ #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ #OBadInputOfLoopInputInLoop = BadInputOfLoop.GetOutPort( 'InputInLoop' )
+ return GraphBadInputInLoop3
+
+
+GraphBadInputInLoop3 = DefGraphBadInputInLoop3()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadInputInLoop3</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadInputInLoop3</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>IsOdd__InputInLoop</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>BadInputOfLoop__InputInLoop</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>InputInLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,InputInLoop) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadInputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadInputOfLoop</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>InputInLoop</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadInputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadInputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:23</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:23</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>359</x-position>
+ <y-position>318</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>BadInputOfLoop</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadInputInLoop3</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop3</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop3</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadInputInLoop3</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadOutputOfLoop
+
+from SuperV import *
+
+# Graph creation of GraphBadOutputOfLoop
+def DefGraphBadOutputOfLoop() :
+ GraphBadOutputOfLoop = Graph( 'GraphBadOutputOfLoop' )
+ GraphBadOutputOfLoop.SetName( 'GraphBadOutputOfLoop' )
+ GraphBadOutputOfLoop.SetAuthor( '' )
+ GraphBadOutputOfLoop.SetComment( '' )
+ GraphBadOutputOfLoop.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadOutputOfLoop.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadOutputOfLoop = []
+ PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
+ PyBadOutputOfLoop.append( ' return 1 ' )
+ PyBadOutputOfLoop.append( '' )
+ BadOutputOfLoop = GraphBadOutputOfLoop.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
+ BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
+ BadOutputOfLoop.SetAuthor( '' )
+ BadOutputOfLoop.SetComment( 'Compute Node' )
+ BadOutputOfLoop.Coords( 768 , 323 )
+ IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
+ IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
+ OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadOutputOfLoop.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadOutputOfLoop.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadOutputOfLoop.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadOutputOfLoop.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadOutputOfLoop.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadOutputOfLoop.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadOutputOfLoop.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ LEndSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop.Link( OEndSwitcha , IBadOutputOfLoopOutputOfLoop )
+
+ # Input datas
+ IIsOddInputInLoop.Input( 136306160 )
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadOutputOfLoop
+
+
+GraphBadOutputOfLoop = DefGraphBadOutputOfLoop()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadOutputOfLoop</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadOutputOfLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>IsOdd__InputInLoop</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>InputInLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,InputInLoop) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadOutputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadOutputOfLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>OutputOfLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadOutputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadOutputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>14/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>768</x-position>
+ <y-position>323</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>BadOutputOfLoop</tonode-name>
+ <toserviceparameter-name>OutputOfLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadOutputOfLoop</fromnode-name>
+ <fromserviceparameter-name>IsOdd__InputInLoop</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>InputInLoop</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136306160</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadOutputOfLoop1
+
+from SuperV import *
+
+# Graph creation of GraphBadOutputOfLoop1
+def DefGraphBadOutputOfLoop1() :
+ GraphBadOutputOfLoop1 = Graph( 'GraphBadOutputOfLoop1' )
+ GraphBadOutputOfLoop1.SetName( 'GraphBadOutputOfLoop1' )
+ GraphBadOutputOfLoop1.SetAuthor( '' )
+ GraphBadOutputOfLoop1.SetComment( '' )
+ GraphBadOutputOfLoop1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadOutputOfLoop1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadOutputOfLoop = []
+ PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
+ PyBadOutputOfLoop.append( ' return 1 ' )
+ PyBadOutputOfLoop.append( '' )
+ BadOutputOfLoop = GraphBadOutputOfLoop1.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
+ BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
+ BadOutputOfLoop.SetAuthor( '' )
+ BadOutputOfLoop.SetComment( 'Compute Node' )
+ BadOutputOfLoop.Coords( 287 , 349 )
+ IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
+ IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
+ OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadOutputOfLoop1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadOutputOfLoop1.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadOutputOfLoop1.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadOutputOfLoop1.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop1.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LInitLoopMaxBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop1.Link( OInitLoopMax , IBadOutputOfLoopOutputOfLoop )
+
+ LSwitchOddIsOddGate = GraphBadOutputOfLoop1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop1.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadOutputOfLoop1.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadOutputOfLoop1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ # Input datas
+ IIsOddInputInLoop.Input( 136306160 )
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadOutputOfLoop1
+
+
+GraphBadOutputOfLoop1 = DefGraphBadOutputOfLoop1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadOutputOfLoop1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadOutputOfLoop1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>IsOdd__InputInLoop</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>InputInLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,InputInLoop) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadOutputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadOutputOfLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>OutputOfLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadOutputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadOutputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:22</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:22</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>287</x-position>
+ <y-position>349</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>BadOutputOfLoop</tonode-name>
+ <toserviceparameter-name>OutputOfLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadOutputOfLoop1</fromnode-name>
+ <fromserviceparameter-name>IsOdd__InputInLoop</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>InputInLoop</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136306160</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop1</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphBadOutputOfLoop2
+
+from SuperV import *
+
+# Graph creation of GraphBadOutputOfLoop2
+def DefGraphBadOutputOfLoop2() :
+ GraphBadOutputOfLoop2 = Graph( 'GraphBadOutputOfLoop2' )
+ GraphBadOutputOfLoop2.SetName( 'GraphBadOutputOfLoop2' )
+ GraphBadOutputOfLoop2.SetAuthor( '' )
+ GraphBadOutputOfLoop2.SetComment( '' )
+ GraphBadOutputOfLoop2.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphBadOutputOfLoop2.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyBadOutputOfLoop = []
+ PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
+ PyBadOutputOfLoop.append( ' return 1 ' )
+ PyBadOutputOfLoop.append( '' )
+ BadOutputOfLoop = GraphBadOutputOfLoop2.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
+ BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
+ BadOutputOfLoop.SetAuthor( '' )
+ BadOutputOfLoop.SetComment( 'Compute Node' )
+ BadOutputOfLoop.Coords( 503 , 338 )
+ IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
+ IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
+ OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphBadOutputOfLoop2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphBadOutputOfLoop2.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphBadOutputOfLoop2.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphBadOutputOfLoop2.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop2.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LSwitchOddIsOddGate = GraphBadOutputOfLoop2.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop2.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphBadOutputOfLoop2.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphBadOutputOfLoop2.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ # Input datas
+ IIsOddInputInLoop.Input( 136306160 )
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+ IEndOfInitLoopMax.Input( 136221856 )
+
+ # Output Ports of the graph
+ #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphBadOutputOfLoop2
+
+
+GraphBadOutputOfLoop2 = DefGraphBadOutputOfLoop2()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphBadOutputOfLoop2</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphBadOutputOfLoop2</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>IsOdd__InputInLoop</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>EndOfInitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>InitLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>InputInLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,InputInLoop) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>BadOutputOfLoop</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>BadOutputOfLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>OutputOfLoop</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>BadOutputOfLoop</FuncName>
+ <PyFunc><![CDATA[def BadOutputOfLoop() : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1 ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>14/12/2004 - 15:59:49</creation-date>
+ <lastmodification-date>14/12/2004 - 15:59:49</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>503</x-position>
+ <y-position>338</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>575</x>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>111</y> </coord>
+ <coord>
+<x>375</x>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>362</x>
+ <y>82</y> </coord>
+ <coord>
+<x>360</x>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>BadOutputOfLoop</tonode-name>
+ <toserviceparameter-name>OutputOfLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphBadOutputOfLoop2</fromnode-name>
+ <fromserviceparameter-name>IsOdd__InputInLoop</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>InputInLoop</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136306160</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphBadOutputOfLoop2</fromnode-name>
+ <fromserviceparameter-name>EndOfInitLoop__Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>136221856</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
# Generated python file of Graph GraphConvertObjRefCheck
from SuperV import *
-# Graph creation
-GraphConvertObjRefCheck = Graph( 'GraphConvertObjRefCheck' )
-GraphConvertObjRefCheck.SetName( 'GraphConvertObjRefCheck' )
-GraphConvertObjRefCheck.SetAuthor( 'JR' )
-GraphConvertObjRefCheck.SetComment( 'Check conversions of ObjRef' )
-GraphConvertObjRefCheck.Coords( 0 , 0 )
-# Creation of Factory Nodes
-
-MiscTypes = GraphConvertObjRefCheck.FNode( 'TypesCheck' , 'TypesCheck' , 'MiscTypes' )
-MiscTypes.SetName( 'MiscTypes' )
-MiscTypes.SetAuthor( '' )
-MiscTypes.SetContainer( 'localhost/FactoryServer' )
-MiscTypes.SetComment( 'MiscTypes from TypesCheck' )
-MiscTypes.Coords( 284 , 28 )
-
-# Creation of InLine Nodes
-PySyrComponent = []
-PySyrComponent.append( 'from LifeCycleCORBA import * ' )
-PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' )
-PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
-PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' )
-PySyrComponent.append( ' print "SyrComponent orb",orb ' )
-PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' )
-PySyrComponent.append( ' print "SyrComponent lcc",lcc ' )
-PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
-PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' )
-PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' )
-PySyrComponent.append( ' return ComponentRef ' )
-PySyrComponent.append( '' )
-SyrComponent = GraphConvertObjRefCheck.INode( 'SyrComponent' , PySyrComponent )
-SyrComponent.InPort( 'aContainer' , 'string' )
-SyrComponent.InPort( 'aComponent' , 'string' )
-SyrComponent.OutPort( 'anObjRef' , 'objref' )
-SyrComponent.SetName( 'SyrComponent' )
-SyrComponent.SetAuthor( 'JR' )
-SyrComponent.SetComment( 'InLine Node' )
-SyrComponent.Coords( 14 , 114 )
-
-# Creation of Links
-SyrComponentanObjRef = SyrComponent.Port( 'anObjRef' )
-MiscTypesInShort = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InShort' ) )
-
-MiscTypesInString = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InString' ) )
-
-MiscTypesInBool = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InBool' ) )
-
-MiscTypesInChar = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InChar' ) )
-
-MiscTypesInLong = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InLong' ) )
-
-MiscTypesInFloat = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InFloat' ) )
-
-MiscTypesInDouble = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InDouble' ) )
-
-MiscTypesInObjRef = GraphConvertObjRefCheck.Link( SyrComponentanObjRef , MiscTypes.Port( 'InObjRef' ) )
-
-# Creation of Input datas
-SyrComponentaContainer = SyrComponent.Input( 'aContainer' , 'FactoryServerPy')
-SyrComponentaComponent = SyrComponent.Input( 'aComponent' , 'SyrControlComponent')
-
-# Creation of Output variables
-MiscTypesOutString = MiscTypes.Port( 'OutString' )
-MiscTypesOutBool = MiscTypes.Port( 'OutBool' )
-MiscTypesOutChar = MiscTypes.Port( 'OutChar' )
-MiscTypesOutShort = MiscTypes.Port( 'OutShort' )
-MiscTypesOutLong = MiscTypes.Port( 'OutLong' )
-MiscTypesOutFloat = MiscTypes.Port( 'OutFloat' )
-MiscTypesOutDouble = MiscTypes.Port( 'OutDouble' )
-MiscTypesOutObjRef = MiscTypes.Port( 'OutObjRef' )
-
-GraphConvertObjRefCheck.Run()
-GraphConvertObjRefCheck.DoneW()
-GraphConvertObjRefCheck.PrintPorts()
+# Graph creation of GraphConvertObjRefCheck
+def DefGraphConvertObjRefCheck() :
+ GraphConvertObjRefCheck = Graph( 'GraphConvertObjRefCheck' )
+ GraphConvertObjRefCheck.SetName( 'GraphConvertObjRefCheck' )
+ GraphConvertObjRefCheck.SetAuthor( 'JR' )
+ GraphConvertObjRefCheck.SetComment( 'Check conversions of ObjRef' )
+ GraphConvertObjRefCheck.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ MiscTypes = GraphConvertObjRefCheck.FNode( 'TypesCheck' , 'TypesCheck' , 'MiscTypes' )
+ MiscTypes.SetName( 'MiscTypes' )
+ MiscTypes.SetAuthor( '' )
+ MiscTypes.SetContainer( 'localhost/FactoryServer' )
+ MiscTypes.SetComment( 'MiscTypes from TypesCheck' )
+ MiscTypes.Coords( 284 , 28 )
+ IMiscTypesInString = MiscTypes.GetInPort( 'InString' )
+ IMiscTypesInBool = MiscTypes.GetInPort( 'InBool' )
+ IMiscTypesInChar = MiscTypes.GetInPort( 'InChar' )
+ IMiscTypesInShort = MiscTypes.GetInPort( 'InShort' )
+ IMiscTypesInLong = MiscTypes.GetInPort( 'InLong' )
+ IMiscTypesInFloat = MiscTypes.GetInPort( 'InFloat' )
+ IMiscTypesInDouble = MiscTypes.GetInPort( 'InDouble' )
+ IMiscTypesInObjRef = MiscTypes.GetInPort( 'InObjRef' )
+ IMiscTypesGate = MiscTypes.GetInPort( 'Gate' )
+ OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' )
+ OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' )
+ OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' )
+ OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' )
+ OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' )
+ OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' )
+ OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' )
+ OMiscTypesOutObjRef = MiscTypes.GetOutPort( 'OutObjRef' )
+ OMiscTypesGate = MiscTypes.GetOutPort( 'Gate' )
+
+ # Creation of InLine Nodes
+ PySyrComponent = []
+ PySyrComponent.append( 'from LifeCycleCORBA import * ' )
+ PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' )
+ PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
+ PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' )
+ PySyrComponent.append( ' print "SyrComponent orb",orb ' )
+ PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' )
+ PySyrComponent.append( ' print "SyrComponent lcc",lcc ' )
+ PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' )
+ PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' )
+ PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' )
+ PySyrComponent.append( ' return ComponentRef ' )
+ PySyrComponent.append( '' )
+ SyrComponent = GraphConvertObjRefCheck.INode( 'SyrComponent' , PySyrComponent )
+ SyrComponent.SetName( 'SyrComponent' )
+ SyrComponent.SetAuthor( 'JR' )
+ SyrComponent.SetComment( 'InLine Node' )
+ SyrComponent.Coords( 14 , 114 )
+ ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' )
+ ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' )
+ ISyrComponentGate = SyrComponent.GetInPort( 'Gate' )
+ OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' )
+ OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' )
+
+ PyObjRefToInline = []
+ PyObjRefToInline.append( 'def ObjRefToInline(objRef): ' )
+ PyObjRefToInline.append( ' return objRef ' )
+ ObjRefToInline = GraphConvertObjRefCheck.INode( 'ObjRefToInline' , PyObjRefToInline )
+ ObjRefToInline.SetName( 'ObjRefToInline' )
+ ObjRefToInline.SetAuthor( '' )
+ ObjRefToInline.SetComment( 'Compute Node' )
+ ObjRefToInline.Coords( 496 , 168 )
+ IObjRefToInlinetoInLine = ObjRefToInline.InPort( 'toInLine' , 'int' )
+ IObjRefToInlineGate = ObjRefToInline.GetInPort( 'Gate' )
+ OObjRefToInlineGate = ObjRefToInline.GetOutPort( 'Gate' )
+
+ # Creation of Links
+ LSyrComponentanObjRefMiscTypesInObjRef = GraphConvertObjRefCheck.Link( OSyrComponentanObjRef , IMiscTypesInObjRef )
+
+ LSyrComponentanObjRefMiscTypesInString = GraphConvertObjRefCheck.Link( OSyrComponentanObjRef , IMiscTypesInString )
+
+ LMiscTypesOutObjRefObjRefToInlinetoInLine = GraphConvertObjRefCheck.Link( OMiscTypesOutObjRef , IObjRefToInlinetoInLine )
+
+ # Input datas
+ ISyrComponentaContainer.Input( 'FactoryServerPy' )
+ ISyrComponentaComponent.Input( 'SyrControlComponent' )
+ IMiscTypesInBool.Input( 138492744 )
+ IMiscTypesInChar.Input( 135402800 )
+ IMiscTypesInShort.Input( 135448464 )
+ IMiscTypesInLong.Input( 135469224 )
+ IMiscTypesInFloat.Input( 65.6954 )
+ IMiscTypesInDouble.Input( 65.6954 )
+
+ # Output Ports of the graph
+ #OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' )
+ #OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' )
+ #OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' )
+ #OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' )
+ #OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' )
+ #OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' )
+ #OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' )
+ return GraphConvertObjRefCheck
+
+
+GraphConvertObjRefCheck = DefGraphConvertObjRefCheck()
-<!DOCTYPE Dataflow>
+<!DOCTYPE SuperGraph>
+<supergraph>
<dataflow>
<info-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphConvertObjRefCheck</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>GraphConvertObjRefCheck</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>GraphConvertObjRefCheck</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>string</inParameter-type>
- <inParameter-name>SyrComponent\aContainer</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>SyrComponent__aContainer</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>string</inParameter-type>
- <inParameter-name>SyrComponent\aComponent</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>SyrComponent__aComponent</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>MiscTypes__InBool</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>char</inParameter-type>
+ <inParameter-name>MiscTypes__InChar</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>short</inParameter-type>
+ <inParameter-name>MiscTypes__InShort</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>MiscTypes__InLong</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>float</inParameter-type>
+ <inParameter-name>MiscTypes__InFloat</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>MiscTypes__InDouble</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>string</outParameter-type>
- <outParameter-name>MiscTypes\OutString</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutString</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>boolean</outParameter-type>
- <outParameter-name>MiscTypes\OutBool</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutBool</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>char</outParameter-type>
- <outParameter-name>MiscTypes\OutChar</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutChar</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>short</outParameter-type>
- <outParameter-name>MiscTypes\OutShort</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutShort</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>MiscTypes\OutLong</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutLong</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>float</outParameter-type>
- <outParameter-name>MiscTypes\OutFloat</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>MiscTypes__OutFloat</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>double</outParameter-type>
- <outParameter-name>MiscTypes\OutDouble</outParameter-name> </outParameter>
- <outParameter>
-<outParameter-type>SuperVisionTest::Adder</outParameter-type>
- <outParameter-name>MiscTypes\OutObjRef</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>30/7/2003 - 14:23:52</creation-date>
- <lastmodification-date>11/9/2003 - 15:18:16</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>Check conversions of ObjRef</comment>
- <x-position>0</x-position>
- <y-position>0</y-position> </node> </info-list>
- <node-list>
+ <outParameter-name>MiscTypes__OutDouble</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>30/7/2003 - 14:23:52</creation-date>
+ <lastmodification-date>29/12/2004 - 16:1:50</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>Check conversions of ObjRef</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>SyrComponent</node-name>
- <kind>3</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>SyrComponent</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>SyrComponent</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>string</inParameter-type>
- <inParameter-name>aContainer</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>aContainer</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>string</inParameter-type>
- <inParameter-name>aComponent</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>aComponent</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>objref</outParameter-type>
- <outParameter-name>anObjRef</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>anObjRef</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>SyrComponent</FuncName>
- <PyFunc><![CDATA[from LifeCycleCORBA import * ]]></PyFunc>
- <PyFunc><![CDATA[def SyrComponent( aContainer , aComponent ) : ]]></PyFunc>
- <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,")" ]]></PyFunc>
- <PyFunc><![CDATA[ orb = CORBA.ORB_init([], CORBA.ORB_ID) ]]></PyFunc>
- <PyFunc><![CDATA[ print "SyrComponent orb",orb ]]></PyFunc>
- <PyFunc><![CDATA[ lcc = LifeCycleCORBA(orb) ]]></PyFunc>
- <PyFunc><![CDATA[ print "SyrComponent lcc",lcc ]]></PyFunc>
- <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,")" ]]></PyFunc>
- <PyFunc><![CDATA[ ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ]]></PyFunc>
- <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ]]></PyFunc>
- <PyFunc><![CDATA[ return ComponentRef ]]></PyFunc>
- <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>11/9/2003 - 15:16:43</creation-date>
- <lastmodification-date>11/9/2003 - 15:16:43</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>InLine Node</comment>
- <x-position>14</x-position>
- <y-position>114</y-position> </node>
- <node>
+ <PyFunc><![CDATA[from LifeCycleCORBA import * ]]></PyFunc>
+ <PyFunc><![CDATA[def SyrComponent( aContainer , aComponent ) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,")" ]]></PyFunc>
+ <PyFunc><![CDATA[ orb = CORBA.ORB_init([], CORBA.ORB_ID) ]]></PyFunc>
+ <PyFunc><![CDATA[ print "SyrComponent orb",orb ]]></PyFunc>
+ <PyFunc><![CDATA[ lcc = LifeCycleCORBA(orb) ]]></PyFunc>
+ <PyFunc><![CDATA[ print "SyrComponent lcc",lcc ]]></PyFunc>
+ <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,")" ]]></PyFunc>
+ <PyFunc><![CDATA[ ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ]]></PyFunc>
+ <PyFunc><![CDATA[ print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ]]></PyFunc>
+ <PyFunc><![CDATA[ return ComponentRef ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>29/12/2004 - 15:57:21</creation-date>
+ <lastmodification-date>29/12/2004 - 15:57:21</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>InLine Node</comment>
+ <x-position>14</x-position>
+ <y-position>114</y-position> </node>
+ <node>
<component-name>TypesCheck</component-name>
- <interface-name>TypesCheck</interface-name>
- <node-name>MiscTypes</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>TypesCheck</interface-name>
+ <node-name>MiscTypes</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>MiscTypes</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>string</inParameter-type>
- <inParameter-name>InString</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InString</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>boolean</inParameter-type>
- <inParameter-name>InBool</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InBool</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>char</inParameter-type>
- <inParameter-name>InChar</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InChar</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>short</inParameter-type>
- <inParameter-name>InShort</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InShort</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>InLong</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InLong</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>float</inParameter-type>
- <inParameter-name>InFloat</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InFloat</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>double</inParameter-type>
- <inParameter-name>InDouble</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InDouble</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>SuperVisionTest::Adder</inParameter-type>
- <inParameter-name>InObjRef</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>InObjRef</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>string</outParameter-type>
- <outParameter-name>OutString</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutString</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>boolean</outParameter-type>
- <outParameter-name>OutBool</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutBool</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>char</outParameter-type>
- <outParameter-name>OutChar</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutChar</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>short</outParameter-type>
- <outParameter-name>OutShort</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutShort</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>OutLong</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutLong</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>float</outParameter-type>
- <outParameter-name>OutFloat</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutFloat</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>double</outParameter-type>
- <outParameter-name>OutDouble</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>OutDouble</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>SuperVisionTest::Adder</outParameter-type>
- <outParameter-name>OutObjRef</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>11/9/2003 - 15:16:43</creation-date>
- <lastmodification-date>11/9/2003 - 15:16:43</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>MiscTypes from TypesCheck</comment>
- <x-position>284</x-position>
- <y-position>28</y-position> </node> </node-list>
- <link-list>
+ <outParameter-name>OutObjRef</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>29/12/2004 - 15:57:21</creation-date>
+ <lastmodification-date>29/12/2004 - 15:57:21</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>MiscTypes from TypesCheck</comment>
+ <x-position>284</x-position>
+ <y-position>28</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>ObjRefToInline</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>ObjRefToInline</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>int</inParameter-type>
+ <inParameter-name>toInLine</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>ObjRefToInline</FuncName>
+ <PyFunc><![CDATA[def ObjRefToInline(objRef): ]]></PyFunc>
+ <PyFunc><![CDATA[ return objRef ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>29/12/2004 - 15:58:56</creation-date>
+ <lastmodification-date>29/12/2004 - 15:58:56</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>496</x-position>
+ <y-position>168</y-position> </node> </node-list>
+ <link-list>
<link>
<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InShort</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InString</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InObjRef</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InBool</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InChar</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InLong</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InFloat</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InDouble</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>SyrComponent</fromnode-name>
- <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
- <tonode-name>MiscTypes</tonode-name>
- <toserviceparameter-name>InObjRef</toserviceparameter-name>
- <coord-list/> </link> </link-list>
- <data-list>
+ <fromserviceparameter-name>anObjRef</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InString</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>MiscTypes</fromnode-name>
+ <fromserviceparameter-name>OutObjRef</fromserviceparameter-name>
+ <tonode-name>ObjRefToInline</tonode-name>
+ <toserviceparameter-name>toInLine</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
<data>
<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
- <fromserviceparameter-name>SyrComponent\aContainer</fromserviceparameter-name>
- <tonode-name>SyrComponent</tonode-name>
- <toserviceparameter-name>aContainer</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>SyrComponent__aContainer</fromserviceparameter-name>
+ <tonode-name>SyrComponent</tonode-name>
+ <toserviceparameter-name>aContainer</toserviceparameter-name>
+ <data-value>
<value-type>18</value-type>
- <value>FactoryServerPy</value> </data-value>
- <coord-list/> </data>
- <data>
+ <value>FactoryServerPy</value> </data-value>
+ <coord-list/> </data>
+ <data>
<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
- <fromserviceparameter-name>SyrComponent\aComponent</fromserviceparameter-name>
- <tonode-name>SyrComponent</tonode-name>
- <toserviceparameter-name>aComponent</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>SyrComponent__aComponent</fromserviceparameter-name>
+ <tonode-name>SyrComponent</tonode-name>
+ <toserviceparameter-name>aComponent</toserviceparameter-name>
+ <data-value>
<value-type>18</value-type>
- <value>SyrControlComponent</value> </data-value>
- <coord-list/> </data> </data-list></dataflow>
+ <value>SyrControlComponent</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InBool</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InBool</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>138492744</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InChar</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InChar</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>135402800</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InShort</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InShort</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>135448464</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InLong</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InLong</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>135469224</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InFloat</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InFloat</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>65.6954</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphConvertObjRefCheck</fromnode-name>
+ <fromserviceparameter-name>MiscTypes__InDouble</fromserviceparameter-name>
+ <tonode-name>MiscTypes</tonode-name>
+ <toserviceparameter-name>InDouble</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>65.6954</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
# Generated python file of Graph GraphCpuUsed
from SuperV import *
+import time
# Graph creation
GraphCpuUsed = Graph( 'GraphCpuUsed' )
GraphCpuUsed.SetName( 'GraphCpuUsed' )
CompareResult = Compare.Port( 'Result' )
GraphCpuUsed.Run()
-GraphCpuUsed.DoneW()
+while GraphCpuUsed.IsDone() == 0 :
+ time.sleep(1)
+ print "sigma",sigma.CpuUsed(),"seconds"
+ print "Sigma",Sigma.CpuUsed(),"seconds"
+ print "Add",Add.CpuUsed(),"seconds"
+ print "Sub",Sub.CpuUsed(),"seconds"
+ print "Compare",Compare.CpuUsed(),"seconds"
+
print GraphCpuUsed.State()
GraphCpuUsed.PrintPorts()
print "sigma",sigma.CpuUsed(),"seconds"
--- /dev/null
+
+# Generated python file of Graph GraphEssai3
+
+from SuperV import *
+
+# Graph creation of GraphEssai3
+def DefGraphEssai3() :
+ GraphEssai3 = Graph( 'GraphEssai3' )
+ GraphEssai3.SetName( 'GraphEssai3' )
+ GraphEssai3.SetAuthor( '' )
+ GraphEssai3.SetComment( '' )
+ GraphEssai3.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ Add = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+ Add.SetName( 'Add' )
+ Add.SetAuthor( '' )
+ Add.SetContainer( 'localhost/FactoryServer' )
+ Add.SetComment( 'Add from AddComponent' )
+ Add.Coords( 1 , 152 )
+ IAddx = Add.GetInPort( 'x' )
+ IAddy = Add.GetInPort( 'y' )
+ IAddGate = Add.GetInPort( 'Gate' )
+ OAddFuncValue = Add.GetOutPort( 'FuncValue' )
+ OAddz = Add.GetOutPort( 'z' )
+ OAddGate = Add.GetOutPort( 'Gate' )
+
+ Sub = GraphEssai3.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
+ Sub.SetName( 'Sub' )
+ Sub.SetAuthor( '' )
+ Sub.SetContainer( 'localhost/FactoryServer' )
+ Sub.SetComment( 'Sub from SubComponent' )
+ Sub.Coords( 412 , 377 )
+ ISubx = Sub.GetInPort( 'x' )
+ ISuby = Sub.GetInPort( 'y' )
+ ISubGate = Sub.GetInPort( 'Gate' )
+ OSubz = Sub.GetOutPort( 'z' )
+ OSubGate = Sub.GetOutPort( 'Gate' )
+
+ Mul = GraphEssai3.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
+ Mul.SetName( 'Mul' )
+ Mul.SetAuthor( '' )
+ Mul.SetContainer( 'localhost/FactoryServer' )
+ Mul.SetComment( 'Mul from MulComponent' )
+ Mul.Coords( 412 , 152 )
+ IMulx = Mul.GetInPort( 'x' )
+ IMuly = Mul.GetInPort( 'y' )
+ IMulGate = Mul.GetInPort( 'Gate' )
+ OMulz = Mul.GetOutPort( 'z' )
+ OMulGate = Mul.GetOutPort( 'Gate' )
+
+ Div = GraphEssai3.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
+ Div.SetName( 'Div' )
+ Div.SetAuthor( '' )
+ Div.SetContainer( 'localhost/FactoryServer' )
+ Div.SetComment( 'Div from DivComponent' )
+ Div.Coords( 622 , 124 )
+ IDivx = Div.GetInPort( 'x' )
+ IDivy = Div.GetInPort( 'y' )
+ IDivGate = Div.GetInPort( 'Gate' )
+ ODivz = Div.GetOutPort( 'z' )
+ ODivGate = Div.GetOutPort( 'Gate' )
+
+ Addition = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
+ Addition.SetName( 'Addition' )
+ Addition.SetAuthor( '' )
+ Addition.SetContainer( 'localhost/AdditionServer' )
+ Addition.SetComment( 'Addition from AddComponent' )
+ Addition.Coords( 0 , 0 )
+ IAdditionGate = Addition.GetInPort( 'Gate' )
+ OAdditionAdder = Addition.GetOutPort( 'Adder' )
+ OAdditionGate = Addition.GetOutPort( 'Gate' )
+
+ Addition_1 = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
+ Addition_1.SetName( 'Addition_1' )
+ Addition_1.SetAuthor( '' )
+ Addition_1.SetContainer( 'localhost/Addition_1Server' )
+ Addition_1.SetComment( 'Addition from AddComponent' )
+ Addition_1.Coords( 4 , 327 )
+ IAddition_1Gate = Addition_1.GetInPort( 'Gate' )
+ OAddition_1Adder = Addition_1.GetOutPort( 'Adder' )
+ OAddition_1Gate = Addition_1.GetOutPort( 'Gate' )
+
+ # Creation of Computing Nodes
+ AddAndCompare_ServiceinParameter = []
+ AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
+ AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
+ AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
+ AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
+ AddAndCompare_ServiceoutParameter = []
+ AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
+ AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
+ AddAndCompare_ServiceinStreamParameter = []
+ AddAndCompare_ServiceoutStreamParameter = []
+ AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
+ AddAndCompare = GraphEssai3.CNode( AddAndCompare_Service )
+ AddAndCompare.SetName( 'AddAndCompare' )
+ AddAndCompare.SetAuthor( '' )
+ AddAndCompare.SetComment( 'Python function' )
+ AddAndCompare.Coords( 233 , 0 )
+ IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' )
+ IAddAndComparex = AddAndCompare.GetInPort( 'x' )
+ IAddAndComparey = AddAndCompare.GetInPort( 'y' )
+ IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' )
+ IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' )
+ OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
+ OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
+ OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' )
+
+ # Creation of Links
+ LAddFuncValueMulx = GraphEssai3.Link( OAddFuncValue , IMulx )
+
+ LAddFuncValueAddAndComparex = GraphEssai3.Link( OAddFuncValue , IAddAndComparex )
+ LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 )
+ LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 )
+
+ LAddzSubx = GraphEssai3.Link( OAddz , ISubx )
+ LAddzSubx.AddCoord( 1 , 187 , 459 )
+ LAddzSubx.AddCoord( 2 , 186 , 262 )
+
+ LAddzAddAndComparey = GraphEssai3.Link( OAddz , IAddAndComparey )
+ LAddzAddAndComparey.AddCoord( 1 , 187 , 139 )
+ LAddzAddAndComparey.AddCoord( 2 , 186 , 261 )
+
+ LSubzDivx = GraphEssai3.Link( OSubz , IDivx )
+ LSubzDivx.AddCoord( 1 , 598 , 203 )
+ LSubzDivx.AddCoord( 2 , 598 , 457 )
+
+ LMulzDivy = GraphEssai3.Link( OMulz , IDivy )
+
+ LAdditionAdderAddAndCompareAdder = GraphEssai3.Link( OAdditionAdder , IAddAndCompareAdder )
+
+ LAddition_1AdderAddAndCompareanOtherAdder = GraphEssai3.Link( OAddition_1Adder , IAddAndCompareanOtherAdder )
+ LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
+ LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
+
+ # Input datas
+ IAddx.Input( 1 )
+ IAddy.Input( 2 )
+ ISuby.Input( 3 )
+ IMuly.Input( 4 )
+
+ # Output Ports of the graph
+ #ODivz = Div.GetOutPort( 'z' )
+ #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
+ #OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
+ return GraphEssai3
+
+
+GraphEssai3 = DefGraphEssai3()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphEssai3</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphEssai3</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Sub__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Mul__y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Div__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>AddAndCompare__FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>AddAndCompare__z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/3/2003 - 10:59:37</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Add</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Add from AddComponent</comment>
+ <x-position>1</x-position>
+ <y-position>152</y-position> </node>
+ <node>
+<component-name>SubComponent</component-name>
+ <interface-name>SubComponent</interface-name>
+ <node-name>Sub</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Sub from SubComponent</comment>
+ <x-position>412</x-position>
+ <y-position>377</y-position> </node>
+ <node>
+<component-name>MulComponent</component-name>
+ <interface-name>MulComponent</interface-name>
+ <node-name>Mul</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Mul</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Mul from MulComponent</comment>
+ <x-position>412</x-position>
+ <y-position>152</y-position> </node>
+ <node>
+<component-name>DivComponent</component-name>
+ <interface-name>DivComponent</interface-name>
+ <node-name>Div</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Div</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Div from DivComponent</comment>
+ <x-position>622</x-position>
+ <y-position>124</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Addition</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Addition</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>Adder</outParameter-type>
+ <outParameter-name>Adder</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/AdditionServer</container>
+ <comment>Addition from AddComponent</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Addition_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Addition</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>Adder</outParameter-type>
+ <outParameter-name>Adder</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>localhost/Addition_1Server</container>
+ <comment>Addition from AddComponent</comment>
+ <x-position>4</x-position>
+ <y-position>327</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>AddAndCompare</node-name>
+ <kind>2</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>AddAndCompare</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>Adder</inParameter-type>
+ <inParameter-name>Adder</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>Adder</inParameter-type>
+ <inParameter-name>anOtherAdder</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>11/1/2005 - 16:42:5</creation-date>
+ <lastmodification-date>11/1/2005 - 16:42:5</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>233</x-position>
+ <y-position>0</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>FuncValue</fromserviceparameter-name>
+ <tonode-name>Mul</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>FuncValue</fromserviceparameter-name>
+ <tonode-name>AddAndCompare</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>195</x>
+ <y>108</y> </coord>
+ <coord>
+<x>195</x>
+ <y>233</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>187</x>
+ <y>459</y> </coord>
+ <coord>
+<x>186</x>
+ <y>262</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>AddAndCompare</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>187</x>
+ <y>139</y> </coord>
+ <coord>
+<x>186</x>
+ <y>261</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Sub</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Div</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>598</x>
+ <y>203</y> </coord>
+ <coord>
+<x>598</x>
+ <y>457</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Mul</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Div</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Addition</fromnode-name>
+ <fromserviceparameter-name>Adder</fromserviceparameter-name>
+ <tonode-name>AddAndCompare</tonode-name>
+ <toserviceparameter-name>Adder</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Addition_1</fromnode-name>
+ <fromserviceparameter-name>Adder</fromserviceparameter-name>
+ <tonode-name>AddAndCompare</tonode-name>
+ <toserviceparameter-name>anOtherAdder</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>215</x>
+ <y>168</y> </coord>
+ <coord>
+<x>214</x>
+ <y>407</y> </coord> </coord-list> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphEssai3</fromnode-name>
+ <fromserviceparameter-name>Add__x</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphEssai3</fromnode-name>
+ <fromserviceparameter-name>Add__y</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>2</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphEssai3</fromnode-name>
+ <fromserviceparameter-name>Sub__y</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>3</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphEssai3</fromnode-name>
+ <fromserviceparameter-name>Mul__y</fromserviceparameter-name>
+ <tonode-name>Mul</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>4</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
# Generated python file of Graph GraphGOTO
from SuperV import *
-# Graph creation
-GraphGOTO = Graph( 'GraphGOTO' )
-GraphGOTO.SetName( 'GraphGOTO' )
-GraphGOTO.SetAuthor( 'JR' )
-GraphGOTO.SetComment( 'Syracuse algorithm' )
-GraphGOTO.Coords( 0 , 0 )
-# Creation of Factory Nodes
-
-test_ISEVEN = GraphGOTO.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( 195 , 417 )
-
-test_ISONE = GraphGOTO.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 , 145 )
-
-m3p1 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
-m3p1.SetName( 'm3p1' )
-m3p1.SetAuthor( '' )
-m3p1.SetContainer( 'localhost/FactoryServer' )
-m3p1.SetComment( 'C_M3P1 from SyrComponent' )
-m3p1.Coords( 784 , 36 )
-
-div2 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
-div2.SetName( 'div2' )
-div2.SetAuthor( '' )
-div2.SetContainer( 'localhost/FactoryServer' )
-div2.SetComment( 'C_DIV2 from SyrComponent' )
-div2.Coords( 788 , 409 )
-
-incr = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
-incr.SetName( 'incr' )
-incr.SetAuthor( '' )
-incr.SetContainer( 'localhost/FactoryServer' )
-incr.SetComment( 'C_INCR from SyrComponent' )
-incr.Coords( 788 , 230 )
-
-# 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 = GraphGOTO.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( 9 , 250 )
-
-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 = GraphGOTO.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( 396 , 193 )
-
-# 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 = GraphGOTO.SNode( 'Switch_OneEven' , Pytest )
-EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
-EndSwitch_OneEven.SetAuthor( '' )
-EndSwitch_OneEven.SetComment( '' )
-EndSwitch_OneEven.Coords( 1152 , 292 )
-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( 595 , 239 )
-
-# Creation of GOTO Nodes
-Pycontrol_m3p1 = []
-Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' )
-Pycontrol_m3p1.append( ' return 0,1,N,K' )
-control_m3p1 = GraphGOTO.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( 980 , 81 )
-
-Pycontrol_div2 = []
-Pycontrol_div2.append( 'def control_div2( N , NB ) :' )
-Pycontrol_div2.append( ' return N,NB' )
-control_div2 = GraphGOTO.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( 1039 , 454 )
-
-# Creation of Links
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-label_testValEven = GraphGOTO.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) )
-label_testValEven.AddCoord( 1 , 369 , 273 )
-label_testValEven.AddCoord( 2 , 370 , 498 )
-
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-label_testValOne = GraphGOTO.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) )
-label_testValOne.AddCoord( 1 , 385 , 303 )
-label_testValOne.AddCoord( 2 , 384 , 225 )
-
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-control_m3p1N = GraphGOTO.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) )
-
-div2anInteger = div2.Port( 'anInteger' )
-control_div2N = GraphGOTO.Link( div2anInteger , control_div2.Port( 'N' ) )
-
-incraNewCount = incr.Port( 'aNewCount' )
-control_m3p1K = GraphGOTO.Link( incraNewCount , control_m3p1.Port( 'K' ) )
-control_m3p1K.AddCoord( 1 , 964 , 145 )
-control_m3p1K.AddCoord( 2 , 964 , 309 )
-
-control_div2K = GraphGOTO.Link( incraNewCount , control_div2.Port( 'K' ) )
-control_div2K.AddCoord( 1 , 963 , 518 )
-control_div2K.AddCoord( 2 , 964 , 312 )
-
-label_beginNT = label_begin.Port( 'NT' )
-label_testNT = GraphGOTO.Link( label_beginNT , label_test.Port( 'NT' ) )
-
-test_ISONEanInteger = GraphGOTO.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) )
-test_ISONEanInteger.AddCoord( 1 , 192 , 226 )
-test_ISONEanInteger.AddCoord( 2 , 191 , 331 )
-
-test_ISEVENanInteger = GraphGOTO.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) )
-test_ISEVENanInteger.AddCoord( 1 , 191 , 494 )
-test_ISEVENanInteger.AddCoord( 2 , 192 , 331 )
-
-label_beginKT = label_begin.Port( 'KT' )
-label_testKT = GraphGOTO.Link( label_beginKT , label_test.Port( 'KT' ) )
-
-label_testValEven = label_test.Port( 'ValEven' )
-testValEven = GraphGOTO.Link( label_testValEven , test.Port( 'ValEven' ) )
-testValEven.AddCoord( 1 , 587 , 318 )
-testValEven.AddCoord( 2 , 570 , 318 )
-testValEven.AddCoord( 3 , 569 , 272 )
-
-label_testValOne = label_test.Port( 'ValOne' )
-testValOne = GraphGOTO.Link( label_testValOne , test.Port( 'ValOne' ) )
-testValOne.AddCoord( 1 , 585 , 273 )
-testValOne.AddCoord( 2 , 586 , 303 )
-
-label_testNT = label_test.Port( 'NT' )
-testNT = GraphGOTO.Link( label_testNT , test.Port( 'NT' ) )
-
-label_testKT = label_test.Port( 'KT' )
-testKT = GraphGOTO.Link( label_testKT , test.Port( 'KT' ) )
-
-testFinished = test.Port( 'Finished' )
-EndSwitch_OneEvenFinished = GraphGOTO.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) )
-
-testIncr = test.Port( 'Incr' )
-incrInGate = GraphGOTO.Link( testIncr , incr.Port( 'InGate' ) )
-incrInGate.AddCoord( 1 , 783 , 341 )
-incrInGate.AddCoord( 2 , 782 , 302 )
-
-testEven = test.Port( 'Even' )
-div2InGate = GraphGOTO.Link( testEven , div2.Port( 'InGate' ) )
-div2InGate.AddCoord( 1 , 754 , 518 )
-div2InGate.AddCoord( 2 , 753 , 330 )
-
-testOdd = test.Port( 'Odd' )
-m3p1InGate = GraphGOTO.Link( testOdd , m3p1.Port( 'InGate' ) )
-m3p1InGate.AddCoord( 1 , 758 , 145 )
-m3p1InGate.AddCoord( 2 , 760 , 359 )
-
-testN = test.Port( 'N' )
-m3p1anOddInteger = GraphGOTO.Link( testN , m3p1.Port( 'anOddInteger' ) )
-m3p1anOddInteger.AddCoord( 1 , 767 , 116 )
-m3p1anOddInteger.AddCoord( 2 , 767 , 116 )
-m3p1anOddInteger.AddCoord( 3 , 767 , 390 )
-
-div2anEvenInteger = GraphGOTO.Link( testN , div2.Port( 'anEvenInteger' ) )
-div2anEvenInteger.AddCoord( 1 , 767 , 489 )
-div2anEvenInteger.AddCoord( 2 , 766 , 389 )
-
-testK = test.Port( 'K' )
-EndSwitch_OneEvenK = GraphGOTO.Link( testK , EndSwitch_OneEven.Port( 'K' ) )
-
-incraCount = GraphGOTO.Link( testK , incr.Port( 'aCount' ) )
-incraCount.AddCoord( 1 , 772 , 311 )
-incraCount.AddCoord( 2 , 772 , 417 )
-incraCount.AddCoord( 3 , 772 , 417 )
-
-testDefault = test.Port( 'Default' )
-EndSwitch_OneEvenDefault = GraphGOTO.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) )
-EndSwitch_OneEvenDefault.AddCoord( 1 , 778 , 384 )
-EndSwitch_OneEvenDefault.AddCoord( 2 , 778 , 448 )
-
-control_m3p1OutGate = control_m3p1.Port( 'OutGate' )
-label_testInGate = GraphGOTO.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) )
-label_testInGate.AddCoord( 1 , 388 , 388 )
-label_testInGate.AddCoord( 2 , 389 , 597 )
-label_testInGate.AddCoord( 3 , 1319 , 597 )
-label_testInGate.AddCoord( 4 , 1318 , 231 )
-
-control_div2OutGate = control_div2.Port( 'OutGate' )
-label_beginInGate = GraphGOTO.Link( control_div2OutGate , label_begin.Port( 'InGate' ) )
-label_beginInGate.AddCoord( 1 , 4 , 388 )
-label_beginInGate.AddCoord( 2 , 3 , 587 )
-label_beginInGate.AddCoord( 3 , 1214 , 588 )
-label_beginInGate.AddCoord( 4 , 1213 , 546 )
-
-# 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' )
+# Graph creation of GraphGOTO
+def DefGraphGOTO() :
+ GraphGOTO = Graph( 'GraphGOTO' )
+ GraphGOTO.SetName( 'GraphGOTO' )
+ GraphGOTO.SetAuthor( 'JR' )
+ GraphGOTO.SetComment( 'Syracuse algorithm' )
+ GraphGOTO.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ test_ISEVEN = GraphGOTO.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( 195 , 417 )
+ 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 = GraphGOTO.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 , 145 )
+ 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 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
+ m3p1.SetName( 'm3p1' )
+ m3p1.SetAuthor( '' )
+ m3p1.SetContainer( 'localhost/FactoryServer' )
+ m3p1.SetComment( 'C_M3P1 from SyrComponent' )
+ m3p1.Coords( 861 , 46 )
+ Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
+ Im3p1Gate = m3p1.GetInPort( 'Gate' )
+ Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
+ Om3p1Gate = m3p1.GetOutPort( 'Gate' )
+
+ div2 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
+ div2.SetName( 'div2' )
+ div2.SetAuthor( '' )
+ div2.SetContainer( 'localhost/FactoryServer' )
+ div2.SetComment( 'C_DIV2 from SyrComponent' )
+ div2.Coords( 858 , 466 )
+ Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
+ Idiv2Gate = div2.GetInPort( 'Gate' )
+ Odiv2anInteger = div2.GetOutPort( 'anInteger' )
+ Odiv2Gate = div2.GetOutPort( 'Gate' )
+
+ incr = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
+ incr.SetName( 'incr' )
+ incr.SetAuthor( '' )
+ incr.SetContainer( 'localhost/FactoryServer' )
+ incr.SetComment( 'C_INCR from SyrComponent' )
+ incr.Coords( 865 , 169 )
+ IincraCount = incr.GetInPort( 'aCount' )
+ IincrGate = incr.GetInPort( 'Gate' )
+ OincraNewCount = incr.GetOutPort( 'aNewCount' )
+ OincrGate = incr.GetOutPort( 'Gate' )
+
+ incr_1 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
+ incr_1.SetName( 'incr_1' )
+ incr_1.SetAuthor( '' )
+ incr_1.SetContainer( 'localhost/FactoryServer' )
+ incr_1.SetComment( 'C_INCR from SyrComponent' )
+ incr_1.Coords( 859 , 338 )
+ Iincr_1aCount = incr_1.GetInPort( 'aCount' )
+ Iincr_1Gate = incr_1.GetInPort( 'Gate' )
+ Oincr_1aNewCount = incr_1.GetOutPort( 'aNewCount' )
+ Oincr_1Gate = incr_1.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 = GraphGOTO.INode( 'label_begin' , Pylabel_begin )
+ label_begin.SetName( 'label_begin' )
+ label_begin.SetAuthor( '' )
+ label_begin.SetComment( 'Python function' )
+ label_begin.Coords( 9 , 250 )
+ 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 = GraphGOTO.INode( 'label_test' , Pylabel_test )
+ label_test.SetName( 'label_test' )
+ label_test.SetAuthor( '' )
+ label_test.SetComment( 'Python function' )
+ label_test.Coords( 396 , 193 )
+ 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 = GraphGOTO.SNode( 'Switch_OneEven' , Pytest )
+ EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
+ EndSwitch_OneEven.SetAuthor( '' )
+ EndSwitch_OneEven.SetComment( 'Compute Node' )
+ EndSwitch_OneEven.Coords( 1256 , 305 )
+ 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( 595 , 239 )
+ 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 = GraphGOTO.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' )
+ control_m3p1.SetName( 'control_m3p1' )
+ control_m3p1.SetAuthor( '' )
+ control_m3p1.SetComment( 'Compute Node' )
+ control_m3p1.Coords( 1073 , 87 )
+ 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 = GraphGOTO.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
+ control_div2.SetName( 'control_div2' )
+ control_div2.SetAuthor( '' )
+ control_div2.SetComment( 'Compute Node' )
+ control_div2.Coords( 1128 , 453 )
+ 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 = GraphGOTO.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
+ Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 369 , 273 )
+ Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 370 , 498 )
+
+ Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
+ Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 385 , 303 )
+ Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 384 , 225 )
+
+ Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
+
+ Ldiv2anIntegercontrol_div2N = GraphGOTO.Link( Odiv2anInteger , Icontrol_div2N )
+
+ LincraNewCountcontrol_m3p1K = GraphGOTO.Link( OincraNewCount , Icontrol_m3p1K )
+ LincraNewCountcontrol_m3p1K.AddCoord( 1 , 1048 , 139 )
+ LincraNewCountcontrol_m3p1K.AddCoord( 2 , 1048 , 241 )
+
+ Lincr_1aNewCountcontrol_div2K = GraphGOTO.Link( Oincr_1aNewCount , Icontrol_div2K )
+
+ Llabel_beginNTlabel_testNT = GraphGOTO.Link( Olabel_beginNT , Ilabel_testNT )
+
+ Llabel_beginNTtest_ISONEanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISONEanInteger )
+ Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 226 )
+ Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 )
+
+ Llabel_beginNTtest_ISEVENanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISEVENanInteger )
+ Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 494 )
+ Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 331 )
+
+ Llabel_beginKTlabel_testKT = GraphGOTO.Link( Olabel_beginKT , Ilabel_testKT )
+
+ Llabel_testValEventestValEven = GraphGOTO.Link( Olabel_testValEven , ItestValEven )
+ Llabel_testValEventestValEven.AddCoord( 1 , 587 , 318 )
+ Llabel_testValEventestValEven.AddCoord( 2 , 570 , 318 )
+ Llabel_testValEventestValEven.AddCoord( 3 , 569 , 272 )
+
+ Llabel_testValOnetestValOne = GraphGOTO.Link( Olabel_testValOne , ItestValOne )
+ Llabel_testValOnetestValOne.AddCoord( 1 , 585 , 273 )
+ Llabel_testValOnetestValOne.AddCoord( 2 , 586 , 303 )
+
+ Llabel_testNTtestNT = GraphGOTO.Link( Olabel_testNT , ItestNT )
+
+ Llabel_testKTtestKT = GraphGOTO.Link( Olabel_testKT , ItestKT )
+
+ LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO.Link( OtestFinished , IEndSwitch_OneEvenFinished )
+
+ LtestEvenincr_1Gate = GraphGOTO.Link( OtestEven , Iincr_1Gate )
+
+ LtestEvendiv2Gate = GraphGOTO.Link( OtestEven , Idiv2Gate )
+ LtestEvendiv2Gate.AddCoord( 1 , 793 , 561 )
+ LtestEvendiv2Gate.AddCoord( 2 , 794 , 310 )
+
+ LtestOddincrGate = GraphGOTO.Link( OtestOdd , IincrGate )
+
+ LtestOddm3p1Gate = GraphGOTO.Link( OtestOdd , Im3p1Gate )
+ LtestOddm3p1Gate.AddCoord( 1 , 778 , 138 )
+ LtestOddm3p1Gate.AddCoord( 2 , 780 , 328 )
+
+ LtestNm3p1anOddInteger = GraphGOTO.Link( OtestN , Im3p1anOddInteger )
+ LtestNm3p1anOddInteger.AddCoord( 1 , 808 , 113 )
+ LtestNm3p1anOddInteger.AddCoord( 2 , 807 , 352 )
+
+ LtestNdiv2anEvenInteger = GraphGOTO.Link( OtestN , Idiv2anEvenInteger )
+ LtestNdiv2anEvenInteger.AddCoord( 1 , 806 , 537 )
+ LtestNdiv2anEvenInteger.AddCoord( 2 , 807 , 351 )
+
+ LtestKEndSwitch_OneEvenK = GraphGOTO.Link( OtestK , IEndSwitch_OneEvenK )
+
+ LtestKincraCount = GraphGOTO.Link( OtestK , IincraCount )
+ LtestKincraCount.AddCoord( 1 , 773 , 236 )
+ LtestKincraCount.AddCoord( 2 , 773 , 370 )
+
+ LtestKincr_1aCount = GraphGOTO.Link( OtestK , Iincr_1aCount )
+ LtestKincr_1aCount.AddCoord( 1 , 774 , 409 )
+ LtestKincr_1aCount.AddCoord( 2 , 773 , 368 )
+
+ LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO.Link( OtestDefault , IEndSwitch_OneEvenDefault )
+ LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 840 , 381 )
+ LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 839 , 394 )
+
+ Lcontrol_m3p1Gatelabel_testGate = GraphGOTO.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
+ Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 )
+ Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 )
+ Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1441 , 604 )
+ Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1441 , 199 )
+
+ Lcontrol_div2Gatelabel_beginGate = GraphGOTO.Link( Ocontrol_div2Gate , Ilabel_beginGate )
+ Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 )
+ Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 )
+ Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1307 , 586 )
+ Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1307 , 528 )
+
+ # 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 GraphGOTO
+
+
+GraphGOTO = DefGraphGOTO()
GraphGOTO.Run()
-<!DOCTYPE Dataflow>
+<!DOCTYPE SuperGraph>
+<supergraph>
<dataflow>
<info-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphSyrControl</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
-<service-name>GraphSyrControl</service-name>
- <inParameter-list>
+ <interface-name>?</interface-name>
+ <node-name>GraphGOTO_2</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphGOTO_2</service-name>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>label_begin\NB</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>label_begin__NB</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>label_begin\KB</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>label_begin__KB</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndSwitch_OneEven\Finished</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>test__Incr</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndSwitch_OneEven\K</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>11/3/2003 - 18:34:21</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>Syracuse algorithm</comment>
- <x-position>0</x-position>
- <y-position>0</y-position> </node> </info-list>
- <node-list>
+ <outParameter-name>EndSwitch_OneEven__Finished</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndSwitch_OneEven__K</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:44:46</creation-date>
+ <lastmodification-date>17/1/2005 - 13:47:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>Syracuse algorithm</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
<node>
<component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISEVEN</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>test_ISEVEN</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>C_ISEVEN</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>anInteger</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>BoolEven</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>18/9/2003 - 17:27:22</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:22</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>C_ISEVEN from SyrComponent</comment>
- <x-position>195</x-position>
- <y-position>417</y-position> </node>
- <node>
+ <outParameter-name>BoolEven</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_ISEVEN from SyrComponent</comment>
+ <x-position>195</x-position>
+ <y-position>417</y-position> </node>
+ <node>
<component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISONE</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>test_ISONE</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>C_ISONE</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>anInteger</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>BoolOne</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>18/9/2003 - 17:27:22</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:22</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>C_ISONE from SyrComponent</comment>
- <x-position>201</x-position>
- <y-position>145</y-position> </node>
- <node>
+ <outParameter-name>BoolOne</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_ISONE from SyrComponent</comment>
+ <x-position>201</x-position>
+ <y-position>145</y-position> </node>
+ <node>
<component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>m3p1</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>m3p1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>C_M3P1</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>anOddInteger</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>anOddInteger</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>anEvenInteger</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>18/9/2003 - 17:27:22</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:22</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>C_M3P1 from SyrComponent</comment>
- <x-position>784</x-position>
- <y-position>36</y-position> </node>
- <node>
+ <outParameter-name>anEvenInteger</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_M3P1 from SyrComponent</comment>
+ <x-position>861</x-position>
+ <y-position>46</y-position> </node>
+ <node>
<component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>div2</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>div2</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>C_DIV2</service-name>
- <inParameter-list>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>anEvenInteger</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>anInteger</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_DIV2 from SyrComponent</comment>
+ <x-position>858</x-position>
+ <y-position>466</y-position> </node>
+ <node>
+<component-name>SyrComponent</component-name>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>incr</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>C_INCR</service-name>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>anEvenInteger</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>aCount</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>anInteger</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>18/9/2003 - 17:27:22</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:22</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>C_DIV2 from SyrComponent</comment>
- <x-position>788</x-position>
- <y-position>409</y-position> </node>
- <node>
+ <outParameter-name>aNewCount</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_INCR from SyrComponent</comment>
+ <x-position>865</x-position>
+ <y-position>169</y-position> </node>
+ <node>
<component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>incr</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>SyrComponent</interface-name>
+ <node-name>incr_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>C_INCR</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>aCount</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>aCount</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>aNewCount</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>C_INCR from SyrComponent</comment>
- <x-position>788</x-position>
- <y-position>230</y-position> </node>
- <node>
+ <outParameter-name>aNewCount</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>C_INCR from SyrComponent</comment>
+ <x-position>859</x-position>
+ <y-position>338</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>label_begin</node-name>
- <kind>3</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>label_begin</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>label_begin</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>NB</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>NB</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>KB</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>KB</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>NT</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>NT</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>label_begin</FuncName>
- <PyFunc><![CDATA[def label_begin( NB , KB ):]]></PyFunc>
- <PyFunc><![CDATA[ print "label_begin",NB,KB]]></PyFunc>
- <PyFunc><![CDATA[ return NB,KB]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>Python function</comment>
- <x-position>9</x-position>
- <y-position>250</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def label_begin( NB , KB ):]]></PyFunc>
+ <PyFunc><![CDATA[ print "label_begin",NB,KB]]></PyFunc>
+ <PyFunc><![CDATA[ return NB,KB]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>9</x-position>
+ <y-position>250</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>label_test</node-name>
- <kind>3</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>label_test</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>label_test</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>ValEven</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>ValEven</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>ValOne</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>ValOne</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>NT</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>NT</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>KT</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>KT</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>ValEven</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>ValEven</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>ValOne</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>ValOne</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>NT</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>NT</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>label_test</FuncName>
- <PyFunc><![CDATA[def label_test( ValEven , ValOne , NB , KB ):]]></PyFunc>
- <PyFunc><![CDATA[ print "label_begin",ValEven,ValOne,NB,KB]]></PyFunc>
- <PyFunc><![CDATA[ return ValEven,ValOne,NB,KB]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>Python function</comment>
- <x-position>396</x-position>
- <y-position>193</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def label_test( ValEven , ValOne , NB , KB ):]]></PyFunc>
+ <PyFunc><![CDATA[ print "label_begin",ValEven,ValOne,NB,KB]]></PyFunc>
+ <PyFunc><![CDATA[ return ValEven,ValOne,NB,KB]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>396</x-position>
+ <y-position>193</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>test</node-name>
- <kind>6</kind>
- <coupled-node>EndSwitch_OneEven</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>test</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch_OneEven</coupled-node>
+ <service>
<service-name>test</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>ValOne</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>ValOne</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>ValEven</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>ValEven</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>NT</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>NT</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>KT</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>KT</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Finished</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Finished</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Incr</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Incr</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Even</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Odd</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>N</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>N</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>K</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>K</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>Switch_OneEven</FuncName>
- <PyFunc><![CDATA[def Switch_OneEven( ValOne , ValEven , NT , KT ) :]]></PyFunc>
- <PyFunc><![CDATA[ Finished = ValOne]]></PyFunc>
- <PyFunc><![CDATA[ if Finished == 0 :]]></PyFunc>
- <PyFunc><![CDATA[ Incr = 1]]></PyFunc>
- <PyFunc><![CDATA[ Even = ValEven]]></PyFunc>
- <PyFunc><![CDATA[ if Even == 0 :]]></PyFunc>
- <PyFunc><![CDATA[ Odd = 1]]></PyFunc>
- <PyFunc><![CDATA[ else :]]></PyFunc>
- <PyFunc><![CDATA[ Odd = 0]]></PyFunc>
- <PyFunc><![CDATA[ else :]]></PyFunc>
- <PyFunc><![CDATA[ Incr = 0]]></PyFunc>
- <PyFunc><![CDATA[ Even = 0]]></PyFunc>
- <PyFunc><![CDATA[ Odd = 0]]></PyFunc>
- <PyFunc><![CDATA[ Even = ValEven]]></PyFunc>
- <PyFunc><![CDATA[ return Finished,Incr,Even,Odd,NT,KT]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>595</x-position>
- <y-position>239</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def Switch_OneEven( ValOne , ValEven , NT , KT ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Finished = ValOne]]></PyFunc>
+ <PyFunc><![CDATA[ if Finished == 0 :]]></PyFunc>
+ <PyFunc><![CDATA[ Incr = 1]]></PyFunc>
+ <PyFunc><![CDATA[ Even = ValEven]]></PyFunc>
+ <PyFunc><![CDATA[ if Even == 0 :]]></PyFunc>
+ <PyFunc><![CDATA[ Odd = 1]]></PyFunc>
+ <PyFunc><![CDATA[ else :]]></PyFunc>
+ <PyFunc><![CDATA[ Odd = 0]]></PyFunc>
+ <PyFunc><![CDATA[ else :]]></PyFunc>
+ <PyFunc><![CDATA[ Incr = 0]]></PyFunc>
+ <PyFunc><![CDATA[ Even = 0]]></PyFunc>
+ <PyFunc><![CDATA[ Odd = 0]]></PyFunc>
+ <PyFunc><![CDATA[ Even = ValEven]]></PyFunc>
+ <PyFunc><![CDATA[ return Finished,Incr,Even,Odd,NT,KT]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>595</x-position>
+ <y-position>239</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>EndSwitch_OneEven</node-name>
- <kind>7</kind>
- <coupled-node>test</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch_OneEven</node-name>
+ <kind>7</kind>
+ <coupled-node>test</coupled-node>
+ <service>
<service-name>EndSwitch_OneEven</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Finished</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Finished</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Finished</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Finished</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>K</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>K</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>EndSwitch_OneEven</FuncName>
- <PyFunc><![CDATA[def EndSwitch_OneEven( Finished , K ):]]></PyFunc>
- <PyFunc><![CDATA[ print "label_begin",Finished,K]]></PyFunc>
- <PyFunc><![CDATA[ return Finished,K]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>1152</x-position>
- <y-position>292</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def EndSwitch_OneEven( Finished , K ):]]></PyFunc>
+ <PyFunc><![CDATA[ print "label_begin",Finished,K]]></PyFunc>
+ <PyFunc><![CDATA[ return Finished,K]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1256</x-position>
+ <y-position>305</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>control_m3p1</node-name>
- <kind>8</kind>
- <coupled-node>label_test</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>control_m3p1</node-name>
+ <kind>8</kind>
+ <coupled-node>label_test</coupled-node>
+ <service>
<service-name>control_m3p1</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>N</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>N</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>ValOne</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>ValOne</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>ValEven</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>ValEven</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>NT</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>NT</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>KT</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>control_m3p1</FuncName>
- <PyFunc><![CDATA[def control_m3p1( N , K ):]]></PyFunc>
- <PyFunc><![CDATA[ return 0,1,N,K]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>980</x-position>
- <y-position>81</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def control_m3p1( N , K ):]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,1,N,K]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1073</x-position>
+ <y-position>87</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>control_div2</node-name>
- <kind>8</kind>
- <coupled-node>label_begin</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>control_div2</node-name>
+ <kind>8</kind>
+ <coupled-node>label_begin</coupled-node>
+ <service>
<service-name>control_div2</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>N</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>N</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>K</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>NB</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>NB</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>KB</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>KB</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>control_div2</FuncName>
- <PyFunc><![CDATA[def control_div2( N , NB ) :]]></PyFunc>
- <PyFunc><![CDATA[ return N,NB]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>18/9/2003 - 17:27:23</creation-date>
- <lastmodification-date>18/9/2003 - 17:27:23</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>1039</x-position>
- <y-position>454</y-position> </node> </node-list>
- <link-list>
+ <PyFunc><![CDATA[def control_div2( N , NB ) :]]></PyFunc>
+ <PyFunc><![CDATA[ return N,NB]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/1/2005 - 13:45:36</creation-date>
+ <lastmodification-date>17/1/2005 - 13:45:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1128</x-position>
+ <y-position>453</y-position> </node> </node-list>
+ <link-list>
<link>
<fromnode-name>test_ISEVEN</fromnode-name>
- <fromserviceparameter-name>BoolEven</fromserviceparameter-name>
- <tonode-name>label_test</tonode-name>
- <toserviceparameter-name>ValEven</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>BoolEven</fromserviceparameter-name>
+ <tonode-name>label_test</tonode-name>
+ <toserviceparameter-name>ValEven</toserviceparameter-name>
+ <coord-list>
<coord>
<x>369</x>
- <y>273</y> </coord>
- <coord>
+ <y>273</y> </coord>
+ <coord>
<x>370</x>
- <y>498</y> </coord> </coord-list> </link>
- <link>
+ <y>498</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test_ISONE</fromnode-name>
- <fromserviceparameter-name>BoolOne</fromserviceparameter-name>
- <tonode-name>label_test</tonode-name>
- <toserviceparameter-name>ValOne</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>BoolOne</fromserviceparameter-name>
+ <tonode-name>label_test</tonode-name>
+ <toserviceparameter-name>ValOne</toserviceparameter-name>
+ <coord-list>
<coord>
<x>385</x>
- <y>303</y> </coord>
- <coord>
+ <y>303</y> </coord>
+ <coord>
<x>384</x>
- <y>225</y> </coord> </coord-list> </link>
- <link>
+ <y>225</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>m3p1</fromnode-name>
- <fromserviceparameter-name>anEvenInteger</fromserviceparameter-name>
- <tonode-name>control_m3p1</tonode-name>
- <toserviceparameter-name>N</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>anEvenInteger</fromserviceparameter-name>
+ <tonode-name>control_m3p1</tonode-name>
+ <toserviceparameter-name>N</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>div2</fromnode-name>
- <fromserviceparameter-name>anInteger</fromserviceparameter-name>
- <tonode-name>control_div2</tonode-name>
- <toserviceparameter-name>N</toserviceparameter-name>
- <coord-list/> </link>
- <link>
-<fromnode-name>incr</fromnode-name>
- <fromserviceparameter-name>aNewCount</fromserviceparameter-name>
- <tonode-name>control_m3p1</tonode-name>
- <toserviceparameter-name>K</toserviceparameter-name>
- <coord-list>
-<coord>
-<x>964</x>
- <y>145</y> </coord>
- <coord>
-<x>964</x>
- <y>309</y> </coord> </coord-list> </link>
- <link>
+ <fromserviceparameter-name>anInteger</fromserviceparameter-name>
+ <tonode-name>control_div2</tonode-name>
+ <toserviceparameter-name>N</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>incr</fromnode-name>
- <fromserviceparameter-name>aNewCount</fromserviceparameter-name>
- <tonode-name>control_div2</tonode-name>
- <toserviceparameter-name>K</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>aNewCount</fromserviceparameter-name>
+ <tonode-name>control_m3p1</tonode-name>
+ <toserviceparameter-name>K</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>963</x>
- <y>518</y> </coord>
- <coord>
-<x>964</x>
- <y>312</y> </coord> </coord-list> </link>
- <link>
+<x>1048</x>
+ <y>139</y> </coord>
+ <coord>
+<x>1048</x>
+ <y>241</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>incr_1</fromnode-name>
+ <fromserviceparameter-name>aNewCount</fromserviceparameter-name>
+ <tonode-name>control_div2</tonode-name>
+ <toserviceparameter-name>K</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>label_begin</fromnode-name>
- <fromserviceparameter-name>NT</fromserviceparameter-name>
- <tonode-name>label_test</tonode-name>
- <toserviceparameter-name>NT</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>NT</fromserviceparameter-name>
+ <tonode-name>label_test</tonode-name>
+ <toserviceparameter-name>NT</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>label_begin</fromnode-name>
- <fromserviceparameter-name>NT</fromserviceparameter-name>
- <tonode-name>test_ISONE</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>NT</fromserviceparameter-name>
+ <tonode-name>test_ISONE</tonode-name>
+ <toserviceparameter-name>anInteger</toserviceparameter-name>
+ <coord-list>
<coord>
<x>192</x>
- <y>226</y> </coord>
- <coord>
+ <y>226</y> </coord>
+ <coord>
<x>191</x>
- <y>331</y> </coord> </coord-list> </link>
- <link>
+ <y>331</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>label_begin</fromnode-name>
- <fromserviceparameter-name>NT</fromserviceparameter-name>
- <tonode-name>test_ISEVEN</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>NT</fromserviceparameter-name>
+ <tonode-name>test_ISEVEN</tonode-name>
+ <toserviceparameter-name>anInteger</toserviceparameter-name>
+ <coord-list>
<coord>
<x>191</x>
- <y>494</y> </coord>
- <coord>
+ <y>494</y> </coord>
+ <coord>
<x>192</x>
- <y>331</y> </coord> </coord-list> </link>
- <link>
+ <y>331</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>label_begin</fromnode-name>
- <fromserviceparameter-name>KT</fromserviceparameter-name>
- <tonode-name>label_test</tonode-name>
- <toserviceparameter-name>KT</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>KT</fromserviceparameter-name>
+ <tonode-name>label_test</tonode-name>
+ <toserviceparameter-name>KT</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>label_test</fromnode-name>
- <fromserviceparameter-name>ValEven</fromserviceparameter-name>
- <tonode-name>test</tonode-name>
- <toserviceparameter-name>ValEven</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>ValEven</fromserviceparameter-name>
+ <tonode-name>test</tonode-name>
+ <toserviceparameter-name>ValEven</toserviceparameter-name>
+ <coord-list>
<coord>
<x>587</x>
- <y>318</y> </coord>
- <coord>
+ <y>318</y> </coord>
+ <coord>
<x>570</x>
- <y>318</y> </coord>
- <coord>
+ <y>318</y> </coord>
+ <coord>
<x>569</x>
- <y>272</y> </coord> </coord-list> </link>
- <link>
+ <y>272</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>label_test</fromnode-name>
- <fromserviceparameter-name>ValOne</fromserviceparameter-name>
- <tonode-name>test</tonode-name>
- <toserviceparameter-name>ValOne</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>ValOne</fromserviceparameter-name>
+ <tonode-name>test</tonode-name>
+ <toserviceparameter-name>ValOne</toserviceparameter-name>
+ <coord-list>
<coord>
<x>585</x>
- <y>273</y> </coord>
- <coord>
+ <y>273</y> </coord>
+ <coord>
<x>586</x>
- <y>303</y> </coord> </coord-list> </link>
- <link>
+ <y>303</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>label_test</fromnode-name>
- <fromserviceparameter-name>NT</fromserviceparameter-name>
- <tonode-name>test</tonode-name>
- <toserviceparameter-name>NT</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>NT</fromserviceparameter-name>
+ <tonode-name>test</tonode-name>
+ <toserviceparameter-name>NT</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>label_test</fromnode-name>
- <fromserviceparameter-name>KT</fromserviceparameter-name>
- <tonode-name>test</tonode-name>
- <toserviceparameter-name>KT</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>KT</fromserviceparameter-name>
+ <tonode-name>test</tonode-name>
+ <toserviceparameter-name>KT</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>Finished</fromserviceparameter-name>
- <tonode-name>EndSwitch_OneEven</tonode-name>
- <toserviceparameter-name>Finished</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Finished</fromserviceparameter-name>
+ <tonode-name>EndSwitch_OneEven</tonode-name>
+ <toserviceparameter-name>Finished</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>Incr</fromserviceparameter-name>
- <tonode-name>incr</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list>
-<coord>
-<x>783</x>
- <y>341</y> </coord>
- <coord>
-<x>782</x>
- <y>302</y> </coord> </coord-list> </link>
- <link>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>incr_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>Even</fromserviceparameter-name>
- <tonode-name>div2</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>div2</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>754</x>
- <y>518</y> </coord>
- <coord>
-<x>753</x>
- <y>330</y> </coord> </coord-list> </link>
- <link>
+<x>793</x>
+ <y>561</y> </coord>
+ <coord>
+<x>794</x>
+ <y>310</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>Odd</fromserviceparameter-name>
- <tonode-name>m3p1</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>incr</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>test</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>m3p1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>758</x>
- <y>145</y> </coord>
- <coord>
-<x>760</x>
- <y>359</y> </coord> </coord-list> </link>
- <link>
+<x>778</x>
+ <y>138</y> </coord>
+ <coord>
+<x>780</x>
+ <y>328</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>N</fromserviceparameter-name>
- <tonode-name>m3p1</tonode-name>
- <toserviceparameter-name>anOddInteger</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>N</fromserviceparameter-name>
+ <tonode-name>m3p1</tonode-name>
+ <toserviceparameter-name>anOddInteger</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>767</x>
- <y>116</y> </coord>
- <coord>
-<x>767</x>
- <y>116</y> </coord>
- <coord>
-<x>767</x>
- <y>390</y> </coord> </coord-list> </link>
- <link>
+<x>808</x>
+ <y>113</y> </coord>
+ <coord>
+<x>807</x>
+ <y>352</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>N</fromserviceparameter-name>
- <tonode-name>div2</tonode-name>
- <toserviceparameter-name>anEvenInteger</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>N</fromserviceparameter-name>
+ <tonode-name>div2</tonode-name>
+ <toserviceparameter-name>anEvenInteger</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>767</x>
- <y>489</y> </coord>
- <coord>
-<x>766</x>
- <y>389</y> </coord> </coord-list> </link>
- <link>
+<x>806</x>
+ <y>537</y> </coord>
+ <coord>
+<x>807</x>
+ <y>351</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>K</fromserviceparameter-name>
- <tonode-name>EndSwitch_OneEven</tonode-name>
- <toserviceparameter-name>K</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>K</fromserviceparameter-name>
+ <tonode-name>EndSwitch_OneEven</tonode-name>
+ <toserviceparameter-name>K</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>K</fromserviceparameter-name>
- <tonode-name>incr</tonode-name>
- <toserviceparameter-name>aCount</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>K</fromserviceparameter-name>
+ <tonode-name>incr</tonode-name>
+ <toserviceparameter-name>aCount</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>772</x>
- <y>311</y> </coord>
- <coord>
-<x>772</x>
- <y>417</y> </coord>
- <coord>
-<x>772</x>
- <y>417</y> </coord> </coord-list> </link>
- <link>
+<x>773</x>
+ <y>236</y> </coord>
+ <coord>
+<x>773</x>
+ <y>370</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>test</fromnode-name>
- <fromserviceparameter-name>Default</fromserviceparameter-name>
- <tonode-name>EndSwitch_OneEven</tonode-name>
- <toserviceparameter-name>Default</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>K</fromserviceparameter-name>
+ <tonode-name>incr_1</tonode-name>
+ <toserviceparameter-name>aCount</toserviceparameter-name>
+ <coord-list>
<coord>
-<x>778</x>
- <y>384</y> </coord>
- <coord>
-<x>778</x>
- <y>448</y> </coord> </coord-list> </link>
- <link>
+<x>774</x>
+ <y>409</y> </coord>
+ <coord>
+<x>773</x>
+ <y>368</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>test</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>EndSwitch_OneEven</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>840</x>
+ <y>381</y> </coord>
+ <coord>
+<x>839</x>
+ <y>394</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>control_m3p1</fromnode-name>
- <fromserviceparameter-name>OutGate</fromserviceparameter-name>
- <tonode-name>label_test</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>label_test</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
<coord>
<x>388</x>
- <y>388</y> </coord>
- <coord>
+ <y>388</y> </coord>
+ <coord>
<x>389</x>
- <y>597</y> </coord>
- <coord>
-<x>1319</x>
- <y>597</y> </coord>
- <coord>
-<x>1318</x>
- <y>231</y> </coord> </coord-list> </link>
- <link>
+ <y>597</y> </coord>
+ <coord>
+<x>1441</x>
+ <y>604</y> </coord>
+ <coord>
+<x>1441</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>control_div2</fromnode-name>
- <fromserviceparameter-name>OutGate</fromserviceparameter-name>
- <tonode-name>label_begin</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>label_begin</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
<coord>
<x>4</x>
- <y>388</y> </coord>
- <coord>
+ <y>388</y> </coord>
+ <coord>
<x>3</x>
- <y>587</y> </coord>
- <coord>
-<x>1214</x>
- <y>588</y> </coord>
- <coord>
-<x>1213</x>
- <y>546</y> </coord> </coord-list> </link> </link-list>
- <data-list>
+ <y>587</y> </coord>
+ <coord>
+<x>1307</x>
+ <y>586</y> </coord>
+ <coord>
+<x>1307</x>
+ <y>528</y> </coord> </coord-list> </link> </link-list>
+ <data-list>
<data>
-<fromnode-name>GraphSyrControl</fromnode-name>
- <fromserviceparameter-name>label_begin\NB</fromserviceparameter-name>
- <tonode-name>label_begin</tonode-name>
- <toserviceparameter-name>NB</toserviceparameter-name>
- <data-value>
+<fromnode-name>GraphGOTO_2</fromnode-name>
+ <fromserviceparameter-name>label_begin__NB</fromserviceparameter-name>
+ <tonode-name>label_begin</tonode-name>
+ <toserviceparameter-name>NB</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>7</value> </data-value>
- <coord-list/> </data>
- <data>
-<fromnode-name>GraphSyrControl</fromnode-name>
- <fromserviceparameter-name>label_begin\KB</fromserviceparameter-name>
- <tonode-name>label_begin</tonode-name>
- <toserviceparameter-name>KB</toserviceparameter-name>
- <data-value>
+ <value>7</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphGOTO_2</fromnode-name>
+ <fromserviceparameter-name>label_begin__KB</fromserviceparameter-name>
+ <tonode-name>label_begin</tonode-name>
+ <toserviceparameter-name>KB</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>0</value> </data-value>
- <coord-list/> </data> </data-list></dataflow>
+ <value>0</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph aNewDataFlow
+
+from SuperV import *
+
+# Graph creation of aNewDataFlow
+def DefaNewDataFlow() :
+ aNewDataFlow = Graph( 'aNewDataFlow' )
+ aNewDataFlow.SetName( 'aNewDataFlow' )
+ aNewDataFlow.SetAuthor( '' )
+ aNewDataFlow.SetComment( '' )
+ aNewDataFlow.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyVoidFunction = []
+ PyVoidFunction.append( 'import salome ' )
+ PyVoidFunction.append( 'def VoidFunction() : ' )
+ PyVoidFunction.append( ' print 'VoidFunction()' ' )
+ PyVoidFunction.append( ' return 'Done' ' )
+ PyVoidFunction.append( '' )
+ VoidFunction = aNewDataFlow.INode( 'VoidFunction' , PyVoidFunction )
+ VoidFunction.SetName( 'VoidFunction' )
+ VoidFunction.SetAuthor( '' )
+ VoidFunction.SetComment( 'Compute Node' )
+ VoidFunction.Coords( 60 , 58 )
+ IVoidFunctionGate = VoidFunction.GetInPort( 'Gate' )
+ OVoidFunctionDone = VoidFunction.OutPort( 'Done' , 'string' )
+ OVoidFunctionGate = VoidFunction.GetOutPort( 'Gate' )
+
+ # Output Ports of the graph
+ #OVoidFunctionDone = VoidFunction.GetOutPort( 'Done' )
+ return aNewDataFlow
+
+
+aNewDataFlow = DefaNewDataFlow()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>aNewDataFlow</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>aNewDataFlow</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>VoidFunction__Done</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 12:52:44</creation-date>
+ <lastmodification-date>8/12/2004 - 16:0:49</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>VoidFunction</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>VoidFunction</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Done</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>VoidFunction</FuncName>
+ <PyFunc><![CDATA[import salome ]]></PyFunc>
+ <PyFunc><![CDATA[def VoidFunction() : ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'VoidFunction()' ]]></PyFunc>
+ <PyFunc><![CDATA[ return 'Done' ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>8/12/2004 - 16:0:49</creation-date>
+ <lastmodification-date>8/12/2004 - 16:0:49</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>60</x-position>
+ <y-position>58</y-position> </node> </node-list>
+ <link-list/>
+ <data-list/> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphInputInLoop_2
+
+from SuperV import *
+
+# Graph creation of GraphInputInLoop_2
+def DefGraphInputInLoop_2() :
+ GraphInputInLoop_2 = Graph( 'GraphInputInLoop_2' )
+ GraphInputInLoop_2.SetName( 'GraphInputInLoop_2' )
+ GraphInputInLoop_2.SetAuthor( '' )
+ GraphInputInLoop_2.SetComment( '' )
+ GraphInputInLoop_2.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even,Const) : ' )
+ PyIsOdd.append( ' print 'IsOdd',a,Even,Const ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a,Const ' )
+ IsOdd = GraphInputInLoop_2.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddConst = IsOdd.InPort( 'Const' , 'string' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddConst = IsOdd.OutPort( 'Const' , 'string' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( '' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( '' )
+ InitLoop,EndOfInitLoop = GraphInputInLoop_2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 105 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphInputInLoop_2.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 105 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphInputInLoop_2.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 576 , 73 )
+
+ LInitLoopIndexSwitcha = GraphInputInLoop_2.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphInputInLoop_2.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LInitLoopMaxEndOfInitLoopMax = GraphInputInLoop_2.Link( OInitLoopMax , IEndOfInitLoopMax )
+
+ LSwitchOddIsOddGate = GraphInputInLoop_2.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphInputInLoop_2.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphInputInLoop_2.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 92 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 159 )
+
+ LSwitchaIsOdda = GraphInputInLoop_2.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 366 , 71 )
+ LSwitchaIsOdda.AddCoord( 2 , 366 , 182 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphInputInLoop_2.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ # Input datas
+ IIsOddConst.Input( 'Const Input Value' )
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 100 )
+
+ # Output Ports of the graph
+ #OIsOddConst = IsOdd.GetOutPort( 'Const' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphInputInLoop_2
+
+
+GraphInputInLoop_2 = DefGraphInputInLoop_2()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphInputInLoop_2</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphInputInLoop_2</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>IsOdd__Const</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>IsOdd__Const</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>boolean</inParameter-type>
+ <inParameter-name>Even</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Const</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Const</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even,Const) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'IsOdd',a,Even,Const ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Const ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:47:59</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:47:59</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoop</FuncName>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:47:59</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>105</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:47:59</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch</FuncName>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:47:59</creation-date>
+ <lastmodification-date>7/1/2005 - 16:47:59</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>105</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>576</x>
+ <y>136</y> </coord>
+ <coord>
+<x>576</x>
+ <y>73</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>375</x>
+ <y>92</y> </coord>
+ <coord>
+<x>375</x>
+ <y>159</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>366</x>
+ <y>71</y> </coord>
+ <coord>
+<x>366</x>
+ <y>182</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphInputInLoop_2</fromnode-name>
+ <fromserviceparameter-name>IsOdd__Const</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Const</toserviceparameter-name>
+ <data-value>
+<value-type>18</value-type>
+ <value>Const Input Value</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphInputInLoop_2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphInputInLoop_2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphInputInLoop_2</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>100</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+from GraphEssai import *
+import time
+
+exec GraphEssai.ListNodes('GraphEssai')
+
+GraphEssai.Run()
+time.sleep(10)
+GraphEssai.Kill()
+print 'Add :',Add.State()
+print 'Sub :',Sub.State()
+print 'Mul :',Mul.State()
+print 'Div :',Div.State()
+print 'GraphEssai :',GraphEssai.State()
+
+
+GraphEssai.Run()
+time.sleep(5)
+GraphEssai.Suspend()
+print 'Add :',Add.State()
+print 'Sub :',Sub.State()
+print 'Mul :',Mul.State()
+print 'Div :',Div.State()
+print 'GraphEssai :',GraphEssai.State()
+GraphEssai.Resume()
+time.sleep(5)
+print 'Add :',Add.State()
+print 'Sub :',Sub.State()
+print 'Mul :',Mul.State()
+print 'Div :',Div.State()
+print 'GraphEssai :',GraphEssai.State()
+
+GraphEssai.DoneW()
+GraphEssai.PrintPorts()
+time.sleep(1)
+print 'Add :',Add.State()
+print 'Sub :',Sub.State()
+print 'Mul :',Mul.State()
+print 'Div :',Div.State()
+print 'GraphEssai :',GraphEssai.State()
+
# Generated python file of Graph GraphLoop
from SuperV import *
-# Graph creation
-GraphLoop = Graph( 'GraphLoop' )
-GraphLoop.SetName( 'GraphLoop' )
-GraphLoop.SetAuthor( '' )
-GraphLoop.SetComment( '' )
-GraphLoop.Coords( 0 , 0 )
-# Creation of Factory Nodes
+# Graph creation of GraphLoop
+def DefGraphLoop() :
+ GraphLoop = Graph( 'GraphLoop' )
+ GraphLoop.SetName( 'GraphLoop' )
+ GraphLoop.SetAuthor( '' )
+ GraphLoop.SetComment( '' )
+ GraphLoop.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyInit = []
+ PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
+ PyInit.append( ' if Min <= Max : ' )
+ PyInit.append( ' Index = Min ' )
+ PyInit.append( ' else : ' )
+ PyInit.append( ' Index = Max ' )
+ PyInit.append( ' return Index,Min,Max,Incr ' )
+ PyMoreInit = []
+ PyMoreInit.append( 'import time ' )
+ PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
+ PyMoreInit.append( ' time.sleep(2) ' )
+ PyMoreInit.append( ' if Index < Max : ' )
+ PyMoreInit.append( ' DoLoop = 1 ' )
+ PyMoreInit.append( ' else : ' )
+ PyMoreInit.append( ' DoLoop = 0 ' )
+ PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
+ PyNextInit = []
+ PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
+ PyNextInit.append( ' Index = Index + Incr ' )
+ PyNextInit.append( ' return Index,Min,Max,Incr ' )
+ Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 366 , 262 )
+ PyEndInit = []
+ EndInit.SetPyFunction( '' , PyEndInit )
+ IInitInitLoop = Init.GetInPort( 'DoLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMin = Init.InPort( 'Min' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitIncr = Init.InPort( 'Incr' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMin = Init.GetOutPort( 'Min' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ OInitIncr = Init.GetOutPort( 'Incr' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMin = EndInit.GetInPort( 'Min' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitIncr = EndInit.GetInPort( 'Incr' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMin = EndInit.GetOutPort( 'Min' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 17 , 257 )
+
+ # Creation of Links
+ LInitIndexEndInitIndex = GraphLoop.Link( OInitIndex , IEndInitIndex )
+
+ LInitMinEndInitMin = GraphLoop.Link( OInitMin , IEndInitMin )
+
+ LInitMaxEndInitMax = GraphLoop.Link( OInitMax , IEndInitMax )
+
+ LInitIncrEndInitIncr = GraphLoop.Link( OInitIncr , IEndInitIncr )
+
+ # Input datas
+ IInitIndex.Input( 0 )
+ IInitMin.Input( 5 )
+ IInitMax.Input( 10 )
+ IInitIncr.Input( 1 )
+
+ # Output Ports of the graph
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMin = EndInit.GetOutPort( 'Min' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ return GraphLoop
-# Creation of Loop Nodes
-PyInit = []
-PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
-PyInit.append( ' if Min <= Max : ' )
-PyInit.append( ' Index = Min ' )
-PyInit.append( ' else : ' )
-PyInit.append( ' Index = Max ' )
-PyInit.append( ' return Index,Min,Max,Incr ' )
-PyMoreInit = []
-PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
-PyMoreInit.append( ' if Index < Max : ' )
-PyMoreInit.append( ' DoLoop = 1 ' )
-PyMoreInit.append( ' else : ' )
-PyMoreInit.append( ' DoLoop = 0 ' )
-PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
-PyNextInit = []
-PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
-PyNextInit.append( ' Index = Index + Incr ' )
-PyNextInit.append( ' return Index,Min,Max,Incr ' )
-Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
-EndInit.SetName( 'EndInit' )
-EndInit.SetAuthor( '' )
-EndInit.SetComment( '' )
-EndInit.Coords( 314 , 91 )
-Init.InPort( 'Index' , 'long' )
-Init.InPort( 'Min' , 'long' )
-Init.InPort( 'Max' , 'long' )
-Init.InPort( 'Incr' , 'long' )
-Init.OutPort( 'Index' , 'long' )
-Init.OutPort( 'Min' , 'long' )
-Init.OutPort( 'Max' , 'long' )
-Init.OutPort( 'Incr' , 'long' )
-Init.SetName( 'Init' )
-Init.SetAuthor( '' )
-Init.SetComment( '' )
-Init.Coords( 31 , 74 )
-
-# Creation of Links
-InitIndex = Init.Port( 'Index' )
-EndInitIndex = GraphLoop.Link( InitIndex , EndInit.Port( 'Index' ) )
-
-InitMin = Init.Port( 'Min' )
-EndInitMin = GraphLoop.Link( InitMin , EndInit.Port( 'Min' ) )
-
-InitMax = Init.Port( 'Max' )
-EndInitMax = GraphLoop.Link( InitMax , EndInit.Port( 'Max' ) )
-
-InitIncr = Init.Port( 'Incr' )
-EndInitIncr = GraphLoop.Link( InitIncr , EndInit.Port( 'Incr' ) )
-
-# Creation of Input datas
-InitIndex = Init.Input( 'Index' , 0)
-InitMin = Init.Input( 'Min' , 0)
-InitMax = Init.Input( 'Max' , 1000)
-InitIncr = Init.Input( 'Incr' , 1)
-
-# Creation of Output variables
-EndInitIndex = EndInit.Port( 'Index' )
-EndInitMin = EndInit.Port( 'Min' )
-EndInitMax = EndInit.Port( 'Max' )
-EndInitIncr = EndInit.Port( 'Incr' )
-
-GraphLoop.Run()
-
-GraphLoop.DoneW()
-
-GraphLoop.PrintPorts()
+GraphLoop = DefGraphLoop()
-<!DOCTYPE Dataflow>
+<!DOCTYPE SuperGraph>
+<supergraph>
<dataflow>
<info-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphLoop</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoop</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>GraphLoop</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Init\Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Init\Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Init__Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Init\Max</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Init\Incr</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Init__Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndInit\Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndInit\Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>EndInit__Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndInit\Max</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndInit\Incr</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>24/3/2003 - 14:44:35</creation-date>
- <lastmodification-date>25/3/2003 - 9:50:2</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>0</x-position>
- <y-position>0</y-position> </node> </info-list>
- <node-list>
+ <outParameter-name>EndInit__Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>24/3/2003 - 14:44:35</creation-date>
+ <lastmodification-date>16/12/2004 - 11:8:15</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>Init</node-name>
- <kind>4</kind>
- <coupled-node>EndInit</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
<service-name>Init</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Max</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Max</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>Init</FuncName>
- <PyFunc><![CDATA[def Init(Index,Min,Max,Incr) : ]]></PyFunc>
- <PyFunc><![CDATA[ if Min <= Max : ]]></PyFunc>
- <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
- <PyFunc><![CDATA[ else : ]]></PyFunc>
- <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
- <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
- <PyFunction>
+ <PyFunc><![CDATA[def Init(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Min <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
+ <PyFunction>
<FuncName>More</FuncName>
- <PyFunc><![CDATA[def More(Index,Min,Max,Incr) : ]]></PyFunc>
- <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
- <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
- <PyFunc><![CDATA[ else : ]]></PyFunc>
- <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
- <PyFunc><![CDATA[ return DoLoop,Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
- <PyFunction>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def More(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
+ <PyFunction>
<FuncName>Next</FuncName>
- <PyFunc><![CDATA[def Next(Index,Min,Max,Incr) : ]]></PyFunc>
- <PyFunc><![CDATA[ Index = Index + Incr ]]></PyFunc>
- <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>25/3/2003 - 9:50:2</creation-date>
- <lastmodification-date>25/3/2003 - 9:50:2</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>17</x-position>
- <y-position>257</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def Next(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 11:8:15</creation-date>
+ <lastmodification-date>16/12/2004 - 11:8:15</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>17</x-position>
+ <y-position>257</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>EndInit</node-name>
- <kind>5</kind>
- <coupled-node>Init</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
<service-name>EndInit</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Max</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Max</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
-<PyFunction/> </PyFunction-list>
- <creation-date>25/3/2003 - 9:50:2</creation-date>
- <lastmodification-date>25/3/2003 - 9:50:2</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>626</x-position>
- <y-position>259</y-position> </node> </node-list>
- <link-list>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 11:8:15</creation-date>
+ <lastmodification-date>16/12/2004 - 11:8:15</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>366</x-position>
+ <y-position>262</y-position> </node> </node-list>
+ <link-list>
<link>
<fromnode-name>Init</fromnode-name>
- <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
- <tonode-name>EndInit</tonode-name>
- <toserviceparameter-name>DoLoop</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Init</fromnode-name>
- <fromserviceparameter-name>Index</fromserviceparameter-name>
- <tonode-name>EndInit</tonode-name>
- <toserviceparameter-name>Index</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Init</fromnode-name>
- <fromserviceparameter-name>Min</fromserviceparameter-name>
- <tonode-name>EndInit</tonode-name>
- <toserviceparameter-name>Min</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Init</fromnode-name>
- <fromserviceparameter-name>Max</fromserviceparameter-name>
- <tonode-name>EndInit</tonode-name>
- <toserviceparameter-name>Max</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Init</fromnode-name>
- <fromserviceparameter-name>Incr</fromserviceparameter-name>
- <tonode-name>EndInit</tonode-name>
- <toserviceparameter-name>Incr</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Incr</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>EndInit</fromnode-name>
- <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
- <tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
- <coord-list/> </link> </link-list>
- <data-list>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
<data>
<fromnode-name>GraphLoop</fromnode-name>
- <fromserviceparameter-name>Init\Index</fromserviceparameter-name>
- <tonode-name>Init</tonode-name>
- <toserviceparameter-name>Index</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>0</value> </data-value>
- <coord-list/> </data>
- <data>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
<fromnode-name>GraphLoop</fromnode-name>
- <fromserviceparameter-name>Init\Min</fromserviceparameter-name>
- <tonode-name>Init</tonode-name>
- <toserviceparameter-name>Min</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>Init__Min</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>0</value> </data-value>
- <coord-list/> </data>
- <data>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
<fromnode-name>GraphLoop</fromnode-name>
- <fromserviceparameter-name>Init\Max</fromserviceparameter-name>
- <tonode-name>Init</tonode-name>
- <toserviceparameter-name>Max</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>10</value> </data-value>
- <coord-list/> </data>
- <data>
+ <value>10</value> </data-value>
+ <coord-list/> </data>
+ <data>
<fromnode-name>GraphLoop</fromnode-name>
- <fromserviceparameter-name>Init\Incr</fromserviceparameter-name>
- <tonode-name>Init</tonode-name>
- <toserviceparameter-name>Incr</toserviceparameter-name>
- <data-value>
+ <fromserviceparameter-name>Init__Incr</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>1</value> </data-value>
- <coord-list/> </data> </data-list></dataflow>
+ <value>1</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphLoopDoWhile
+
+from SuperV import *
+
+# Graph creation of GraphLoopDoWhile
+def DefGraphLoopDoWhile() :
+ GraphLoopDoWhile = Graph( 'GraphLoopDoWhile' )
+ GraphLoopDoWhile.SetName( 'GraphLoopDoWhile' )
+ GraphLoopDoWhile.SetAuthor( 'JR' )
+ GraphLoopDoWhile.SetComment( '' )
+ GraphLoopDoWhile.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyLoop = []
+ PyMoreLoop = []
+ PyMoreLoop.append( '' )
+ PyNextLoop = []
+ PyNextLoop.append( 'def LoopWhileNext(Index,Max) : ' )
+ PyNextLoop.append( ' Index = Index + 1 ' )
+ PyNextLoop.append( ' return Index,Max ' )
+ PyNextLoop.append( '' )
+ Loop,EndLoop = GraphLoopDoWhile.LNode( '' , PyLoop , '' , PyMoreLoop , 'LoopWhileNext' , PyNextLoop )
+ EndLoop.SetName( 'EndLoop' )
+ EndLoop.SetAuthor( '' )
+ EndLoop.SetComment( 'Compute Node' )
+ EndLoop.Coords( 414 , 232 )
+ PyEndLoop = []
+ PyEndLoop.append( 'import time ' )
+ PyEndLoop.append( 'def DoWhile(DoLoop,Index,Max) : ' )
+ PyEndLoop.append( ' print 'DoWhile',DoLoop,Index,Max ' )
+ PyEndLoop.append( ' time.sleep(2) ' )
+ PyEndLoop.append( ' if Index == Max : ' )
+ PyEndLoop.append( ' DoLoop = 0 ' )
+ PyEndLoop.append( ' else : ' )
+ PyEndLoop.append( ' DoLoop = 1 ' )
+ PyEndLoop.append( ' print 'DoWhile',DoLoop,Index,Max ' )
+ PyEndLoop.append( ' return DoLoop,Index,Max ' )
+ EndLoop.SetPyFunction( 'DoWhile' , PyEndLoop )
+ ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
+ ILoopIndex = Loop.InPort( 'Index' , 'long' )
+ ILoopMax = Loop.InPort( 'Max' , 'long' )
+ ILoopGate = Loop.GetInPort( 'Gate' )
+ OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
+ OLoopIndex = Loop.GetOutPort( 'Index' )
+ OLoopMax = Loop.GetOutPort( 'Max' )
+ IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
+ IEndLoopIndex = EndLoop.GetInPort( 'Index' )
+ IEndLoopMax = EndLoop.GetInPort( 'Max' )
+ IEndLoopGate = EndLoop.GetInPort( 'Gate' )
+ OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
+ OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ Loop.SetName( 'Loop' )
+ Loop.SetAuthor( '' )
+ Loop.SetComment( 'Compute Node' )
+ Loop.Coords( 105 , 226 )
+
+ # Creation of Links
+ LLoopIndexEndLoopIndex = GraphLoopDoWhile.Link( OLoopIndex , IEndLoopIndex )
+
+ LLoopMaxEndLoopMax = GraphLoopDoWhile.Link( OLoopMax , IEndLoopMax )
+
+ # Input datas
+ ILoopIndex.Input( 5 )
+ ILoopMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ return GraphLoopDoWhile
+
+
+GraphLoopDoWhile = DefGraphLoopDoWhile()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopDoWhile</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopDoWhile</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>16/12/2004 - 15:39:50</creation-date>
+ <lastmodification-date>16/12/2004 - 18:44:10</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Loop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndLoop</coupled-node>
+ <service>
+<service-name>Loop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>LoopWhileNext</FuncName>
+ <PyFunc><![CDATA[def LoopWhileNext(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 18:44:10</creation-date>
+ <lastmodification-date>16/12/2004 - 18:44:10</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>105</x-position>
+ <y-position>226</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>Loop</coupled-node>
+ <service>
+<service-name>EndLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>DoWhile</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def DoWhile(DoLoop,Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'DoWhile',DoLoop,Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index == Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'DoWhile',DoLoop,Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 18:44:10</creation-date>
+ <lastmodification-date>16/12/2004 - 18:44:10</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>414</x-position>
+ <y-position>232</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphLoopDoWhile</fromnode-name>
+ <fromserviceparameter-name>Loop__Index</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopDoWhile</fromnode-name>
+ <fromserviceparameter-name>Loop__Max</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphLoopGates
+
+from SuperV import *
+
+# Graph creation of GraphLoopGates
+def DefGraphLoopGates() :
+ GraphLoopGates = Graph( 'GraphLoopGates' )
+ GraphLoopGates.SetName( 'GraphLoopGates' )
+ GraphLoopGates.SetAuthor( 'JR' )
+ GraphLoopGates.SetComment( '' )
+ GraphLoopGates.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ Add = GraphLoopGates.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+ Add.SetName( 'Add' )
+ Add.SetAuthor( '' )
+ Add.SetContainer( 'localhost/FactoryServer' )
+ Add.SetComment( 'Add from AddComponent' )
+ Add.Coords( 248 , 70 )
+ IAddx = Add.GetInPort( 'x' )
+ IAddy = Add.GetInPort( 'y' )
+ IAddGate = Add.GetInPort( 'Gate' )
+ OAddFuncValue = Add.GetOutPort( 'FuncValue' )
+ OAddz = Add.GetOutPort( 'z' )
+ OAddGate = Add.GetOutPort( 'Gate' )
+
+ Add_1 = GraphLoopGates.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+ Add_1.SetName( 'Add_1' )
+ Add_1.SetAuthor( '' )
+ Add_1.SetContainer( 'localhost/FactoryServer' )
+ Add_1.SetComment( 'Add from AddComponent' )
+ Add_1.Coords( 249 , 305 )
+ IAdd_1x = Add_1.GetInPort( 'x' )
+ IAdd_1y = Add_1.GetInPort( 'y' )
+ IAdd_1Gate = Add_1.GetInPort( 'Gate' )
+ OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
+ OAdd_1z = Add_1.GetOutPort( 'z' )
+ OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
+
+ Sub = GraphLoopGates.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
+ Sub.SetName( 'Sub' )
+ Sub.SetAuthor( '' )
+ Sub.SetContainer( 'localhost/FactoryServer' )
+ Sub.SetComment( 'Sub from SubComponent' )
+ Sub.Coords( 453 , 72 )
+ ISubx = Sub.GetInPort( 'x' )
+ ISuby = Sub.GetInPort( 'y' )
+ ISubGate = Sub.GetInPort( 'Gate' )
+ OSubz = Sub.GetOutPort( 'z' )
+ OSubGate = Sub.GetOutPort( 'Gate' )
+
+ Sub_1 = GraphLoopGates.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
+ Sub_1.SetName( 'Sub_1' )
+ Sub_1.SetAuthor( '' )
+ Sub_1.SetContainer( 'localhost/FactoryServer' )
+ Sub_1.SetComment( 'Sub from SubComponent' )
+ Sub_1.Coords( 455 , 304 )
+ ISub_1x = Sub_1.GetInPort( 'x' )
+ ISub_1y = Sub_1.GetInPort( 'y' )
+ ISub_1Gate = Sub_1.GetInPort( 'Gate' )
+ OSub_1z = Sub_1.GetOutPort( 'z' )
+ OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
+
+ # Creation of InLine Nodes
+ PyGate = []
+ PyGate.append( 'from time import * ' )
+ PyGate.append( 'def Gate(G1,G2) : ' )
+ PyGate.append( ' sleep(1) ' )
+ PyGate.append( ' return G1&G2 ' )
+ Gate = GraphLoopGates.INode( 'Gate' , PyGate )
+ Gate.SetName( 'Gate' )
+ Gate.SetAuthor( '' )
+ Gate.SetComment( 'Compute Node' )
+ Gate.Coords( 650 , 227 )
+ IGateG1 = Gate.InPort( 'G1' , 'long' )
+ IGateG2 = Gate.InPort( 'G2' , 'long' )
+ IGateGate = Gate.GetInPort( 'Gate' )
+ OGateG = Gate.OutPort( 'G' , 'long' )
+ OGateGate = Gate.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInit = []
+ PyInit.append( 'from time import * ' )
+ PyInit.append( 'def Init(Index,Min,Max) : ' )
+ PyInit.append( ' Index = Min ' )
+ PyInit.append( ' sleep(1) ' )
+ PyInit.append( ' return Index,Min,Max ' )
+ PyMoreInit = []
+ PyMoreInit.append( 'def More(Index,Min,Max) : ' )
+ PyMoreInit.append( ' if Index < Max : ' )
+ PyMoreInit.append( ' DoLoop = 1 ' )
+ PyMoreInit.append( ' else : ' )
+ PyMoreInit.append( ' DoLoop = 0 ' )
+ PyMoreInit.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInit = []
+ PyNextInit.append( 'def Next(Index,Min,Max) : ' )
+ PyNextInit.append( ' Index = Index + 1 ' )
+ PyNextInit.append( ' return Index,Min,Max ' )
+ Init,EndInit = GraphLoopGates.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 840 , 204 )
+ PyEndInit = []
+ EndInit.SetPyFunction( 'EndInit' , PyEndInit )
+ IInitDoLoop = Init.GetInPort( 'DoLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMin = Init.InPort( 'Min' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMin = Init.GetOutPort( 'Min' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMin = EndInit.GetInPort( 'Min' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitGate = EndInit.GetOutPort( 'Gate' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMin = EndInit.GetOutPort( 'Min' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 10 , 181 )
+
+ # Creation of Links
+ LInitGateAdd_1Gate = GraphLoopGates.Link( OInitGate , IAdd_1Gate )
+
+ LInitGateAddGate = GraphLoopGates.Link( OInitGate , IAddGate )
+
+ LInitIndexEndInitIndex = GraphLoopGates.Link( OInitIndex , IEndInitIndex )
+
+ LInitMinEndInitMin = GraphLoopGates.Link( OInitMin , IEndInitMin )
+
+ LInitMaxEndInitMax = GraphLoopGates.Link( OInitMax , IEndInitMax )
+
+ LAddGateSubGate = GraphLoopGates.Link( OAddGate , ISubGate )
+
+ LAdd_1GateSub_1Gate = GraphLoopGates.Link( OAdd_1Gate , ISub_1Gate )
+
+ LSubGateGateG1 = GraphLoopGates.Link( OSubGate , IGateG1 )
+
+ LSub_1GateGateG2 = GraphLoopGates.Link( OSub_1Gate , IGateG2 )
+
+ LGateGEndInitGate = GraphLoopGates.Link( OGateG , IEndInitGate )
+
+ # Input datas
+ IInitIndex.Input( 0 )
+ IInitMin.Input( 5 )
+ IInitMax.Input( 13 )
+ IAddx.Input( 1 )
+ IAddy.Input( 2 )
+ IAdd_1x.Input( 3 )
+ IAdd_1y.Input( 4 )
+ ISubx.Input( 5 )
+ ISuby.Input( 6 )
+ ISub_1x.Input( 7 )
+ ISub_1y.Input( 8 )
+
+ # Output Ports of the graph
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMin = EndInit.GetOutPort( 'Min' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OAddFuncValue = Add.GetOutPort( 'FuncValue' )
+ #OAddz = Add.GetOutPort( 'z' )
+ #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
+ #OAdd_1z = Add_1.GetOutPort( 'z' )
+ #OSubz = Sub.GetOutPort( 'z' )
+ #OSub_1z = Sub_1.GetOutPort( 'z' )
+ return GraphLoopGates
+
+
+GraphLoopGates = DefGraphLoopGates()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopGates</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopsGates</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add_1__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add_1__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Sub__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Sub__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Sub_1__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Sub_1__y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add__FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add_1__FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add_1__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Sub__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Sub_1__z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 16:57:1</creation-date>
+ <lastmodification-date>7/1/2005 - 17:8:8</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Init(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[def More(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:59:3</creation-date>
+ <lastmodification-date>7/1/2005 - 16:59:3</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>181</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndInit</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 16:59:3</creation-date>
+ <lastmodification-date>7/1/2005 - 16:59:3</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>840</x-position>
+ <y-position>204</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Add</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:3:59</creation-date>
+ <lastmodification-date>7/1/2005 - 17:3:59</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Add from AddComponent</comment>
+ <x-position>248</x-position>
+ <y-position>70</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Add_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:4:5</creation-date>
+ <lastmodification-date>7/1/2005 - 17:4:5</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Add from AddComponent</comment>
+ <x-position>249</x-position>
+ <y-position>305</y-position> </node>
+ <node>
+<component-name>SubComponent</component-name>
+ <interface-name>SubComponent</interface-name>
+ <node-name>Sub</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:4:31</creation-date>
+ <lastmodification-date>7/1/2005 - 17:4:31</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Sub from SubComponent</comment>
+ <x-position>453</x-position>
+ <y-position>72</y-position> </node>
+ <node>
+<component-name>SubComponent</component-name>
+ <interface-name>SubComponent</interface-name>
+ <node-name>Sub_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:4:32</creation-date>
+ <lastmodification-date>7/1/2005 - 17:4:32</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Sub from SubComponent</comment>
+ <x-position>455</x-position>
+ <y-position>304</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Gate</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Gate</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>G1</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>G2</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>G</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Gate</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Gate(G1,G2) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return G1&G2 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:7:9</creation-date>
+ <lastmodification-date>7/1/2005 - 17:7:9</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>650</x-position>
+ <y-position>227</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add_1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Gate</tonode-name>
+ <toserviceparameter-name>G1</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub_1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Gate</tonode-name>
+ <toserviceparameter-name>G2</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Gate</fromnode-name>
+ <fromserviceparameter-name>G</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Init__Min</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>13</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Add__x</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Add__y</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>2</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Add_1__x</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>3</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Add_1__y</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>4</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Sub__x</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Sub__y</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>6</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Sub_1__x</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>7</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopGates</fromnode-name>
+ <fromserviceparameter-name>Sub_1__y</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>8</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
-# Generated python file of Graph GraphLoopSwitch
+# Generated python file of Graph GraphLoopSwitch_1
from SuperV import *
-# Graph creation
-GraphLoopSwitch = Graph( 'GraphLoopSwitch' )
-GraphLoopSwitch.SetName( 'GraphLoopSwitch' )
-GraphLoopSwitch.SetAuthor( '' )
-GraphLoopSwitch.SetComment( '' )
-GraphLoopSwitch.Coords( 0 , 0 )
-# Creation of Factory Nodes
-
-# Creation of InLine Nodes
-PyIsOdd = []
-PyIsOdd.append( 'from time import * ' )
-PyIsOdd.append( 'def IsOdd(a,Even) : ' )
-PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
-PyIsOdd.append( ' sleep( 1 ) ' )
-PyIsOdd.append( ' return a ' )
-IsOdd = GraphLoopSwitch.INode( 'IsOdd' , PyIsOdd )
-IsOdd.SetName( 'IsOdd' )
-IsOdd.SetAuthor( '' )
-IsOdd.SetComment( 'Python function' )
-IsOdd.Coords( 397 , 1 )
-IsOdd.InPort( 'a' , 'long' )
-IsOdd.InPort( 'Even' , 'boolean' )
-IsOdd.OutPort( 'a' , 'long' )
-
-# Creation of Loop Nodes
-PyInitLoop = []
-PyInitLoop.append( ' ' )
-PyMoreInitLoop = []
-PyMoreInitLoop.append( ' ' )
-PyNextInitLoop = []
-PyNextInitLoop.append( ' ' )
-InitLoop,EndOfInitLoop = GraphLoopSwitch.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
-EndOfInitLoop.SetName( 'EndOfInitLoop' )
-EndOfInitLoop.SetAuthor( '' )
-EndOfInitLoop.SetComment( '' )
-EndOfInitLoop.Coords( 767 , 102 )
-PyEndOfInitLoop = []
-PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
-PyEndOfInitLoop.append( ' Index = Index + 1 ' )
-PyEndOfInitLoop.append( ' if Index <= Max : ' )
-PyEndOfInitLoop.append( ' DoLoop = 1 ' )
-PyEndOfInitLoop.append( ' else : ' )
-PyEndOfInitLoop.append( ' DoLoop = 0 ' )
-PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
-EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
-InitLoop.SetName( 'InitLoop' )
-InitLoop.SetAuthor( '' )
-InitLoop.SetComment( '' )
-InitLoop.Coords( 10 , 108 )
-InitLoop.InPort( 'Index' , 'long' )
-InitLoop.InPort( 'Min' , 'long' )
-InitLoop.InPort( 'Max' , 'long' )
-InitLoop.OutPort( 'Index' , 'long' )
-InitLoop.OutPort( 'Min' , 'long' )
-InitLoop.OutPort( 'Max' , 'long' )
-
-# Creation of Switch Nodes
-PySwitch = []
-PySwitch.append( 'from time import * ' )
-PySwitch.append( 'def Switch(a) : ' )
-PySwitch.append( ' if ( a & 1 ) == 0 : ' )
-PySwitch.append( ' sleep(1) ' )
-PySwitch.append( ' return a & 1,1-(a&1),a ' )
-Switch,EndSwitch = GraphLoopSwitch.SNode( 'Switch' , PySwitch )
-EndSwitch.SetName( 'EndSwitch' )
-EndSwitch.SetAuthor( '' )
-EndSwitch.SetComment( '' )
-EndSwitch.Coords( 587 , 103 )
-PyEndSwitch = []
-PyEndSwitch.append( 'def EndSwitch(a) : ' )
-PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
-PyEndSwitch.append( ' sleep(1) ' )
-PyEndSwitch.append( ' return a ' )
-EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
-EndSwitch.InPort( 'a' , 'long' )
-EndSwitch.OutPort( 'a' , 'long' )
-Switch.SetName( 'Switch' )
-Switch.SetAuthor( '' )
-Switch.SetComment( '' )
-Switch.Coords( 194 , 109 )
-Switch.InPort( 'a' , 'long' )
-Switch.OutPort( 'Odd' , 'long' )
-Switch.OutPort( 'Even' , 'int' )
-Switch.OutPort( 'a' , 'int' )
-
-# Creation of Links
-IsOdda = IsOdd.Port( 'a' )
-EndSwitcha = GraphLoopSwitch.Link( IsOdda , EndSwitch.Port( 'a' ) )
-EndSwitcha.AddCoord( 1 , 576 , 136 )
-EndSwitcha.AddCoord( 2 , 575 , 81 )
-
-InitLoopIndex = InitLoop.Port( 'Index' )
-Switcha = GraphLoopSwitch.Link( InitLoopIndex , Switch.Port( 'a' ) )
-
-InitLoopMin = InitLoop.Port( 'Min' )
-EndOfInitLoopMin = GraphLoopSwitch.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) )
-
-InitLoopMax = InitLoop.Port( 'Max' )
-EndOfInitLoopMax = GraphLoopSwitch.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) )
-
-SwitchOdd = Switch.Port( 'Odd' )
-IsOddInGate = GraphLoopSwitch.Link( SwitchOdd , IsOdd.Port( 'InGate' ) )
-
-SwitchEven = Switch.Port( 'Even' )
-EndSwitchDefault = GraphLoopSwitch.Link( SwitchEven , EndSwitch.Port( 'Default' ) )
-
-IsOddEven = GraphLoopSwitch.Link( SwitchEven , IsOdd.Port( 'Even' ) )
-IsOddEven.AddCoord( 1 , 375 , 111 )
-IsOddEven.AddCoord( 2 , 375 , 172 )
-
-Switcha = Switch.Port( 'a' )
-IsOdda = GraphLoopSwitch.Link( Switcha , IsOdd.Port( 'a' ) )
-IsOdda.AddCoord( 1 , 362 , 82 )
-IsOdda.AddCoord( 2 , 360 , 201 )
-
-EndSwitcha = EndSwitch.Port( 'a' )
-EndOfInitLoopIndex = GraphLoopSwitch.Link( EndSwitcha , EndOfInitLoop.Port( 'Index' ) )
-
-# Creation of Input datas
-InitLoopIndex = InitLoop.Input( 'Index' , 0)
-InitLoopMin = InitLoop.Input( 'Min' , 0)
-InitLoopMax = InitLoop.Input( 'Max' , 100)
-
-# Creation of Output variables
-EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' )
-EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' )
-EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' )
-
-GraphLoopSwitch.Run()
-GraphLoopSwitch.DoneW()
-GraphLoopSwitch.State()
-GraphLoopSwitch.PrintPorts()
+# Graph creation of GraphLoopSwitch_1
+def DefGraphLoopSwitch_1() :
+ GraphLoopSwitch_1 = Graph( 'GraphLoopSwitch_1' )
+ GraphLoopSwitch_1.SetName( 'GraphLoopSwitch_1' )
+ GraphLoopSwitch_1.SetAuthor( '' )
+ GraphLoopSwitch_1.SetComment( '' )
+ GraphLoopSwitch_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a,Even) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphLoopSwitch_1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 397 , 1 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoop = []
+ PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoop.append( ' Index = Min ' )
+ PyInitLoop.append( ' return Index,Min,Max ' )
+ PyInitLoop.append( ' ' )
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( ' ' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( ' ' )
+ InitLoop,EndOfInitLoop = GraphLoopSwitch_1.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 767 , 102 )
+ PyEndOfInitLoop = []
+ PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
+ PyEndOfInitLoop.append( ' Index = Index + 1 ' )
+ PyEndOfInitLoop.append( ' if Index <= Max : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 1 ' )
+ PyEndOfInitLoop.append( ' else : ' )
+ PyEndOfInitLoop.append( ' DoLoop = 0 ' )
+ PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
+ IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 108 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndSwitch = GraphLoopSwitch_1.SNode( 'Switch' , PySwitch )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 587 , 103 )
+ PyEndSwitch = []
+ PyEndSwitch.append( 'def EndSwitch(a) : ' )
+ PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PyEndSwitch.append( ' sleep(1) ' )
+ PyEndSwitch.append( ' return a ' )
+ EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 194 , 109 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndSwitcha = GraphLoopSwitch_1.Link( OIsOdda , IEndSwitcha )
+ LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
+ LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
+
+ LInitLoopIndexSwitcha = GraphLoopSwitch_1.Link( OInitLoopIndex , ISwitcha )
+
+ LInitLoopMinEndOfInitLoopMin = GraphLoopSwitch_1.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitch_1.Link( OInitLoopMax , IEndOfInitLoopMax )
+
+ LSwitchOddIsOddGate = GraphLoopSwitch_1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenEndSwitchDefault = GraphLoopSwitch_1.Link( OSwitchEven , IEndSwitchDefault )
+
+ LSwitchEvenIsOddEven = GraphLoopSwitch_1.Link( OSwitchEven , IIsOddEven )
+ LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
+ LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
+
+ LSwitchaIsOdda = GraphLoopSwitch_1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
+ LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitch_1.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ # Input datas
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 5 )
+ IInitLoopMax.Input( 100 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphLoopSwitch_1
+
+
+GraphLoopSwitch_1 = DefGraphLoopSwitch_1()
-<!DOCTYPE Dataflow>
+<!DOCTYPE SuperGraph>
+<supergraph>
<dataflow>
<info-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphLoopSwitch</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
-<service-name>GraphLoopSwitch</service-name>
- <inParameter-list>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopSwitch_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopSwitch_1</service-name>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>InitLoop\Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InitLoop__Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>InitLoop\Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>InitLoop__Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>InitLoop\Max</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>InitLoop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndOfInitLoop\Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>EndOfInitLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndOfInitLoop\Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>EndOfInitLoop__Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>EndOfInitLoop\Max</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list/>
- <creation-date>22/10/2003 - 10:36:39</creation-date>
- <lastmodification-date>22/10/2003 - 10:37:20</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>0</x-position>
- <y-position>0</y-position> </node> </info-list>
- <node-list>
+ <outParameter-name>EndOfInitLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>22/10/2003 - 10:36:39</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
<node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>IsOdd</node-name>
- <kind>3</kind>
- <coupled-node>?</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
<service-name>IsOdd</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>a</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>boolean</inParameter-type>
- <inParameter-name>Even</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Even</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>IsOdd</FuncName>
- <PyFunc><![CDATA[from time import * ]]></PyFunc>
- <PyFunc><![CDATA[def IsOdd(a,Even) : ]]></PyFunc>
- <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
- <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
- <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>22/10/2003 - 10:36:39</creation-date>
- <lastmodification-date>22/10/2003 - 10:36:39</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>Python function</comment>
- <x-position>397</x-position>
- <y-position>1</y-position> </node>
- <node>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a,Even) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphLoopSwitch1)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:45:0</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>397</x-position>
+ <y-position>1</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>InitLoop</node-name>
- <kind>4</kind>
- <coupled-node>EndOfInitLoop</coupled-node>
- <service>
-<service-name>Loop</service-name>
- <inParameter-list>
+ <interface-name>?</interface-name>
+ <node-name>InitLoop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoop</coupled-node>
+ <service>
+<service-name>InitLoop</service-name>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
<FuncName>?</FuncName>
- <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
- <PyFunction>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
<FuncName>?</FuncName>
- <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
- <PyFunction>
-<FuncName>?</FuncName>
- <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>22/10/2003 - 10:36:40</creation-date>
- <lastmodification-date>22/10/2003 - 10:36:40</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>10</x-position>
- <y-position>108</y-position> </node>
- <node>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:45:0</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>108</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>EndOfInitLoop</node-name>
- <kind>5</kind>
- <coupled-node>InitLoop</coupled-node>
- <service>
-<service-name>EndLoop</service-name>
- <inParameter-list>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoop</coupled-node>
+ <service>
+<service-name>EndOfInitLoop</service-name>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Index</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Min</inParameter-name> </inParameter>
- <inParameter>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Index</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Min</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>EndOfInitLoop</FuncName>
- <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
- <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
- <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
- <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
- <PyFunc><![CDATA[ else : ]]></PyFunc>
- <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
- <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>22/10/2003 - 10:36:40</creation-date>
- <lastmodification-date>22/10/2003 - 10:36:40</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>767</x-position>
- <y-position>102</y-position> </node>
- <node>
+ <PyFunc><![CDATA[def EndOfInitLoop( DoLoop , Index , Min , Max ) :]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:45:0</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>767</x-position>
+ <y-position>102</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>Switch</node-name>
- <kind>6</kind>
- <coupled-node>EndSwitch</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndSwitch</coupled-node>
+ <service>
<service-name>Switch</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>Odd</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>int</outParameter-type>
- <outParameter-name>Even</outParameter-name> </outParameter>
- <outParameter>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
<outParameter-type>int</outParameter-type>
- <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>Switch</FuncName>
- <PyFunc><![CDATA[from time import * ]]></PyFunc>
- <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
- <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
- <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
- <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>22/10/2003 - 10:36:59</creation-date>
- <lastmodification-date>22/10/2003 - 10:36:59</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>194</x-position>
- <y-position>109</y-position> </node>
- <node>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:45:0</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>194</x-position>
+ <y-position>109</y-position> </node>
+ <node>
<component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>EndSwitch</node-name>
- <kind>7</kind>
- <coupled-node>Switch</coupled-node>
- <service>
+ <interface-name>?</interface-name>
+ <node-name>EndSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
<service-name>EndSwitch</service-name>
- <inParameter-list>
+ <inParameter-list>
<inParameter>
<inParameter-type>long</inParameter-type>
- <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
- <outParameter-list>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
<outParameter>
<outParameter-type>long</outParameter-type>
- <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
- <Parameter-list/>
- <PyFunction-list>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
<PyFunction>
<FuncName>EndSwitch</FuncName>
- <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
- <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
- <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
- <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
- <creation-date>22/10/2003 - 10:36:59</creation-date>
- <lastmodification-date>22/10/2003 - 10:36:59</lastmodification-date>
- <editor-release>1.05</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>587</x-position>
- <y-position>103</y-position> </node> </node-list>
- <link-list>
+ <PyFunc><![CDATA[def EndSwitch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:45:0</creation-date>
+ <lastmodification-date>16/12/2004 - 16:45:0</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>587</x-position>
+ <y-position>103</y-position> </node> </node-list>
+ <link-list>
<link>
<fromnode-name>IsOdd</fromnode-name>
- <fromserviceparameter-name>a</fromserviceparameter-name>
- <tonode-name>EndSwitch</tonode-name>
- <toserviceparameter-name>a</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
<coord>
<x>576</x>
- <y>136</y> </coord>
- <coord>
+ <y>136</y> </coord>
+ <coord>
<x>575</x>
- <y>81</y> </coord> </coord-list> </link>
- <link>
+ <y>81</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>InitLoop</fromnode-name>
- <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
- <tonode-name>EndOfInitLoop</tonode-name>
- <toserviceparameter-name>DoLoop</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>InitLoop</fromnode-name>
- <fromserviceparameter-name>Index</fromserviceparameter-name>
- <tonode-name>Switch</tonode-name>
- <toserviceparameter-name>a</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>InitLoop</fromnode-name>
- <fromserviceparameter-name>Min</fromserviceparameter-name>
- <tonode-name>EndOfInitLoop</tonode-name>
- <toserviceparameter-name>Min</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>InitLoop</fromnode-name>
- <fromserviceparameter-name>Max</fromserviceparameter-name>
- <tonode-name>EndOfInitLoop</tonode-name>
- <toserviceparameter-name>Max</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>EndOfInitLoop</fromnode-name>
- <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
- <tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Switch</fromnode-name>
- <fromserviceparameter-name>Odd</fromserviceparameter-name>
- <tonode-name>IsOdd</tonode-name>
- <toserviceparameter-name>InGate</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Switch</fromnode-name>
- <fromserviceparameter-name>Even</fromserviceparameter-name>
- <tonode-name>EndSwitch</tonode-name>
- <toserviceparameter-name>Default</toserviceparameter-name>
- <coord-list/> </link>
- <link>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>EndSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
<fromnode-name>Switch</fromnode-name>
- <fromserviceparameter-name>Even</fromserviceparameter-name>
- <tonode-name>IsOdd</tonode-name>
- <toserviceparameter-name>Even</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Even</toserviceparameter-name>
+ <coord-list>
<coord>
<x>375</x>
- <y>111</y> </coord>
- <coord>
+ <y>111</y> </coord>
+ <coord>
<x>375</x>
- <y>172</y> </coord> </coord-list> </link>
- <link>
+ <y>172</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>Switch</fromnode-name>
- <fromserviceparameter-name>a</fromserviceparameter-name>
- <tonode-name>IsOdd</tonode-name>
- <toserviceparameter-name>a</toserviceparameter-name>
- <coord-list>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
<coord>
<x>362</x>
- <y>82</y> </coord>
- <coord>
+ <y>82</y> </coord>
+ <coord>
<x>360</x>
- <y>201</y> </coord> </coord-list> </link>
- <link>
+ <y>201</y> </coord> </coord-list> </link>
+ <link>
<fromnode-name>EndSwitch</fromnode-name>
- <fromserviceparameter-name>a</fromserviceparameter-name>
- <tonode-name>EndOfInitLoop</tonode-name>
- <toserviceparameter-name>Index</toserviceparameter-name>
- <coord-list/> </link> </link-list>
- <data-list>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
<data>
-<fromnode-name>GraphLoopSwitch</fromnode-name>
- <fromserviceparameter-name>InitLoop\Index</fromserviceparameter-name>
- <tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>Index</toserviceparameter-name>
- <data-value>
+<fromnode-name>GraphLoopSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Index</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>0</value> </data-value>
- <coord-list/> </data>
- <data>
-<fromnode-name>GraphLoopSwitch</fromnode-name>
- <fromserviceparameter-name>InitLoop\Min</fromserviceparameter-name>
- <tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>Min</toserviceparameter-name>
- <data-value>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Min</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>0</value> </data-value>
- <coord-list/> </data>
- <data>
-<fromnode-name>GraphLoopSwitch</fromnode-name>
- <fromserviceparameter-name>InitLoop\Max</fromserviceparameter-name>
- <tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>Max</toserviceparameter-name>
- <data-value>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoop__Max</fromserviceparameter-name>
+ <tonode-name>InitLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
<value-type>3</value-type>
- <value>100</value> </data-value>
- <coord-list/> </data> </data-list></dataflow>
+ <value>100</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphLoopWhile
+
+from SuperV import *
+
+# Graph creation of GraphLoopWhile
+def DefGraphLoopWhile() :
+ GraphLoopWhile = Graph( 'GraphLoopWhile' )
+ GraphLoopWhile.SetName( 'GraphLoopWhile' )
+ GraphLoopWhile.SetAuthor( 'JR' )
+ GraphLoopWhile.SetComment( '' )
+ GraphLoopWhile.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyLoop = []
+ PyMoreLoop = []
+ PyMoreLoop.append( 'import time ' )
+ PyMoreLoop.append( 'def LoopWhileMore(Index,Max) : ' )
+ PyMoreLoop.append( ' time.sleep(2) ' )
+ PyMoreLoop.append( ' if Index < Max : ' )
+ PyMoreLoop.append( ' DoLoop = 1 ' )
+ PyMoreLoop.append( ' else : ' )
+ PyMoreLoop.append( ' DoLoop = 0 ' )
+ PyMoreLoop.append( ' return DoLoop,Index,Max ' )
+ PyMoreLoop.append( '' )
+ PyNextLoop = []
+ PyNextLoop.append( 'def LoopWhileNext(Index,Max) : ' )
+ PyNextLoop.append( ' Index = Index + 1 ' )
+ PyNextLoop.append( ' return Index,Max ' )
+ PyNextLoop.append( '' )
+ Loop,EndLoop = GraphLoopWhile.LNode( '' , PyLoop , 'LoopWhileMore' , PyMoreLoop , 'LoopWhileNext' , PyNextLoop )
+ EndLoop.SetName( 'EndLoop' )
+ EndLoop.SetAuthor( '' )
+ EndLoop.SetComment( 'Compute Node' )
+ EndLoop.Coords( 414 , 232 )
+ PyEndLoop = []
+ EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
+ ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
+ ILoopIndex = Loop.InPort( 'Index' , 'long' )
+ ILoopMax = Loop.InPort( 'Max' , 'long' )
+ ILoopGate = Loop.GetInPort( 'Gate' )
+ OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
+ OLoopIndex = Loop.GetOutPort( 'Index' )
+ OLoopMax = Loop.GetOutPort( 'Max' )
+ IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
+ IEndLoopIndex = EndLoop.GetInPort( 'Index' )
+ IEndLoopMax = EndLoop.GetInPort( 'Max' )
+ IEndLoopGate = EndLoop.GetInPort( 'Gate' )
+ OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
+ OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ Loop.SetName( 'Loop' )
+ Loop.SetAuthor( '' )
+ Loop.SetComment( 'Compute Node' )
+ Loop.Coords( 105 , 226 )
+
+ # Creation of Links
+ LLoopIndexEndLoopIndex = GraphLoopWhile.Link( OLoopIndex , IEndLoopIndex )
+
+ LLoopMaxEndLoopMax = GraphLoopWhile.Link( OLoopMax , IEndLoopMax )
+
+ # Input datas
+ ILoopIndex.Input( 5 )
+ ILoopMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ return GraphLoopWhile
+
+
+GraphLoopWhile = DefGraphLoopWhile()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopWhile</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopWhile_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>16/12/2004 - 15:39:50</creation-date>
+ <lastmodification-date>16/12/2004 - 16:51:46</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Loop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndLoop</coupled-node>
+ <service>
+<service-name>Loop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>LoopWhileMore</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def LoopWhileMore(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>LoopWhileNext</FuncName>
+ <PyFunc><![CDATA[def LoopWhileNext(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:51:46</creation-date>
+ <lastmodification-date>16/12/2004 - 16:51:46</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>105</x-position>
+ <y-position>226</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>Loop</coupled-node>
+ <service>
+<service-name>EndLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:51:46</creation-date>
+ <lastmodification-date>16/12/2004 - 16:51:46</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>414</x-position>
+ <y-position>232</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphLoopWhile</fromnode-name>
+ <fromserviceparameter-name>Loop__Index</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopWhile</fromnode-name>
+ <fromserviceparameter-name>Loop__Max</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphLoopsCoupled_3
+
+from SuperV import *
+
+# Graph creation of GraphLoopsCoupled_3
+def DefGraphLoopsCoupled_3() :
+ GraphLoopsCoupled_3 = Graph( 'GraphLoopsCoupled_3' )
+ GraphLoopsCoupled_3.SetName( 'GraphLoopsCoupled_3' )
+ GraphLoopsCoupled_3.SetAuthor( 'JR' )
+ GraphLoopsCoupled_3.SetComment( '' )
+ GraphLoopsCoupled_3.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyAdd = []
+ PyAdd.append( 'def Add(x,y) : ' )
+ PyAdd.append( ' return x+y ' )
+ PyAdd.append( '' )
+ Add = GraphLoopsCoupled_3.INode( 'Add' , PyAdd )
+ Add.SetName( 'Add' )
+ Add.SetAuthor( '' )
+ Add.SetComment( 'Compute Node' )
+ Add.Coords( 245 , 38 )
+ IAddx = Add.InPort( 'x' , 'long' )
+ IAddy = Add.InPort( 'y' , 'long' )
+ IAddGate = Add.GetInPort( 'Gate' )
+ OAddz = Add.OutPort( 'z' , 'long' )
+ OAddGate = Add.GetOutPort( 'Gate' )
+
+ PyAdd_1 = []
+ PyAdd_1.append( 'def Add(x,y) : ' )
+ PyAdd_1.append( ' return x+y ' )
+ PyAdd_1.append( '' )
+ Add_1 = GraphLoopsCoupled_3.INode( 'Add' , PyAdd_1 )
+ Add_1.SetName( 'Add_1' )
+ Add_1.SetAuthor( '' )
+ Add_1.SetComment( 'Compute Node' )
+ Add_1.Coords( 243 , 288 )
+ IAdd_1x = Add_1.InPort( 'x' , 'long' )
+ IAdd_1y = Add_1.InPort( 'y' , 'long' )
+ IAdd_1Gate = Add_1.GetInPort( 'Gate' )
+ OAdd_1z = Add_1.OutPort( 'z' , 'long' )
+ OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
+
+ PySub = []
+ PySub.append( 'def Sub(x,y) : ' )
+ PySub.append( ' return x-y ' )
+ PySub.append( '' )
+ Sub = GraphLoopsCoupled_3.INode( 'Sub' , PySub )
+ Sub.SetName( 'Sub' )
+ Sub.SetAuthor( '' )
+ Sub.SetComment( 'Compute Node' )
+ Sub.Coords( 458 , 18 )
+ ISubx = Sub.InPort( 'x' , 'long' )
+ ISuby = Sub.InPort( 'y' , 'long' )
+ ISubGate = Sub.GetInPort( 'Gate' )
+ OSubz = Sub.OutPort( 'z' , 'long' )
+ OSubGate = Sub.GetOutPort( 'Gate' )
+
+ PySub_1 = []
+ PySub_1.append( 'def Sub(x,y) : ' )
+ PySub_1.append( ' return x-y ' )
+ PySub_1.append( '' )
+ Sub_1 = GraphLoopsCoupled_3.INode( 'Sub' , PySub_1 )
+ Sub_1.SetName( 'Sub_1' )
+ Sub_1.SetAuthor( '' )
+ Sub_1.SetComment( 'Compute Node' )
+ Sub_1.Coords( 461 , 268 )
+ ISub_1x = Sub_1.InPort( 'x' , 'long' )
+ ISub_1y = Sub_1.InPort( 'y' , 'long' )
+ ISub_1Gate = Sub_1.GetInPort( 'Gate' )
+ OSub_1z = Sub_1.OutPort( 'z' , 'long' )
+ OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyLoop = []
+ PyLoop.append( ' ' )
+ PyMoreLoop = []
+ PyMoreLoop.append( 'def More(Index,Max,z) : ' )
+ PyMoreLoop.append( ' DoLoop = 0 ' )
+ PyMoreLoop.append( ' if Index < Max : ' )
+ PyMoreLoop.append( ' DoLoop = 1 ' )
+ PyMoreLoop.append( ' return DoLoop,Index,Max,z ' )
+ PyMoreLoop.append( ' ' )
+ PyNextLoop = []
+ PyNextLoop.append( 'def Next(Index,Max,z) : ' )
+ PyNextLoop.append( ' Index = Index + 1 ' )
+ PyNextLoop.append( ' return Index,Max,z ' )
+ PyNextLoop.append( ' ' )
+ Loop,EndLoop = GraphLoopsCoupled_3.LNode( '' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop )
+ EndLoop.SetName( 'EndLoop' )
+ EndLoop.SetAuthor( '' )
+ EndLoop.SetComment( 'Compute Node' )
+ EndLoop.Coords( 662 , 38 )
+ PyEndLoop = []
+ EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
+ ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
+ ILoopIndex = Loop.InPort( 'Index' , 'long' )
+ ILoopMax = Loop.InPort( 'Max' , 'long' )
+ ILoopz = Loop.InPort( 'z' , 'long' )
+ ILoopGate = Loop.GetInPort( 'Gate' )
+ OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
+ OLoopIndex = Loop.GetOutPort( 'Index' )
+ OLoopMax = Loop.GetOutPort( 'Max' )
+ OLoopz = Loop.GetOutPort( 'z' )
+ IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
+ IEndLoopIndex = EndLoop.GetInPort( 'Index' )
+ IEndLoopMax = EndLoop.GetInPort( 'Max' )
+ IEndLoopz = EndLoop.GetInPort( 'z' )
+ IEndLoopGate = EndLoop.GetInPort( 'Gate' )
+ OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
+ OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ OEndLoopz = EndLoop.GetOutPort( 'z' )
+ OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
+ Loop.SetName( 'Loop' )
+ Loop.SetAuthor( '' )
+ Loop.SetComment( 'Compute Node' )
+ Loop.Coords( 15 , 58 )
+
+ PyInit = []
+ PyInit.append( ' ' )
+ PyMoreInit = []
+ PyMoreInit.append( 'def More(Index,Max,z) : ' )
+ PyMoreInit.append( ' DoLoop = 0 ' )
+ PyMoreInit.append( ' if Index < Max : ' )
+ PyMoreInit.append( ' DoLoop = 1 ' )
+ PyMoreInit.append( ' return DoLoop,Index,Max,z ' )
+ PyMoreInit.append( ' ' )
+ PyNextInit = []
+ PyNextInit.append( 'def Next(Index,Max,z) : ' )
+ PyNextInit.append( ' Index = Index + 1 ' )
+ PyNextInit.append( ' return Index,Max,z ' )
+ PyNextInit.append( ' ' )
+ Init,EndInit = GraphLoopsCoupled_3.LNode( '' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 670 , 288 )
+ PyEndInit = []
+ EndInit.SetPyFunction( 'EndInit' , PyEndInit )
+ IInitDoLoop = Init.GetInPort( 'DoLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitz = Init.InPort( 'z' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ OInitz = Init.GetOutPort( 'z' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitz = EndInit.GetInPort( 'z' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ OEndInitz = EndInit.GetOutPort( 'z' )
+ OEndInitGate = EndInit.GetOutPort( 'Gate' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 10 , 308 )
+
+ # Creation of Links
+ LAddzSuby = GraphLoopsCoupled_3.Link( OAddz , ISuby )
+
+ LAddzSub_1x = GraphLoopsCoupled_3.Link( OAddz , ISub_1x )
+
+ LAdd_1zSub_1y = GraphLoopsCoupled_3.Link( OAdd_1z , ISub_1y )
+
+ LAdd_1zSubx = GraphLoopsCoupled_3.Link( OAdd_1z , ISubx )
+
+ LSubzEndInitz = GraphLoopsCoupled_3.Link( OSubz , IEndInitz )
+
+ LSub_1zEndLoopz = GraphLoopsCoupled_3.Link( OSub_1z , IEndLoopz )
+
+ LLoopIndexEndLoopIndex = GraphLoopsCoupled_3.Link( OLoopIndex , IEndLoopIndex )
+
+ LLoopMaxEndLoopMax = GraphLoopsCoupled_3.Link( OLoopMax , IEndLoopMax )
+
+ LLoopMaxAddx = GraphLoopsCoupled_3.Link( OLoopMax , IAddx )
+
+ LLoopzAddy = GraphLoopsCoupled_3.Link( OLoopz , IAddy )
+
+ LInitIndexEndInitIndex = GraphLoopsCoupled_3.Link( OInitIndex , IEndInitIndex )
+
+ LInitMaxEndInitMax = GraphLoopsCoupled_3.Link( OInitMax , IEndInitMax )
+
+ LInitMaxAdd_1x = GraphLoopsCoupled_3.Link( OInitMax , IAdd_1x )
+
+ LInitzAdd_1y = GraphLoopsCoupled_3.Link( OInitz , IAdd_1y )
+
+ # Input datas
+ ILoopIndex.Input( 5 )
+ ILoopMax.Input( 15 )
+ ILoopz.Input( -1 )
+ IInitIndex.Input( 3 )
+ IInitMax.Input( 13 )
+ IInitz.Input( -2 )
+
+ # Output Ports of the graph
+ #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ #OEndLoopz = EndLoop.GetOutPort( 'z' )
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OEndInitz = EndInit.GetOutPort( 'z' )
+ return GraphLoopsCoupled_3
+
+
+GraphLoopsCoupled_3 = DefGraphLoopsCoupled_3()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopsCoupled_3</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopsCoupled_3</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__z</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__z</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/12/2004 - 17:11:7</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Add</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Add</FuncName>
+ <PyFunc><![CDATA[def Add(x,y) : ]]></PyFunc>
+ <PyFunc><![CDATA[ return x+y ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>245</x-position>
+ <y-position>38</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Add_1</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Add</FuncName>
+ <PyFunc><![CDATA[def Add(x,y) : ]]></PyFunc>
+ <PyFunc><![CDATA[ return x+y ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>243</x-position>
+ <y-position>288</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Sub</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Sub</FuncName>
+ <PyFunc><![CDATA[def Sub(x,y) : ]]></PyFunc>
+ <PyFunc><![CDATA[ return x-y ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>458</x-position>
+ <y-position>18</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Sub_1</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Sub</FuncName>
+ <PyFunc><![CDATA[def Sub(x,y) : ]]></PyFunc>
+ <PyFunc><![CDATA[ return x-y ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>461</x-position>
+ <y-position>268</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Loop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndLoop</coupled-node>
+ <service>
+<service-name>Loop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>z</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[def More(Index,Max,z) : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max,z ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Max,z) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max,z ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>15</x-position>
+ <y-position>58</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>Loop</coupled-node>
+ <service>
+<service-name>EndLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>z</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>662</x-position>
+ <y-position>38</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>z</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[def More(Index,Max,z) : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max,z ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Max,z) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max,z ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>308</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>z</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndInit</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 18:26:39</creation-date>
+ <lastmodification-date>17/12/2004 - 18:26:39</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>670</x-position>
+ <y-position>288</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add_1</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add_1</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>z</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub_1</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>z</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>z</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Loop__Index</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Loop__Max</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>15</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Loop__z</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>z</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>3</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>13</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsCoupled_3</fromnode-name>
+ <fromserviceparameter-name>Init__z</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>z</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-2</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphLoopsGates_1
+
+from SuperV import *
+
+# Graph creation of GraphLoopsGates_1
+def DefGraphLoopsGates_1() :
+ GraphLoopsGates_1 = Graph( 'GraphLoopsGates_1' )
+ GraphLoopsGates_1.SetName( 'GraphLoopsGates_1' )
+ GraphLoopsGates_1.SetAuthor( 'JR' )
+ GraphLoopsGates_1.SetComment( '' )
+ GraphLoopsGates_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ Add = GraphLoopsGates_1.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+ Add.SetName( 'Add' )
+ Add.SetAuthor( '' )
+ Add.SetContainer( 'localhost/FactoryServer' )
+ Add.SetComment( 'Add from AddComponent' )
+ Add.Coords( 230 , 76 )
+ IAddx = Add.GetInPort( 'x' )
+ IAddy = Add.GetInPort( 'y' )
+ IAddGate = Add.GetInPort( 'Gate' )
+ OAddFuncValue = Add.GetOutPort( 'FuncValue' )
+ OAddz = Add.GetOutPort( 'z' )
+ OAddGate = Add.GetOutPort( 'Gate' )
+
+ Add_1 = GraphLoopsGates_1.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
+ Add_1.SetName( 'Add_1' )
+ Add_1.SetAuthor( '' )
+ Add_1.SetContainer( 'localhost/FactoryServer' )
+ Add_1.SetComment( 'Add from AddComponent' )
+ Add_1.Coords( 225 , 304 )
+ IAdd_1x = Add_1.GetInPort( 'x' )
+ IAdd_1y = Add_1.GetInPort( 'y' )
+ IAdd_1Gate = Add_1.GetInPort( 'Gate' )
+ OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
+ OAdd_1z = Add_1.GetOutPort( 'z' )
+ OAdd_1Gate = Add_1.GetOutPort( 'Gate' )
+
+ Sub = GraphLoopsGates_1.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
+ Sub.SetName( 'Sub' )
+ Sub.SetAuthor( '' )
+ Sub.SetContainer( 'localhost/FactoryServer' )
+ Sub.SetComment( 'Sub from SubComponent' )
+ Sub.Coords( 447 , 77 )
+ ISubx = Sub.GetInPort( 'x' )
+ ISuby = Sub.GetInPort( 'y' )
+ ISubGate = Sub.GetInPort( 'Gate' )
+ OSubz = Sub.GetOutPort( 'z' )
+ OSubGate = Sub.GetOutPort( 'Gate' )
+
+ Sub_1 = GraphLoopsGates_1.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
+ Sub_1.SetName( 'Sub_1' )
+ Sub_1.SetAuthor( '' )
+ Sub_1.SetContainer( 'localhost/FactoryServer' )
+ Sub_1.SetComment( 'Sub from SubComponent' )
+ Sub_1.Coords( 448 , 304 )
+ ISub_1x = Sub_1.GetInPort( 'x' )
+ ISub_1y = Sub_1.GetInPort( 'y' )
+ ISub_1Gate = Sub_1.GetInPort( 'Gate' )
+ OSub_1z = Sub_1.GetOutPort( 'z' )
+ OSub_1Gate = Sub_1.GetOutPort( 'Gate' )
+
+ # Creation of InLine Nodes
+ PyGate = []
+ PyGate.append( 'from time import * ' )
+ PyGate.append( 'def Gate(G1,G2) : ' )
+ PyGate.append( ' sleep(1) ' )
+ PyGate.append( ' return G1&G2 ' )
+ Gate = GraphLoopsGates_1.INode( 'Gate' , PyGate )
+ Gate.SetName( 'Gate' )
+ Gate.SetAuthor( '' )
+ Gate.SetComment( 'Compute Node' )
+ Gate.Coords( 640 , 224 )
+ IGateG1 = Gate.InPort( 'G1' , 'long' )
+ IGateG2 = Gate.InPort( 'G2' , 'long' )
+ IGateGate = Gate.GetInPort( 'Gate' )
+ OGateG = Gate.OutPort( 'G' , 'long' )
+ OGateGate = Gate.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInit = []
+ PyInit.append( 'from time import * ' )
+ PyInit.append( 'def Init(Index,Min,Max) : ' )
+ PyInit.append( ' Index = Min ' )
+ PyInit.append( ' sleep(1) ' )
+ PyInit.append( ' return Index,Min,Max ' )
+ PyMoreInit = []
+ PyMoreInit.append( 'def More(Index,Min,Max) : ' )
+ PyMoreInit.append( ' if Index < Max : ' )
+ PyMoreInit.append( ' DoLoop = 1 ' )
+ PyMoreInit.append( ' else : ' )
+ PyMoreInit.append( ' DoLoop = 0 ' )
+ PyMoreInit.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInit = []
+ PyNextInit.append( 'from time import * ' )
+ PyNextInit.append( 'def Next(Index,Min,Max) : ' )
+ PyNextInit.append( ' Index = Index + 1 ' )
+ PyNextInit.append( ' sleep(1) ' )
+ PyNextInit.append( ' return Index,Min,Max ' )
+ Init,EndInit = GraphLoopsGates_1.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 851 , 200 )
+ PyEndInit = []
+ EndInit.SetPyFunction( 'EndInit' , PyEndInit )
+ IInitDoLoop = Init.GetInPort( 'DoLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMin = Init.InPort( 'Min' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMin = Init.GetOutPort( 'Min' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMin = EndInit.GetInPort( 'Min' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMin = EndInit.GetOutPort( 'Min' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ OEndInitGate = EndInit.GetOutPort( 'Gate' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 29 , 251 )
+
+ PyInit_1 = []
+ PyInit_1.append( 'from time import * ' )
+ PyInit_1.append( 'def Init_1(Index,Min,Max) : ' )
+ PyInit_1.append( ' Index = Min ' )
+ PyInit_1.append( ' sleep(1) ' )
+ PyInit_1.append( ' return Index,Min,Max ' )
+ PyMoreInit_1 = []
+ PyMoreInit_1.append( 'def More_1(Index,Min,Max) : ' )
+ PyMoreInit_1.append( ' if Index < Max : ' )
+ PyMoreInit_1.append( ' DoLoop = 1 ' )
+ PyMoreInit_1.append( ' else : ' )
+ PyMoreInit_1.append( ' DoLoop = 0 ' )
+ PyMoreInit_1.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInit_1 = []
+ PyNextInit_1.append( 'from time import * ' )
+ PyNextInit_1.append( 'def Next_1(Index,Min,Max) : ' )
+ PyNextInit_1.append( ' Index = Index + 1 ' )
+ PyNextInit_1.append( ' sleep(1) ' )
+ PyNextInit_1.append( ' return Index,Min,Max ' )
+ Init_1,EndInit_1 = GraphLoopsGates_1.LNode( 'Init_1' , PyInit_1 , 'More_1' , PyMoreInit_1 , 'Next_1' , PyNextInit_1 )
+ EndInit_1.SetName( 'EndInit_1' )
+ EndInit_1.SetAuthor( '' )
+ EndInit_1.SetComment( 'Compute Node' )
+ EndInit_1.Coords( 1049 , 201 )
+ PyEndInit_1 = []
+ EndInit_1.SetPyFunction( 'EndInit_1' , PyEndInit_1 )
+ IInit_1DoLoop = Init_1.GetInPort( 'DoLoop' )
+ IInit_1Index = Init_1.InPort( 'Index' , 'long' )
+ IInit_1Min = Init_1.InPort( 'Min' , 'long' )
+ IInit_1Max = Init_1.InPort( 'Max' , 'long' )
+ IInit_1Gate = Init_1.GetInPort( 'Gate' )
+ OInit_1DoLoop = Init_1.GetOutPort( 'DoLoop' )
+ OInit_1Index = Init_1.GetOutPort( 'Index' )
+ OInit_1Min = Init_1.GetOutPort( 'Min' )
+ OInit_1Max = Init_1.GetOutPort( 'Max' )
+ IEndInit_1DoLoop = EndInit_1.GetInPort( 'DoLoop' )
+ IEndInit_1Index = EndInit_1.GetInPort( 'Index' )
+ IEndInit_1Min = EndInit_1.GetInPort( 'Min' )
+ IEndInit_1Max = EndInit_1.GetInPort( 'Max' )
+ IEndInit_1Gate = EndInit_1.GetInPort( 'Gate' )
+ OEndInit_1DoLoop = EndInit_1.GetOutPort( 'DoLoop' )
+ OEndInit_1Index = EndInit_1.GetOutPort( 'Index' )
+ OEndInit_1Min = EndInit_1.GetOutPort( 'Min' )
+ OEndInit_1Max = EndInit_1.GetOutPort( 'Max' )
+ OEndInit_1Gate = EndInit_1.GetOutPort( 'Gate' )
+ Init_1.SetName( 'Init_1' )
+ Init_1.SetAuthor( '' )
+ Init_1.SetComment( 'Compute Node' )
+ Init_1.Coords( 9 , 24 )
+
+ # Creation of Links
+ LInitIndexEndInitIndex = GraphLoopsGates_1.Link( OInitIndex , IEndInitIndex )
+
+ LInitIndexSubx = GraphLoopsGates_1.Link( OInitIndex , ISubx )
+
+ LInitMinEndInitMin = GraphLoopsGates_1.Link( OInitMin , IEndInitMin )
+
+ LInitMinSuby = GraphLoopsGates_1.Link( OInitMin , ISuby )
+
+ LInitMinSub_1x = GraphLoopsGates_1.Link( OInitMin , ISub_1x )
+
+ LInitMaxEndInitMax = GraphLoopsGates_1.Link( OInitMax , IEndInitMax )
+
+ LInitMaxSub_1y = GraphLoopsGates_1.Link( OInitMax , ISub_1y )
+
+ LInitGateAdd_1Gate = GraphLoopsGates_1.Link( OInitGate , IAdd_1Gate )
+
+ LInitGateAddGate = GraphLoopsGates_1.Link( OInitGate , IAddGate )
+
+ LEndInitGateEndInit_1Gate = GraphLoopsGates_1.Link( OEndInitGate , IEndInit_1Gate )
+
+ LAddGateSubGate = GraphLoopsGates_1.Link( OAddGate , ISubGate )
+
+ LAdd_1GateSub_1Gate = GraphLoopsGates_1.Link( OAdd_1Gate , ISub_1Gate )
+
+ LSubGateGateG1 = GraphLoopsGates_1.Link( OSubGate , IGateG1 )
+
+ LSub_1GateGateG2 = GraphLoopsGates_1.Link( OSub_1Gate , IGateG2 )
+
+ LGateGEndInitGate = GraphLoopsGates_1.Link( OGateG , IEndInitGate )
+
+ LInit_1IndexEndInit_1Index = GraphLoopsGates_1.Link( OInit_1Index , IEndInit_1Index )
+
+ LInit_1MinEndInit_1Min = GraphLoopsGates_1.Link( OInit_1Min , IEndInit_1Min )
+
+ LInit_1MaxEndInit_1Max = GraphLoopsGates_1.Link( OInit_1Max , IEndInit_1Max )
+
+ LInit_1GateInitGate = GraphLoopsGates_1.Link( OInit_1Gate , IInitGate )
+ LInit_1GateInitGate.AddCoord( 1 , 9 , 346 )
+ LInit_1GateInitGate.AddCoord( 2 , 9 , 199 )
+ LInit_1GateInitGate.AddCoord( 3 , 194 , 199 )
+ LInit_1GateInitGate.AddCoord( 4 , 194 , 119 )
+
+ # Input datas
+ IInitIndex.Input( 0 )
+ IInitMin.Input( 5 )
+ IInitMax.Input( 8 )
+ IAddx.Input( 1 )
+ IAddy.Input( 2 )
+ IAdd_1x.Input( 3 )
+ IAdd_1y.Input( 4 )
+ IInit_1Index.Input( 0 )
+ IInit_1Min.Input( 1 )
+ IInit_1Max.Input( 3 )
+
+ # Output Ports of the graph
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMin = EndInit.GetOutPort( 'Min' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OAddFuncValue = Add.GetOutPort( 'FuncValue' )
+ #OAddz = Add.GetOutPort( 'z' )
+ #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' )
+ #OAdd_1z = Add_1.GetOutPort( 'z' )
+ #OSubz = Sub.GetOutPort( 'z' )
+ #OSub_1z = Sub_1.GetOutPort( 'z' )
+ #OEndInit_1Index = EndInit_1.GetOutPort( 'Index' )
+ #OEndInit_1Min = EndInit_1.GetOutPort( 'Min' )
+ #OEndInit_1Max = EndInit_1.GetOutPort( 'Max' )
+ return GraphLoopsGates_1
+
+
+GraphLoopsGates_1 = DefGraphLoopsGates_1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphLoopsGates_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphLoopsGates_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add_1__x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>Add_1__y</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init_1__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init_1__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init_1__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add__FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add_1__FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Add_1__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Sub__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>Sub_1__z</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit_1__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit_1__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit_1__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 16:57:1</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Init(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[def More(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Next(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>29</x-position>
+ <y-position>251</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndInit</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>851</x-position>
+ <y-position>200</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Add</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Add from AddComponent</comment>
+ <x-position>230</x-position>
+ <y-position>76</y-position> </node>
+ <node>
+<component-name>AddComponent</component-name>
+ <interface-name>AddComponent</interface-name>
+ <node-name>Add_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Add</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>FuncValue</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Add from AddComponent</comment>
+ <x-position>225</x-position>
+ <y-position>304</y-position> </node>
+ <node>
+<component-name>SubComponent</component-name>
+ <interface-name>SubComponent</interface-name>
+ <node-name>Sub</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Sub from SubComponent</comment>
+ <x-position>447</x-position>
+ <y-position>77</y-position> </node>
+ <node>
+<component-name>SubComponent</component-name>
+ <interface-name>SubComponent</interface-name>
+ <node-name>Sub_1</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Sub</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>x</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>double</inParameter-type>
+ <inParameter-name>y</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>double</outParameter-type>
+ <outParameter-name>z</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>Sub from SubComponent</comment>
+ <x-position>448</x-position>
+ <y-position>304</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Gate</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Gate</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>G1</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>G2</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>G</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Gate</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Gate(G1,G2) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return G1&G2 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>640</x-position>
+ <y-position>224</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init_1</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit_1</coupled-node>
+ <service>
+<service-name>Init_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Init_1(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More_1</FuncName>
+ <PyFunc><![CDATA[def More_1(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Next_1(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>9</x-position>
+ <y-position>24</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit_1</node-name>
+ <kind>5</kind>
+ <coupled-node>Init_1</coupled-node>
+ <service>
+<service-name>EndInit_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndInit_1</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>7/1/2005 - 17:57:7</creation-date>
+ <lastmodification-date>7/1/2005 - 17:57:7</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1049</x-position>
+ <y-position>201</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>EndInit_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Sub</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Add_1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Sub_1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Gate</tonode-name>
+ <toserviceparameter-name>G1</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Sub_1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Gate</tonode-name>
+ <toserviceparameter-name>G2</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Gate</fromnode-name>
+ <fromserviceparameter-name>G</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init_1</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit_1</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init_1</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit_1</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init_1</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit_1</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init_1</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit_1</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init_1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>9</x>
+ <y>346</y> </coord>
+ <coord>
+<x>9</x>
+ <y>199</y> </coord>
+ <coord>
+<x>194</x>
+ <y>199</y> </coord>
+ <coord>
+<x>194</x>
+ <y>119</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndInit_1</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init_1</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init__Min</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>8</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Add__x</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Add__y</fromserviceparameter-name>
+ <tonode-name>Add</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>2</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Add_1__x</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>x</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>3</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Add_1__y</fromserviceparameter-name>
+ <tonode-name>Add_1</tonode-name>
+ <toserviceparameter-name>y</toserviceparameter-name>
+ <data-value>
+<value-type>7</value-type>
+ <value>4</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init_1__Index</fromserviceparameter-name>
+ <tonode-name>Init_1</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init_1__Min</fromserviceparameter-name>
+ <tonode-name>Init_1</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphLoopsGates_1</fromnode-name>
+ <fromserviceparameter-name>Init_1__Max</fromserviceparameter-name>
+ <tonode-name>Init_1</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>3</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
EndOfforN.Coords( 1535 , 332 )
PyEndOfforN = []
EndOfforN.SetPyFunction( '' , PyEndOfforN )
- IforNInitLoop = forN.GetInPort( 'InitLoop' )
+ IforNInitLoop = forN.GetInPort( 'DoLoop' )
IforNN = forN.InPort( 'N' , 'long' )
IforNK = forN.InPort( 'K' , 'long' )
IforNSyrComponent = forN.InPort( 'SyrComponent' , 'objref' )
EndOfwhileNotOne.Coords( 1366 , 303 )
PyEndOfwhileNotOne = []
EndOfwhileNotOne.SetPyFunction( '' , PyEndOfwhileNotOne )
- IwhileNotOneInitLoop = whileNotOne.GetInPort( 'InitLoop' )
+ IwhileNotOneInitLoop = whileNotOne.GetInPort( 'DoLoop' )
IwhileNotOneSyrComponent = whileNotOne.InPort( 'SyrComponent' , 'objref' )
IwhileNotOneN = whileNotOne.InPort( 'N' , 'long' )
IwhileNotOneK = whileNotOne.InPort( 'K' , 'long' )
EndOffori.Coords( 976 , 212 )
PyEndOffori = []
EndOffori.SetPyFunction( '' , PyEndOffori )
- IforiInitLoop = fori.GetInPort( 'InitLoop' )
+ IforiInitLoop = fori.GetInPort( 'DoLoop' )
Iforii = fori.InPort( 'i' , 'long' )
IforiK = fori.InPort( 'K' , 'long' )
IforiGate = fori.GetInPort( 'Gate' )
EndOfwhileEven.Coords( 988 , 451 )
PyEndOfwhileEven = []
EndOfwhileEven.SetPyFunction( '' , PyEndOfwhileEven )
- IwhileEvenInitLoop = whileEven.GetInPort( 'InitLoop' )
+ IwhileEvenInitLoop = whileEven.GetInPort( 'DoLoop' )
IwhileEvenSyrComponent = whileEven.InPort( 'SyrComponent' , 'objref' )
IwhileEvenN = whileEven.InPort( 'N' , 'long' )
IwhileEvenK = whileEven.InPort( 'K' , 'long' )
EndOfforN.Coords( 1535 , 332 )
PyEndOfforN = []
EndOfforN.SetPyFunction( '' , PyEndOfforN )
- IforNInitLoop = forN.GetInPort( 'InitLoop' )
+ IforNInitLoop = forN.GetInPort( 'DoLoop' )
IforNN = forN.InPort( 'N' , 'long' )
IforNK = forN.InPort( 'K' , 'long' )
IforNSyrComponent = forN.InPort( 'SyrComponent' , 'objref' )
EndOfwhileNotOne.Coords( 1366 , 303 )
PyEndOfwhileNotOne = []
EndOfwhileNotOne.SetPyFunction( '' , PyEndOfwhileNotOne )
- IwhileNotOneInitLoop = whileNotOne.GetInPort( 'InitLoop' )
+ IwhileNotOneInitLoop = whileNotOne.GetInPort( 'DoLoop' )
IwhileNotOneSyrComponent = whileNotOne.InPort( 'SyrComponent' , 'objref' )
IwhileNotOneN = whileNotOne.InPort( 'N' , 'long' )
IwhileNotOneK = whileNotOne.InPort( 'K' , 'long' )
EndOffori.Coords( 976 , 212 )
PyEndOffori = []
EndOffori.SetPyFunction( '' , PyEndOffori )
- IforiInitLoop = fori.GetInPort( 'InitLoop' )
+ IforiInitLoop = fori.GetInPort( 'DoLoop' )
Iforii = fori.InPort( 'i' , 'long' )
IforiK = fori.InPort( 'K' , 'long' )
IforiGate = fori.GetInPort( 'Gate' )
EndOfwhileEven.Coords( 988 , 451 )
PyEndOfwhileEven = []
EndOfwhileEven.SetPyFunction( '' , PyEndOfwhileEven )
- IwhileEvenInitLoop = whileEven.GetInPort( 'InitLoop' )
+ IwhileEvenInitLoop = whileEven.GetInPort( 'DoLoop' )
IwhileEvenSyrComponent = whileEven.InPort( 'SyrComponent' , 'objref' )
IwhileEvenN = whileEven.InPort( 'N' , 'long' )
IwhileEvenK = whileEven.InPort( 'K' , 'long' )
<fromnode-name>EndOfforN</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>forN</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>whileNotOne</fromnode-name>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileNotOne</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromnode-name>EndOffori</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>fori</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOffori</fromnode-name>
<fromnode-name>EndOfwhileEven</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileEven</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileEven</fromnode-name>
<fromnode-name>EndOfforN</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>forN</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>whileNotOne</fromnode-name>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileNotOne</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromnode-name>EndOffori</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>fori</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOffori</fromnode-name>
<fromnode-name>EndOfwhileEven</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileEven</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileEven</fromnode-name>
--- /dev/null
+
+# Generated python file of Graph GraphNonVoidEndLoop
+
+from SuperV import *
+
+# Graph creation of GraphNonVoidEndLoop
+def DefGraphNonVoidEndLoop() :
+ GraphNonVoidEndLoop = Graph( 'GraphNonVoidEndLoop' )
+ GraphNonVoidEndLoop.SetName( 'GraphNonVoidEndLoop' )
+ GraphNonVoidEndLoop.SetAuthor( '' )
+ GraphNonVoidEndLoop.SetComment( '' )
+ GraphNonVoidEndLoop.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyInit = []
+ PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
+ PyInit.append( ' if Min <= Max : ' )
+ PyInit.append( ' Index = Min ' )
+ PyInit.append( ' else : ' )
+ PyInit.append( ' Index = Max ' )
+ PyInit.append( ' print 'Init',Index,Min,Max,Incr ' )
+ PyInit.append( ' return Index,Min,Max,Incr ' )
+ PyMoreInit = []
+ PyMoreInit.append( 'import time ' )
+ PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' )
+ PyMoreInit.append( ' time.sleep(2) ' )
+ PyMoreInit.append( ' if Index < Max : ' )
+ PyMoreInit.append( ' DoLoop = 1 ' )
+ PyMoreInit.append( ' else : ' )
+ PyMoreInit.append( ' DoLoop = 0 ' )
+ PyMoreInit.append( ' print 'More', DoLoop,Index,Min,Max,Incr ' )
+ PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
+ PyNextInit = []
+ PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
+ PyNextInit.append( ' Index = Index + Incr ' )
+ PyNextInit.append( ' print 'Next', Index,Min,Max,Incr ' )
+ PyNextInit.append( ' return Index,Min,Max,Incr ' )
+ Init,EndInit = GraphNonVoidEndLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 411 , 260 )
+ PyEndInit = []
+ PyEndInit.append( 'def EndLoop(DoLoop,Index,Min,Max,Incr) : ' )
+ PyEndInit.append( ' print 'EndLoop',DoLoop,Index,Min,Max,Incr ' )
+ PyEndInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
+ PyEndInit.append( '' )
+ EndInit.SetPyFunction( 'EndLoop' , PyEndInit )
+ IInitDoLoop = Init.GetInPort( 'DoLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMin = Init.InPort( 'Min' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitIncr = Init.InPort( 'Incr' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMin = Init.GetOutPort( 'Min' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ OInitIncr = Init.GetOutPort( 'Incr' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMin = EndInit.GetInPort( 'Min' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitIncr = EndInit.GetInPort( 'Incr' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMin = EndInit.GetOutPort( 'Min' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 17 , 257 )
+
+ # Creation of Links
+ LInitIndexEndInitIndex = GraphNonVoidEndLoop.Link( OInitIndex , IEndInitIndex )
+
+ LInitMinEndInitMin = GraphNonVoidEndLoop.Link( OInitMin , IEndInitMin )
+
+ LInitMaxEndInitMax = GraphNonVoidEndLoop.Link( OInitMax , IEndInitMax )
+
+ LInitIncrEndInitIncr = GraphNonVoidEndLoop.Link( OInitIncr , IEndInitIncr )
+
+ # Input datas
+ IInitIndex.Input( 0 )
+ IInitMin.Input( 5 )
+ IInitMax.Input( 10 )
+ IInitIncr.Input( 1 )
+
+ # Output Ports of the graph
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMin = EndInit.GetOutPort( 'Min' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ return GraphNonVoidEndLoop
+
+
+GraphNonVoidEndLoop = DefGraphNonVoidEndLoop()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphNonVoidEndLoop</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphNonVoidEndLoop_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>24/3/2003 - 14:44:35</creation-date>
+ <lastmodification-date>16/12/2004 - 16:53:28</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init</FuncName>
+ <PyFunc><![CDATA[def Init(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Min <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'Init',Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def More(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'More', DoLoop,Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'Next', Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:53:28</creation-date>
+ <lastmodification-date>16/12/2004 - 16:53:28</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>17</x-position>
+ <y-position>257</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop</FuncName>
+ <PyFunc><![CDATA[def EndLoop(DoLoop,Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'EndLoop',DoLoop,Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 16:53:28</creation-date>
+ <lastmodification-date>16/12/2004 - 16:53:28</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>411</x-position>
+ <y-position>260</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Incr</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphNonVoidEndLoop</fromnode-name>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop</fromnode-name>
+ <fromserviceparameter-name>Init__Min</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop</fromnode-name>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop</fromnode-name>
+ <fromserviceparameter-name>Init__Incr</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
<fromnode-name>EndInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link> </link-list>
<data-list>
<data>
<fromnode-name>EndOfInitLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>InitLoop_1</fromnode-name>
<fromnode-name>EndOfInitLoop_1</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop_1</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
--- /dev/null
+
+# Generated python file of Graph GraphSIGFPE
+
+from SuperV import *
+
+# Graph creation of GraphSIGFPE
+def DefGraphSIGFPE() :
+ GraphSIGFPE = Graph( 'GraphSIGFPE' )
+ GraphSIGFPE.SetName( 'GraphSIGFPE' )
+ GraphSIGFPE.SetAuthor( 'JR' )
+ GraphSIGFPE.SetComment( '' )
+ GraphSIGFPE.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ SIGFPEfunc = GraphSIGFPE.FNode( 'SIGNALSComponent' , 'SIGNALSComponent' , 'SIGFPEfunc' )
+ SIGFPEfunc.SetName( 'SIGFPEfunc' )
+ SIGFPEfunc.SetAuthor( '' )
+ SIGFPEfunc.SetContainer( 'localhost/FactoryServer' )
+ SIGFPEfunc.SetComment( 'SIGFPEfunc from SIGNALSComponent' )
+ SIGFPEfunc.Coords( 134 , 137 )
+ ISIGFPEfunca = SIGFPEfunc.GetInPort( 'a' )
+ ISIGFPEfuncb = SIGFPEfunc.GetInPort( 'b' )
+ ISIGFPEfuncGate = SIGFPEfunc.GetInPort( 'Gate' )
+ OSIGFPEfuncreturn = SIGFPEfunc.GetOutPort( 'return' )
+ OSIGFPEfuncGate = SIGFPEfunc.GetOutPort( 'Gate' )
+
+ # Input datas
+ ISIGFPEfunca.Input( 1 )
+ ISIGFPEfuncb.Input( 0 )
+
+ # Output Ports of the graph
+ #OSIGFPEfuncreturn = SIGFPEfunc.GetOutPort( 'return' )
+ return GraphSIGFPE
+
+
+GraphSIGFPE = DefGraphSIGFPE()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSIGFPE</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSIGFPE</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>SIGFPEfunc__a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>SIGFPEfunc__b</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>SIGFPEfunc__return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:15:9</creation-date>
+ <lastmodification-date>8/12/2004 - 18:15:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>SIGNALSComponent</component-name>
+ <interface-name>SIGNALSComponent</interface-name>
+ <node-name>SIGFPEfunc</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>SIGFPEfunc</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>b</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:15:36</creation-date>
+ <lastmodification-date>8/12/2004 - 18:15:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>SIGFPEfunc from SIGNALSComponent</comment>
+ <x-position>134</x-position>
+ <y-position>137</y-position> </node> </node-list>
+ <link-list/>
+ <data-list>
+<data>
+<fromnode-name>GraphSIGFPE</fromnode-name>
+ <fromserviceparameter-name>SIGFPEfunc__a</fromserviceparameter-name>
+ <tonode-name>SIGFPEfunc</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSIGFPE</fromnode-name>
+ <fromserviceparameter-name>SIGFPEfunc__b</fromserviceparameter-name>
+ <tonode-name>SIGFPEfunc</tonode-name>
+ <toserviceparameter-name>b</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph SIGFPEPython
+
+from SuperV import *
+
+# Graph creation of SIGFPEPython
+def DefSIGFPEPython() :
+ SIGFPEPython = Graph( 'SIGFPEPython' )
+ SIGFPEPython.SetName( 'SIGFPEPython' )
+ SIGFPEPython.SetAuthor( 'JR' )
+ SIGFPEPython.SetComment( '' )
+ SIGFPEPython.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PySIGFPEPython = []
+ PySIGFPEPython.append( 'def SIGFPEPython() : ' )
+ PySIGFPEPython.append( ' import libSIGNALSComponent_Swig ' )
+ PySIGFPEPython.append( ' s = libSIGNALSComponent_Swig.SIGNALSComponentEngine() ' )
+ PySIGFPEPython.append( ' s.SIGFPEfunc(1,0) ' )
+ PySIGFPEPython.append( ' ' )
+ SIGFPEPython = SIGFPEPython.INode( 'SIGFPEPython' , PySIGFPEPython )
+ SIGFPEPython.SetName( 'SIGFPEPython' )
+ SIGFPEPython.SetAuthor( '' )
+ SIGFPEPython.SetComment( 'Compute Node' )
+ SIGFPEPython.Coords( 118 , 159 )
+ ISIGFPEPythonGate = SIGFPEPython.GetInPort( 'Gate' )
+ OSIGFPEPythonGate = SIGFPEPython.GetOutPort( 'Gate' )
+
+ # Output Ports of the graph
+ return SIGFPEPython
+
+
+SIGFPEPython = DefSIGFPEPython()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>SIGFPEPython</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>SIGFPEPython</service-name>
+ <inParameter-list/>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>9/12/2004 - 18:7:31</creation-date>
+ <lastmodification-date>10/12/2004 - 12:35:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>SIGFPEPython</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>SIGFPEPython</service-name>
+ <inParameter-list/>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>SIGFPEPython</FuncName>
+ <PyFunc><![CDATA[def SIGFPEPython() : ]]></PyFunc>
+ <PyFunc><![CDATA[ import libSIGNALSComponent_Swig ]]></PyFunc>
+ <PyFunc><![CDATA[ s = libSIGNALSComponent_Swig.SIGNALSComponentEngine() ]]></PyFunc>
+ <PyFunc><![CDATA[ s.SIGFPEfunc(1,0) ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>10/12/2004 - 12:35:36</creation-date>
+ <lastmodification-date>10/12/2004 - 12:35:36</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>118</x-position>
+ <y-position>159</y-position> </node> </node-list>
+ <link-list/>
+ <data-list/> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSIGSEGV
+
+from SuperV import *
+
+# Graph creation of GraphSIGSEGV
+def DefGraphSIGSEGV() :
+ GraphSIGSEGV = Graph( 'GraphSIGSEGV' )
+ GraphSIGSEGV.SetName( 'GraphSIGSEGV' )
+ GraphSIGSEGV.SetAuthor( 'JR' )
+ GraphSIGSEGV.SetComment( '' )
+ GraphSIGSEGV.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ SIGSEGVfunc = GraphSIGSEGV.FNode( 'SIGNALSComponent' , 'SIGNALSComponent' , 'SIGSEGVfunc' )
+ SIGSEGVfunc.SetName( 'SIGSEGVfunc' )
+ SIGSEGVfunc.SetAuthor( '' )
+ SIGSEGVfunc.SetContainer( 'localhost/FactoryServer' )
+ SIGSEGVfunc.SetComment( 'SIGSEGVfunc from SIGNALSComponent' )
+ SIGSEGVfunc.Coords( 152 , 197 )
+ ISIGSEGVfuncGate = SIGSEGVfunc.GetInPort( 'Gate' )
+ OSIGSEGVfuncreturn = SIGSEGVfunc.GetOutPort( 'return' )
+ OSIGSEGVfuncGate = SIGSEGVfunc.GetOutPort( 'Gate' )
+
+ # Output Ports of the graph
+ #OSIGSEGVfuncreturn = SIGSEGVfunc.GetOutPort( 'return' )
+ return GraphSIGSEGV
+
+
+GraphSIGSEGV = DefGraphSIGSEGV()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSIGSEGV</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSIGSEGV</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>SIGSEGVfunc__return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:9:47</creation-date>
+ <lastmodification-date>8/12/2004 - 18:13:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>SIGNALSComponent</component-name>
+ <interface-name>SIGNALSComponent</interface-name>
+ <node-name>SIGSEGVfunc</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>SIGSEGVfunc</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:10:12</creation-date>
+ <lastmodification-date>8/12/2004 - 18:10:12</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>SIGSEGVfunc from SIGNALSComponent</comment>
+ <x-position>152</x-position>
+ <y-position>197</y-position> </node> </node-list>
+ <link-list/>
+ <data-list/> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSIGSEGVPython
+
+from SuperV import *
+
+# Graph creation of GraphSIGSEGVPython
+def DefGraphSIGSEGVPython() :
+ GraphSIGSEGVPython = Graph( 'GraphSIGSEGVPython' )
+ GraphSIGSEGVPython.SetName( 'GraphSIGSEGVPython' )
+ GraphSIGSEGVPython.SetAuthor( 'JR' )
+ GraphSIGSEGVPython.SetComment( '' )
+ GraphSIGSEGVPython.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PySIGSEGVPython = []
+ PySIGSEGVPython.append( 'def SIGSEGVPython() : ' )
+ PySIGSEGVPython.append( ' import libSIGNALSComponent_Swig ' )
+ PySIGSEGVPython.append( ' s = libSIGNALSComponent_Swig.SIGNALSComponentEngine() ' )
+ PySIGSEGVPython.append( ' s.SIGSEGVfunc() ' )
+ PySIGSEGVPython.append( ' ' )
+ SIGSEGVPython = GraphSIGSEGVPython.INode( 'SIGSEGVPython' , PySIGSEGVPython )
+ SIGSEGVPython.SetName( 'SIGSEGVPython' )
+ SIGSEGVPython.SetAuthor( '' )
+ SIGSEGVPython.SetComment( 'Compute Node' )
+ SIGSEGVPython.Coords( 105 , 143 )
+ ISIGSEGVPythonGate = SIGSEGVPython.GetInPort( 'Gate' )
+ OSIGSEGVPythonGate = SIGSEGVPython.GetOutPort( 'Gate' )
+
+ # Output Ports of the graph
+ return GraphSIGSEGVPython
+
+
+GraphSIGSEGVPython = DefGraphSIGSEGVPython()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSIGSEGVPython</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSIGSEGVPython</service-name>
+ <inParameter-list/>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>9/12/2004 - 18:13:21</creation-date>
+ <lastmodification-date>10/12/2004 - 12:39:15</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>SIGSEGVPython</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>SIGSEGVPython</service-name>
+ <inParameter-list/>
+ <outParameter-list/> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>SIGSEGVPython</FuncName>
+ <PyFunc><![CDATA[def SIGSEGVPython() : ]]></PyFunc>
+ <PyFunc><![CDATA[ import libSIGNALSComponent_Swig ]]></PyFunc>
+ <PyFunc><![CDATA[ s = libSIGNALSComponent_Swig.SIGNALSComponentEngine() ]]></PyFunc>
+ <PyFunc><![CDATA[ s.SIGSEGVfunc() ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>10/12/2004 - 12:39:15</creation-date>
+ <lastmodification-date>10/12/2004 - 12:39:15</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>105</x-position>
+ <y-position>143</y-position> </node> </node-list>
+ <link-list/>
+ <data-list/> </dataflow></supergraph>
PyEndOfInitLoop.append( ' DoLoop = 0 ' )
PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
-IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+IInitLoopInitLoop = InitLoop.GetInPort( 'DoLoop' )
IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
<fromnode-name>EndOfInitLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
EndLoop.Coords( 1158 , 393 )
PyEndLoop = []
EndLoop.SetPyFunction( 'EndInit' , PyEndLoop )
-ILoopInitLoop = Loop.GetInPort( 'InitLoop' )
+ILoopInitLoop = Loop.GetInPort( 'DoLoop' )
ILoopIndex = Loop.InPort( 'Index' , 'long' )
ILoopMin = Loop.InPort( 'Min' , 'long' )
ILoopMax = Loop.InPort( 'Max' , 'long' )
<fromnode-name>EndLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Loop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link> </link-list>
<data-list>
<data>
<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoopSwitch</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
<fromnode-name>EndOfInitLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
--- /dev/null
+
+# Generated python file of Graph GraphSwitch_1_1
+
+from SuperV import *
+
+# Graph creation of GraphSwitch_1_1
+def DefGraphSwitch_1_1() :
+ GraphSwitch_1_1 = Graph( 'GraphSwitch_1_1' )
+ GraphSwitch_1_1.SetName( 'GraphSwitch_1_1' )
+ GraphSwitch_1_1.SetAuthor( '' )
+ GraphSwitch_1_1.SetComment( '' )
+ GraphSwitch_1_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 388 , 50 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 397 , 279 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 766 , 127 )
+ PyEndOfInitLoopSwitch = []
+ EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndOfSwitch = GraphSwitch_1_1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 580 , 147 )
+ PyEndOfSwitch = []
+ EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 195 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndOfSwitcha = GraphSwitch_1_1.Link( OIsOdda , IEndOfSwitcha )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LIsEvenaEndOfSwitcha = GraphSwitch_1_1.Link( OIsEvena , IEndOfSwitcha )
+
+ LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate )
+
+ LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda )
+
+ LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena )
+
+ LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ return GraphSwitch_1_1
+
+
+GraphSwitch_1_1 = DefGraphSwitch_1_1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitch_1_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitch_1_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>1/10/2003 - 17:23:54</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>388</x-position>
+ <y-position>50</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>766</x-position>
+ <y-position>127</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>397</x-position>
+ <y-position>279</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>195</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch_1</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 17:7:20</creation-date>
+ <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>580</x-position>
+ <y-position>147</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSwitchCheck
+
+from SuperV import *
+
+# Graph creation of GraphSwitchCheck
+def DefGraphSwitchCheck() :
+ GraphSwitchCheck = Graph( 'GraphSwitchCheck' )
+ GraphSwitchCheck.SetName( 'GraphSwitchCheck' )
+ GraphSwitchCheck.SetAuthor( 'JR' )
+ GraphSwitchCheck.SetComment( '' )
+ GraphSwitchCheck.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitchCheck.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 415 , 7 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitchCheck.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 421 , 438 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ PyPrintOdd = []
+ PyPrintOdd.append( 'from time import * ' )
+ PyPrintOdd.append( 'def Print(a,Branch) : ' )
+ PyPrintOdd.append( ' print "Print ",a,Branch ' )
+ PyPrintOdd.append( ' sleep(1) ' )
+ PyPrintOdd.append( ' return Branch ' )
+ PrintOdd = GraphSwitchCheck.INode( 'Print' , PyPrintOdd )
+ PrintOdd.SetName( 'PrintOdd' )
+ PrintOdd.SetAuthor( '' )
+ PrintOdd.SetComment( 'Compute Node' )
+ PrintOdd.Coords( 415 , 130 )
+ IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
+ IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
+ IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
+ OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
+ OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
+
+ PyPrintEven = []
+ PyPrintEven.append( 'from time import * ' )
+ PyPrintEven.append( 'def Print_1(a,Branch) : ' )
+ PyPrintEven.append( ' print "Print ",a,Branch ' )
+ PyPrintEven.append( ' sleep(1) ' )
+ PyPrintEven.append( ' return Branch ' )
+ PrintEven = GraphSwitchCheck.INode( 'Print_1' , PyPrintEven )
+ PrintEven.SetName( 'PrintEven' )
+ PrintEven.SetAuthor( '' )
+ PrintEven.SetComment( 'Compute Node' )
+ PrintEven.Coords( 423 , 289 )
+ IPrintEvena = PrintEven.InPort( 'a' , 'long' )
+ IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
+ IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
+ OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
+ OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
+
+ PyEmptyNode = []
+ PyEmptyNode.append( 'from time import * ' )
+ PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
+ PyEmptyNode.append( ' sleep(1) ' )
+ PyEmptyNode.append( ' return a,Branch ' )
+ EmptyNode = GraphSwitchCheck.INode( 'EmptyNode' , PyEmptyNode )
+ EmptyNode.SetName( 'EmptyNode' )
+ EmptyNode.SetAuthor( '' )
+ EmptyNode.SetComment( 'Compute Node' )
+ EmptyNode.Coords( 652 , 110 )
+ IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
+ IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
+ IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
+ OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
+ OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
+ OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'from time import * ' )
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' sleep(1) ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheck.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 1074 , 194 )
+ PyEndOfInitLoopSwitch = []
+ PyEndOfInitLoopSwitch.append( 'from time import * ' )
+ PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
+ PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
+ PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' Branch = "Negative or null" ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a,Branch,1 ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' Branch = "Even" ' )
+ PySwitch.append( ' else : ' )
+ PySwitch.append( ' Branch = "Odd" ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
+ Switch,EndOfSwitch = GraphSwitchCheck.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 882 , 194 )
+ PyEndOfSwitch = []
+ PyEndOfSwitch.append( 'from time import * ' )
+ PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
+ PyEndOfSwitch.append( ' sleep(1) ' )
+ PyEndOfSwitch.append( ' return a ' )
+ EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 195 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
+ OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEmptyNodea = GraphSwitchCheck.Link( OIsOdda , IEmptyNodea )
+ LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
+
+ LIsEvenaEndOfSwitcha = GraphSwitchCheck.Link( OIsEvena , IEndOfSwitcha )
+
+ LPrintOddBranchEmptyNodeBranch = GraphSwitchCheck.Link( OPrintOddBranch , IEmptyNodeBranch )
+
+ LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheck.Link( OPrintEvenBranch , IEndOfSwitchBranch )
+
+ LEmptyNodeaEndOfSwitcha = GraphSwitchCheck.Link( OEmptyNodea , IEndOfSwitcha )
+
+ LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheck.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitchCheck.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheck.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheck.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LSwitchOddIsOddGate = GraphSwitchCheck.Link( OSwitchOdd , IIsOddGate )
+ LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
+ LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
+
+ LSwitchOddPrintOddGate = GraphSwitchCheck.Link( OSwitchOdd , IPrintOddGate )
+ LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
+ LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
+
+ LSwitchEvenIsEvenGate = GraphSwitchCheck.Link( OSwitchEven , IIsEvenGate )
+ LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
+ LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
+
+ LSwitchEvenPrintEvenGate = GraphSwitchCheck.Link( OSwitchEven , IPrintEvenGate )
+ LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
+ LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
+
+ LSwitchaIsOdda = GraphSwitchCheck.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
+ LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
+
+ LSwitchaIsEvena = GraphSwitchCheck.Link( OSwitcha , IIsEvena )
+ LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
+ LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaPrintOdda = GraphSwitchCheck.Link( OSwitcha , IPrintOdda )
+
+ LSwitchaPrintEvena = GraphSwitchCheck.Link( OSwitcha , IPrintEvena )
+ LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
+ LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchBranchPrintOddBranch = GraphSwitchCheck.Link( OSwitchBranch , IPrintOddBranch )
+
+ LSwitchBranchPrintEvenBranch = GraphSwitchCheck.Link( OSwitchBranch , IPrintEvenBranch )
+ LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
+ LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
+
+ LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheck.Link( OSwitchDefault , IEndOfSwitchDefault )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheck.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ #OSwitchdefault = Switch.GetOutPort( 'default' )
+ return GraphSwitchCheck
+
+
+GraphSwitchCheck = DefGraphSwitchCheck()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitchCheck</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitchCheck</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>Switch__default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>13/1/2005 - 11:48:50</creation-date>
+ <lastmodification-date>13/1/2005 - 11:51:24</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>415</x-position>
+ <y-position>7</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>438</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Print</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>415</x-position>
+ <y-position>130</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Print_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print_1(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>423</x-position>
+ <y-position>289</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EmptyNode</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>EmptyNode</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EmptyNode</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EmptyNode(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>652</x-position>
+ <y-position>110</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoopSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1074</x-position>
+ <y-position>194</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Negative or null" ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a,Branch,1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Even" ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Odd" ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a,Branch,0 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>195</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfSwitch(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:50:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:50:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>882</x-position>
+ <y-position>194</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>646</x>
+ <y>78</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintOdd</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintEven</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>101</y> </coord>
+ <coord>
+<x>401</x>
+ <y>160</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>245</y> </coord>
+ <coord>
+<x>401</x>
+ <y>159</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>533</y> </coord>
+ <coord>
+<x>392</x>
+ <y>182</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>403</y> </coord>
+ <coord>
+<x>392</x>
+ <y>181</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>78</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>509</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>361</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>369</x>
+ <y>381</y> </coord>
+ <coord>
+<x>369</x>
+ <y>219</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitchCheck</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheck</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheck</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSwitchCheckDefault
+
+from SuperV import *
+
+# Graph creation of GraphSwitchCheckDefault
+def DefGraphSwitchCheckDefault() :
+ GraphSwitchCheckDefault = Graph( 'GraphSwitchCheckDefault' )
+ GraphSwitchCheckDefault.SetName( 'GraphSwitchCheckDefault' )
+ GraphSwitchCheckDefault.SetAuthor( 'JR' )
+ GraphSwitchCheckDefault.SetComment( '' )
+ GraphSwitchCheckDefault.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitchCheckDefault.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 415 , 7 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitchCheckDefault.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 421 , 438 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ PyPrintOdd = []
+ PyPrintOdd.append( 'from time import * ' )
+ PyPrintOdd.append( 'def Print(a,Branch) : ' )
+ PyPrintOdd.append( ' print "Print ",a,Branch ' )
+ PyPrintOdd.append( ' sleep(1) ' )
+ PyPrintOdd.append( ' return Branch ' )
+ PrintOdd = GraphSwitchCheckDefault.INode( 'Print' , PyPrintOdd )
+ PrintOdd.SetName( 'PrintOdd' )
+ PrintOdd.SetAuthor( '' )
+ PrintOdd.SetComment( 'Compute Node' )
+ PrintOdd.Coords( 415 , 130 )
+ IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
+ IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
+ IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
+ OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
+ OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
+
+ PyPrintEven = []
+ PyPrintEven.append( 'from time import * ' )
+ PyPrintEven.append( 'def Print_1(a,Branch) : ' )
+ PyPrintEven.append( ' print "Print ",a,Branch ' )
+ PyPrintEven.append( ' sleep(1) ' )
+ PyPrintEven.append( ' return Branch ' )
+ PrintEven = GraphSwitchCheckDefault.INode( 'Print_1' , PyPrintEven )
+ PrintEven.SetName( 'PrintEven' )
+ PrintEven.SetAuthor( '' )
+ PrintEven.SetComment( 'Compute Node' )
+ PrintEven.Coords( 423 , 289 )
+ IPrintEvena = PrintEven.InPort( 'a' , 'long' )
+ IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
+ IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
+ OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
+ OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
+
+ PyEmptyNode = []
+ PyEmptyNode.append( 'from time import * ' )
+ PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
+ PyEmptyNode.append( ' sleep(1) ' )
+ PyEmptyNode.append( ' return a,Branch ' )
+ EmptyNode = GraphSwitchCheckDefault.INode( 'EmptyNode' , PyEmptyNode )
+ EmptyNode.SetName( 'EmptyNode' )
+ EmptyNode.SetAuthor( '' )
+ EmptyNode.SetComment( 'Compute Node' )
+ EmptyNode.Coords( 652 , 110 )
+ IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
+ IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
+ IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
+ OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
+ OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
+ OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
+
+ PyDefault = []
+ PyDefault.append( 'from time import * ' )
+ PyDefault.append( 'def Default(a,Branch) : ' )
+ PyDefault.append( ' sleep(1) ' )
+ PyDefault.append( ' return a,Branch ' )
+ Default = GraphSwitchCheckDefault.INode( 'Default' , PyDefault )
+ Default.SetName( 'Default' )
+ Default.SetAuthor( '' )
+ Default.SetComment( 'Compute Node' )
+ Default.Coords( 421 , 592 )
+ IDefaulta = Default.InPort( 'a' , 'long' )
+ IDefaultBranch = Default.InPort( 'Branch' , 'string' )
+ IDefaultGate = Default.GetInPort( 'Gate' )
+ ODefaulta = Default.OutPort( 'a' , 'long' )
+ ODefaultBranch = Default.OutPort( 'Branch' , 'string' )
+ ODefaultGate = Default.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'from time import * ' )
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' sleep(1) ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 1074 , 194 )
+ PyEndOfInitLoopSwitch = []
+ PyEndOfInitLoopSwitch.append( 'from time import * ' )
+ PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
+ PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
+ PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' Branch = "Negative or null" ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a,Branch,1 ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' Branch = "Even" ' )
+ PySwitch.append( ' else : ' )
+ PySwitch.append( ' Branch = "Odd" ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
+ Switch,EndOfSwitch = GraphSwitchCheckDefault.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 882 , 194 )
+ PyEndOfSwitch = []
+ PyEndOfSwitch.append( 'from time import * ' )
+ PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
+ PyEndOfSwitch.append( ' sleep(1) ' )
+ PyEndOfSwitch.append( ' return a ' )
+ EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 190 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
+ OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEmptyNodea = GraphSwitchCheckDefault.Link( OIsOdda , IEmptyNodea )
+ LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
+
+ LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault.Link( OIsEvena , IEndOfSwitcha )
+
+ LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault.Link( OPrintOddBranch , IEmptyNodeBranch )
+
+ LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OPrintEvenBranch , IEndOfSwitchBranch )
+
+ LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault.Link( OEmptyNodea , IEndOfSwitcha )
+
+ LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
+
+ LDefaultaEndOfSwitcha = GraphSwitchCheckDefault.Link( ODefaulta , IEndOfSwitcha )
+
+ LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( ODefaultBranch , IEndOfSwitchBranch )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LSwitchOddIsOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IIsOddGate )
+ LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
+ LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
+
+ LSwitchOddPrintOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IPrintOddGate )
+ LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
+ LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
+
+ LSwitchEvenIsEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IIsEvenGate )
+ LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
+ LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
+
+ LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IPrintEvenGate )
+ LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
+ LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
+
+ LSwitchaIsOdda = GraphSwitchCheckDefault.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
+ LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
+
+ LSwitchaIsEvena = GraphSwitchCheckDefault.Link( OSwitcha , IIsEvena )
+ LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
+ LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaPrintOdda = GraphSwitchCheckDefault.Link( OSwitcha , IPrintOdda )
+
+ LSwitchaPrintEvena = GraphSwitchCheckDefault.Link( OSwitcha , IPrintEvena )
+ LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
+ LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaDefaulta = GraphSwitchCheckDefault.Link( OSwitcha , IDefaulta )
+ LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
+ LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
+
+ LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintOddBranch )
+
+ LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintEvenBranch )
+ LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
+ LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
+
+ LSwitchBranchDefaultBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IDefaultBranch )
+ LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
+ LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
+
+ LSwitchDefaultDefaultGate = GraphSwitchCheckDefault.Link( OSwitchDefault , IDefaultGate )
+ LSwitchDefaultDefaultGate.AddCoord( 1 , 360 , 707 )
+ LSwitchDefaultDefaultGate.AddCoord( 2 , 360 , 263 )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ #OSwitchdefault = Switch.GetOutPort( 'default' )
+ return GraphSwitchCheckDefault
+
+
+GraphSwitchCheckDefault = DefGraphSwitchCheckDefault()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitchCheckDefault</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitchCheck_2</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>Switch__default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>13/1/2005 - 12:21:43</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>415</x-position>
+ <y-position>7</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>438</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>415</x-position>
+ <y-position>130</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print_1(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>423</x-position>
+ <y-position>289</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EmptyNode</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>EmptyNode</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EmptyNode</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EmptyNode(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>652</x-position>
+ <y-position>110</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Default</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Default</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Default</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Default(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>592</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoopSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1074</x-position>
+ <y-position>194</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Negative or null" ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a,Branch,1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Even" ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Odd" ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a,Branch,0 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>190</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfSwitch(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>882</x-position>
+ <y-position>194</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>646</x>
+ <y>78</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintOdd</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintEven</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>101</y> </coord>
+ <coord>
+<x>401</x>
+ <y>160</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>245</y> </coord>
+ <coord>
+<x>401</x>
+ <y>159</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>533</y> </coord>
+ <coord>
+<x>392</x>
+ <y>182</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>403</y> </coord>
+ <coord>
+<x>392</x>
+ <y>181</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>78</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>509</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>361</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>663</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>369</x>
+ <y>381</y> </coord>
+ <coord>
+<x>369</x>
+ <y>219</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>370</x>
+ <y>683</y> </coord>
+ <coord>
+<x>370</x>
+ <y>220</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>360</x>
+ <y>707</y> </coord>
+ <coord>
+<x>360</x>
+ <y>263</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitchCheckDefault</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSwitchCheckDefault1
+
+from SuperV import *
+
+# Graph creation of GraphSwitchCheckDefault1
+def DefGraphSwitchCheckDefault1() :
+ GraphSwitchCheckDefault1 = Graph( 'GraphSwitchCheckDefault1' )
+ GraphSwitchCheckDefault1.SetName( 'GraphSwitchCheckDefault1' )
+ GraphSwitchCheckDefault1.SetAuthor( 'JR' )
+ GraphSwitchCheckDefault1.SetComment( '' )
+ GraphSwitchCheckDefault1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitchCheckDefault1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 415 , 7 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitchCheckDefault1.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 421 , 438 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ PyPrintOdd = []
+ PyPrintOdd.append( 'from time import * ' )
+ PyPrintOdd.append( 'def Print(a,Branch) : ' )
+ PyPrintOdd.append( ' print "Print ",a,Branch ' )
+ PyPrintOdd.append( ' sleep(1) ' )
+ PyPrintOdd.append( ' return Branch ' )
+ PrintOdd = GraphSwitchCheckDefault1.INode( 'Print' , PyPrintOdd )
+ PrintOdd.SetName( 'PrintOdd' )
+ PrintOdd.SetAuthor( '' )
+ PrintOdd.SetComment( 'Compute Node' )
+ PrintOdd.Coords( 415 , 130 )
+ IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
+ IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
+ IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
+ OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
+ OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
+
+ PyPrintEven = []
+ PyPrintEven.append( 'from time import * ' )
+ PyPrintEven.append( 'def Print_1(a,Branch) : ' )
+ PyPrintEven.append( ' print "Print ",a,Branch ' )
+ PyPrintEven.append( ' sleep(1) ' )
+ PyPrintEven.append( ' return Branch ' )
+ PrintEven = GraphSwitchCheckDefault1.INode( 'Print_1' , PyPrintEven )
+ PrintEven.SetName( 'PrintEven' )
+ PrintEven.SetAuthor( '' )
+ PrintEven.SetComment( 'Compute Node' )
+ PrintEven.Coords( 423 , 289 )
+ IPrintEvena = PrintEven.InPort( 'a' , 'long' )
+ IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
+ IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
+ OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
+ OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
+
+ PyEmptyNode = []
+ PyEmptyNode.append( 'from time import * ' )
+ PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
+ PyEmptyNode.append( ' sleep(1) ' )
+ PyEmptyNode.append( ' return a,Branch ' )
+ EmptyNode = GraphSwitchCheckDefault1.INode( 'EmptyNode' , PyEmptyNode )
+ EmptyNode.SetName( 'EmptyNode' )
+ EmptyNode.SetAuthor( '' )
+ EmptyNode.SetComment( 'Compute Node' )
+ EmptyNode.Coords( 652 , 110 )
+ IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
+ IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
+ IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
+ OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
+ OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
+ OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
+
+ PyDefault = []
+ PyDefault.append( 'from time import * ' )
+ PyDefault.append( 'def Default(a,Branch) : ' )
+ PyDefault.append( ' sleep(1) ' )
+ PyDefault.append( ' return a,Branch ' )
+ Default = GraphSwitchCheckDefault1.INode( 'Default' , PyDefault )
+ Default.SetName( 'Default' )
+ Default.SetAuthor( '' )
+ Default.SetComment( 'Compute Node' )
+ Default.Coords( 421 , 592 )
+ IDefaulta = Default.InPort( 'a' , 'long' )
+ IDefaultBranch = Default.InPort( 'Branch' , 'string' )
+ IDefaultGate = Default.GetInPort( 'Gate' )
+ ODefaulta = Default.OutPort( 'a' , 'long' )
+ ODefaultBranch = Default.OutPort( 'Branch' , 'string' )
+ ODefaultGate = Default.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'from time import * ' )
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' sleep(1) ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 1074 , 194 )
+ PyEndOfInitLoopSwitch = []
+ PyEndOfInitLoopSwitch.append( 'from time import * ' )
+ PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
+ PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
+ PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' Branch = "Negative or null" ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a,Branch,1 ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' Branch = "Even" ' )
+ PySwitch.append( ' else : ' )
+ PySwitch.append( ' Branch = "Odd" ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
+ Switch,EndOfSwitch = GraphSwitchCheckDefault1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 882 , 194 )
+ PyEndOfSwitch = []
+ PyEndOfSwitch.append( 'from time import * ' )
+ PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
+ PyEndOfSwitch.append( ' sleep(1) ' )
+ PyEndOfSwitch.append( ' return a ' )
+ EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 190 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
+ OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEmptyNodea = GraphSwitchCheckDefault1.Link( OIsOdda , IEmptyNodea )
+ LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
+
+ LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OIsEvena , IEndOfSwitcha )
+
+ LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault1.Link( OPrintOddBranch , IEmptyNodeBranch )
+
+ LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OPrintEvenBranch , IEndOfSwitchBranch )
+
+ LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OEmptyNodea , IEndOfSwitcha )
+
+ LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
+
+ LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha )
+
+ LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LSwitchOddIsOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IIsOddGate )
+ LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
+ LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
+
+ LSwitchOddPrintOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IPrintOddGate )
+ LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
+ LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
+
+ LSwitchEvenIsEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IIsEvenGate )
+ LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
+ LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
+
+ LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IPrintEvenGate )
+ LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
+ LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
+
+ LSwitchaIsOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
+ LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
+
+ LSwitchaIsEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IIsEvena )
+ LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
+ LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaPrintOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintOdda )
+
+ LSwitchaPrintEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintEvena )
+ LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
+ LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta )
+ LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
+ LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
+
+ LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch )
+
+ LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch )
+ LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
+ LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
+
+ LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch )
+ LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
+ LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
+
+ LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate )
+ LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 )
+ LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ return GraphSwitchCheckDefault1
+
+
+GraphSwitchCheckDefault1 = DefGraphSwitchCheckDefault1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitchCheckDefault1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitchCheckDefault</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>13/1/2005 - 12:21:43</creation-date>
+ <lastmodification-date>13/1/2005 - 12:28:19</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>415</x-position>
+ <y-position>7</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>438</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>415</x-position>
+ <y-position>130</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print_1(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>423</x-position>
+ <y-position>289</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EmptyNode</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>EmptyNode</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EmptyNode</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EmptyNode(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>652</x-position>
+ <y-position>110</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Default</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Default</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Default</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Default(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>592</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoopSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1074</x-position>
+ <y-position>194</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Negative or null" ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a,Branch,1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Even" ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Odd" ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a,Branch,0 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>190</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfSwitch(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>882</x-position>
+ <y-position>194</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>646</x>
+ <y>78</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintOdd</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PrintEven</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>101</y> </coord>
+ <coord>
+<x>401</x>
+ <y>160</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>245</y> </coord>
+ <coord>
+<x>401</x>
+ <y>159</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>533</y> </coord>
+ <coord>
+<x>392</x>
+ <y>182</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>403</y> </coord>
+ <coord>
+<x>392</x>
+ <y>181</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>78</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>509</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>361</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>663</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>369</x>
+ <y>381</y> </coord>
+ <coord>
+<x>369</x>
+ <y>219</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>370</x>
+ <y>683</y> </coord>
+ <coord>
+<x>370</x>
+ <y>220</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>default</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>363</x>
+ <y>707</y> </coord>
+ <coord>
+<x>362</x>
+ <y>239</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSwitchCheckDefault1
+
+from SuperV import *
+
+# Graph creation of GraphSwitchCheckDefault1
+def DefGraphSwitchCheckDefault1() :
+ GraphSwitchCheckDefault1 = Graph( 'GraphSwitchCheckDefault1' )
+ GraphSwitchCheckDefault1.SetName( 'GraphSwitchCheckDefault1' )
+ GraphSwitchCheckDefault1.SetAuthor( 'JR' )
+ GraphSwitchCheckDefault1.SetComment( '' )
+ GraphSwitchCheckDefault1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitchCheckDefault1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 415 , 7 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitchCheckDefault1.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 421 , 438 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ PyPrintOdd = []
+ PyPrintOdd.append( 'from time import * ' )
+ PyPrintOdd.append( 'def Print(a,Branch) : ' )
+ PyPrintOdd.append( ' print "Print ",a,Branch ' )
+ PyPrintOdd.append( ' sleep(1) ' )
+ PyPrintOdd.append( ' return Branch ' )
+ PrintOdd = GraphSwitchCheckDefault1.INode( 'Print' , PyPrintOdd )
+ PrintOdd.SetName( 'PrintOdd' )
+ PrintOdd.SetAuthor( '' )
+ PrintOdd.SetComment( 'Compute Node' )
+ PrintOdd.Coords( 415 , 130 )
+ IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
+ IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
+ IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
+ OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
+ OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
+
+ PyPrintEven = []
+ PyPrintEven.append( 'from time import * ' )
+ PyPrintEven.append( 'def Print_1(a,Branch) : ' )
+ PyPrintEven.append( ' print "Print ",a,Branch ' )
+ PyPrintEven.append( ' sleep(1) ' )
+ PyPrintEven.append( ' return Branch ' )
+ PrintEven = GraphSwitchCheckDefault1.INode( 'Print_1' , PyPrintEven )
+ PrintEven.SetName( 'PrintEven' )
+ PrintEven.SetAuthor( '' )
+ PrintEven.SetComment( 'Compute Node' )
+ PrintEven.Coords( 423 , 289 )
+ IPrintEvena = PrintEven.InPort( 'a' , 'long' )
+ IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
+ IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
+ OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
+ OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
+
+ PyEmptyNode = []
+ PyEmptyNode.append( 'from time import * ' )
+ PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
+ PyEmptyNode.append( ' sleep(1) ' )
+ PyEmptyNode.append( ' return a,Branch ' )
+ EmptyNode = GraphSwitchCheckDefault1.INode( 'EmptyNode' , PyEmptyNode )
+ EmptyNode.SetName( 'EmptyNode' )
+ EmptyNode.SetAuthor( '' )
+ EmptyNode.SetComment( 'Compute Node' )
+ EmptyNode.Coords( 652 , 110 )
+ IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
+ IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
+ IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
+ OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
+ OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
+ OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
+
+ PyDefault = []
+ PyDefault.append( 'from time import * ' )
+ PyDefault.append( 'def Default(a,Branch) : ' )
+ PyDefault.append( ' sleep(1) ' )
+ PyDefault.append( ' return a,Branch ' )
+ Default = GraphSwitchCheckDefault1.INode( 'Default' , PyDefault )
+ Default.SetName( 'Default' )
+ Default.SetAuthor( '' )
+ Default.SetComment( 'Compute Node' )
+ Default.Coords( 421 , 592 )
+ IDefaulta = Default.InPort( 'a' , 'long' )
+ IDefaultBranch = Default.InPort( 'Branch' , 'string' )
+ IDefaultGate = Default.GetInPort( 'Gate' )
+ ODefaulta = Default.OutPort( 'a' , 'long' )
+ ODefaultBranch = Default.OutPort( 'Branch' , 'string' )
+ ODefaultGate = Default.GetOutPort( 'Gate' )
+
+ PyPuta = []
+ PyPuta.append( 'from time import * ' )
+ PyPuta.append( 'def Puta(a) : ' )
+ PyPuta.append( ' sleep(1) ' )
+ PyPuta.append( ' return a ' )
+ Puta = GraphSwitchCheckDefault1.INode( 'Puta' , PyPuta )
+ Puta.SetName( 'Puta' )
+ Puta.SetAuthor( '' )
+ Puta.SetComment( 'Compute Node' )
+ Puta.Coords( 658 , 472 )
+ IPutaa = Puta.InPort( 'a' , 'long' )
+ IPutaGate = Puta.GetInPort( 'Gate' )
+ OPutaa = Puta.OutPort( 'a' , 'long' )
+ OPutaGate = Puta.GetOutPort( 'Gate' )
+
+ PyPutBranch = []
+ PyPutBranch.append( 'from time import * ' )
+ PyPutBranch.append( 'def PutBranch(Branch) : ' )
+ PyPutBranch.append( ' sleep(1) ' )
+ PyPutBranch.append( ' return Branch ' )
+ PutBranch = GraphSwitchCheckDefault1.INode( 'PutBranch' , PyPutBranch )
+ PutBranch.SetName( 'PutBranch' )
+ PutBranch.SetAuthor( '' )
+ PutBranch.SetComment( 'Compute Node' )
+ PutBranch.Coords( 662 , 613 )
+ IPutBranchBranch = PutBranch.InPort( 'Branch' , 'string' )
+ IPutBranchGate = PutBranch.GetInPort( 'Gate' )
+ OPutBranchBranch = PutBranch.OutPort( 'Branch' , 'string' )
+ OPutBranchGate = PutBranch.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'from time import * ' )
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' sleep(1) ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 1074 , 194 )
+ PyEndOfInitLoopSwitch = []
+ PyEndOfInitLoopSwitch.append( 'from time import * ' )
+ PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
+ PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
+ PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' Branch = "Negative or null" ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a,Branch,1 ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' Branch = "Even" ' )
+ PySwitch.append( ' else : ' )
+ PySwitch.append( ' Branch = "Odd" ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
+ Switch,EndOfSwitch = GraphSwitchCheckDefault1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 882 , 194 )
+ PyEndOfSwitch = []
+ PyEndOfSwitch.append( 'from time import * ' )
+ PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
+ PyEndOfSwitch.append( ' sleep(1) ' )
+ PyEndOfSwitch.append( ' return a ' )
+ EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 190 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
+ OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEmptyNodea = GraphSwitchCheckDefault1.Link( OIsOdda , IEmptyNodea )
+ LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
+
+ LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault1.Link( OPrintOddBranch , IEmptyNodeBranch )
+
+ LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OEmptyNodea , IEndOfSwitcha )
+
+ LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
+
+ LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha )
+
+ LDefaultaPutaa = GraphSwitchCheckDefault1.Link( ODefaulta , IPutaa )
+
+ LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch )
+
+ LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IPutBranchBranch )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LSwitchOddIsOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IIsOddGate )
+ LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
+ LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
+
+ LSwitchOddPrintOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IPrintOddGate )
+ LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
+ LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
+
+ LSwitchEvenIsEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IIsEvenGate )
+ LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
+ LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
+
+ LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IPrintEvenGate )
+ LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
+ LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
+
+ LSwitchaIsOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
+ LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
+
+ LSwitchaIsEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IIsEvena )
+ LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
+ LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaPrintOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintOdda )
+
+ LSwitchaPrintEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintEvena )
+ LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
+ LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
+
+ LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta )
+ LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
+ LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
+
+ LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch )
+
+ LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch )
+ LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
+ LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
+
+ LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch )
+ LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
+ LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
+
+ LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate )
+ LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 )
+ LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ LPutaaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OPutaa , IEndOfSwitcha )
+
+ LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OPutBranchBranch , IEndOfSwitchBranch )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OIsEvena = IsEven.GetOutPort( 'a' )
+ #OPrintEvenBranch = PrintEven.GetOutPort( 'Branch' )
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ return GraphSwitchCheckDefault1
+
+
+GraphSwitchCheckDefault1 = DefGraphSwitchCheckDefault1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitchCheckDefault1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitchCheckDefault1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>IsEven__a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>PrintEven__Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>13/1/2005 - 12:21:43</creation-date>
+ <lastmodification-date>13/1/2005 - 12:33:25</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>415</x-position>
+ <y-position>7</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>438</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>415</x-position>
+ <y-position>130</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PrintEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PrintEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print_1</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Print_1(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",a,Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>423</x-position>
+ <y-position>289</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EmptyNode</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>EmptyNode</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EmptyNode</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EmptyNode(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>652</x-position>
+ <y-position>110</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Default</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Default</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Default</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Default(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>421</x-position>
+ <y-position>592</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfInitLoopSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1074</x-position>
+ <y-position>194</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Negative or null" ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a,Branch,1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Even" ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = "Odd" ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a,Branch,0 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>190</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndOfSwitch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def EndOfSwitch(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:23:17</creation-date>
+ <lastmodification-date>13/1/2005 - 12:23:17</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>882</x-position>
+ <y-position>194</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Puta</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Puta</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Puta</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Puta(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:31:48</creation-date>
+ <lastmodification-date>13/1/2005 - 12:31:48</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>658</x-position>
+ <y-position>472</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>PutBranch</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>PutBranch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>PutBranch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def PutBranch(Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 12:32:11</creation-date>
+ <lastmodification-date>13/1/2005 - 12:32:11</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>662</x-position>
+ <y-position>613</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>646</x>
+ <y>78</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>PrintOdd</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EmptyNode</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EmptyNode</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Puta</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Default</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PutBranch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>101</y> </coord>
+ <coord>
+<x>401</x>
+ <y>160</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>401</x>
+ <y>245</y> </coord>
+ <coord>
+<x>401</x>
+ <y>159</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>533</y> </coord>
+ <coord>
+<x>392</x>
+ <y>182</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>392</x>
+ <y>403</y> </coord>
+ <coord>
+<x>392</x>
+ <y>181</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>78</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>509</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>381</x>
+ <y>361</y> </coord>
+ <coord>
+<x>382</x>
+ <y>200</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>382</x>
+ <y>663</y> </coord>
+ <coord>
+<x>382</x>
+ <y>199</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintOdd</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>PrintEven</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>369</x>
+ <y>381</y> </coord>
+ <coord>
+<x>369</x>
+ <y>219</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>370</x>
+ <y>683</y> </coord>
+ <coord>
+<x>370</x>
+ <y>220</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>default</fromserviceparameter-name>
+ <tonode-name>Default</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list>
+<coord>
+<x>363</x>
+ <y>707</y> </coord>
+ <coord>
+<x>362</x>
+ <y>239</y> </coord> </coord-list> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Puta</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>PutBranch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitchCheckDefault1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoopSwitch</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
<fromnode-name>EndOfInitLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch_1</fromnode-name>
--- /dev/null
+
+# Generated python file of Graph GraphSwitch_1
+
+from SuperV import *
+
+# Graph creation of GraphSwitch_1
+def DefGraphSwitch_1() :
+ GraphSwitch_1 = Graph( 'GraphSwitch_1' )
+ GraphSwitch_1.SetName( 'GraphSwitch_1' )
+ GraphSwitch_1.SetAuthor( '' )
+ GraphSwitch_1.SetComment( '' )
+ GraphSwitch_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitch_1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 388 , 50 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitch_1.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 397 , 279 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 766 , 127 )
+ PyEndOfInitLoopSwitch = []
+ EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if a == 0 : ' )
+ PySwitch.append( ' return 0,0,a ' )
+ PySwitch.append( ' if a < 0 : ' )
+ PySwitch.append( ' return 1,1,a ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndOfSwitch = GraphSwitch_1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 580 , 147 )
+ PyEndOfSwitch = []
+ EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 195 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndOfSwitcha = GraphSwitch_1.Link( OIsOdda , IEndOfSwitcha )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitch_1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LIsEvenaEndOfSwitcha = GraphSwitch_1.Link( OIsEvena , IEndOfSwitcha )
+
+ LSwitchOddIsOddGate = GraphSwitch_1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenIsEvenGate = GraphSwitch_1.Link( OSwitchEven , IIsEvenGate )
+
+ LSwitchaIsOdda = GraphSwitch_1.Link( OSwitcha , IIsOdda )
+
+ LSwitchaIsEvena = GraphSwitch_1.Link( OSwitcha , IIsEvena )
+
+ LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1.Link( OSwitchDefault , IEndOfSwitchDefault )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ return GraphSwitch_1
+
+
+GraphSwitch_1 = DefGraphSwitch_1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitch_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitch_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>1/10/2003 - 17:23:54</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>388</x-position>
+ <y-position>50</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>766</x-position>
+ <y-position>127</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>397</x-position>
+ <y-position>279</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if a == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a ]]></PyFunc>
+ <PyFunc><![CDATA[ if a < 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 1,1,a ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>195</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch_1</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>12/1/2005 - 16:10:58</creation-date>
+ <lastmodification-date>12/1/2005 - 16:10:58</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>580</x-position>
+ <y-position>147</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphSwitch_1_1
+
+from SuperV import *
+
+# Graph creation of GraphSwitch_1_1
+def DefGraphSwitch_1_1() :
+ GraphSwitch_1_1 = Graph( 'GraphSwitch_1_1' )
+ GraphSwitch_1_1.SetName( 'GraphSwitch_1_1' )
+ GraphSwitch_1_1.SetAuthor( '' )
+ GraphSwitch_1_1.SetComment( '' )
+ GraphSwitch_1_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 388 , 50 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsEven = []
+ PyIsEven.append( 'from time import * ' )
+ PyIsEven.append( 'def IsEven(a) : ' )
+ PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
+ PyIsEven.append( ' sleep( 1 ) ' )
+ PyIsEven.append( ' return a ' )
+ IsEven = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven )
+ IsEven.SetName( 'IsEven' )
+ IsEven.SetAuthor( '' )
+ IsEven.SetComment( 'Compute Node' )
+ IsEven.Coords( 395 , 334 )
+ IIsEvena = IsEven.InPort( 'a' , 'long' )
+ IIsEvenGate = IsEven.GetInPort( 'Gate' )
+ OIsEvena = IsEven.OutPort( 'a' , 'long' )
+ OIsEvenGate = IsEven.GetOutPort( 'Gate' )
+
+ PyPrint = []
+ PyPrint.append( 'def Print(a,Branch) : ' )
+ PyPrint.append( ' print "Print ",Branch ' )
+ PyPrint.append( ' return a,Branch ' )
+ Print = GraphSwitch_1_1.INode( 'Print' , PyPrint )
+ Print.SetName( 'Print' )
+ Print.SetAuthor( '' )
+ Print.SetComment( 'Compute Node' )
+ Print.Coords( 639 , 63 )
+ IPrinta = Print.InPort( 'a' , 'long' )
+ IPrintBranch = Print.InPort( 'Branch' , 'string' )
+ IPrintGate = Print.GetInPort( 'Gate' )
+ OPrinta = Print.OutPort( 'a' , 'long' )
+ OPrintBranch = Print.OutPort( 'Branch' , 'string' )
+ OPrintGate = Print.GetOutPort( 'Gate' )
+
+ PyPrint_1 = []
+ PyPrint_1.append( 'def Print_1(a,Branch) : ' )
+ PyPrint_1.append( ' print "Print ",Branch ' )
+ PyPrint_1.append( ' return a,Branch ' )
+ Print_1 = GraphSwitch_1_1.INode( 'Print_1' , PyPrint_1 )
+ Print_1.SetName( 'Print_1' )
+ Print_1.SetAuthor( '' )
+ Print_1.SetComment( 'Compute Node' )
+ Print_1.Coords( 639 , 263 )
+ IPrint_1a = Print_1.InPort( 'a' , 'long' )
+ IPrint_1Branch = Print_1.InPort( 'Branch' , 'string' )
+ IPrint_1Gate = Print_1.GetInPort( 'Gate' )
+ OPrint_1a = Print_1.OutPort( 'a' , 'long' )
+ OPrint_1Branch = Print_1.OutPort( 'Branch' , 'string' )
+ OPrint_1Gate = Print_1.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' Index = Max ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 1082 , 150 )
+ PyEndOfInitLoopSwitch = []
+ EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' Branch = 'Negative or null' ' )
+ PySwitch.append( ' if a <= 0 : ' )
+ PySwitch.append( ' return 0,0,a,Branch,1 ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' Branch = 'Even' ' )
+ PySwitch.append( ' else : ' )
+ PySwitch.append( ' Branch = 'Odd' ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
+ Switch,EndOfSwitch = GraphSwitch_1_1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 880 , 150 )
+ PyEndOfSwitch = []
+ EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 195 , 129 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
+ OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaPrinta = GraphSwitch_1_1.Link( OIsOdda , IPrinta )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LIsEvenaPrint_1a = GraphSwitch_1_1.Link( OIsEvena , IPrint_1a )
+
+ LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate )
+
+ LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda )
+
+ LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena )
+
+ LSwitchBranchPrintBranch = GraphSwitch_1_1.Link( OSwitchBranch , IPrintBranch )
+
+ LSwitchBranchPrint_1Branch = GraphSwitch_1_1.Link( OSwitchBranch , IPrint_1Branch )
+
+ LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ LPrintaEndOfSwitcha = GraphSwitch_1_1.Link( OPrinta , IEndOfSwitcha )
+
+ LPrint_1aEndOfSwitcha = GraphSwitch_1_1.Link( OPrint_1a , IEndOfSwitcha )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( -5 )
+ IInitLoopSwitchMax.Input( 10 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ #OSwitchdefault = Switch.GetOutPort( 'default' )
+ #OPrintBranch = Print.GetOutPort( 'Branch' )
+ #OPrint_1Branch = Print_1.GetOutPort( 'Branch' )
+ return GraphSwitch_1_1
+
+
+GraphSwitch_1_1 = DefGraphSwitch_1_1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphSwitch_1_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphSwitch_1_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>InitLoopSwitch__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndOfInitLoopSwitch__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>Switch__default</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Print__Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Print_1__Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>1/10/2003 - 17:23:54</creation-date>
+ <lastmodification-date>13/1/2005 - 11:21:30</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsOdd</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsOdd</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsOdd</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsOdd(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsOdd (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Python function</comment>
+ <x-position>388</x-position>
+ <y-position>50</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>InitLoopSwitch</node-name>
+ <kind>4</kind>
+ <coupled-node>EndOfInitLoopSwitch</coupled-node>
+ <service>
+<service-name>InitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>InitLoop</FuncName>
+ <PyFunc><![CDATA[def InitLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>MoreLoop</FuncName>
+ <PyFunc><![CDATA[def MoreLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index >= Min : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>NextLoop</FuncName>
+ <PyFunc><![CDATA[def NextLoop(Index,Min,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index - 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>10</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfInitLoopSwitch</node-name>
+ <kind>5</kind>
+ <coupled-node>InitLoopSwitch</coupled-node>
+ <service>
+<service-name>EndOfInitLoopSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>1.05</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>1082</x-position>
+ <y-position>150</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>IsEven</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>IsEven</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>IsEven</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def IsEven(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print a,"IsEven (GraphSwitch)" ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep( 1 ) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>395</x-position>
+ <y-position>334</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Switch</node-name>
+ <kind>6</kind>
+ <coupled-node>EndOfSwitch</coupled-node>
+ <service>
+<service-name>Switch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Odd</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>Even</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>int</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>boolean</outParameter-type>
+ <outParameter-name>default</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Switch</FuncName>
+ <PyFunc><![CDATA[from time import * ]]></PyFunc>
+ <PyFunc><![CDATA[def Switch(a) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = 'Negative or null' ]]></PyFunc>
+ <PyFunc><![CDATA[ if a <= 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ return 0,0,a,Branch,1 ]]></PyFunc>
+ <PyFunc><![CDATA[ if ( a & 1 ) == 0 : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = 'Even' ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Branch = 'Odd' ]]></PyFunc>
+ <PyFunc><![CDATA[ sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ return a & 1,1-(a&1),a,Branch,0 ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>195</x-position>
+ <y-position>129</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndOfSwitch</node-name>
+ <kind>7</kind>
+ <coupled-node>Switch</coupled-node>
+ <service>
+<service-name>EndOfSwitch</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndSwitch_1</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>880</x-position>
+ <y-position>150</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Print</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Void</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print</FuncName>
+ <PyFunc><![CDATA[def Print(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:17:18</creation-date>
+ <lastmodification-date>13/1/2005 - 11:17:18</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>639</x-position>
+ <y-position>63</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Print_1</node-name>
+ <kind>3</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>Print_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>a</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>string</inParameter-type>
+ <inParameter-name>Branch</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>a</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>string</outParameter-type>
+ <outParameter-name>Branch</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Print_1</FuncName>
+ <PyFunc><![CDATA[def Print_1(a,Branch) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print "Print ",Branch ]]></PyFunc>
+ <PyFunc><![CDATA[ return a,Branch ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>13/1/2005 - 11:20:58</creation-date>
+ <lastmodification-date>13/1/2005 - 11:20:58</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>639</x-position>
+ <y-position>263</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>IsOdd</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Print</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>Switch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>InitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>IsEven</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>Print_1</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Odd</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Even</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsOdd</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>IsEven</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>Print</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Branch</fromserviceparameter-name>
+ <tonode-name>Print_1</tonode-name>
+ <toserviceparameter-name>Branch</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Switch</fromnode-name>
+ <fromserviceparameter-name>Default</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>Default</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndOfSwitch</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfInitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Print</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Print_1</fromnode-name>
+ <fromserviceparameter-name>a</fromserviceparameter-name>
+ <tonode-name>EndOfSwitch</tonode-name>
+ <toserviceparameter-name>a</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Min</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>-5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
+ <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
+ <tonode-name>InitLoopSwitch</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
<fromnode-name>EndOfInitLoopSwitch</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoopSwitch</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch</fromnode-name>
<fromnode-name>EndOfInitLoop</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>InitLoop</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Switch_1</fromnode-name>
+++ /dev/null
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#
-#
-# File : GraphSyracuseC.py
-# Module : SuperVisionTest
-
-from SuperV import *
-# Graph creation
-GraphSyracuseC = Graph( 'GraphSyracuseC' )
-GraphSyracuseC.SetName( 'GraphSyracuseC' )
-GraphSyracuseC.SetAuthor( 'JR' )
-GraphSyracuseC.SetComment( 'Syracuse algorithm' )
-GraphSyracuseC.Coords( 0 , 0 )
-
-# Creation of Computing Nodes
-test_ISEVEN = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-test_ISEVEN.SetName( 'test_ISEVEN' )
-test_ISEVEN.SetAuthor( '' )
-test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-test_ISEVEN.SetComment( '' )
-test_ISEVEN.Coords( 252 , 266 )
-test_ISONE = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-test_ISONE.SetName( 'test_ISONE' )
-test_ISONE.SetAuthor( '' )
-test_ISONE.SetContainer( 'localhost/FactoryServer' )
-test_ISONE.SetComment( '' )
-test_ISONE.Coords( 268 , 29 )
-m3p1 = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
-m3p1.SetName( 'm3p1' )
-m3p1.SetAuthor( '' )
-m3p1.SetContainer( 'localhost/FactoryServer' )
-m3p1.SetComment( '' )
-m3p1.Coords( 644 , 410 )
-div2 = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
-div2.SetName( 'div2' )
-div2.SetAuthor( '' )
-div2.SetContainer( 'localhost/FactoryServer' )
-div2.SetComment( '' )
-div2.Coords( 648 , 209 )
-incr = GraphSyracuseC.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
-incr.SetName( 'incr' )
-incr.SetAuthor( '' )
-incr.SetContainer( 'localhost/FactoryServer' )
-incr.SetComment( '' )
-incr.Coords( 640 , 2 )
-
-# Creation of Input datas
-test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 7)
-test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 7)
-m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 7)
-div2anEvenInteger = div2.Input( 'anEvenInteger' , 7)
-incraCount = incr.Input( 'aCount' , 0)
-
-# Creation of Output variables
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-div2anInteger = div2.Port( 'anInteger' )
-incraNewCount = incr.Port( 'aNewCount' )
-
-GraphSyracuseC.IsValid()
-
-GraphSyracuseC.ThreadsMax()
-
-GraphSyracuseC.LevelMax()
-
-GraphSyracuseC.SubGraphsNumber()
-
-GraphSyracuseC.IsExecutable()
-
-exec GraphSyracuseC.ListNodes()
-test_ISEVENanInteger = test_ISEVEN.Port( 'anInteger' )
-test_ISONEanInteger = test_ISONE.Port( 'anInteger' )
-m3p1anOddInteger = m3p1.Port( 'anOddInteger' )
-div2anEvenInteger = div2.Port( 'anEvenInteger' )
-incraCount = incr.Port( 'aCount' )
-
-# Creation of Output variables
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-div2anInteger = div2.Port( 'anInteger' )
-incraNewCount = incr.Port( 'aNewCount' )
-
-
-GraphSyracuseC.Start()
-
-test_ISEVEN.SuspendDone()
-test_ISONE.SuspendDone()
-
-test_ISEVEN.Resume()
-test_ISONE.Resume()
-
-# Suspend des nodes de tete des sous-graphes sauf test
-m3p1.Suspend()
-div2.Suspend()
-incr.Suspend()
-
-# Attentes de suspension de m3p1, div2, incr et result.
-# Puis demandes de suspension après exécution
-m3p1.SuspendDone()
-div2.SuspendDone()
-incr.SuspendDone()
-
-# Attente de fin d'exécution de test
-test_ISONE.DoneW()
-test_ISEVEN.DoneW()
-
-# Etats et Threads des nodes
-GraphSyracuseC.PrintThreads()
-
-while int( test_ISONEBoolOne.ToString() ) == 0 :
- if int( test_ISEVENBoolEven.ToString() ) == 0 :
- sts = m3p1.ReRun()
- sts = incr.ReRun()
- sts = m3p1.DoneW()
- sts = test_ISEVENanInteger.Input( m3p1anEvenInteger.ToString() )
- sts = test_ISONEanInteger.Input( m3p1anEvenInteger.ToString() )
- sts = test_ISEVEN.ReRun()
- sts = test_ISONE.ReRun()
- sts = test_ISEVEN.DoneW()
- sts = test_ISONE.DoneW()
- sts = incr.DoneW()
- sts = incraCount.Input( incraNewCount.ToString() )
- print incraNewCount.ToString(),"m3p1",m3p1anEvenInteger.ToString(),test_ISEVENBoolEven.ToString()
- while int( test_ISEVENBoolEven.ToString() ) == 1 :
- sts = div2anEvenInteger.Input( test_ISEVENanInteger.ToString() )
- sts = div2.ReRun()
- sts = incr.ReRun()
- sts = div2.DoneW()
- sts = test_ISEVENanInteger.Input( div2anInteger.ToString() )
- sts = test_ISONEanInteger.Input( div2anInteger.ToString() )
- sts = test_ISEVEN.ReRun()
- sts = test_ISONE.ReRun()
- sts = test_ISEVEN.DoneW()
- sts = test_ISONE.DoneW()
- sts = incr.DoneW()
- sts = incraCount.Input( incraNewCount.ToString() )
- print incraNewCount.ToString(),"div2",div2anInteger.ToString(),test_ISEVENBoolEven.ToString()
- sts = m3p1anOddInteger.Input( div2anInteger.ToString() )
-
-
-GraphSyracuseC.PrintThreads()
-m3p1.Resume()
-div2.Resume()
-incr.Resume()
-test_ISONE.Resume()
-test_ISEVEN.Resume()
-GraphSyracuseC.DoneW()
-print GraphSyracuseC.State()
-GraphSyracuseC.PrintPorts()
-GraphSyracuseC.PrintThreads()
-
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii' ?>
-
-<!-- XML Dataflow -->
-
-<!-- Dataflow information -->
-<dataflow>
- <info-list>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphSyracuseC</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>GraphSyracuseC</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>test_ISEVEN\anInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>test_ISONE\anInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>m3p1\anOddInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>div2\anEvenInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>incr\aCount</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_ISEVEN\BoolEven</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_ISONE\BoolOne</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>m3p1\anEvenInteger</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>div2\anInteger</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>incr\aNewCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>Syracuse algorithm</comment>
- <x-position>0</x-position>
- <y-position>0</y-position>
- </node>
- </info-list>
-
- <node-list>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISEVEN</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_ISEVEN</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolEven</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>252</x-position>
- <y-position>266</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISONE</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_ISONE</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolOne</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>268</x-position>
- <y-position>29</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>m3p1</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_M3P1</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anOddInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>anEvenInteger</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>644</x-position>
- <y-position>410</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>div2</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_DIV2</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anEvenInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>anInteger</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>648</x-position>
- <y-position>209</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>incr</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_INCR</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>aCount</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>aNewCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 17:0:26</creation-date>
- <lastmodification-date>11/3/2003 - 17:0:26</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>640</x-position>
- <y-position>2</y-position>
- </node>
- </node-list>
-
- <link-list>
- </link-list>
-
- <data-list>
- <data>
- <fromnode-name>GraphSyracuseC</fromnode-name>
- <fromserviceparameter-name>test_ISEVEN\anInteger</fromserviceparameter-name>
- <tonode-name>test_ISEVEN</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>7</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseC</fromnode-name>
- <fromserviceparameter-name>test_ISONE\anInteger</fromserviceparameter-name>
- <tonode-name>test_ISONE</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>7</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseC</fromnode-name>
- <fromserviceparameter-name>m3p1\anOddInteger</fromserviceparameter-name>
- <tonode-name>m3p1</tonode-name>
- <toserviceparameter-name>anOddInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>7</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseC</fromnode-name>
- <fromserviceparameter-name>div2\anEvenInteger</fromserviceparameter-name>
- <tonode-name>div2</tonode-name>
- <toserviceparameter-name>anEvenInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>7</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseC</fromnode-name>
- <fromserviceparameter-name>incr\aCount</fromserviceparameter-name>
- <tonode-name>incr</tonode-name>
- <toserviceparameter-name>aCount</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>0</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- </data-list>
-
-</dataflow>
+++ /dev/null
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#
-#
-# File : GraphSyracuseCEv.py
-# Module : SuperVisionTest
-
-from SuperV import *
-import SUPERV
-import SUPERV_idl
-
-# Graph creation
-GraphSyracuseCEv = Graph( 'GraphSyracuseCEv' )
-GraphSyracuseCEv.SetName( 'GraphSyracuseCEv' )
-GraphSyracuseCEv.SetAuthor( 'JR' )
-GraphSyracuseCEv.SetComment( 'Syracuse algorithm' )
-GraphSyracuseCEv.Coords( 0 , 0 )
-
-# Creation of Computing Nodes
-test_ISEVEN = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-test_ISEVEN.SetName( 'test_ISEVEN' )
-test_ISEVEN.SetAuthor( '' )
-test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-test_ISEVEN.SetComment( '' )
-test_ISEVEN.Coords( 252 , 266 )
-test_ISONE = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-test_ISONE.SetName( 'test_ISONE' )
-test_ISONE.SetAuthor( '' )
-test_ISONE.SetContainer( 'localhost/FactoryServer' )
-test_ISONE.SetComment( '' )
-test_ISONE.Coords( 268 , 29 )
-m3p1 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
-m3p1.SetName( 'm3p1' )
-m3p1.SetAuthor( '' )
-m3p1.SetContainer( 'localhost/FactoryServer' )
-m3p1.SetComment( '' )
-m3p1.Coords( 644 , 410 )
-div2 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
-div2.SetName( 'div2' )
-div2.SetAuthor( '' )
-div2.SetContainer( 'localhost/FactoryServer' )
-div2.SetComment( '' )
-div2.Coords( 648 , 209 )
-incr = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
-incr.SetName( 'incr' )
-incr.SetAuthor( '' )
-incr.SetContainer( 'localhost/FactoryServer' )
-incr.SetComment( '' )
-incr.Coords( 640 , 2 )
-
-# Creation of Input datas
-test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
-test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
-m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
-div2anEvenInteger = div2.Input( 'anEvenInteger' , 31)
-incraCount = incr.Input( 'aCount' , 0)
-
-GraphSyracuseCEv.IsValid()
-
-GraphSyracuseCEv.ThreadsMax()
-
-GraphSyracuseCEv.LevelMax()
-
-GraphSyracuseCEv.SubGraphsNumber()
-
-GraphSyracuseCEv.IsExecutable()
-
-
-
-
-exec GraphSyracuseCEv.ListNodes()
-
-test_ISEVENanInteger = test_ISEVEN.Port( 'anInteger' )
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-test_ISONEanInteger = test_ISONE.Port( 'anInteger' )
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-m3p1anOddInteger = m3p1.Port( 'anOddInteger' )
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-div2anEvenInteger = div2.Port( 'anEvenInteger' )
-div2anInteger = div2.Port( 'anInteger' )
-incraCount = incr.Port( 'aCount' )
-incraNewCount = incr.Port( 'aNewCount' )
-
-GraphSyracuseCEv.Start()
-
-test_ISEVEN.SuspendDone()
-test_ISONE.SuspendDone()
-
-test_ISEVEN.Resume()
-test_ISONE.Resume()
-
-m3p1.SuspendDone()
-div2.SuspendDone()
-incr.SuspendDone()
-
-test_ISEVEN.DoneW()
-test_ISONE.DoneW()
-
-aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
-while aNode != None :
- if int( test_ISONEBoolOne.ToString() ) == 0 :
- if int( test_ISEVENBoolEven.ToString() ) == 0 :
- while aNode != None :
- if aNode.Name() == 'm3p1' :
- if aState == SUPERV_idl._0_SUPERV.SuspendReadyState :
- sts = m3p1.ReRun()
- sts = incr.ReRun()
- else :
- if aState == SUPERV_idl._0_SUPERV.SuspendDoneState :
- sts = test_ISEVENanInteger.Input( m3p1anEvenInteger.ToString() )
- sts = test_ISONEanInteger.Input( m3p1anEvenInteger.ToString() )
- sts = test_ISEVEN.ReRun()
- sts = test_ISONE.ReRun()
- else :
- if ( aNode.Name() == 'incr' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) :
- sts = incraCount.Input( incraNewCount.ToString() )
- aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
- print incraNewCount.ToString(),"m3p1",m3p1anEvenInteger.ToString()
- sts = div2anEvenInteger.Input( m3p1anEvenInteger.ToString() )
- while int( test_ISEVENBoolEven.ToString() ) == 1 :
- sts = div2.ReRun()
- sts = incr.ReRun()
- aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
- while aNode != None :
- if ( aNode.Name() == 'div2' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) :
- sts = test_ISEVENanInteger.Input( div2anInteger.ToString() )
- sts = test_ISONEanInteger.Input( div2anInteger.ToString() )
- sts = test_ISEVEN.ReRun()
- sts = test_ISONE.ReRun()
- aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
- sts = incraCount.Input( incraNewCount.ToString() )
- print incraNewCount.ToString(),"div2",div2anInteger.ToString()
- sts = m3p1anOddInteger.Input( div2anInteger.ToString() )
- sts = div2anEvenInteger.Input( div2anInteger.ToString() )
- if int( test_ISONEBoolOne.ToString() ) == 0 :
- sts = m3p1.ReRun()
- sts = incr.ReRun()
- aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
- else :
- GraphSyracuseCEv.PrintThreads()
- m3p1.Resume()
- div2.Resume()
- incr.Resume()
- test_ISONE.Resume()
- test_ISEVEN.Resume()
- aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
-
-GraphSyracuseCEv.DoneW()
-print GraphSyracuseCEv.State()
-GraphSyracuseCEv.PrintThreads()
-GraphSyracuseCEv.PrintPorts()
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii' ?>
-
-<!-- XML Dataflow -->
-
-<!-- Dataflow information -->
-<dataflow>
- <info-list>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphSyracuseCEv</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>GraphSyracuseCEv</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>test_ISEVEN\anInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>test_ISONE\anInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>m3p1\anOddInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>div2\anEvenInteger</inParameter-name>
- </inParameter>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>incr\aCount</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_ISEVEN\BoolEven</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_ISONE\BoolOne</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>m3p1\anEvenInteger</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>div2\anInteger</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>incr\aNewCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>Syracuse algorithm</comment>
- <x-position>0</x-position>
- <y-position>0</y-position>
- </node>
- </info-list>
-
- <node-list>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISEVEN</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_ISEVEN</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolEven</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>252</x-position>
- <y-position>266</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>test_ISONE</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_ISONE</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolOne</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>268</x-position>
- <y-position>29</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>m3p1</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_M3P1</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anOddInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>anEvenInteger</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>644</x-position>
- <y-position>410</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>div2</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_DIV2</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anEvenInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>anInteger</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>648</x-position>
- <y-position>209</y-position>
- </node>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>incr</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>C_INCR</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>aCount</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>aNewCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 15:7:39</creation-date>
- <lastmodification-date>11/3/2003 - 15:7:39</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>640</x-position>
- <y-position>2</y-position>
- </node>
- </node-list>
-
- <link-list>
- </link-list>
-
- <data-list>
- <data>
- <fromnode-name>GraphSyracuseCEv</fromnode-name>
- <fromserviceparameter-name>test_ISEVEN\anInteger</fromserviceparameter-name>
- <tonode-name>test_ISEVEN</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>31</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseCEv</fromnode-name>
- <fromserviceparameter-name>test_ISONE\anInteger</fromserviceparameter-name>
- <tonode-name>test_ISONE</tonode-name>
- <toserviceparameter-name>anInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>31</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseCEv</fromnode-name>
- <fromserviceparameter-name>m3p1\anOddInteger</fromserviceparameter-name>
- <tonode-name>m3p1</tonode-name>
- <toserviceparameter-name>anOddInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>31</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseCEv</fromnode-name>
- <fromserviceparameter-name>div2\anEvenInteger</fromserviceparameter-name>
- <tonode-name>div2</tonode-name>
- <toserviceparameter-name>anEvenInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>31</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- <data>
- <fromnode-name>GraphSyracuseCEv</fromnode-name>
- <fromserviceparameter-name>incr\aCount</fromserviceparameter-name>
- <tonode-name>incr</tonode-name>
- <toserviceparameter-name>aCount</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>0</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- </data-list>
-
-</dataflow>
+++ /dev/null
-
-# Generated python file of Graph GraphSyracuseC_Void
-
-from SuperV import *
-# Graph creation
-GraphSyracuseC_Void = Graph( 'GraphSyracuseC_Void' )
-print GraphSyracuseC_Void.SetName( 'GraphSyracuseC_Void' )
-print GraphSyracuseC_Void.SetAuthor( 'JR' )
-print GraphSyracuseC_Void.SetComment( 'Syracuse algorithm' )
-GraphSyracuseC_Void.Coords( 0 , 0 )
-
-# Creation of Nodes
-test_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-print test_ISEVEN.SetName( 'test_ISEVEN' )
-print test_ISEVEN.SetAuthor( '' )
-print test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-print test_ISEVEN.SetComment( '' )
-test_ISEVEN.Coords( 5 , 416 )
-test_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-print test_ISONE.SetName( 'test_ISONE' )
-print test_ISONE.SetAuthor( '' )
-print test_ISONE.SetContainer( 'localhost/FactoryServer' )
-print test_ISONE.SetComment( '' )
-test_ISONE.Coords( 7 , 232 )
-m3p1 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
-print m3p1.SetName( 'm3p1' )
-print m3p1.SetAuthor( '' )
-print m3p1.SetContainer( 'localhost/FactoryServer' )
-print m3p1.SetComment( '' )
-m3p1.Coords( 180 , 417 )
-div2 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
-print div2.SetName( 'div2' )
-print div2.SetAuthor( '' )
-print div2.SetContainer( 'localhost/FactoryServer' )
-print div2.SetComment( '' )
-div2.Coords( 435 , 7 )
-div2_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-print div2_ISEVEN.SetName( 'div2_ISEVEN' )
-print div2_ISEVEN.SetAuthor( '' )
-print div2_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-print div2_ISEVEN.SetComment( '' )
-div2_ISEVEN.Coords( 619 , 191 )
-div2_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-print div2_ISONE.SetName( 'div2_ISONE' )
-print div2_ISONE.SetAuthor( '' )
-print div2_ISONE.SetContainer( 'localhost/FactoryServer' )
-print div2_ISONE.SetComment( '' )
-div2_ISONE.Coords( 616 , 6 )
-incr = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
-print incr.SetName( 'incr' )
-print incr.SetAuthor( '' )
-print incr.SetContainer( 'localhost/FactoryServer' )
-print incr.SetComment( '' )
-incr.Coords( 434 , 193 )
-
-# Creation of intermediate Output variables and of links
-test_ISEVENOutVoid = test_ISEVEN.Port( 'OutVoid' )
-m3p1InVoid = GraphSyracuseC_Void.Link( test_ISEVENOutVoid , m3p1.Port( 'InVoid' ) )
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-div2anEvenInteger = GraphSyracuseC_Void.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) )
-print div2anEvenInteger.AddCoord( 1 , 368 , 158 )
-print div2anEvenInteger.AddCoord( 2 , 369 , 568 )
-div2anInteger = div2.Port( 'anInteger' )
-div2_ISONEanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) )
-div2_ISEVENanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) )
-print div2_ISEVENanInteger.AddCoord( 1 , 603 , 342 )
-print div2_ISEVENanInteger.AddCoord( 2 , 603 , 158 )
-
-# Creation of Input datas
-test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
-test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
-m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
-div2InanEvenInteger = div2.Port( 'anEvenInteger' )
-incraCount = incr.Input( 'aCount' , 0)
-
-# Missing Input datas
-
-# Creation of Output variables
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' )
-div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' )
-incraNewCount = incr.Port( 'aNewCount' )
-
-GraphSyracuseC_Void.IsValid()
-
-GraphSyracuseC_Void.ThreadsMax()
-
-GraphSyracuseC_Void.LevelMax()
-
-GraphSyracuseC_Void.GraphsNumber()
-
-curM3P1 = m3p1.Input( 'anOddInteger' , 31 )
-curtestISEVEN = test_ISEVEN.Input( 'anInteger' , curM3P1.ToAny() )
-curtestISONE = test_ISONE.Input( 'anInteger' , curM3P1.ToAny() )
-
-GraphSyracuseC_Void.IsExecutable()
-
-GraphSyracuseC_Void.Start()
-
-m3p1.Suspend()
-
-div2_ISEVEN.SuspendDone()
-div2_ISONE.SuspendDone()
-
-test_ISEVEN.Resume()
-test_ISONE.Resume()
-
-# Attente de fin d'exécution de test
-test_ISONE.DoneW()
-test_ISEVEN.DoneW()
-
-m3p1.SuspendedW()
-incr.SuspendedW()
-incr.SuspendDone()
-
-# Etats et Threads des nodes
-GraphSyracuseC_Void.PrintThreads()
-
-BoolOne = int( test_ISONEBoolOne.ToString() )
-BoolEven = int( test_ISEVENBoolEven.ToString() )
-while BoolOne == 0 :
- if BoolEven == 0 :
- sts = div2_ISONE.ReRunAt('m3p1')
- sts = incr.ReRun()
- sts = m3p1.DoneW()
- sts = incr.DoneW()
- sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 )
- BoolEven = 1
- BoolOne = 0
- Current = int( m3p1anEvenInteger.ToString() )
- print "m3p1",Current,BoolEven
- while BoolEven == 1 :
- sts = incr.ReRun()
- sts = div2.DoneW()
- sts = div2_ISEVEN.DoneW()
- sts = div2_ISONE.DoneW()
- sts = incr.DoneW()
- sts = incraCount.Input( incraNewCount.ToString() )
- BoolOne = int( div2_ISONEBoolOne.ToString() )
- BoolEven = int( div2_ISEVENBoolEven.ToString() )
- Current = int( div2anInteger.ToString() )
- print "div2",Current,BoolEven,BoolOne
- if BoolEven == 1 :
- div2InanEvenInteger.Input( Current )
- sts = div2_ISONE.ReRunAt('div2')
- sts = curM3P1.Input( Current )
-
-
-GraphSyracuseC_Void.PrintThreads()
-m3p1.Resume()
-div2.Resume()
-incr.Resume()
-div2_ISONE.Resume()
-div2_ISEVEN.Resume()
-GraphSyracuseC_Void.DoneW()
-print GraphSyracuseC_Void.State()
-GraphSyracuseC_Void.PrintPorts()
-GraphSyracuseC_Void.PrintThreads()
-
+++ /dev/null
-# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-#
-#
-#
-# File : GraphSyracuseCpp.py
-# Module : SuperVisionTest
-
-from SuperV import *
-# Graph creation
-GraphSyracuseCpp = Graph( 'GraphSyracuseCpp' )
-GraphSyracuseCpp.SetName( 'GraphSyracuseCpp' )
-GraphSyracuseCpp.SetAuthor( 'JR' )
-GraphSyracuseCpp.SetComment( 'Syracuse algorithm' )
-GraphSyracuseCpp.Coords( 0 , 0 )
-
-# Creation of Computing Nodes
-Syracuse = GraphSyracuseCpp.Node( 'SyrComponent' , 'SyrComponent' , 'Init' )
-Syracuse.SetName( 'Syracuse' )
-Syracuse.SetAuthor( '' )
-#Syracuse.SetContainer( 'localhost/FactoryServer' )
-Syracuse.SetComment( '' )
-Syracuse.Coords( 9 , 207 )
-test_IsEven = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'IsEven' )
-test_IsEven.SetName( 'test_IsEven' )
-test_IsEven.SetAuthor( '' )
-#test_IsEven.SetContainer( 'localhost/FactoryServer' )
-test_IsEven.SetComment( '' )
-test_IsEven.Coords( 197 , 407 )
-test_IsOne = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'IsOne' )
-test_IsOne.SetName( 'test_IsOne' )
-test_IsOne.SetAuthor( '' )
-#test_IsOne.SetContainer( 'localhost/FactoryServer' )
-test_IsOne.SetComment( '' )
-test_IsOne.Coords( 208 , 59 )
-m3p1_M3p1 = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'M3p1' )
-m3p1_M3p1.SetName( 'm3p1_M3p1' )
-m3p1_M3p1.SetAuthor( '' )
-#m3p1_M3p1.SetContainer( 'localhost/FactoryServer' )
-m3p1_M3p1.SetComment( '' )
-m3p1_M3p1.Coords( 418 , 408 )
-div2_Div2 = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Div2' )
-div2_Div2.SetName( 'div2_Div2' )
-div2_Div2.SetAuthor( '' )
-#div2_Div2.SetContainer( 'localhost/FactoryServer' )
-div2_Div2.SetComment( '' )
-div2_Div2.Coords( 414 , 10 )
-incr_Incr = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Incr' )
-incr_Incr.SetName( 'incr_Incr' )
-incr_Incr.SetAuthor( '' )
-#incr_Incr.SetContainer( 'localhost/FactoryServer' )
-incr_Incr.SetComment( '' )
-incr_Incr.Coords( 416 , 207 )
-result_Current = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Current' )
-result_Current.SetName( 'result_Current' )
-result_Current.SetAuthor( '' )
-#result_Current.SetContainer( 'localhost/FactoryServer' )
-result_Current.SetComment( '' )
-result_Current.Coords( 603 , 216 )
-result_Count = GraphSyracuseCpp.CNode( 'SyrComponent' , 'Syr' , 'Count' )
-result_Count.SetName( 'result_Count' )
-result_Count.SetAuthor( '' )
-#result_Count.SetContainer( 'localhost/FactoryServer' )
-result_Count.SetComment( '' )
-result_Count.Coords( 803 , 212 )
-
-# Creation of intermediate Output variables and of Computing Links
-SyracuseaSyracuse = Syracuse.Port( 'aSyracuse' )
-test_IsEvenaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , test_IsEven.Port( 'aSyracuse' ) )
-test_IsEvenaSyracuse.AddCoord( 1 , 175 , 559 )
-test_IsEvenaSyracuse.AddCoord( 2 , 175 , 359 )
-test_IsOneaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , test_IsOne.Port( 'aSyracuse' ) )
-test_IsOneaSyracuse.AddCoord( 1 , 177 , 211 )
-test_IsOneaSyracuse.AddCoord( 2 , 177 , 359 )
-m3p1_M3p1aSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , m3p1_M3p1.Port( 'aSyracuse' ) )
-m3p1_M3p1aSyracuse.AddCoord( 1 , 388 , 560 )
-m3p1_M3p1aSyracuse.AddCoord( 2 , 388 , 359 )
-div2_Div2aSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , div2_Div2.Port( 'aSyracuse' ) )
-div2_Div2aSyracuse.AddCoord( 1 , 389 , 162 )
-div2_Div2aSyracuse.AddCoord( 2 , 389 , 359 )
-incr_IncraSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , incr_Incr.Port( 'aSyracuse' ) )
-result_CurrentaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , result_Current.Port( 'aSyracuse' ) )
-result_CurrentaSyracuse.AddCoord( 1 , 590 , 368 )
-result_CurrentaSyracuse.AddCoord( 2 , 590 , 390 )
-result_CurrentaSyracuse.AddCoord( 3 , 388 , 390 )
-result_CurrentaSyracuse.AddCoord( 4 , 388 , 359 )
-result_CountaSyracuse = GraphSyracuseCpp.Link( SyracuseaSyracuse , result_Count.Port( 'aSyracuse' ) )
-result_CountaSyracuse.AddCoord( 1 , 785 , 364 )
-result_CountaSyracuse.AddCoord( 2 , 785 , 391 )
-result_CountaSyracuse.AddCoord( 3 , 389 , 391 )
-result_CountaSyracuse.AddCoord( 4 , 389 , 357 )
-
-# Missing Input datas
-SyracuseanOddInteger = Syracuse.Input( 'anOddInteger' , 7 )
-
-# Creation of Output variables
-test_IsEvenBoolEven = test_IsEven.Port( 'BoolEven' )
-test_IsOneBoolOne = test_IsOne.Port( 'BoolOne' )
-count_incr_Incr = incr_Incr.Port('aSyracuse')
-result_CurrentaCurrent = result_Current.Port( 'aCurrent' )
-
-GraphSyracuseCpp.IsValid()
-GraphSyracuseCpp.LevelMax()
-GraphSyracuseCpp.ThreadsMax()
-
-exec GraphSyracuseCpp.ListNodes()
-SyracuseanOddInteger = Syracuse.Input( 'anOddInteger' , 7 )
-test_IsEvenBoolEven = test_IsEven.Port( 'BoolEven' )
-test_IsOneBoolOne = test_IsOne.Port( 'BoolOne' )
-count_incr_Incr = incr_Incr.Port('aSyracuse')
-result_CurrentaCurrent = result_Current.Port( 'aCurrent' )
-
-
-GraphSyracuseCpp.Start( 7 )
-
-# Suspend des nodes de tete de Syr
-sts = test_IsOne.Suspend()
-sts = test_IsEven.Suspend()
-sts = m3p1_M3p1.Suspend()
-sts = div2_Div2.Suspend()
-sts = incr_Incr.Suspend()
-sts = result_Current.Suspend()
-sts = result_Count.Suspend()
-
-# Ex\81écution du node de tete
-sts = Syracuse.Resume()
-sts = Syracuse.DoneW()
-
-# Attente de suspension de test et demandes de suspension apr\81ès ex\81écution
-sts = test_IsOne.SuspendedW()
-sts = test_IsOne.SuspendDone()
-sts = test_IsEven.SuspendedW()
-sts = test_IsEven.SuspendDone()
-
-# Ex\81écution de test avec la valeur de d\81épart
-sts = test_IsOne.Resume()
-sts = test_IsEven.Resume()
-
-# Attentes de suspension de m3p1, div2, incr et result.
-# Puis demandes de suspension apr\81ès ex\81écution
-sts = m3p1_M3p1.SuspendedW()
-sts = div2_Div2.SuspendedW()
-sts = incr_Incr.SuspendedW()
-sts = result_Current.SuspendedW()
-sts = result_Count.SuspendedW()
-sts = m3p1_M3p1.SuspendDone()
-sts = div2_Div2.SuspendDone()
-sts = incr_Incr.SuspendDone()
-sts = result_Current.SuspendDone()
-
-# Attente de fin d'ex\81écution de test
-sts = test_IsOne.SuspendedW()
-sts = test_IsEven.SuspendedW()
-
-GraphSyracuseCpp.PrintThreads()
-
-IsOneBoolOne = test_IsOneBoolOne.ToString()
-while int( IsOneBoolOne ) == 0 :
- IsEvenBoolEven = test_IsEvenBoolEven.ToString()
- if int( IsEvenBoolEven ) == 0 :
- sts = m3p1_M3p1.ReRun()
- sts = incr_Incr.ReRun()
- sts = m3p1_M3p1.SuspendedW()
- sts = result_Current.ReRun()
- sts = test_IsOne.ReRun()
- sts = test_IsEven.ReRun()
- sts = test_IsOne.SuspendedW()
- sts = test_IsEven.SuspendedW()
- sts = incr_Incr.SuspendedW()
- sts = result_Current.SuspendedW()
- print "m3p1_M3p1",result_CurrentaCurrent.ToString(),IsEvenBoolEven
- IsEvenBoolEven = test_IsEvenBoolEven.ToString()
- while int( IsEvenBoolEven ) == 1 :
- sts = div2_Div2.ReRun()
- sts = incr_Incr.ReRun()
- sts = div2_Div2.SuspendedW()
- sts = result_Current.ReRun()
- sts = test_IsOne.ReRun()
- sts = test_IsEven.ReRun()
- sts = test_IsOne.SuspendedW()
- sts = test_IsEven.SuspendedW()
- sts = incr_Incr.SuspendedW()
- sts = IsEvenBoolEven = test_IsEvenBoolEven.ToString()
- sts = result_Current.SuspendedW()
- print "div2_Div2",result_CurrentaCurrent.ToString(),IsEvenBoolEven
- IsOneBoolOne = test_IsOneBoolOne.ToString()
-
-
-
-GraphSyracuseCpp.PrintThreads()
-sts = m3p1_M3p1.ControlClear()
-sts = m3p1_M3p1.Resume()
-sts = div2_Div2.ControlClear()
-sts = div2_Div2.Resume()
-sts = incr_Incr.ControlClear()
-sts = incr_Incr.Resume()
-sts = test_IsOne.Resume()
-sts = test_IsEven.Resume()
-sts = result_Current.ControlClear()
-sts = result_Current.Resume()
-sts = result_Count.ControlClear()
-sts = result_Count.Resume()
-sts = GraphSyracuseCpp.DoneW()
-print sts
-GraphSyracuseCpp.PrintPorts()
-GraphSyracuseCpp.PrintThreads()
-
+++ /dev/null
-<?xml version='1.0' encoding='us-ascii' ?>
-
-<!-- XML Dataflow -->
-
-<!-- Dataflow information -->
-<dataflow>
- <info-list>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>GraphSyracuseCpp</node-name>
- <kind>1</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>GraphSyracuseCpp</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>Syracuse\anOddInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_IsEven\BoolEven</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>test_IsOne\BoolOne</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>result_Current\aCurrent</outParameter-name>
- </outParameter>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>result_Count\aCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:37</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>JR</author>
- <container>?</container>
- <comment>Syracuse algorithm</comment>
- <x-position>0</x-position>
- <y-position>0</y-position>
- </node>
- </info-list>
-
- <node-list>
- <node>
- <component-name>SyrComponent</component-name>
- <interface-name>SyrComponent</interface-name>
- <node-name>Syracuse</node-name>
- <kind>0</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>Init</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>long</inParameter-type>
- <inParameter-name>anOddInteger</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>Syr</outParameter-type>
- <outParameter-name>aSyracuse</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>localhost/FactoryServer</container>
- <comment>?</comment>
- <x-position>9</x-position>
- <y-position>207</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>test_IsEven</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>IsEven</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolEven</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>197</x-position>
- <y-position>407</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>test_IsOne</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>IsOne</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>BoolOne</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>208</x-position>
- <y-position>59</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>m3p1_M3p1</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>M3p1</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>418</x-position>
- <y-position>408</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>div2_Div2</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>Div2</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>414</x-position>
- <y-position>10</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>incr_Incr</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>Incr</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>416</x-position>
- <y-position>207</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>result_Current</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>Current</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>aCurrent</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>603</x-position>
- <y-position>216</y-position>
- </node>
- <node>
- <component-name>?</component-name>
- <interface-name>?</interface-name>
- <node-name>result_Count</node-name>
- <kind>2</kind>
- <coupled-node>?</coupled-node>
- <service>
- <service-name>Count</service-name>
- <inParameter-list>
- <inParameter>
- <inParameter-type>Syr</inParameter-type>
- <inParameter-name>aSyracuse</inParameter-name>
- </inParameter>
- </inParameter-list>
- <outParameter-list>
- <outParameter>
- <outParameter-type>long</outParameter-type>
- <outParameter-name>aCount</outParameter-name>
- </outParameter>
- </outParameter-list>
- </service>
- <Parameter-list>
- </Parameter-list>
- <PyFunction-list>
- </PyFunction-list>
- <creation-date>11/3/2003 - 16:43:27</creation-date>
- <lastmodification-date>11/3/2003 - 16:43:27</lastmodification-date>
- <editor-release>1.04</editor-release>
- <author>?</author>
- <container>?</container>
- <comment>?</comment>
- <x-position>803</x-position>
- <y-position>212</y-position>
- </node>
- </node-list>
-
- <link-list>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>test_IsEven</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>175</x>
- <y>559</y>
- </coord>
- <coord>
- <x>175</x>
- <y>359</y>
- </coord>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>test_IsOne</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>177</x>
- <y>211</y>
- </coord>
- <coord>
- <x>177</x>
- <y>359</y>
- </coord>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>m3p1_M3p1</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>388</x>
- <y>560</y>
- </coord>
- <coord>
- <x>388</x>
- <y>359</y>
- </coord>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>div2_Div2</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>389</x>
- <y>162</y>
- </coord>
- <coord>
- <x>389</x>
- <y>359</y>
- </coord>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>incr_Incr</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>result_Current</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>590</x>
- <y>368</y>
- </coord>
- <coord>
- <x>590</x>
- <y>390</y>
- </coord>
- <coord>
- <x>388</x>
- <y>390</y>
- </coord>
- <coord>
- <x>388</x>
- <y>359</y>
- </coord>
- </coord-list>
- </link>
- <link>
- <fromnode-name>Syracuse</fromnode-name>
- <fromserviceparameter-name>aSyracuse</fromserviceparameter-name>
- <tonode-name>result_Count</tonode-name>
- <toserviceparameter-name>aSyracuse</toserviceparameter-name>
- <coord-list>
- <coord>
- <x>785</x>
- <y>364</y>
- </coord>
- <coord>
- <x>785</x>
- <y>391</y>
- </coord>
- <coord>
- <x>389</x>
- <y>391</y>
- </coord>
- <coord>
- <x>389</x>
- <y>357</y>
- </coord>
- </coord-list>
- </link>
- </link-list>
-
- <data-list>
- <data>
- <fromnode-name>GraphSyracuseCpp</fromnode-name>
- <fromserviceparameter-name>Syracuse\anOddInteger</fromserviceparameter-name>
- <tonode-name>Syracuse</tonode-name>
- <toserviceparameter-name>anOddInteger</toserviceparameter-name>
- <data-value>
- <value-type>3</value-type>
- <value>31</value>
- </data-value>
- <coord-list>
- </coord-list>
- </data>
- </data-list>
-
-</dataflow>
--- /dev/null
+
+# Generated python file of Graph GraphTwoLoops
+
+from SuperV import *
+
+# Graph creation of GraphTwoLoops
+def DefGraphTwoLoops() :
+ GraphTwoLoops = Graph( 'GraphTwoLoops' )
+ GraphTwoLoops.SetName( 'GraphTwoLoops' )
+ GraphTwoLoops.SetAuthor( 'JR' )
+ GraphTwoLoops.SetComment( '' )
+ GraphTwoLoops.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyLoop1 = []
+ PyLoop1.append( 'def Loop1(Index,Max) : ' )
+ PyLoop1.append( ' return Index,Max ' )
+ PyLoop1.append( '' )
+ PyMoreLoop1 = []
+ PyMoreLoop1.append( 'import time ' )
+ PyMoreLoop1.append( 'def More(Index,Max) : ' )
+ PyMoreLoop1.append( ' time.sleep(2) ' )
+ PyMoreLoop1.append( ' DoLoop = 0 ' )
+ PyMoreLoop1.append( ' if Index < Max : ' )
+ PyMoreLoop1.append( ' DoLoop = 1 ' )
+ PyMoreLoop1.append( ' return DoLoop,Index,Max ' )
+ PyMoreLoop1.append( '' )
+ PyNextLoop1 = []
+ PyNextLoop1.append( 'def Next(Index,Max) : ' )
+ PyNextLoop1.append( ' Index = Index + 1 ' )
+ PyNextLoop1.append( ' return Index,Max ' )
+ PyNextLoop1.append( '' )
+ Loop1,EndLoop1 = GraphTwoLoops.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 )
+ EndLoop1.SetName( 'EndLoop1' )
+ EndLoop1.SetAuthor( '' )
+ EndLoop1.SetComment( 'Compute Node' )
+ EndLoop1.Coords( 634 , 177 )
+ PyEndLoop1 = []
+ EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 )
+ ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' )
+ ILoop1Index = Loop1.InPort( 'Index' , 'long' )
+ ILoop1Max = Loop1.InPort( 'Max' , 'long' )
+ ILoop1Gate = Loop1.GetInPort( 'Gate' )
+ OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' )
+ OLoop1Index = Loop1.GetOutPort( 'Index' )
+ OLoop1Max = Loop1.GetOutPort( 'Max' )
+ IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' )
+ IEndLoop1Index = EndLoop1.GetInPort( 'Index' )
+ IEndLoop1Max = EndLoop1.GetInPort( 'Max' )
+ IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' )
+ OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' )
+ OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
+ OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
+ OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' )
+ Loop1.SetName( 'Loop1' )
+ Loop1.SetAuthor( '' )
+ Loop1.SetComment( 'Compute Node' )
+ Loop1.Coords( 7 , 175 )
+
+ PyLoop = []
+ PyMoreLoop = []
+ PyMoreLoop.append( '' )
+ PyNextLoop = []
+ PyNextLoop.append( 'def Next(Index,Max) : ' )
+ PyNextLoop.append( ' Index = Index + 1 ' )
+ PyNextLoop.append( ' return Index,Max ' )
+ PyNextLoop.append( '' )
+ Loop,EndLoop = GraphTwoLoops.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop )
+ EndLoop.SetName( 'EndLoop' )
+ EndLoop.SetAuthor( '' )
+ EndLoop.SetComment( 'Compute Node' )
+ EndLoop.Coords( 426 , 180 )
+ PyEndLoop = []
+ PyEndLoop.append( 'import time ' )
+ PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) : ' )
+ PyEndLoop.append( ' time.sleep(1) ' )
+ PyEndLoop.append( ' DoLoop = 0 ' )
+ PyEndLoop.append( ' if Index < Max : ' )
+ PyEndLoop.append( ' DoLoop = 1 ' )
+ PyEndLoop.append( ' return DoLoop,Index,Max ' )
+ PyEndLoop.append( '' )
+ EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop )
+ ILoopDoLoop = Loop.GetInPort( 'DoLoop' )
+ ILoopIndex = Loop.InPort( 'Index' , 'long' )
+ ILoopMax = Loop.InPort( 'Max' , 'long' )
+ ILoopGate = Loop.GetInPort( 'Gate' )
+ OLoopDoLoop = Loop.GetOutPort( 'DoLoop' )
+ OLoopIndex = Loop.GetOutPort( 'Index' )
+ OLoopMax = Loop.GetOutPort( 'Max' )
+ IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' )
+ IEndLoopIndex = EndLoop.GetInPort( 'Index' )
+ IEndLoopMax = EndLoop.GetInPort( 'Max' )
+ IEndLoopGate = EndLoop.GetInPort( 'Gate' )
+ OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' )
+ OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ OEndLoopGate = EndLoop.GetOutPort( 'Gate' )
+ Loop.SetName( 'Loop' )
+ Loop.SetAuthor( '' )
+ Loop.SetComment( 'Compute Node' )
+ Loop.Coords( 208 , 179 )
+
+ # Creation of Links
+ LLoop1IndexEndLoop1Index = GraphTwoLoops.Link( OLoop1Index , IEndLoop1Index )
+
+ LLoop1MaxEndLoop1Max = GraphTwoLoops.Link( OLoop1Max , IEndLoop1Max )
+
+ LLoop1GateLoopGate = GraphTwoLoops.Link( OLoop1Gate , ILoopGate )
+
+ LLoopIndexEndLoopIndex = GraphTwoLoops.Link( OLoopIndex , IEndLoopIndex )
+
+ LLoopMaxEndLoopMax = GraphTwoLoops.Link( OLoopMax , IEndLoopMax )
+
+ LEndLoopGateEndLoop1Gate = GraphTwoLoops.Link( OEndLoopGate , IEndLoop1Gate )
+
+ # Input datas
+ ILoop1Index.Input( 5 )
+ ILoop1Max.Input( 15 )
+ ILoopIndex.Input( 2 )
+ ILoopMax.Input( 20 )
+
+ # Output Ports of the graph
+ #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' )
+ #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' )
+ #OEndLoopIndex = EndLoop.GetOutPort( 'Index' )
+ #OEndLoopMax = EndLoop.GetOutPort( 'Max' )
+ return GraphTwoLoops
+
+
+GraphTwoLoops = DefGraphTwoLoops()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphTwoLoops</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>aNewDataFlow</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop1__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop1__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Loop__Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop1__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop1__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndLoop__Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>17/12/2004 - 11:3:21</creation-date>
+ <lastmodification-date>17/12/2004 - 16:23:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Loop1</node-name>
+ <kind>4</kind>
+ <coupled-node>EndLoop1</coupled-node>
+ <service>
+<service-name>Loop1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Loop1</FuncName>
+ <PyFunc><![CDATA[def Loop1(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>More</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def More(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 16:23:40</creation-date>
+ <lastmodification-date>17/12/2004 - 16:23:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>7</x-position>
+ <y-position>175</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndLoop1</node-name>
+ <kind>5</kind>
+ <coupled-node>Loop1</coupled-node>
+ <service>
+<service-name>EndLoop1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop1</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 16:23:40</creation-date>
+ <lastmodification-date>17/12/2004 - 16:23:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>634</x-position>
+ <y-position>177</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Loop</node-name>
+ <kind>4</kind>
+ <coupled-node>EndLoop</coupled-node>
+ <service>
+<service-name>Loop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[def Next(Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 16:23:40</creation-date>
+ <lastmodification-date>17/12/2004 - 16:23:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>208</x-position>
+ <y-position>179</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndLoop</node-name>
+ <kind>5</kind>
+ <coupled-node>Loop</coupled-node>
+ <service>
+<service-name>EndLoop</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def EndLoop(DoLoop,Index,Max) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(1) ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index < Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 1 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Max ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>17/12/2004 - 16:23:40</creation-date>
+ <lastmodification-date>17/12/2004 - 16:23:40</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>426</x-position>
+ <y-position>180</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Loop1</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndLoop1</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop1</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndLoop1</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop1</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndLoop1</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop1</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop1</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Loop1</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Loop</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndLoop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndLoop</fromnode-name>
+ <fromserviceparameter-name>Gate</fromserviceparameter-name>
+ <tonode-name>EndLoop1</tonode-name>
+ <toserviceparameter-name>Gate</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphTwoLoops</fromnode-name>
+ <fromserviceparameter-name>Loop1__Index</fromserviceparameter-name>
+ <tonode-name>Loop1</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphTwoLoops</fromnode-name>
+ <fromserviceparameter-name>Loop1__Max</fromserviceparameter-name>
+ <tonode-name>Loop1</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>15</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphTwoLoops</fromnode-name>
+ <fromserviceparameter-name>Loop__Index</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>2</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphTwoLoops</fromnode-name>
+ <fromserviceparameter-name>Loop__Max</fromserviceparameter-name>
+ <tonode-name>Loop</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>20</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphUndefinedSymbol
+
+from SuperV import *
+
+# Graph creation of GraphUndefinedSymbol
+def DefGraphUndefinedSymbol() :
+ GraphUndefinedSymbol = Graph( 'GraphUndefinedSymbol' )
+ GraphUndefinedSymbol.SetName( 'GraphUndefinedSymbol' )
+ GraphUndefinedSymbol.SetAuthor( 'JR' )
+ GraphUndefinedSymbol.SetComment( '' )
+ GraphUndefinedSymbol.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ UndefinedSymbol = GraphUndefinedSymbol.FNode( 'UndefinedSymbolComponent' , 'UndefinedSymbolComponent' , 'UndefinedSymbol' )
+ UndefinedSymbol.SetName( 'UndefinedSymbol' )
+ UndefinedSymbol.SetAuthor( '' )
+ UndefinedSymbol.SetContainer( 'localhost/FactoryServer' )
+ UndefinedSymbol.SetComment( 'UndefinedSymbol from UndefinedSymbolComponent' )
+ UndefinedSymbol.Coords( 146 , 166 )
+ IUndefinedSymbolGate = UndefinedSymbol.GetInPort( 'Gate' )
+ OUndefinedSymbolreturn = UndefinedSymbol.GetOutPort( 'return' )
+ OUndefinedSymbolGate = UndefinedSymbol.GetOutPort( 'Gate' )
+
+ # Output Ports of the graph
+ #OUndefinedSymbolreturn = UndefinedSymbol.GetOutPort( 'return' )
+ return GraphUndefinedSymbol
+
+
+GraphUndefinedSymbol = DefGraphUndefinedSymbol()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphUndefinedSymbol</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphUndefinedSymbol</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>UndefinedSymbol__return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:16:21</creation-date>
+ <lastmodification-date>8/12/2004 - 18:16:32</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>JR</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>UndefinedSymbolComponent</component-name>
+ <interface-name>UndefinedSymbolComponent</interface-name>
+ <node-name>UndefinedSymbol</node-name>
+ <kind>0</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>UndefinedSymbol</service-name>
+ <inParameter-list/>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>return</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>8/12/2004 - 18:16:32</creation-date>
+ <lastmodification-date>8/12/2004 - 18:16:32</lastmodification-date>
+ <editor-release>2.0</editor-release>
+ <author>?</author>
+ <container>localhost/FactoryServer</container>
+ <comment>UndefinedSymbol from UndefinedSymbolComponent</comment>
+ <x-position>146</x-position>
+ <y-position>166</y-position> </node> </node-list>
+ <link-list/>
+ <data-list/> </dataflow></supergraph>
--- /dev/null
+
+# Generated python file of Graph GraphNonVoidEndLoop_1
+
+from SuperV import *
+
+# Graph creation of GraphNonVoidEndLoop_1
+def DefGraphNonVoidEndLoop_1() :
+ GraphNonVoidEndLoop_1 = Graph( 'GraphNonVoidEndLoop_1' )
+ GraphNonVoidEndLoop_1.SetName( 'GraphNonVoidEndLoop_1' )
+ GraphNonVoidEndLoop_1.SetAuthor( '' )
+ GraphNonVoidEndLoop_1.SetComment( '' )
+ GraphNonVoidEndLoop_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of Loop Nodes
+ PyInit = []
+ PyInit.append( 'def Init(Index,Min,Max,Incr) : ' )
+ PyInit.append( ' if Min <= Max : ' )
+ PyInit.append( ' Index = Min ' )
+ PyInit.append( ' else : ' )
+ PyInit.append( ' Index = Max ' )
+ PyInit.append( ' print 'Init',Index,Min,Max,Incr ' )
+ PyInit.append( ' return Index,Min,Max,Incr ' )
+ PyMoreInit = []
+ PyMoreInit.append( ' ' )
+ PyNextInit = []
+ PyNextInit.append( 'import time ' )
+ PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' )
+ PyNextInit.append( ' time.sleep(2) ' )
+ PyNextInit.append( ' Index = Index + Incr ' )
+ PyNextInit.append( ' print 'Next', Index,Min,Max,Incr ' )
+ PyNextInit.append( ' return Index,Min,Max,Incr ' )
+ Init,EndInit = GraphNonVoidEndLoop_1.LNode( 'Init' , PyInit , '' , PyMoreInit , 'Next' , PyNextInit )
+ EndInit.SetName( 'EndInit' )
+ EndInit.SetAuthor( '' )
+ EndInit.SetComment( 'Compute Node' )
+ EndInit.Coords( 411 , 260 )
+ PyEndInit = []
+ PyEndInit.append( 'def EndLoop(DoLoop,Index,Min,Max,Incr) : ' )
+ PyEndInit.append( ' print 'EndLoop',DoLoop,Index,Min,Max,Incr ' )
+ PyEndInit.append( ' if Index == Max : ' )
+ PyEndInit.append( ' DoLoop = 0 ' )
+ PyEndInit.append( ' return DoLoop,Index,Min,Max,Incr ' )
+ PyEndInit.append( '' )
+ EndInit.SetPyFunction( 'EndLoop' , PyEndInit )
+ IInitInitLoop = Init.GetInPort( 'InitLoop' )
+ IInitIndex = Init.InPort( 'Index' , 'long' )
+ IInitMin = Init.InPort( 'Min' , 'long' )
+ IInitMax = Init.InPort( 'Max' , 'long' )
+ IInitIncr = Init.InPort( 'Incr' , 'long' )
+ IInitGate = Init.GetInPort( 'Gate' )
+ OInitDoLoop = Init.GetOutPort( 'DoLoop' )
+ OInitIndex = Init.GetOutPort( 'Index' )
+ OInitMin = Init.GetOutPort( 'Min' )
+ OInitMax = Init.GetOutPort( 'Max' )
+ OInitIncr = Init.GetOutPort( 'Incr' )
+ IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
+ IEndInitIndex = EndInit.GetInPort( 'Index' )
+ IEndInitMin = EndInit.GetInPort( 'Min' )
+ IEndInitMax = EndInit.GetInPort( 'Max' )
+ IEndInitIncr = EndInit.GetInPort( 'Incr' )
+ IEndInitGate = EndInit.GetInPort( 'Gate' )
+ OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
+ OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ OEndInitMin = EndInit.GetOutPort( 'Min' )
+ OEndInitMax = EndInit.GetOutPort( 'Max' )
+ OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ Init.SetName( 'Init' )
+ Init.SetAuthor( '' )
+ Init.SetComment( 'Compute Node' )
+ Init.Coords( 17 , 257 )
+
+ # Creation of Links
+ LInitIndexEndInitIndex = GraphNonVoidEndLoop_1.Link( OInitIndex , IEndInitIndex )
+
+ LInitMinEndInitMin = GraphNonVoidEndLoop_1.Link( OInitMin , IEndInitMin )
+
+ LInitMaxEndInitMax = GraphNonVoidEndLoop_1.Link( OInitMax , IEndInitMax )
+
+ LInitIncrEndInitIncr = GraphNonVoidEndLoop_1.Link( OInitIncr , IEndInitIncr )
+
+ # Input datas
+ IInitIndex.Input( 0 )
+ IInitMin.Input( 5 )
+ IInitMax.Input( 10 )
+ IInitIncr.Input( 1 )
+
+ # Output Ports of the graph
+ #OEndInitIndex = EndInit.GetOutPort( 'Index' )
+ #OEndInitMin = EndInit.GetOutPort( 'Min' )
+ #OEndInitMax = EndInit.GetOutPort( 'Max' )
+ #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
+ return GraphNonVoidEndLoop_1
+
+
+GraphNonVoidEndLoop_1 = DefGraphNonVoidEndLoop_1()
--- /dev/null
+<!DOCTYPE SuperGraph>
+<supergraph>
+<dataflow>
+<info-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>GraphNonVoidEndLoop_1</node-name>
+ <kind>1</kind>
+ <coupled-node>?</coupled-node>
+ <service>
+<service-name>GraphNonVoidEndLoop_1</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Init__Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>EndInit__Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list/>
+ <creation-date>24/3/2003 - 14:44:35</creation-date>
+ <lastmodification-date>16/12/2004 - 11:17:3</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>?</comment>
+ <x-position>0</x-position>
+ <y-position>0</y-position> </node> </info-list>
+ <node-list>
+<node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>Init</node-name>
+ <kind>4</kind>
+ <coupled-node>EndInit</coupled-node>
+ <service>
+<service-name>Init</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>Init</FuncName>
+ <PyFunc><![CDATA[def Init(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ if Min <= Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Min ]]></PyFunc>
+ <PyFunc><![CDATA[ else : ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Max ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'Init',Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>?</FuncName>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction>
+ <PyFunction>
+<FuncName>Next</FuncName>
+ <PyFunc><![CDATA[import time ]]></PyFunc>
+ <PyFunc><![CDATA[def Next(Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ time.sleep(2) ]]></PyFunc>
+ <PyFunc><![CDATA[ Index = Index + Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'Next', Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ return Index,Min,Max,Incr ]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 11:17:3</creation-date>
+ <lastmodification-date>16/12/2004 - 11:17:3</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>17</x-position>
+ <y-position>257</y-position> </node>
+ <node>
+<component-name>?</component-name>
+ <interface-name>?</interface-name>
+ <node-name>EndInit</node-name>
+ <kind>5</kind>
+ <coupled-node>Init</coupled-node>
+ <service>
+<service-name>EndInit</service-name>
+ <inParameter-list>
+<inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Index</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Min</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Max</inParameter-name> </inParameter>
+ <inParameter>
+<inParameter-type>long</inParameter-type>
+ <inParameter-name>Incr</inParameter-name> </inParameter> </inParameter-list>
+ <outParameter-list>
+<outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Index</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Min</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Max</outParameter-name> </outParameter>
+ <outParameter>
+<outParameter-type>long</outParameter-type>
+ <outParameter-name>Incr</outParameter-name> </outParameter> </outParameter-list> </service>
+ <DataStream-list/>
+ <PyFunction-list>
+<PyFunction>
+<FuncName>EndLoop</FuncName>
+ <PyFunc><![CDATA[def EndLoop(DoLoop,Index,Min,Max,Incr) : ]]></PyFunc>
+ <PyFunc><![CDATA[ print 'EndLoop',DoLoop,Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[ if Index == Max : ]]></PyFunc>
+ <PyFunc><![CDATA[ DoLoop = 0 ]]></PyFunc>
+ <PyFunc><![CDATA[ return DoLoop,Index,Min,Max,Incr ]]></PyFunc>
+ <PyFunc><![CDATA[?]]></PyFunc> </PyFunction> </PyFunction-list>
+ <creation-date>16/12/2004 - 11:17:3</creation-date>
+ <lastmodification-date>16/12/2004 - 11:17:3</lastmodification-date>
+ <editor-release>1.04</editor-release>
+ <author>?</author>
+ <container>?</container>
+ <comment>Compute Node</comment>
+ <x-position>411</x-position>
+ <y-position>260</y-position> </node> </node-list>
+ <link-list>
+<link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Index</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Min</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Max</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>Init</fromnode-name>
+ <fromserviceparameter-name>Incr</fromserviceparameter-name>
+ <tonode-name>EndInit</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <coord-list/> </link>
+ <link>
+<fromnode-name>EndInit</fromnode-name>
+ <fromserviceparameter-name>DoLoop</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <coord-list/> </link> </link-list>
+ <data-list>
+<data>
+<fromnode-name>GraphNonVoidEndLoop_1</fromnode-name>
+ <fromserviceparameter-name>Init__Index</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Index</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>0</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop_1</fromnode-name>
+ <fromserviceparameter-name>Init__Min</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Min</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>5</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop_1</fromnode-name>
+ <fromserviceparameter-name>Init__Max</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Max</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>10</value> </data-value>
+ <coord-list/> </data>
+ <data>
+<fromnode-name>GraphNonVoidEndLoop_1</fromnode-name>
+ <fromserviceparameter-name>Init__Incr</fromserviceparameter-name>
+ <tonode-name>Init</tonode-name>
+ <toserviceparameter-name>Incr</toserviceparameter-name>
+ <data-value>
+<value-type>3</value-type>
+ <value>1</value> </data-value>
+ <coord-list/> </data> </data-list> </dataflow></supergraph>
<fromnode-name>Endfori</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>fori</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list>
<coord>
<x>8</x>
<fromnode-name>EndOfforN</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>forN</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>whileNotOne</fromnode-name>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileNotOne</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileNotOne</fromnode-name>
<fromnode-name>EndOffori</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>fori</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOffori</fromnode-name>
<fromnode-name>EndOfwhileEven</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>whileEven</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfwhileEven</fromnode-name>
<fromnode-name>EndInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list>
<coord>
<x>205</x>
<fromnode-name>EndInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list>
<coord>
<x>205</x>
<fromnode-name>EndInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>Func</fromnode-name>
<fromnode-name>Endfori</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>fori</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list>
<coord>
<x>8</x>
<fromnode-name>EndOfInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>DisplayVitesse</fromnode-name>
<fromnode-name>EndOfInit</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>Init</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>EndOfInit</fromnode-name>
<fromnode-name>EndOfLoopOnViews</fromnode-name>
<fromserviceparameter-name>DoLoop</fromserviceparameter-name>
<tonode-name>LoopOnViews</tonode-name>
- <toserviceparameter-name>InitLoop</toserviceparameter-name>
+ <toserviceparameter-name>DoLoop</toserviceparameter-name>
<coord-list/> </link>
<link>
<fromnode-name>CreateView</fromnode-name>
\note <BR>In general, ports represent <STRONG>input or output parameters</STRONG> of the functions,
implemented in different kinds of nodes of the graph.
*/
- enum KindOfPort { UndefinedParameter , ServiceParameter , GateParameter ,
- InLineParameter , LoopParameter , SwitchParameter ,
- EndSwitchParameter , GOTOParameter , DataStreamParameter } ;
+ enum KindOfPort { UndefinedParameter ,
+ ServiceParameter ,
+ GateParameter ,
+ InLineParameter ,
+ LoopParameter ,
+ SwitchParameter ,
+ EndSwitchParameter ,
+ GOTOParameter ,
+ DataStreamParameter } ;
/*!
This enumeration contains a set of dependencies of InPorts and OutPorts.
/*!
This enumeration contains a set of elements defining the type of the node.
*/
- enum KindOfNode { FactoryNode , DataFlowGraph , ComputingNode ,
- InLineNode , LoopNode , EndLoopNode ,
- SwitchNode , EndSwitchNode , GOTONode , DataStreamGraph ,
- MacroNode ,UnknownNode };
+ enum KindOfNode { FactoryNode ,
+ DataFlowGraph ,
+ ComputingNode ,
+ InLineNode ,
+ LoopNode ,
+ EndLoopNode ,
+ SwitchNode ,
+ EndSwitchNode ,
+ GOTONode ,
+ DataStreamGraph ,
+ MacroNode ,
+ UnknownNode };
/*!
This struct contains fields defining the date.
on this node(graph).
*/
- enum GraphEvent { UndefinedEvent , NoEvent , NewThreadEvent ,
- WaitingEvent , ReadyEvent ,
- RunningEvent , DoneEvent , ErroredEvent ,
- SuspendEvent , ResumeEvent ,
- KillEvent , StopEvent ,
- ReRunEvent , ReStartEvent } ;
+ enum GraphEvent { UndefinedEvent ,
+ NoEvent ,
+ NewThreadEvent ,
+ WaitingEvent ,
+ ReadyEvent ,
+ RunningEvent ,
+ DoneEvent ,
+ ErroredEvent ,
+ SuspendEvent ,
+ ResumeEvent ,
+ KillEvent ,
+ StopEvent } ;
// UndefinedState : Non existing Node, Port etc...
/*!
This enumeration contains a set of elements defining the current state of the node(graph).
*/
- enum GraphState { UndefinedState , NoState , EditingState , SuspendState ,
- WaitingState , ReadyState , SuspendReadyState ,
+ enum GraphState { UndefinedState ,
+ NoState ,
+ EditingState ,
+ SuspendState ,
+ WaitingState ,
+ ReadyState ,
+ SuspendReadyState ,
RunningState ,
- DoneState , ErrorState ,
- SuspendDoneState , SuspendErroredState ,
- KillState , StopState ,
- ReRunState , ReStartState ,
- NumberOfGraphStates } ;
+ DoneState ,
+ ErrorState ,
+ SuspendDoneState ,
+ SuspendErroredState ,
+ KillState ,
+ StopState ,
+ LoadingState,
+ NumberOfGraphStates } ;
/*! A sequence of string values.
*/
The %ControlState gives a possibility to determine the "control actions" which have been done by
the user (Suspend, SuspendDone, Kill, etc...).
*/
- enum ControlState { VoidState , ToSuspendStartState ,
- ToSuspendState , ToSuspendDoneState ,
- ToKillState , ToKillDoneState , ToStopState ,
+ enum ControlState { VoidState ,
+ ToSuspendStartState ,
+ ToSuspendState ,
+ ToSuspendDoneState ,
+ ToKillState ,
+ ToKillDoneState ,
+ ToStopState ,
NumberOfControlStates } ;
-
-
-
-
-
////////////////
/*! \brief interface %SuperG
*/
boolean Resume();
-/*!
- Restarts execution of the node.
-*/
- boolean ReRun();
-/*!
-Restarts execution of the graph beginning from a definite node.
-*/
- boolean ReRunAt( in string aNodeName );
-/*!
- Restarts and suspends execution of the node(graph).
-*/
- boolean ReStart();
-/*!
-Restarts and suspends execution of the graph beginning from a definite node.
-\param aNodeName String parameter defining the name of the node.
-*/
- boolean ReStartAt( in string aNodeName );
-
- // Control state required : Kill, Suspend, Stop
+// Control state required : Kill, Suspend, Stop
/*!
Returns control state of the node(graph).
*/
void ControlClear() ;
boolean ContainerKill();
+
/*!
Sets the position of the node in the window.
*/
Engines::Component ComponentRef( in string aComputerContainer ,
in string aComponentName ) ;
-/*!
- Creates a link connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
-*/
+ /*! Creates a link connecting two ports (%Output %Port and %Input %Port) of the nodes in a Graph
+ */
SUPERV::Link Link( in SUPERV::Port OutputPort ,
in SUPERV::Port InputPort ) ;
-/*!
-Imports a graph into a file with XML format
-\param anXmlFile String parameter defining the name of the XML file.
-\return True, if the graph has been successfully imported.
-*/
+ /*!
+ Imports a graph into a file with XML format
+ \param anXmlFile String parameter defining the name of the XML file.
+ \return True, if the graph has been successfully imported.
+ */
boolean Import( in string anXmlFile ) ;
-/*!
-Exports a graph from a file with XML format
-\param anXmlFile String parameter defining the name of the XML file.
-\return True, if the graph has been successfully imported.
-*/
+
+ /*!
+ Exports a graph from a file with XML format
+ \param anXmlFile String parameter defining the name of the XML file.
+ \return True, if the graph has been successfully imported.
+ */
boolean Export( in string anXmlFile ) ;
-/*!
-Returns True if the graph is read Only.
-*/
+
+ /*!
+ Returns True if the graph is read Only.
+ */
boolean IsReadOnly() ;
-/*!
- Starts asynchronous execution of the graph.
-*/
+ /*!
+ Starts asynchronous execution of the graph.
+ */
boolean Run() ;
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. And returns immediately Nil, NoEvent and NoState if not.
- Returns false if the graph is finished, suspended, killed or stopped.
-\param aNode %Node for which this method is called
-\param anEvent An operation, which has been performed on this node(graph).
-\param aState Current state of the graph
-*/
+ /*!
+ Assigns to the %Node an %Event and a %State of the %Node, if the Event is
+ available. And returns immediately Nil, NoEvent and NoState if not.
+ Returns false if the graph is finished, suspended, killed or stopped.
+ \param aNode %Node for which this method is called
+ \param anEvent An operation, which has been performed on this node(graph).
+ \param aState Current state of the graph
+ */
boolean EventNoW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
out SUPERV::GraphState aState ) ;
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. Waits if it is not available at the current moment.
- Returns false if the graph is finished, suspended, killed or stopped.
-\param aNode %Node for which this method is called
-\param anEvent An operation, which has been performed on this node(graph).
-\param aState Current state of the graph
-*/
+ /*!
+ Assigns to the %Node an %Event and a %State of the %Node, if the Event is
+ available. Waits if it is not available at the current moment.
+ Returns false if the graph is finished, suspended, killed or stopped.
+ \param aNode %Node for which this method is called
+ \param anEvent An operation, which has been performed on this node(graph).
+ \param aState Current state of the graph
+ */
boolean Event( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
out SUPERV::GraphState aState ) ;
-
+
// Same as Event but execution of the thread is suspended between the
// return of EventW and the next call to EventW
-/*!
- Assigns to the %Node an %Event and a %State of the %Node, if the Event is
- available. And returns immediately Nil, NoEvent and NoState if not.
- Returns false if the graph is finished, suspended, killed or stopped.
-\note <BR>Execution of the thread is suspended between the return of this
-method and its next usage.
-\param aNode %Node for which this method is called
-\param anEvent An operation, which has been performed on this node(graph).
-\param aState Current state of the graph
-*/
+ /*!
+ Assigns to the %Node an %Event and a %State of the %Node, if the Event is
+ available. And returns immediately Nil, NoEvent and NoState if not.
+ Returns false if the graph is finished, suspended, killed or stopped.
+ \note <BR>Execution of the thread is suspended between the return of this
+ method and its next usage.
+ \param aNode %Node for which this method is called
+ \param anEvent An operation, which has been performed on this node(graph).
+ \param aState Current state of the graph
+ */
boolean EventW( out SUPERV::CNode aNode , out SUPERV::GraphEvent anEvent ,
out SUPERV::GraphState aState ) ;
-/*! \name Methods used for inner debugging purposes of threads management :
-*/
-/*@{*/
-
+ /*! \name Methods used for inner debugging purposes of threads management :
+ */
+ /*@{*/
+
long EventQSize() ;
long LevelMax() ;
SUPERV::ListOfNodes LevelNodes( in long aLevel ) ;
long ThreadsMax() ;
+
+ /*@}*/
-/*@}*/
-
-/*!
-Returns the number of currently running threads.
-*/
+ /*!
+ Returns the number of currently running threads.
+ */
long Threads();
-/*!
-Returns the number of suspended threads.
-*/
+ /*!
+ Returns the number of suspended threads.
+ */
long SuspendedThreads();
-/*!
-Returns True if the graph is valid.
-*/
+ /*!
+ Returns True if the graph is valid.
+ */
boolean IsValid() ;
-/*!
-Returns True if the graph can be executed.
-*/
+ /*!
+ Returns True if the graph can be executed.
+ */
boolean IsExecutable() ;
-/*!
-Returns True if the graph is being currently edited.
-*/
+ /*!
+ Returns True if the graph is being currently edited.
+ */
boolean IsEditing() ;
-/*!
-Returns True if the graph is being currently executed.
-*/
+ /*!
+ Returns True if the graph is being currently executed.
+ */
boolean IsExecuting() ;
-
+
long LastLevelDone() ;
-
-/*!
- Launches step-by-step execution of the graph.
-\note The execution is suspended immediatly after performance of operations of the first node and
-user can specify the nodes, where execution will be again suspended after its resuming.
-*/
+
+ /*!
+ Launches step-by-step execution of the graph.
+ \note The execution is suspended immediatly after performance of operations of the first node and
+ user can specify the nodes, where execution will be again suspended after its resuming.
+ */
boolean Start() ;
-/*!
-Allows to copy one graph into another.
-*/
+ /*!
+ Allows to copy one graph into another.
+ */
SUPERV::Graph Copy() ;
-/*!
-Convert a FlowGraph to a StreamGraph.
-*/
+ /*!
+ Convert a FlowGraph to a StreamGraph.
+ */
SUPERV::StreamGraph ToStreamGraph() ;
-/*!
-Merges two graphs
-*/
+ /*!
+ Merges two graphs
+ */
boolean Merge( in Graph aGraph ) ;
-/*!
-Returns a list of nodes of the graph.
-*/
+ /*!
+ Returns a list of nodes of the graph.
+ */
SUPERV::ListOfNodes Nodes() ;
-/*!
-Returns a list of links of the graph.
-*/
+ /*!
+ Returns a list of links of the graph.
+ */
SUPERV::ListOfLinks GLinks() ;
-/*!
-Gets IOR of the garph.
-*/
+ /*!
+ Gets IOR of the garph.
+ */
string getIOR();
-
-/*!
-Returns the number of independent subgraphs
-*/
+
+ /*!
+ Returns the number of independent subgraphs
+ */
long SubGraphsNumber() ;
-/*!
-Returns a list of Nodes of a SubGraph.
-*/
+ /*!
+ Returns a list of Nodes of a SubGraph.
+ */
SUPERV::ListOfNodes SubGraphsNodes( in long SubGraphNumber ) ;
+ /*! Forces use of Editor's data model and destroy of Executor
+ */
+ void Editing();
+
} ;
// void Destroy() ;
+ /*! Checks if the types of Ports that it connects are compatible
+ */
+ boolean IsValid();
+
+ /*! Check if the Link equals to the another given Link
+ */
+ boolean IsEqual( in SUPERV::Link aLink );
+
} ;
const SUPERV::KindOfPort aKindOfPort ,
int index ) {
cdebug << "AddInPort " << Name() << " ConnectedInPortsNumber " << ConnectedInPortsNumber() << endl ;
+// JR 12.01.2005 : InitLoop and DoLoop are reserved parameter names in LoopNodes :
+ if ( IsLoopNode() && ( strcmp( InputParameterName , "InitLoop" ) == 0 ||
+ strcmp( InputParameterName , "DoLoop" ) == 0 ) ) {
+ return NULL ;
+ }
return GraphBase::PortsOfNode::AddInPort( _ORB , NamePtr() ,
Kind() ,
InputParameterName ,
}
+bool GraphBase::ComputingNode::CheckLoop(GraphBase::LoopNode * aLoopNode ,
+ GraphBase::EndOfLoopNode * anEndLoopNode ) const {
+ cdebug_in << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
+ << anEndLoopNode->Name() << ") LinkedNodesSize "
+ << LinkedNodesSize() << endl;
+
+ int i ;
+ if ( LinkedNodesSize() == 0 && !IsDataFlowNode() && !IsDataStreamNode() ) {
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name()
+ << " , " << anEndLoopNode->Name() << ") LinkedNodesSize "
+ << LinkedNodesSize() << " false" << endl;
+ return false ;
+ }
+// We check that all nodes linked to that node go to the end of LoopNode :
+ for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ;
+ cdebug << i << ". " << Name() << " Linked to " << aNode->Name() << endl ;
+ if ( !aNode->IsEndLoopNode() || aNode != anEndLoopNode ) {
+ if ( !aNode->CheckLoop( aLoopNode , anEndLoopNode ) ) {
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name()
+ << " , " << anEndLoopNode->Name() << ") LinkedNodesSize "
+ << LinkedNodesSize() << " false" << endl;
+ return false ;
+ }
+ }
+ }
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckLoop( " << aLoopNode->Name() << " , "
+ << anEndLoopNode->Name() << ") LinkedNodesSize "
+ << LinkedNodesSize() << " true" << endl;
+ return true ;
+}
+
+bool GraphBase::ComputingNode::CheckEndLoop(GraphBase::LoopNode * aLoopNode ,
+ GraphBase::EndOfLoopNode * anEndLoopNode ) const {
+ cdebug_in << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
+ << anEndLoopNode->Name() << ") LinkedFromNodesSize "
+ << LinkedFromNodesSize() << endl;
+
+ int i ;
+ if ( LinkedFromNodesSize() == 0 ) {
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name()
+ << " , " << anEndLoopNode->Name() << ") LinkedFromNodesSize "
+ << LinkedFromNodesSize() << " false" << endl;
+ return false ;
+ }
+// We have to check that all nodes linked from that node go to the beginning of LoopNode :
+ for ( i = 0 ; i < LinkedFromNodesSize() ; i++ ) {
+ GraphBase::ComputingNode * aNode = (GraphBase::ComputingNode * ) LinkedFromNodes( i ) ;
+ cdebug << i << ". " << Name() << " Linked from " << aNode->Name() << endl ;
+ if ( !aNode->IsLoopNode() || aNode != aLoopNode ) {
+ if ( !aNode->CheckEndLoop( aLoopNode , anEndLoopNode ) ) {
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name()
+ << " , " << anEndLoopNode->Name() << ") LinkedFromNodesSize "
+ << LinkedFromNodesSize() << " false" << endl;
+ return false ;
+ }
+ }
+ }
+ cdebug_out << Name() << "->GraphBase::ComputingNode::CheckEndLoop( " << aLoopNode->Name() << " , "
+ << anEndLoopNode->Name() << ") LinkedFromNodesSize "
+ << LinkedFromNodesSize() << " true" << endl;
+ return true ;
+}
+
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
class InLineNode ;
+ class LoopNode ;
+ class EndOfLoopNode ;
+
class ComputingNode : public StreamNode {
private:
<< " + 1 Service " << ServiceName() << endl ;
ToNode->IncrConnectedInPortsNumber() ; } ;
- bool RemoveLinkedNode( GraphBase::ComputingNode * ToNode ) {
- bool RetVal = GraphBase::StreamNode::RemoveLinkedNode( ToNode ) ;
+ bool RemoveLinkedNode( GraphBase::ComputingNode * ToNode ,
+ bool DoLinkedFromNode = true ) {
+ bool RetVal = GraphBase::StreamNode::RemoveLinkedNode( ToNode , DoLinkedFromNode ) ;
if ( RetVal ) {
- cdebug << "GraphBase::StreamNode::RemoveLinkedNode to " << ToNode->Name() << " from "
+ cdebug << "ComputingNode::RemoveLinkedNode to " << ToNode->Name() << " from "
<< Name() << " ConnectedInPortsNumber "
<< ToNode->ConnectedInPortsNumber() - 1 << endl ;
ToNode->DecrConnectedInPortsNumber() ;
GraphBase::StreamNode::ReNameLinkedNode( OldNodeName , NewNodeName ) ; } ;
void IncrConnectedInPortsNumber() {
- cdebug << "IncrConnectedInPortsNumber " << Name() << " -> "
+ cdebug << "ComputingNode::IncrConnectedInPortsNumber " << Name() << " -> "
<< _ConnectedInPortsNumber+1 << endl ;
_ConnectedInPortsNumber++ ; } ;
void DecrConnectedInPortsNumber() {
}
return false ; } ;
+ bool CheckLoop(GraphBase::LoopNode * aLoopNode ,
+ GraphBase::EndOfLoopNode * anEndLoopNode ) const ;
+ bool CheckEndLoop(GraphBase::LoopNode * aLoopNode ,
+ GraphBase::EndOfLoopNode * anEndLoopNode ) const ;
+
// const GraphBase::ListOfParameters * GetListOfParameters() const ;
const long CpuUsed() ;
bool GraphBase::Graph::ReNameNode( const char* OldNodeName ,
const char* NewNodeName ) {
- cdebug_in << "GraphBase::Graph::ReNameNode (" << OldNodeName << " , " << NewNodeName << ")" << endl;
+ cdebug_in << "GraphBase::Graph::ReNameNode (" << OldNodeName << " , " << NewNodeName << ") "
+ << endl;
int i ;
bool RetVal = false ;
+//#if 0
+ GraphBase::ComputingNode * anOldNode = GetChangeGraphNode( OldNodeName ) ;
+ for ( i = 0 ; i < anOldNode->LinkedNodesSize() ; i++ ) {
+ cdebug << "LinkedNode " << i << " " << anOldNode->LinkedNodes( i )->Name() << endl ;
+ }
+//#endif
if ( !strcmp( OldNodeName , NewNodeName ) ) {
RetVal = true ;
}
SetGraphNodeIndex( NewNodeName , index ) ;
GraphBase::ComputingNode * aNode = GetChangeGraphNode( index ) ;
+// Update 'ToNode's Map from 'aNode'
+ cdebug << "Graph::ReNameNode " << aNode->Name() << " LinkedNodesSize "
+ << aNode->LinkedNodesSize() << endl ;
+ for ( i = 0 ; i < aNode->LinkedNodesSize() ; i++ ) {
+ GraphBase::StreamNode * ToNode = aNode->LinkedNodes( i ) ;
+ ToNode->ReNameLinkedFromNode( OldNodeName , NewNodeName ) ;
+ }
+// Update 'FomNode's Map to 'aNode'
+// Inports 'anInPort' of 'aNode'
for ( i = aNode->GetNodeInPortsSize()-1 ; i >= 0 ; i-- ) {
GraphBase::InPort * anInPort = aNode->GetChangeNodeInPort( i ) ;
+// OutPort 'anOutPort' linked to 'anInPort'
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
cdebug << i << ". " << aNode->Name() << " " << "GraphBase::Graph::ReNameNode of LinkedNode : from " ;
if ( anOutPort ) {
cdebug << " fromDataConnected " << anOutPort->NodeName() << endl ;
}
else {
+// Node 'FromNode' of 'anOutPort'
GraphBase::ComputingNode * FromNode ;
if ( strcmp( anOutPort->NodeName() , Name() ) ) {
FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
else {
FromNode = this ;
}
+// Rename in _MapOfLinkedFromNodes of 'FromNode'
cdebug << " fromConnected " << anOutPort->NodeName() << endl ;
if ( anInPort->IsDataStream() ) {
FromNode->ReNameStreamLinkedNode( OldNodeName , NewNodeName ) ;
}
bool GraphBase::Graph::RemoveNode( const char* aNodeName ) {
- cdebug_in << "Graph::RemoveNode (" << aNodeName << ") " << LinkedNodesSize() << " LinkedNodes :"
- << endl;
+ cdebug_in << "Graph::RemoveNode (" << aNodeName << ") " << endl;
int i ;
bool RetVal = false ;
int index = GetGraphNodeIndex( aNodeName ) ;
GraphBase::ComputingNode * aNode = GetChangeGraphNode( index ) ;
- for ( i = 0 ; i < LinkedNodesSize() ; i++ ) {
- cdebug << " " << i << ". " << LinkedNodes( i ) << endl ;
- }
if ( aNode ) {
- cdebug << "Graph::RemoveNode " << aNode->GetNodeInPortsSize() << " InPorts " << aNode->GetNodeOutPortsSize()
- << " OutPorts" << endl ;
- if ( aNode->GetNodeInPortsSize() ) {
- for ( i = aNode->GetNodeInPortsSize()-1 ; i >= 0 ; i-- ) {
- GraphBase::InPort * anInPort = aNode->GetChangeNodeInPort( i ) ;
- cdebug << "InPort" << i << ". " << aNodeName << "( " << anInPort->PortName() << ") "
- << anInPort->PortStatus() << " <-- " ;
- GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
- if ( anOutPort ) {
- cdebug << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") " << anOutPort->PortStatus() ;
- }
- cdebug << endl ;
- if ( !anInPort->IsNotConnected() ) {
- RetVal = true ;
- if ( anOutPort->IsDataConnected() || anOutPort->IsExternConnected() ) {
- cdebug << " Data/Extern" << endl ;
- }
+ cdebug << "Graph::RemoveNode " << aNode->Name() << " : " << aNode->GetNodeInPortsSize()
+ << " InPorts " << aNode->GetNodeOutPortsSize() << " OutPorts "
+ << aNode->LinkedNodesSize() << " LinkedNodes " << aNode->LinkedFromNodesSize()
+ << " LinkedFromNodes IsEndSwitchNode " << aNode->IsEndSwitchNode() << endl ;
+ for ( i = 0 ; i < aNode->LinkedNodesSize() ; i++ ) {
+ cdebug << " LinkedNode" << i << ". " << aNode->LinkedNodes( i ) << " "
+ << aNode->LinkedNodes( i )->Name() << endl ;
+ }
+ if ( !aNode->IsEndLoopNode() ) { // The LoopNode is already deleted
+ for ( i = 0 ; i < aNode->LinkedFromNodesSize() ; i++ ) {
+ cdebug << " LinkedFromNode" << i << ". " << aNode->LinkedFromNodes( i ) << " "
+ << aNode->LinkedFromNodes( i )->Name() << endl ;
+ }
+ }
+ if ( !aNode->IsEndSwitchNode() ) {
+ if ( aNode->GetNodeInPortsSize() ) {
+ for ( i = aNode->GetNodeInPortsSize()-1 ; i >= 0 ; i-- ) {
+ GraphBase::InPort * anInPort = aNode->GetChangeNodeInPort( i ) ;
+ cdebug << "InPort" << i << ". " << aNodeName << "( " << anInPort->PortName() << ") "
+ << anInPort->PortStatus() << " <-- " ;
+ GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
+ if ( anOutPort && !( aNode->IsEndLoopNode() && anInPort->IsLoop() ) ) {
+ cdebug << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") " << anOutPort->PortStatus() ;
+ }
+ cdebug << endl ;
+ if ( !anInPort->IsNotConnected() ) {
+ RetVal = true ;
+ if ( anOutPort->IsDataConnected() || anOutPort->IsExternConnected() ) {
+ cdebug << " Data/Extern" << endl ;
+ }
+ else {
+ GraphBase::ComputingNode * FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
+ cdebug << "FromNode " << FromNode->Name() << " LinkedNodesSize "
+ << FromNode->LinkedNodesSize() << " and " << aNode->Name()
+ << " LinkedFromNodesSize " << aNode->LinkedFromNodesSize() << endl ;
+ // asv : 04.11.04 : IsGOTO -> IsOneOfGOTO, I believe that it fixes the bug 7120.
+// JR 05.01.05 : IsOneOfGOTO is not ok : I shall check the bug 7120 with IsGOTONode
+// if ( !FromNode->IsOneOfGOTONodes() ) {
+// if ( !FromNode->IsGOTONode() ) {
+ if ( !FromNode->IsGOTONode() &&
+ !( FromNode->IsEndLoopNode() && anInPort->IsLoop() ) ) {
+ if ( anInPort->IsDataStream() ) {
+ RetVal = FromNode->RemoveStreamLinkedNode( aNode ) ;
+ }
+ else {
+ RetVal = FromNode->RemoveLinkedNode( aNode ) ;
+ }
+ if ( !RetVal ) {
+ cdebug << "anOutPort->RemoveLinkedNode Error RetVal " << RetVal << endl ;
+ break ;
+ }
+ }
+ }
+ RetVal = anOutPort->RemoveInPort( anInPort ) ;
+ if ( !RetVal ) {
+ cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
+ break ;
+ }
+ }
else {
- GraphBase::ComputingNode * FromNode = GetChangeGraphNode( anOutPort->NodeName() ) ;
- // asv : 04.11.04 : IsGOTO -> IsOneOfGOTO, I believe that it fixes the bug 7120.
- if ( !FromNode->IsOneOfGOTONodes() ) {
- if ( anInPort->IsDataStream() ) {
- RetVal = FromNode->RemoveStreamLinkedNode( aNode ) ;
+ RetVal = true ;
+ }
+ }
+ }
+ else {
+ RetVal = true ;
+ }
+ }
+ else {
+// Special case of EndSwitchNodes : each Input port must be multi-connected.
+// There is one link for each branch of the switch
+// But in GraphBase::InPort there is only one field GraphBase::OutPort *
+// At execution time there is no problem because only one branch of the switch
+// may be executed and the Executor set the right OutPort in the field
+// GraphBase::OutPort * of each InPort of the EndSwitchNode
+// But here we must remove that node EndSwitch from the LinkedNodes field of
+// terminal nodes of all branches.
+// And also in the OutPorts of that terminal nodes of branches we must remove
+// references to InPorts of the EndSwitchNode.
+
+// Explore LinkedFromnodes of the EndSwitchNode :
+ for ( i = aNode->LinkedFromNodesSize() - 1 ; i >= 0 ; i-- ) {
+ GraphBase::ComputingNode * aLinkedFromNode = (GraphBase::ComputingNode * ) aNode->LinkedFromNodes( i ) ;
+ cdebug << aLinkedFromNode->Name() << " linked to " << aNode->Name() << endl ;
+ int j ;
+ for ( j = aLinkedFromNode->GetNodeOutPortsSize() - 1 ; j >= 0 ; j-- ) {
+ GraphBase::OutPort * anOutPort = aLinkedFromNode->GetChangeNodeOutPort( j ) ;
+ cdebug << "OutPort" << j << ". Remove " << anOutPort->InPortsSize()
+ << " InPortsof OutPort : " << anOutPort->NodeName() << "( "
+ << anOutPort->PortName() << ") "
+ << anOutPort->PortStatus() << " :" << endl ;
+ int k ;
+ for ( k = anOutPort->InPortsSize() - 1 ; k >= 0 ; k-- ) {
+ GraphBase::InPort * anInPort = anOutPort->ChangeInPorts( k ) ;
+ if ( strcmp( anInPort->NodeName() , aNode->Name() ) == NULL ) {
+// InPort of the EndSwitchNode
+ cdebug << " to InPort" << j << ". " << anInPort->NodeName() << "( "
+ << anInPort->PortName() << ") "
+ << anInPort->PortStatus() << endl ;
+ anInPort->RemoveOutPort() ;
+ if ( anOutPort->IsDataStream() ) {
+ aLinkedFromNode->RemoveStreamLinkedNode( aNode ) ;
}
else {
- RetVal = FromNode->RemoveLinkedNode( aNode ) ;
+// false ==> No error for aNode->LinkedFromNode()
+ RetVal = aLinkedFromNode->RemoveLinkedNode( aNode , false ) ;
+ if ( !RetVal ) {
+ cdebug << "aLinkedFromNode->RemoveLinkedNode Error RetVal " << RetVal << endl ;
+ break ;
+ }
}
+// Remove the InPort of the EndSwitchNode from that OutPort
+ RetVal = anOutPort->RemoveInPort( anInPort ) ;
if ( !RetVal ) {
- cdebug << "anOutPort->RemoveLinkedNode Error RetVal " << RetVal << endl ;
+ cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
break ;
}
}
}
- RetVal = anOutPort->RemoveInPort( anInPort ) ;
- if ( !RetVal ) {
- cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
- break ;
- }
- }
- else {
- RetVal = true ;
- }
+ }
}
}
- else {
- RetVal = true ;
- }
+
if ( RetVal ) {
for ( i = aNode->GetNodeOutPortsSize() - 1 ; i >= 0 ; i-- ) {
GraphBase::OutPort * anOutPort = aNode->GetChangeNodeOutPort( i ) ;
cdebug << "anOutPort->RemoveLinkedNode Error RetVal " << RetVal << endl ;
break ;
}
- RetVal = anOutPort->RemoveInPort( anOutPort->ChangeInPorts( j ) ) ;
+ RetVal = anOutPort->RemoveInPort( anInPort ) ;
if ( !RetVal ) {
cdebug << "anOutPort->RemoveInPort( anInPort ) Error RetVal " << RetVal << endl ;
break ;
}
}
}
- if ( RetVal ) {
+ cdebug << "Graph::RemoveNode " << aNode->Name() << " : " << aNode->GetNodeInPortsSize()
+ << " InPorts " << aNode->GetNodeOutPortsSize() << " OutPorts "
+ << aNode->LinkedNodesSize() << " LinkedNodes " << aNode->LinkedFromNodesSize()
+ << " LinkedFromNodes " << endl ;
+ for ( i = 0 ; i < aNode->LinkedNodesSize() ; i++ ) {
+ cdebug << " LinkedNode" << i << ". " << aNode->LinkedNodes( i ) << " "
+ << aNode->LinkedNodes( i )->Name() << endl ;
+ }
+ for ( i = 0 ; i < aNode->LinkedFromNodesSize() ; i++ ) {
+ cdebug << " LinkedFromNode" << i << ". " << aNode->LinkedFromNodes( i ) << " "
+ << aNode->LinkedFromNodes( i )->Name() << endl ;
+ }
+// Delete of aNode from the Graph :
+// The LoopNode is needed by the delete of the EndLoopNode. So the LoopNode will be deleted
+// when the EndLoopNode is deleted. It is the same for SwitchNode & EndSwitchNode
+ if ( RetVal && !aNode->IsLoopNode() && !aNode->IsSwitchNode() ) {
+ GraphBase::InLineNode * theCoupledNode = NULL ;
+ char * theCoupledNodeName = NULL ;
+ int CoupledIndex = -1 ;
+ if ( aNode->IsEndLoopNode() || aNode->IsEndSwitchNode() ) {
+ theCoupledNode = ((GraphBase::GOTONode * ) aNode)->CoupledNode() ;
+ theCoupledNodeName = ((GraphBase::GOTONode * ) aNode)->CoupledNodeName() ;
+ CoupledIndex = GetGraphNodeIndex( theCoupledNode->Name() ) ;
+ }
delete aNode ;
_GraphNodesSize -= 1 ;
for ( i = index ; i < _GraphNodesSize ; i++ ) {
- SetGraphNodeIndex( _GraphNodes[ i+1 ]->Name() , i ) ;
_GraphNodes[ i ] = _GraphNodes[ i+1 ] ;
+ SetGraphNodeIndex( _GraphNodes[ i ]->Name() , i ) ;
}
_GraphNodes.resize( _GraphNodesSize+1 ) ;
_MapOfGraphNodes.erase( aNodeName ) ;
+// Delete of the LoopNode of that EndLoopNode or of the SwitchNode of that EndSwitchNode :
+ if ( theCoupledNode ) {
+ delete theCoupledNode ;
+ _GraphNodesSize -= 1 ;
+ for ( i = CoupledIndex ; i < _GraphNodesSize ; i++ ) {
+ _GraphNodes[ i ] = _GraphNodes[ i+1 ] ;
+ SetGraphNodeIndex( _GraphNodes[ i ]->Name() , i ) ;
+ }
+ _GraphNodes.resize( _GraphNodesSize+1 ) ;
+ _MapOfGraphNodes.erase( theCoupledNodeName ) ;
+ }
RetVal = true ;
}
}
GraphBase::InPort *toPort = NULL ;
if ( fromNode ) {
- fromPort = fromNode->GetChangeOutPort( FromServiceParameterName ) ;
+ // asv : 29.12.04 : as I understand, replacement of "InitLoop" by "DoLoop" was
+ // done by JR in order to keep old graphs and batch test scripts working after change
+ // of special Loop's port name from "InitLoop" to "DoLoop". I suppose, it is not
+ // needed, all old graphs and tests must be changed to use "DoLoop" name for addressing
+ // this port.. It we don't do it, ANY port with "InitLoop" name will be replaced by "DoLoop"
+ // and it can cause unexpected bugs in future... So I comment out the replacement code.
+ //if ( strcmp( FromServiceParameterName , "InitLoop" ) ) {
+//JR 12.01.05 : Yes the test is not good ; now I test that PortName only in LoopNodes ==>
+// + old graphs will runs normally (it is not possible to ask CEA to edit their graphs)
+// + in old graphs "InitLoop" and "DoLoop" were reserved parameter names (but not controlled)
+// + in new graphs, I have added a control at port creation of that names : they are refused
+ if ( !(fromNode->IsLoopNode() && strcmp( FromServiceParameterName , "InitLoop" ) == 0 ) ) {
+ fromPort = fromNode->GetChangeOutPort( FromServiceParameterName ) ;
+ }
+ else {
+ fromPort = fromNode->GetChangeOutPort( "DoLoop" ) ;
+ }
if ( !fromPort ) {
cdebug << "ERROR AddLink fromPort " << FromServiceParameterName << " FromNode("
<< FromNodeName << ") not found." << endl ;
cdebug << "ERROR AddLink FromNode " << FromNodeName << " not found." << endl ;
}
if ( toNode ) {
- toPort = toNode->GetChangeInPort( ToServiceParameterName ) ;
+ // see comment above
+// if ( strcmp( ToServiceParameterName , "InitLoop" ) ) {
+ if ( !(toNode->IsLoopNode() && strcmp( ToServiceParameterName , "InitLoop" ) == 0 ) ) {
+ toPort = toNode->GetChangeInPort( ToServiceParameterName ) ;
+ }
+ else {
+ toPort = toNode->GetChangeInPort( "DoLoop" ) ;
+ }
if ( !toPort ) {
cdebug << "ERROR AddLink toPort " << ToServiceParameterName << " ToNode("
<< ToNodeName << ") not found." << endl ;
toPort->Kind( SUPERV::EndSwitchParameter ) ;
}
}
+// JR 12.01.2005 : an OutPort of a SwitchNode connected to a Gate can be connected only to Gate
+ else if ( fromNode->IsSwitchNode() && fromPort->IsSwitch() && !toPort->IsGate() ) {
+ cdebug << "toPort->AddLink Error( fromPort->IsSwitch() && !toPort->IsGate())." << endl ;
+ cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
+ return false ;
+ }
else if ( !fromPort->AddInPort( toPort ) ) { // --> MapOfInports in the OutPort
cdebug << "!fromPort->AddLink Error." << endl ;
cdebug_out << "GraphBase::Graph::AddLink 0" << endl;
if ( anInPort && ( anInPort->IsPortConnected() ||
anInPort->IsDataConnected() ||
anInPort->IsExternConnected() ) ) {
- GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
- RetVal = anOutPort->RemoveInPort( anInPort ) ; // ==> :
-// anInPort->RemoveOutPort() ;
- const char * FromNodeName = anOutPort->NodeName() ;
+// JR 13.01.2005 : Bug if it is a link to an EndSwitchNode. The OutPort may be an other one !!!
GraphBase::ComputingNode * fromNode = GetChangeGraphNode( FromNodeName ) ;
+ GraphBase::OutPort * anOutPort = NULL ;
+ if ( toNode->IsEndSwitchNode() ) {
+ anOutPort = fromNode->GetChangeOutPort( FromServiceParameterName ) ;
+ RetVal = anOutPort->RemoveInPort( anInPort ) ;
+ }
+ else {
+ anOutPort = anInPort->GetOutPort() ;
+ RetVal = anOutPort->RemoveInPort( anInPort ) ;
+ }
+// anInPort->RemoveOutPort() ; // Already done in RemoveInPort
+// const char * FromNodeName = anOutPort->NodeName() ;
if ( RetVal ) {
if ( fromNode ) {
if ( anInPort->IsDataStream() ) {
if ( fromNode->IsSwitchNode() && !anOutPort->IsGate() && !toNode->IsEndSwitchNode() ) {
anOutPort->Kind( SUPERV::InLineParameter ) ;
}
+// JR 13.01.2005 : Bug if it is a link to an EndSwitchNode. The InPort may be linked !!!
+ if ( toNode->IsEndSwitchNode() ) {
+ int i ;
+ int done = false ;
+ for ( i = 0 ; i < toNode->LinkedFromNodesSize() ; i++ ) {
+ GraphBase::StreamNode * fromNode = toNode->LinkedFromNodes( i ) ;
+ int j ;
+ for ( j = 0 ; j < fromNode->GetNodeOutPortsSize() ; j++ ) {
+ GraphBase::OutPort * fromOutPort = fromNode->GetChangeNodeOutPort( j ) ;
+ int k ;
+ for ( k = 0 ; k < fromOutPort->InPortsSize() ; k++ ) {
+ if ( strcmp( toNode->Name() , fromOutPort->InPorts( k )->NodeName() ) == 0 ) {
+// Restore an OutPort in the InPort
+ anInPort->ChangeOutPort( fromOutPort ) ;
+ cdebug << "Graph::RemoveLink reestablish " << fromOutPort->NodeName() << "( "
+ << fromOutPort->PortName() << " ) in the InPort of EndSwitch : "
+ << toNode->Name() << "( " << anInPort->PortName() << " )" << endl;
+ done = true ;
+ break ;
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ if ( done ) {
+ break ;
+ }
+ }
+ }
}
}
}
return true ;
}
+bool GraphBase::Graph::ValidLoops() const {
+ cdebug_in << "GraphBase::Graph::ValidLoops" << endl;
+
+ int i ;
+ GraphBase::ComputingNode * aNode ;
+ for ( i = 0 ; i < GraphNodesSize() ; i++ ) {
+ aNode = GraphNodes( i ) ;
+ if ( aNode->IsLoopNode() ) {
+ GraphBase::LoopNode * aLoopNode = (GraphBase::LoopNode * ) aNode ;
+ GraphBase::EndOfLoopNode * anEndLoopNode ;
+ anEndLoopNode = (GraphBase::EndOfLoopNode * ) aLoopNode->CoupledNode() ;
+ if ( !aLoopNode->CheckLoop( aLoopNode , anEndLoopNode ) ) {
+ cdebug_out << "GraphBase::Graph::ValidLoops false aLoopNode " << aLoopNode->Name()
+ << endl;
+ return false ;
+ }
+ else if ( !anEndLoopNode->CheckEndLoop( aLoopNode , anEndLoopNode ) ) {
+ cdebug_out << "GraphBase::Graph::ValidLoops false anEndLoopNode " << anEndLoopNode->Name()
+ << endl;
+ return false ;
+ }
+ }
+ }
+ cdebug_out << "GraphBase::Graph::ValidLoops true" << endl;
+ return true ;
+}
+
// Controle de la coherence des noeuds de calcul
// Enregistrement dans la liste des noeuds "tete" de graphe
anOutPort = anInPort->GetOutPort() ;
if ( anOutPort ) {
aRet = anOutPort->Value() ;
- cdebug << "OutPort value " << anOutPort->NodeName() << "("
+ cdebug << "Graph::PortInData OutPort value " << anOutPort->NodeName() << "("
<< anOutPort->PortName() << ") --> InPort " << anInPort->NodeName()
<< "(" << anInPort->PortName() << ") " << anInPort->PortStatus() << endl ;
}
else {
- cdebug << "GraphBase::Graph::PortInData " << ToNodeName << " "
+ cdebug << "Graph::PortInData GraphBase::Graph::PortInData " << ToNodeName << " "
<< ToServiceParameterName << " ERROR no OutPort" << endl ;
}
}
if ( CORBA::is_nil( objComponent ) ) {
cdebug_out << aThread
<< " StartComponent cannot FindOrLoad " << aComputerContainer
- << " " << ComponentName << endl;
+ << " " << ComponentName << " ERROR" << endl;
return 0 ;
}
else {
if ( CORBA::is_nil( myContainer ) ) {
cdebug_out << aThread
<< " GraphBase::Graph::StartComponent myContainer = LCC.FindContainer( '"
- << aComputerContainer << "' ) Container does not exist"
+ << aComputerContainer << "' ) Container does not exist ERROR"
<< endl ;
return 0 ;
}
}
- cdebug_out << aThread << " GraphBase::Graph::StartComponent" << endl;
+ cdebug_out << aThread << " GraphBase::Graph::StartComponent " << RetVal << endl;
return RetVal ;
}
void SetGraphNodeIndex( const char *name , const int index ) {
_MapOfGraphNodes[ name ] = index + 1 ;
cdebug << "SetGraphNodeIndex of " << name << " in _MapOfGraphNodes : "
- << index << " Node " << hex << (void *) _GraphNodes[ index ]
+ << index << " Node " << (void *) _GraphNodes[ index ]
<< " '" << _GraphNodes[ index ]->Name() << "'" << endl ;
} ;
void DelGraphNodeIndex( const char *name ) {
bool InLineServices() ;
bool Sort( int & SubStreamGraphsNumber ) ;
+ bool ValidLoops() const ;
bool ComputingNodes() const ;
bool LinkLoopNodes(bool & NewLink ) ;
bool DataServerNodes() const ;
f << "(undefined)" ;
}
+bool GraphBase::InPort::ChangeOutPort( OutPort * anOutPort ) {
+ if ( _OutPort ) {
+// cdebug << "InPort::ChangeOutPort OutPort of InPort " << NodeName() << "( "
+// << PortName() << " ) : " << _OutPort->NodeName() << "( "
+// << _OutPort->PortName() << " ) changed to " << anOutPort->NodeName()
+// << "( " << anOutPort->PortName() << " )" << endl ;
+// cout << "InPort::ChangeOutPort OutPort of InPort " << NodeName() << "( "
+// << PortName() << " ) : " << _OutPort->NodeName() << "( "
+// << _OutPort->PortName() << " ) changed to " << anOutPort->NodeName()
+// << "( " << anOutPort->PortName() << " )" << endl ;
+ }
+ if ( _InitialOutPort == NULL ) {
+ _InitialOutPort = _OutPort ;
+ }
+ _OutPort = anOutPort ;
+ return true ;
+}
+
bool GraphBase::InPort::RemoveOutPort() {
// Before to return the real status, callers should be checked ...
if ( _OutPort == NULL ) {
case SUPERV::StopState :
f << "StopState";
break;
- case SUPERV::ReRunState :
- f << "ReRunState";
- break;
- case SUPERV::ReStartState :
- f << "ReStartState";
- break;
default :
f << "SUPERV::GraphState_?";
break;
return false ;
_OutPort = anOutPort ;
return true ; } ;
- bool ChangeOutPort( OutPort * anOutPort ) {
- if ( _InitialOutPort == NULL ) {
- _InitialOutPort = _OutPort ;
- }
- _OutPort = anOutPort ;
- return true ; } ;
+ bool ChangeOutPort( OutPort * anOutPort ) ;
bool InitialOutPort() {
if ( _InitialOutPort ) {
_OutPort = _InitialOutPort ;
const bool WithOutGate = (aKind == SUPERV::DataFlowGraph) || (aKind == SUPERV::DataStreamGraph) ||
(aKind == SUPERV::ComputingNode) || (aKind == SUPERV::FactoryNode) ||
(aKind == SUPERV::InLineNode) || (aKind == SUPERV::GOTONode) ||
+ /* asv : 15.12.04 : adding out gate ports for Loop/EndLoop, too. p2.5, PAL7385*/
+ (aKind == SUPERV::LoopNode) || (aKind == SUPERV::EndLoopNode) ||
(aKind == SUPERV::SwitchNode) || (aKind == SUPERV::EndSwitchNode) ||
(aKind == SUPERV::MacroNode) ;
SUPERV::KindOfPort aPortKind = SUPERV::ServiceParameter ;
SALOME_ModuleCatalog::ServicesParameter anInLoopParameter ;
_NodeInPortsSize = _NodeInPortsSize + 1 ;
iVec += 1 ;
- char *aParametername = "InitLoop" ;
- if ( aKind == SUPERV::EndLoopNode ) {
- aParametername = "DoLoop" ;
- }
+// char *aParametername = "InitLoop" ;
+// if ( aKind == SUPERV::EndLoopNode ) {
+ char * aParametername = "DoLoop" ;
+// }
anInLoopParameter.Parametertype = CORBA::string_dup( "long" ) ;
anInLoopParameter.Parametername = CORBA::string_dup( aParametername ) ;
if ( _NodeInPortsSize > (int ) _NodeInPorts.size() ) {
_Name = NULL ;
_Kind = SUPERV::UnknownNode ;
_LinkedNodesSize = 0 ;
+ _LinkedFromNodesSize = 0 ;
_LinkedStreamNodesSize = 0 ;
_HeadNode = false ;
_LevelNumber = -1 ;
}
Kind( DataFlowkind ) ;
_LinkedNodesSize = 0 ;
+ _LinkedFromNodesSize = 0 ;
_LinkedStreamNodesSize = 0 ;
_HeadNode = false ;
_LevelNumber = -1 ;
cdebug << Name() << "->GraphBase::StreamNode::AddLinkedNode( " << ToNode->Name()
<< " ) LinkedNodesSize " << _LinkedNodesSize << " [ " << index
<< " ] _LinkedInPortsNumber " << _LinkedInPortsNumber[ index ] << endl ;
+
+ index = ToNode->GetLinkedFromNodeIndex( Name() ) ;
+ if ( index < 0 ) {
+ cdebug << ToNode->Name() << "<-GraphBase::StreamNode::AddLinkedFromNode( " << Name()
+ << " ) new LinkedFromNode " << endl ;
+ ToNode->_LinkedFromNodes.resize( ToNode->_LinkedFromNodesSize+1 ) ;
+ ToNode->_LinkedFromInPortsNumber.resize( ToNode->_LinkedFromNodesSize+1 ) ;
+ ToNode->_LinkedFromNodes[ ToNode->_LinkedFromNodesSize ] = this ;
+ ToNode->_LinkedFromInPortsNumber[ ToNode->_LinkedFromNodesSize ] = 1 ;
+ ToNode->SetLinkedFromNodeIndex( Name() , ToNode->_LinkedFromNodesSize ) ;
+ index = ToNode->_LinkedFromNodesSize ;
+ ToNode->_LinkedFromNodesSize++ ;
+ }
+ else {
+ cdebug << Name() << "->GraphBase::StreamNode::AddLinkedFromNode( " << ToNode->Name()
+ << " ) old LinkedFromNode " << ToNode->_LinkedFromNodes[index ]->Name() << endl ;
+ ToNode->_LinkedFromInPortsNumber[ index ] += 1 ;
+ }
+ cdebug << ToNode->Name() << "->GraphBase::StreamNode::AddLinkedFromNode( " << Name()
+ << " ) LinkedFromNodesSize " << ToNode->_LinkedFromNodesSize << " [ " << index
+ << " ] _LinkedFromInPortsNumber " << ToNode->_LinkedFromInPortsNumber[ index ] << endl ;
}
-bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode ) {
- int index = GetLinkedNodeIndex( ToNode->Name() ) ;
+bool GraphBase::StreamNode::RemoveLinkedNode( GraphBase::StreamNode * ToNode ,
+ bool DoLinkedFromNode ) {
+ cdebug_in << "StreamNode::RemoveLinkedNode between " << Name() << " LinkedNodesSize "
+ << LinkedNodesSize() << " and " << ToNode->Name() << " LinkedFromNodesSize "
+ << ToNode->LinkedFromNodesSize() << endl ;
+#if 1
+ map< string , int >::iterator aMapOfLinkedNodesIterator ;
+ int i = 0 ;
+ for ( aMapOfLinkedNodesIterator = _MapOfLinkedNodes.begin() ;
+ aMapOfLinkedNodesIterator != _MapOfLinkedNodes.end() ; aMapOfLinkedNodesIterator++ ) {
+ cdebug << "_MapOfLinkedNodes" << i++ << " of " << Name() << " : "
+ << aMapOfLinkedNodesIterator->first << " --> " << aMapOfLinkedNodesIterator->second
+ << endl ;
+ }
+#endif
+#if 1
+ map< string , int >::iterator aMapOfLinkedFromNodesIterator ;
+ int ifrom = 0 ;
+ for ( aMapOfLinkedFromNodesIterator = ToNode->_MapOfLinkedFromNodes.begin() ;
+ aMapOfLinkedFromNodesIterator != ToNode->_MapOfLinkedFromNodes.end() ; aMapOfLinkedFromNodesIterator++ ) {
+ cdebug << "_MapOfLinkedFromNodes" << ifrom++ << " of " << ToNode->Name() << " : "
+ << aMapOfLinkedFromNodesIterator->first << " --> "
+ << aMapOfLinkedFromNodesIterator->second << endl ;
+ }
+#endif
+
+ int index = -1 ;
+ if ( _LinkedNodesSize ) {
+ index = GetLinkedNodeIndex( ToNode->Name() ) ;
+ }
if ( index >= 0 ) {
- cdebug << "GraphBase::StreamNode::RemoveLinkedNode( to " << ToNode->Name() << " from "
+ cdebug << "GraphBase::StreamNode::RemoveLinkedNode to " << ToNode->Name() << " from "
<< Name() << " index : " << index << " LinkedInPortsNumber "
<< _LinkedInPortsNumber[ index ] << " - 1" << endl ;
_LinkedInPortsNumber[ index ] -= 1 ;
}
}
else {
- cdebug << "StreamNode::RemoveLinkedNode index Error " << Name() << " --> " << ToNode->Name() << " : " << index
- << " _LinkedNodesSize " << _LinkedNodesSize << endl ;
-#if 1
- map< string , int >::iterator aMapOfLinkedNodesIterator ;
- int i = 0 ;
- for ( aMapOfLinkedNodesIterator = _MapOfLinkedNodes.begin() ;
- aMapOfLinkedNodesIterator != _MapOfLinkedNodes.end() ; aMapOfLinkedNodesIterator++ ) {
- cdebug << "_MapOfLinkedNodes" << i++ << " " << aMapOfLinkedNodesIterator->first << " --> "
- << aMapOfLinkedNodesIterator->second << endl ;
+ cdebug << "StreamNode::RemoveLinkedNode index Error " << ToNode->Name() << " <-- " << Name() << " : " << index
+ << " _LinkedNodesSize " << ToNode->_LinkedNodesSize << endl ;
+ }
+ int fromindex = 0 ;
+ fromindex = -1 ;
+ if ( ToNode->_LinkedFromNodesSize ) {
+ fromindex = ToNode->GetLinkedFromNodeIndex( Name() ) ;
+ }
+ if ( fromindex >= 0 ) {
+ cdebug << "GraphBase::StreamNode::RemoveLinkedFromNode from " << ToNode->Name() << " to "
+ << Name() << " index : " << fromindex << " LinkedFromInPortsNumber "
+ << ToNode->_LinkedFromInPortsNumber[ fromindex ] << " - 1" << endl ;
+ ToNode->_LinkedFromInPortsNumber[ fromindex ] -= 1 ;
+ if ( ToNode->_LinkedFromInPortsNumber[ fromindex ] == 0 ) {
+ ToNode->_LinkedFromNodesSize-- ;
+ cdebug << "GraphBase::StreamNode::RemoveLinkedFromNode new LinkedFromNodesSize "
+ << ToNode->_LinkedFromNodesSize << " " << Name() << " removed from "
+ << " linkedFromnodes of " << ToNode->Name() << endl ;
+ int i ;
+ for ( i = 0 ; i < ToNode->_LinkedFromNodesSize ; i++ ) {
+ if ( i >= fromindex ) {
+ ToNode->_LinkedFromNodes[ i ] = ToNode->_LinkedFromNodes[ i+1 ] ;
+ ToNode->_LinkedFromInPortsNumber[ i ] = ToNode->_LinkedFromInPortsNumber[ i+1 ] ;
+ ToNode->SetLinkedFromNodeIndex( ToNode->_LinkedFromNodes[ i ]->Name() , i ) ;
+ }
+ cdebug << "StreamNode::RemoveLinkedFromNode" << i << " "
+ << ToNode->_LinkedFromNodes[ i ]->Name() << endl ;
+ }
+ ToNode->DelLinkedFromNodeIndex( Name() ) ;
+ ToNode->_LinkedFromNodes.resize( ToNode->_LinkedFromNodesSize+1 ) ;
+ ToNode->_LinkedFromInPortsNumber.resize( ToNode->_LinkedFromNodesSize+1 ) ;
}
+ }
+ else if ( DoLinkedFromNode ) {
+ cdebug << "StreamNode::RemoveLinkedFromNode index Error " << ToNode->Name() << " --> "
+ << Name() << " : " << fromindex
+ << " _LinkedFromNodesSize " << ToNode->_LinkedFromNodesSize << endl ;
+ }
+ else {
+ cdebug << "StreamNode::RemoveLinkedFromNode index " << ToNode->Name() << " --> " << Name()
+ << " : " << fromindex
+ << " _LinkedFromNodesSize " << ToNode->_LinkedFromNodesSize << endl ;
+ fromindex = 0 ; // No error in EndSwitchNodes
+ }
+
+#if 1
+ map< string , int >::iterator aMapOfLinkedNodesIterator1 ;
+ int ii = 0 ;
+ for ( aMapOfLinkedNodesIterator1 = _MapOfLinkedNodes.begin() ;
+ aMapOfLinkedNodesIterator1 != _MapOfLinkedNodes.end() ; aMapOfLinkedNodesIterator1++ ) {
+ cdebug << "_MapOfLinkedNodes" << ii++ << " of " << Name() << " : "
+ << aMapOfLinkedNodesIterator1->first << " --> " << aMapOfLinkedNodesIterator1->second
+ << " " << _LinkedNodes[ aMapOfLinkedNodesIterator1->second - 1 ]->Name() << endl ;
+ }
#endif
+#if 1
+ map< string , int >::iterator aMapOfLinkedFromNodesIterator1 ;
+ int iifrom = 0 ;
+ for ( aMapOfLinkedFromNodesIterator1 = ToNode->_MapOfLinkedFromNodes.begin() ;
+ aMapOfLinkedFromNodesIterator1 != ToNode->_MapOfLinkedFromNodes.end() ; aMapOfLinkedFromNodesIterator1++ ) {
+ cdebug << "_MapOfLinkedFromNodes" << iifrom++ << " of " << ToNode->Name() << " : "
+ << aMapOfLinkedFromNodesIterator1->first << " --> "
+ << aMapOfLinkedFromNodesIterator1->second << " "
+ << ToNode->_LinkedFromNodes[ aMapOfLinkedFromNodesIterator1->second - 1 ]->Name()
+ << endl ;
}
- return (index >= 0 ) ;
+#endif
+ cdebug_out << "StreamNode::RemoveLinkedNode between " << Name() << " and " << ToNode->Name()
+ << " " << (index >= 0) << " " << (fromindex >= 0) << endl ;
+ return (index >= 0 ) && (fromindex >= 0 ) ;
}
void GraphBase::StreamNode::ReNameLinkedNode( const char* OldNodeName ,
- const char* NewNodeName ) {
- cdebug_in << "GraphBase::StreamNode::ReNameLink (" << OldNodeName << " , "
+ const char* NewNodeName ) {
+ cdebug_in << Name() << "->GraphBase::StreamNode::ReNameLinkedNode (" << OldNodeName << " , "
<< NewNodeName << ")" << endl;
int index = GetLinkedNodeIndex( OldNodeName ) ;
if ( index >= 0 ) {
DelLinkedNodeIndex( OldNodeName ) ;
SetLinkedNodeIndex( NewNodeName , index ) ;
}
- cdebug_out << "GraphBase::StreamNode::ReNameLink" << endl ;
+ else {
+ cdebug << "GraphBase::StreamNode::ReNameLinkedNode ERROR " << OldNodeName << " not found in "
+ << Name() << endl ;
+ }
+ cdebug_out << Name() << "->GraphBase::StreamNode::ReNameLinkedNode" << endl ;
+}
+
+void GraphBase::StreamNode::ReNameLinkedFromNode( const char* OldNodeName ,
+ const char* NewNodeName ) {
+ cdebug_in << Name() << "->GraphBase::StreamNode::ReNameLinkedFromNode (" << OldNodeName << " , "
+ << NewNodeName << ")" << endl;
+ int index = GetLinkedFromNodeIndex( OldNodeName ) ;
+ if ( index >= 0 ) {
+// _MapOfLinkedFromNodes.erase( OldNodeName ) ;
+ DelLinkedFromNodeIndex( OldNodeName ) ;
+ SetLinkedFromNodeIndex( NewNodeName , index ) ;
+ }
+ else {
+ cdebug << Name() << "->GraphBase::StreamNode::ReNameLinkedFromNode ERROR " << OldNodeName
+ << " not found in " << Name() << endl ;
+ }
+ cdebug_out << Name() << "->GraphBase::StreamNode::ReNameLinkedFromNode" << endl ;
}
void GraphBase::StreamNode::AddStreamLinkedNode( GraphBase::StreamNode * ToNode ) {
char * _Name ;
SUPERV::KindOfNode _Kind ;
+// _LinkedNodes are the nodes with link(s) from OutPort(s) of this node
// Nodes with LinkedInPortsNumber InPort(s) linked to Outport(s) of this node :
map< string , int > _MapOfLinkedNodes ;
int _LinkedNodesSize ;
vector<StreamNode * > _LinkedNodes ;
vector<int > _LinkedInPortsNumber ;
+// _LinkedFromNodes are the nodes with link(s) to InPort(s) of this node
+ map< string , int > _MapOfLinkedFromNodes ;
+ int _LinkedFromNodesSize ;
+ vector<StreamNode * > _LinkedFromNodes ;
+ vector<int > _LinkedFromInPortsNumber ;
+
// Nodes with InStreamPort(s) linked to OutStreamport(s) of this node :
// NodeName <--> index of that linked node in _LinkedNodes
map< string , int > _MapOfLinkedStreamNodes ;
return index ; } ;
void SetLinkedNodeIndex( const char * name , const int index ) {
_MapOfLinkedNodes[ name ] = index +1 ;
- cdebug << "SetLinkedNodeIndex of " << name << " in _MapOfLinkedNodes : "
- << index << " Node " << hex << (void *) _LinkedNodes[ index ]
+ cdebug << "SetLinkedNodeIndex of " << name << " in _MapOfLinkedNodes : index "
+ << index << " of " << Name() << " Node " << hex << (void *) _LinkedNodes[ index ]
<< dec << " '" << _LinkedNodes[ index ]->Name() << "'"
<< " _MapOfLinkedNodes " << _MapOfLinkedNodes[ name ] - 1
<< endl ;
StreamNode * LinkedNodes( int i ) const { return _LinkedNodes[ i ] ; } ;
+ int GetLinkedFromNodeIndex( const char * name ) {
+ int index = _MapOfLinkedFromNodes[ name ] -1 ;
+ if ( index >= 0 ) {
+ cdebug << "GetLinkedFromNodeIndex of " << name
+ << " in _MapOfLinkedFromNodes : "
+ << index << " FromNode " << hex << (void *) _LinkedFromNodes[ index ]
+ << dec << " '" << _LinkedFromNodes[ index ]->Name() << "'"
+ << endl ;
+ }
+ return index ; } ;
+ void SetLinkedFromNodeIndex( const char * name , const int index ) {
+ _MapOfLinkedFromNodes[ name ] = index +1 ;
+ cdebug << "SetLinkedFromNodeIndex of " << name << " in _MapOfLinkedFromNodes : index "
+ << index << " of " << Name() << " FromNode " << hex
+ << (void *) _LinkedFromNodes[ index ]
+ << dec << " '" << _LinkedFromNodes[ index ]->Name() << "'"
+ << " _MapOfLinkedFromNodes " << _MapOfLinkedFromNodes[ name ] - 1
+ << endl ;
+ } ;
+ void DelLinkedFromNodeIndex( const char * name ) {
+ _MapOfLinkedFromNodes.erase( name ) ; } ;
+
+ int LinkedFromNodesSize() const { return _LinkedFromNodesSize ; } ;
+
+ const int LinkedFromInPortsNumber( int i ) const { return _LinkedFromInPortsNumber[ i ] ; } ;
+
+ StreamNode * LinkedFromNodes( int i ) const { return _LinkedFromNodes[ i ] ; } ;
+
int GetLinkedStreamNodeIndex( const char * name ) {
int index = _MapOfLinkedStreamNodes[ name ] -1 ;
if ( index >= 0 ) {
void GraphOfNode( GraphBase::Graph * aGraph ) {
_GraphOfNode = aGraph ; } ;
+ GraphBase::Graph * GraphOfNode() const {
+ return _GraphOfNode ; } ;
GraphBase::Graph * GraphOfNode() {
return _GraphOfNode ; } ;
void SubStreamGraph( int SubStreamGraphNumber ) {
_SubStreamGraphNumber = SubStreamGraphNumber ; } ;
- void AddLinkedNode( StreamNode * aNode ) ;
- bool RemoveLinkedNode( StreamNode * aNode ) ;
+ void AddLinkedNode( StreamNode * ToNode ) ;
+ bool RemoveLinkedNode( StreamNode * ToNode ,
+ bool DoLinkedFromNode = true ) ;
void ReNameLinkedNode( const char* OldNodeName ,
const char* NewNodeName ) ;
+ void ReNameLinkedFromNode( const char* OldNodeName ,
+ const char* NewNodeName ) ;
- void AddStreamLinkedNode( StreamNode * aNode ) ;
- bool RemoveStreamLinkedNode( StreamNode * aNode ) ;
+ void AddStreamLinkedNode( StreamNode * ToNode ) ;
+ bool RemoveStreamLinkedNode( StreamNode * ToNode ) ;
void ReNameStreamLinkedNode( const char* OldNodeName ,
const char* NewNodeName ) ;
bool IsValid() ;
bool IsExecutable() ;
- void Executing() ; // asv : removed a bool parameter, use Editing() to set _Executing = false;
+ void Executing() ; // asv : removed a bool parameter, use Editing() to set _Executing = false
bool IsExecuting() ;
-
void Editing() ;
bool IsEditing() ;
-
bool UnValid() ;
void EditedAfterExecution(bool EditedAfterExecution ) ;
bool EditedAfterExecution() ;
}
inline void GraphEditor::DataFlow::Executing() {
- cdebug << "Executing() : set _Executing = true " << endl ;
+ cdebug << "Editor::DataFlow::Executing() : set _Executing = true " << endl ;
_Executing = true ;
}
return _Executing ;
}
+
inline void GraphEditor::DataFlow::Editing() {
- cdebug << "Editing() : set _Executing = false " << endl ;
+ cdebug << "Editor::DataFlow::Editing() : set _Executing = false " << endl ;
_Executing = false ;
}
IsValid() ;
test = SavePY( f , true );
f << endl << Graph()->Name() << " = Def" << Graph()->Name() << "()" << endl ;
- cdebug_out << "GraphEditor::OutNode::SavePy" << endl;
+ cdebug_out << "GraphEditor::OutNode::SavePy " << test << endl;
return test;
}
if ( Graph()->IsDataStreamNode() ) {
StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
}
+ if ( !Graph()->ValidLoops() ) {
+ cdebug_out << "This DataFlow have not valid Loops." << endl ;
+ return false ;
+ }
// CreateService() ;
bool GraphEditor::OutNode::Executable() {
cdebug_in << "GraphEditor::OutNode::Executable" << endl;
bool NewLink ;
+// LinkLoopNodes manage input values of LoopNodes and EndLoopNodes
if ( Graph()->LinkLoopNodes( NewLink ) ) {
if ( NewLink ) {
_Valid = false ;
StreamGraph()->CreateStreamTopology( "/tmp/" ) ;
}
+ // asv : 13.12.04 : introducing check for compatibility of linked ports' types.
+ if ( !IsLinksCompatible() ) {
+ _Executable = false;
+ }
+
cdebug_out << "GraphEditor::OutNode::Executable" << endl;
return _Executable ;
}
return true ;
}
+/** Iterate through ALL links (OutPort-InPort pairs) and check if their types are
+ * compatible - call GraphEditor::DataFlow::IsCompatible(type1, type2).
+ * Returns true if all are compatible.
+ */
+bool GraphEditor::OutNode::IsLinksCompatible() {
+ const GraphBase::ListOfSLinks * Links = Graph()->GetLinks( true ) ;
+ bool b = true;
+ for ( int i = 0 ; i < (int ) Links->size() && b ; i++ ) {
+ GraphBase::SLink aLink = (*Links)[i];
+ GraphBase::ComputingNode* anOutNode = Graph()->GetChangeGraphNode( aLink.FromNodeName.c_str() );
+ GraphBase::ComputingNode* anInNode = Graph()->GetChangeGraphNode( aLink.ToNodeName.c_str() );
+ const GraphBase::OutPort* anOutPort = anOutNode->GetOutPort( aLink.FromServiceParameterName.c_str() );
+ const GraphBase::InPort* anInPort = anInNode->GetInPort( aLink.ToServiceParameterName.c_str() );
+ b = IsCompatible( anOutPort->PortType(), anInPort->PortType() );
+ cdebug << "GraphEditor::OutNode::IsLinksCompatible: "<<aLink.FromNodeName << "("<<aLink.FromServiceParameterName
+ <<") --> "<<aLink.ToNodeName<<"("<<aLink.ToServiceParameterName<<") = " << (b ? "OK" : "Not compatible (ERROR)") << endl;
+ if ( !b )
+ MESSAGE( "Graph structure ERROR: type of port \""<<aLink.FromServiceParameterName<<"\" of node \""
+ <<aLink.FromNodeName<<"\" is not compatible with type of linked port \""
+ <<aLink.ToServiceParameterName<<"\" of node \""<<aLink.ToNodeName<<"\"" );
+ }
+ return b;
+}
+
+static const char* gSimpleTypes[] =
+ {"boolean", "char", "short", "int", "long", "float", "double"};
+bool isSimpleType( string type ) {
+ for ( int i = 0; i < 7; i++ )
+ if ( type == gSimpleTypes[i] )
+ return true;
+ return false;
+}
+/**Returns true if an out-port of type "OutPortType" can be bound with in-port of type "InPortType".
+ * Types: {"string", "boolean", "char", "short", "int", "long", "float", "double", "objref"};
+ * Currently considered compatible ALL types except for objref - they must match exactly
+ */
+bool GraphEditor::OutNode::IsCompatible( const char* OutPortType, const char* InPortType ) const {
+ bool ret = true;
+ string t1 = OutPortType;
+ string t2 = InPortType;
+ // if ANY is a string - the link is OK
+ if ( t1 == "string" || t2 == "string" )
+ ret = true;
+
+ // the next check prohibits linkage of "objref" to any simple type (int, char, etc.)
+ // it is still possible to link "objref" to some UNKNOWN type (probably objref, too,
+ // which interface name came from Cataloge
+ else if ( ( t1 == "objref" && isSimpleType( t2 ) ) ||
+ ( t2 == "objref" && isSimpleType( t1 ) ) )
+ ret = false;
+ return ret;
+}
ostream & operator<< (ostream & f,const GraphEditor::OutNode & G) {
f << (GraphBase::ComputingNode ) *(G.Graph()) ;
bool IsNotExecutable() const {
return !_Executable ; } ;
+ // iterate through ALL links (OutPort-InPort pairs) and check if their types are
+ // compatible - IsCompatible(type1, type2).
+ // Returns true if all are compatible.
+ bool IsLinksCompatible();
+
+ // Returns true if an out-port of type "OutPortType" can be bound with
+ // in-port of type "InPortType". Called from IsLinksCompatible() and Link_Impl::IsValid().
+ bool IsCompatible( const char* OutPortType, const char* InPortType ) const;
+
const CORBA::Any *GetInData( const char *ToNodeName ,
const char *ToParameterName ) ;
const CORBA::Any *GetOutData( const char *FromNodeName ,
bool IsExecutable() ;
bool Run( const bool AndSuspend ) ;
- bool Run( const char * aNodeName ,
- const char * AtNodeName , const bool AndSuspend ) ;
long LastLevelDone() ;
inline bool GraphExecutor::DataFlow::Run( const bool AndSuspend ) {
return GraphExecutor::OutNode::Run( AndSuspend ) ;
}
-inline bool GraphExecutor::DataFlow::Run( const char * aNodeName ,
- const char * AtNodeName ,
- const bool AndSuspend ) {
- return GraphExecutor::OutNode::Run( aNodeName , AtNodeName , AndSuspend ) ;
-}
inline long GraphExecutor::DataFlow::LastLevelDone() {
return GraphExecutor::OutNode::LastLevelDone() ;
#define SuspendedState GraphExecutor::SuspendedState
#define KilledState GraphExecutor::KilledState
#define StoppedState GraphExecutor::StoppedState
-#define ReRunnedState GraphExecutor::ReRunnedState
#define ReStartedState GraphExecutor::ReStartedState
+#define LoadingState GraphExecutor::LoadingState
#define NumberOfAutomatonStates GraphExecutor::NumberOfAutomatonStates
#endif
_StateName[ SuspendedState ] = "SuspendedState" ;
_StateName[ KilledState ] = "KilledState" ;
_StateName[ StoppedState ] = "StoppedState" ;
- _StateName[ ReRunnedState ] = "ReRunnedState" ;
_StateName[ ReStartedState ] = "ReStartedState" ;
+ _StateName[ LoadingState ] = "LoadingState" ;
_EventName[ UndefinedEvent ] = "UndefinedEvent" ;
_EventName[ NewThreadEvent ] = "NewThreadEvent" ;
_GraphStateName[ SUPERV::SuspendErroredState ] = "SuspendErroredState" ;
_GraphStateName[ SUPERV::KillState ] = "KillState" ;
_GraphStateName[ SUPERV::StopState ] = "StopState" ;
- _GraphStateName[ SUPERV::ReRunState ] = "ReRunState" ;
- _GraphStateName[ SUPERV::ReStartState ] = "ReStartState" ;
int i , j ;
// NewStates = _TransitionTable[ States ] [ Events ]
}
pthread_mutex_init( &_MutexPythonWait , NULL ) ;
+ _MutexPythonLocked = false ;
_ExecNumber = 0 ;
_GraphExecutingNumber = 0 ;
_PyInitModule = false ;
return ;
}
+void GraphExecutor::FiniteStateMachine::PyInitModule( bool aPyInitModule ) {
+ _PyInitModule = aPyInitModule ;
+}
+
bool GraphExecutor::FiniteStateMachine::PyInitModule() {
bool InitedModule = _PyInitModule ;
_PyInitModule = true ;
perror( "GraphExecutor::FiniteStateMachine::PyLock" ) ;
exit( 0 ) ;
}
+ _MutexPythonLocked = true ;
// cout << pthread_self() << " GraphExecutor::FiniteStateMachine::PyLocked " << &_MutexPythonWait << endl ;
}
perror( "GraphExecutor::FiniteStateMachine::PyUnLock" ) ;
exit( 0 ) ;
}
+ _MutexPythonLocked = false ;
// cout << pthread_self() << " GraphExecutor::FiniteStateMachine::PyUnLocked " << &_MutexPythonWait << endl ;
}
+void GraphExecutor::FiniteStateMachine::PyLockReset() {
+ if ( _MutexPythonLocked ) {
+ PyUnLock() ;
+ }
+}
+
PyObject * GraphExecutor::FiniteStateMachine::PyFunction( const char * aPyFuncName ) {
PyObject * RetVal = NULL ;
return RetVal ;
}
+
+bool GraphExecutor::FiniteStateMachine::ErasePyFunction( const char * aPyFuncName ) {
+
+ if ( _MapOfPyFunctions[ aPyFuncName ] != NULL ) {
+ _MapOfPyFunctions.erase( aPyFuncName ) ;
+ return true ;
+ }
+ return false ;
+}
+
/*
GraphBase::Graph * GraphExecutor::FiniteStateMachine::MapGraph( const char * aGraphName ) {
GraphBase::Graph * aGraph = _MapOfGraphs[ aGraphName ] ;
case GraphExecutor::SuspendedErroredToReStartState :
f << "SuspendedErroredToReStartState";
break;
- case GraphExecutor::ReRunnedState :
- f << "ReRunnedState";
- break;
case GraphExecutor::ReStartedState :
f << "ReStartedState";
break;
+ case GraphExecutor::LoadingState :
+ f << "LoadingState";
+ break;
default :
f << "GraphExecutor::AutomatonState_?";
break;
SuspendedErroredState,
ResumedSuccessedState ,
ResumedErroredState ,
- KilledSuccessedState ,
+ KilledSuccessedState ,
KilledErroredState ,
- StoppedSuccessedState ,
+ StoppedSuccessedState ,
StoppedErroredState ,
SuccessedState ,
ErroredState ,
StoppedState ,
SuspendedSuccessedToReStartState ,
SuspendedErroredToReStartState ,
- ReRunnedState ,
ReStartedState ,
+ LoadingState,
NumberOfAutomatonStates } ;
- enum NodeEvent { UndefinedEvent , NewThreadEvent ,
- SuspendEvent , ToResumeEvent , ResumeEvent ,
- KillEvent , StopEvent ,
- ExecuteEvent , SuccessEvent , ErrorEvent ,
- ToReStartEvent , ReStartEvent , ReStartAndSuspendEvent ,
- EndExecuteEvent ,
- NoDataReadyEvent , SomeDataReadyEvent ,
- NotAllDataReadyEvent , AllDataReadyEvent ,
- ReadyEvent , SuspendedReadyEvent ,ResumedReadyEvent ,
- KilledReadyEvent , StoppedReadyEvent ,
- ExecutingEvent , SuspendedExecutingEvent ,
- ResumedExecutingEvent , KilledExecutingEvent ,
+ enum NodeEvent { UndefinedEvent ,
+ NewThreadEvent ,
+ SuspendEvent ,
+ ToResumeEvent ,
+ ResumeEvent ,
+ KillEvent ,
+ StopEvent ,
+ ExecuteEvent ,
+ SuccessEvent ,
+ ErrorEvent ,
+ ToReStartEvent ,
+ ReStartEvent ,
+ ReStartAndSuspendEvent ,
+ EndExecuteEvent ,
+ NoDataReadyEvent ,
+ SomeDataReadyEvent ,
+ NotAllDataReadyEvent ,
+ AllDataReadyEvent ,
+ ReadyEvent ,
+ SuspendedReadyEvent ,
+ ResumedReadyEvent ,
+ KilledReadyEvent ,
+ StoppedReadyEvent ,
+ ExecutingEvent ,
+ SuspendedExecutingEvent ,
+ ResumedExecutingEvent ,
+ KilledExecutingEvent ,
StoppedExecutingEvent ,
- SuccessedExecutingEvent , ErroredExecutingEvent ,
- SuspendedSuccessedEvent , SuspendedErroredEvent ,
- ResumedSuccessedEvent , ResumedErroredEvent ,
- KilledEvent , StoppedEvent ,
- ReStartedEvent , ReStartedAndSuspendEvent ,
- NumberOfEvents } ;
+ SuccessedExecutingEvent ,
+ ErroredExecutingEvent ,
+ SuspendedSuccessedEvent ,
+ SuspendedErroredEvent ,
+ ResumedSuccessedEvent ,
+ ResumedErroredEvent ,
+ KilledEvent ,
+ StoppedEvent ,
+ ReStartedEvent ,
+ ReStartedAndSuspendEvent ,
+ NumberOfEvents } ;
enum StateEventAction { ErrorAction ,
VoidAction ,
executeAction , // +- pthread_create
ExecuteAction , // +- pthread_create
- DataWaiting_SomeDataReadyAction ,
- DataUndef_NotAllDataReadyAction ,
- DataUndef_AllDataReadyAction ,
+ DataWaiting_SomeDataReadyAction ,
+ DataUndef_NotAllDataReadyAction ,
+ DataUndef_AllDataReadyAction ,
DataReady_SuspendAction ,
SuspendedReady_ResumeAction ,
DataReady_KillAction ,
DataReady_StopAction ,
- DataReady_ExecuteAction ,
+ DataReady_ExecuteAction ,
Executing_SuspendAction ,
SuspendedExecuting_ResumeAction ,
Executing_KillAction ,
Executing_StopAction ,
- Executing_SuccessAction ,
- Executing_ErrorAction ,
+ Executing_SuccessAction ,
+ Executing_ErrorAction ,
Successed_SuccessAction ,
Errored_ErrorAction ,
Successed_SuspendAction ,
Errored_KillAction ,
Successed_StopAction ,
Errored_StopAction ,
- SuspendedSuccessed_ReStartAction ,
- SuspendedErrored_ReStartAction ,
- SuspendedSuccessed_ReStartAndSuspendAction ,
- SuspendedErrored_ReStartAndSuspendAction ,
+ SuspendedSuccessed_ReStartAction ,
+ SuspendedErrored_ReStartAction ,
+ SuspendedSuccessed_ReStartAndSuspendAction ,
+ SuspendedErrored_ReStartAndSuspendAction ,
NumberOfActions } ;
class FiniteStateMachine {
[ GraphExecutor::NumberOfEvents ] ;
pthread_mutex_t _MutexPythonWait ;
+ bool _MutexPythonLocked ;
+// Map between FuncName and corresponding Python Object Function
map< string , PyObject * > _MapOfPyFunctions ;
bool _PyInitModule ;
int _ExecNumber ;
int ExecNumber() ;
void Executed() ;
+ void PyInitModule(bool) ;
bool PyInitModule() ;
void PyLock() ;
void PyUnLock() ;
+ void PyLockReset() ;
bool PyFunction( const char * aPyFuncName , PyObject * aPyFunction ) ;
PyObject * PyFunction( const char * aPyFuncName ) ;
+ bool ErasePyFunction( const char * aPyFuncName ) ;
string DbgFileNumber() {
#include <iostream>
#include <unistd.h>
#include <stdio.h>
+#include <errno.h>
#include "OpUtil.hxx"
#include "DataFlowBase_SwitchNode.hxx"
#include "DataFlowBase_EndOfSwitchNode.hxx"
-#include "DataFlowExecutor_OutNode.hxx"
+#include "DataFlowExecutor_DataFlow.hxx"
+#include "DataFlowEditor_DataFlow.hxx" // GraphEditor package must be built BEFORE
static void InitInNode( int &_RewindStack ,
SUPERV::ControlState &_ControlState ,
GraphExecutor::FiniteStateMachine ** _Automaton ,
GraphExecutor::FiniteStateMachine * theAutomaton ,
CORBA::ORB_ptr * _Orb ,
- CORBA::ORB_ptr ORB ) {
+ CORBA::ORB_ptr ORB,
+ bool &_Loading ) {
_RewindStack = 0 ;
_ControlState = SUPERV::VoidState ;
_currentState = GraphExecutor::UnKnownState ;
}
*_Automaton = theAutomaton ;
*_Orb = CORBA::ORB::_nil();
+ _Loading = false;
}
GraphExecutor::FiniteStateMachine * theAutomaton = new GraphExecutor::FiniteStateMachine() ;
&_Automaton ,
theAutomaton ,
&_Orb ,
- CORBA::ORB::_nil() ) ;
+ CORBA::ORB::_nil(),
+ _Loading ) ;
}
GraphExecutor::InNode::InNode( CORBA::ORB_ptr ORB,
&_Automaton ,
theAutomaton ,
&_Orb ,
- ORB ) ;
+ ORB,
+ _Loading ) ;
SetDebug( ORB , Graph_prof_debug , Graph_fdebug ) ;
_ComputingNode = NULL ;
_FactoryNode->Component()->ping() ;
}
catch( ... ) {
- cdebug << "InNode::Ping() catched" << endl ;
+ cdebug << "InNode::Ping() ERROR catched" << endl ;
State( GraphExecutor::ErroredState ) ;
_OutNode->State( GraphExecutor::ErroredState ) ;
RetVal = false ;
bool GraphExecutor::InNode::Suspend() {
cdebug_in << "GraphExecutor::InNode::Suspend " << Name() << " " << ThreadNo()
- << endl;
+ << " " << Automaton()->StateName( State() ) << endl;
bool RetVal = false ;
if ( IsDone() ) {
//If loop we need to suspend also ControlState( SUPERV::VoidState ) ;
else if ( IsRunning() ) {
ControlState( SUPERV::ToSuspendState ) ;
if ( IsFactoryNode() || IsComputingNode() ) {
- if ( !CORBA::is_nil( Component() ) ) {
- try {
- RetVal = Component()->Suspend_impl() ;
- }
- catch( ... ) {
- cdebug << "InNode::Suspend() catched" << endl ;
- State( GraphExecutor::ErroredState ) ;
- _OutNode->State( GraphExecutor::ErroredState ) ;
- RetVal = false ;
- }
- if ( RetVal ) {
- if ( IsRunning() ) {
- cdebug << pthread_self() << "GraphExecutor::InNode::Suspend_impl " << Name()
- << " --> thread" << ThreadNo() << " SuspendEvent " << endl;
- SendEvent( GraphExecutor::SuspendEvent ) ;
- cdebug << pthread_self() << "GraphExecutor::InNode::Suspended_impl in Container"
- << Name() << " --> thread" << ThreadNo() << endl;
- }
- else if ( IsDone() ) {
- ControlState( SUPERV::VoidState ) ;
- RetVal = false ; // Too late ...
+// We have to suspend in the container of that node
+ int TrySuspend = 10 ;
+ while ( TrySuspend ) {
+ if ( !CORBA::is_nil( Component() ) ) {
+// We can call that component
+ try {
+ RetVal = Component()->Suspend_impl() ;
+ }
+ catch( ... ) {
+ cdebug << "InNode::Suspend() ERROR catched" << endl ;
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ TrySuspend = 1 ;
+ }
+ cdebug << "Component()->Suspend_impl() returns status " << RetVal << endl ;
+ if ( RetVal ) {
+ if ( IsRunning() ) {
+ cdebug << pthread_self() << "GraphExecutor::InNode::Suspend_impl " << Name()
+ << " --> thread" << ThreadNo() << " SuspendEvent " << endl;
+ SendEvent( GraphExecutor::SuspendEvent ) ;
+ cdebug << pthread_self() << "GraphExecutor::InNode::Suspended_impl in Container"
+ << Name() << " --> thread" << ThreadNo() << endl;
+ TrySuspend = 1 ;
+ }
+ else if ( IsDone() ) {
+ ControlState( SUPERV::VoidState ) ;
+ RetVal = false ; // Too late ...
+ TrySuspend = 1 ;
+ }
+ else {
+ cdebug << "InNode::Suspend component Suspended and !IsDone and !IsRunning !"
+ << endl ;
+ MESSAGE("InNode::Suspend component Suspended and !IsDone and !IsRunning !") ;
+ TrySuspend = 1 ;
+ }
}
else {
- cdebug << "component Suspended and !IsDone and !IsRunning !"
+// Suspend in the Container failed : it is always false if it is a Python Container
+ cdebug << "InNode::Suspend cannot Suspend component ! Python Component ?"
<< endl ;
+ if ( TrySuspend == 1 ) {
+ if ( IsSuspended() ) {
+ RetVal = true ;
+ }
+ else {
+ RetVal = false ;
+ }
+ }
+ }
+ }
+ else {
+ cdebug << "InNode::Suspend with nilComponent while RunningState !. Loading Component ?"
+ << endl ;
+// Wait for the end of loading of the component
+ while ( IsLoading() ) {
+ sleep( 1 ) ;
+ }
+ if ( TrySuspend == 1 ) {
+ if ( IsSuspended() ) {
+ RetVal = true ;
+ }
+ else {
+ RetVal = false ;
+ }
}
}
+ TrySuspend -= 1 ;
+ if ( TrySuspend ) {
+ sleep( 1 ) ;
+ }
}
- else {
- cdebug << "Suspend cannot Suspend component !" << endl ;
- RetVal = false ;
+ }
+ else if ( IsMacroNode() ) {
+// It should be like that but it is not completely implemented
+ GraphBase::Graph * aGraph = (GraphBase::Graph * ) GraphMacroNode()->CoupledNode() ;
+ RetVal = aGraph->GraphEditor()->Executor()->Suspend() ;
+ if ( RetVal ) {
+ State( GraphExecutor::SuspendedState ) ;
}
}
else {
- cdebug << "Suspend with nilComponent while RunningState !" << endl ;
- RetVal = false ;
+// Now we can suspend an InLineNode with the handler of the SuperVision Container
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ; RetVal = false;
+ cdebug << "Suspend of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Suspend of InLine nodes is NOT implemented." );
+ /*
+ if ( pthread_kill( _OutNode->MainThreadId() , SIGUSR2 ) == -1 ) {
+ perror("Suspend pthread_kill error") ;
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ }
+ else {
+ RetVal = true ;
+ }
+ if ( RetVal ) {
+ if ( IsRunning() ) {
+ cdebug << pthread_self() << "GraphExecutor::InNode::Suspend " << Name()
+ << " --> thread" << ThreadNo() << " SuspendEvent " << endl;
+ SendEvent( GraphExecutor::SuspendEvent ) ;
+ cdebug << pthread_self() << "GraphExecutor::InNode::Suspended in SuperVision Container"
+ << Name() << " --> thread" << ThreadNo() << endl;
+ }
+ else if ( IsDone() ) {
+ ControlState( SUPERV::VoidState ) ;
+ RetVal = false ; // Too late ...
+ }
+ else {
+ cdebug << "component Suspended and !IsDone and !IsRunning !"
+ << endl ;
+ }
+ }
+ */
}
}
else {
- cdebug << "Suspend and !IsDone and !IsRunning and !IsWaiting ?"
- << endl ;
+ cdebug << "Suspend and IsDone " << IsDone() << " and IsRunning " << IsRunning()
+ << " and IsWaiting " << IsWaiting() << " and IsReady " << IsReady()
+ << " ?" << endl ;
RetVal = false ;
}
cdebug_out << "GraphExecutor::InNode::Suspend " << RetVal << " "
bool GraphExecutor::InNode::Kill() {
cdebug_in << "GraphExecutor::InNode::Kill " << Name() << " " << ThreadNo() << " "
<< Automaton()->StateName( State() ) << " Threads " << _OutNode->Threads()
- << " SuspendedThreads " << _OutNode->SuspendedThreads() << endl;
+ << " SuspendedThreads " << _OutNode->SuspendedThreads()
+ << " EventQSize " << _OutNode->EventQSize() << endl;
bool RetVal ;
if ( IsDone() ) {
ControlState( SUPERV::ToKillState ) ; // if loop
else {
if ( IsRunning() ) {
if ( IsFactoryNode() || IsComputingNode() ) {
- if ( !CORBA::is_nil( Component() ) ) {
- try {
- RetVal = Component()->Kill_impl() ;
- }
- catch( ... ) {
- cdebug << "InNode::Suspend() catched" << endl ;
- State( GraphExecutor::ErroredState ) ;
- _OutNode->State( GraphExecutor::ErroredState ) ;
- RetVal = false ;
- }
- cdebug << "Component()->Kill_impl() returns status " << RetVal << endl ;
- RetVal = true ;
- if ( IsRunning() ) {
- cdebug << pthread_self() << "GraphExecutor::InNode::Kill_impl " << Name()
- << " --> thread" << ThreadNo() << " SuspendEvent " << endl;
- SendEvent( GraphExecutor::KillEvent ) ;
- cdebug << pthread_self() << "GraphExecutor::InNode::Killed_impl in Container"
- << Name() << " --> thread" << ThreadNo() << endl;
- }
- else if ( IsDone() ) {
- ControlState( SUPERV::VoidState ) ;
- RetVal = false ; // Too late ...
+// We have to suspend in the container of that node
+ int TryKill = 10 ;
+ while ( TryKill ) {
+ if ( !CORBA::is_nil( Component() ) ) {
+// We can call that component
+ try {
+ RetVal = Component()->Kill_impl() ;
+ }
+ catch( ... ) {
+ cdebug << "InNode::Kill_impl ERROR catched" << endl ;
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ TryKill = 1 ;
+ }
+ cdebug << "Component()->Kill_impl() returns status " << RetVal << endl ;
+ if ( RetVal ) {
+ if ( IsRunning() ) {
+ cdebug << pthread_self() << "GraphExecutor::InNode::Kill_impl " << Name()
+ << " --> thread" << ThreadNo() << " KillEvent " << endl;
+ SendEvent( GraphExecutor::KillEvent ) ;
+ cdebug << pthread_self() << "GraphExecutor::InNode::Killed_impl in Container"
+ << Name() << " --> thread" << ThreadNo() << endl;
+ TryKill = 1 ;
+ }
+ else if ( IsDone() ) {
+ ControlState( SUPERV::VoidState ) ;
+ RetVal = false ; // Too late ...
+ TryKill = 1 ;
+ }
+ else {
+ cdebug << "Kill component Killed and !IsDone and !IsRunning !"
+ << endl ;
+ TryKill = 1 ;
+ }
+ }
+ else {
+// Kill in the Container failed : it is always false if it is a Python Container
+ cdebug << "InNode::Suspend cannot Kill component ! Python Component ?"
+ << endl ;
+ if ( TryKill == 1 ) {
+ if ( IsKilled() ) {
+ RetVal = true ;
+ }
+ else {
+ RetVal = false ;
+ }
+ }
+ }
}
else {
- cdebug << "component Killed and !IsDone and !IsRunning !"
+ cdebug << "InNode::Kill with nilComponent while RunningState !. Loading Component ?"
<< endl ;
+// Wait for the end of loading of the component
+ while ( IsLoading() ) {
+ sleep( 1 ) ;
+ }
+ if ( TryKill == 1 ) {
+ if ( IsKilled() ) {
+ RetVal = true ;
+ }
+ else {
+ RetVal = false ;
+ }
+ }
}
+ TryKill -= 1 ;
+ if ( TryKill ) {
+ sleep( 1 ) ;
+ }
}
- else {
- cdebug << "Kill with nilComponent cannot Kill component !" << endl ;
+ }
+ else if ( IsMacroNode() ) {
+// It should be like that but it is not completely implemented
+ GraphBase::Graph * aGraph = (GraphBase::Graph * ) GraphMacroNode()->CoupledNode() ;
+ RetVal = aGraph->GraphEditor()->Executor()->Kill() ;
+ if ( RetVal ) {
+ State( GraphExecutor::KilledState ) ;
+ }
+ }
+ else {
+//PAL6886
+// Now we can kill an InLineNode with the handler of the SuperVision Container
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ cdebug << "Kill of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Kill of InLine nodes is NOT implemented." );
+ /*
+ cdebug << pthread_self() << "Kill of InLineNode " << Name() << " MainThreadId "
+ << _OutNode->MainThreadId() << " :" << endl ;
+ MESSAGE( pthread_self() << "Kill of InLineNode " << Name() << " MainThreadId "
+ << _OutNode->MainThreadId() << " :" ) ;
+ if ( pthread_kill( _OutNode->MainThreadId() , SIGINT ) == -1 ) {
+// python signals run only in main thread ...
+ perror("Kill pthread_kill error") ;
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
RetVal = false ;
}
+ else {
+ cdebug << pthread_self() << "pthread_kill of InLineNode " << Name()
+ << " done. MainThreadId " << _OutNode->MainThreadId() << endl ;
+ MESSAGE( pthread_self() << "pthread_kill of InLineNode " << Name()
+ << " done. MainThreadId " << _OutNode->MainThreadId() ) ;
+ RetVal = true ;
+ }
+ */
}
}
else if ( IsSuspended() ) {
cdebug << pthread_self() << "GraphExecutor::InNode::Kill " << Name()
<< " --> thread" << ThreadNo() << " Resume()" << endl;
- Resume() ;
- RetVal = true ;
+ if ( Resume() ) {
+ RetVal = Kill() ;
+ }
+ else {
+ RetVal = false ;
+ }
}
else if ( IsWaiting() ) {
- RetVal = true ;
+ RetVal = false ;
}
else if ( IsReady() ) {
RetVal = true ;
}
else {
- cdebug << "Kill and !IsDone and !IsRunning and !IsWaiting and !IsReady ?"
- << endl ;
+ cdebug << "Kill and IsDone " << IsDone() << " and IsRunning " << IsRunning()
+ << " and IsWaiting " << IsWaiting() << " and IsReady " << IsReady()
+ << " ?" << endl ;
RetVal = false ;
}
}
}
- cdebug_out << "GraphExecutor::InNode::Kill" << Name() << " " << ThreadNo() << " "
+ cdebug_out << "GraphExecutor::InNode::Kill " << Name() << " " << ThreadNo() << " "
<< Automaton()->StateName( State() ) << " Threads " << _OutNode->Threads()
- << " SuspendedThreads " << _OutNode->SuspendedThreads() << endl ;
+ << " SuspendedThreads " << _OutNode->SuspendedThreads()
+ << " EventQSize " << _OutNode->EventQSize() << endl ;
return RetVal ;
}
RetVal = Component()->Stop_impl() ;
}
catch( ... ) {
- cdebug << "InNode::Stop() catched" << endl ;
+ cdebug << "InNode::Stop() ERROR catched" << endl ;
State( GraphExecutor::ErroredState ) ;
_OutNode->State( GraphExecutor::ErroredState ) ;
RetVal = false ;
}
}
else {
- cdebug << "Suspend cannot Suspend component !" << endl ;
+ cdebug << "Suspend cannot Stop component ! Python Component ?" << endl ;
RetVal = false ;
}
}
}
else if ( State() == GraphExecutor::SuspendedExecutingState ) {
if ( IsFactoryNode() || IsComputingNode() ) {
+ if ( pthread_mutex_lock( &_MutexWait ) ) {
+ perror("ResumeAction pthread_mutex_lock ") ;
+ exit( 0 ) ;
+ }
try {
RetVal = Component()->Resume_impl() ;
+ if ( RetVal ) {
+ State( GraphExecutor::ExecutingState ) ;
+ }
}
catch( ... ) {
- cdebug << "InNode::Resume() catched" << endl ;
+ cdebug << "InNode::Resume() ERROR catched" << endl ;
State( GraphExecutor::ErroredState ) ;
_OutNode->State( GraphExecutor::ErroredState ) ;
RetVal = false ;
}
+ if ( pthread_mutex_unlock( &_MutexWait ) ) {
+ perror("ResumeAction pthread_mutex_unlock ") ;
+ exit( 0 ) ;
+ }
+ }
+ else if ( IsMacroNode() ) {
+ cdebug << "Suspend of MacroNode not yet implemented ? Trying" << endl ;
+ GraphBase::Graph * aGraph = (GraphBase::Graph * ) GraphMacroNode()->CoupledNode() ;
+ RetVal = aGraph->GraphEditor()->Executor()->Resume() ;
+ if ( RetVal ) {
+ State( GraphExecutor::ExecutingState ) ;
+ }
+ }
+ else {
+// Resume of InLinePythonNode in the Node of the SuperVisionContainer ...
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ cdebug << "Resume of InLine nodes is NOT implemented." << endl;
+ MESSAGE( "Resume of InLine nodes is NOT implemented." );
+ /*
+ cdebug << ThreadNo() << "/" << pthread_self()
+ << "Resume of InLineNode pthread_kill" << Name() << endl ;
+ if ( pthread_kill( _OutNode->MainThreadId() , SIGCONT ) == -1 ) {
+ perror("Resume pthread_kill error") ;
+ State( GraphExecutor::ErroredState ) ;
+ _OutNode->State( GraphExecutor::ErroredState ) ;
+ RetVal = false ;
+ }
+ else {
+ State( GraphExecutor::ExecutingState ) ;
+ RetVal = true ;
+ }
+ */
}
}
else if ( State() == GraphExecutor::SuspendedSuccessedState ) {
}
}
#endif
- cdebug_out << "GraphExecutor::InNode::Resume " << RetVal << endl ;
- return RetVal ;
-}
-
-bool GraphExecutor::InNode::ReStart( const char * AtNodeName ,
- const bool AndSuspend ) {
- bool RetVal = false ;
- GraphExecutor::InNode * aRestartNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetGraphNode( AtNodeName )->GetInNode() ;
- cdebug_in << pthread_self() << "/" << ThreadNo()
- << " --> GraphExecutor::InNode::ReStartAt( "
- << AtNodeName << " , " << AndSuspend << ") " << endl
- << "thread " << aRestartNode->ThreadNo() << " "
- << Automaton()->StateName( aRestartNode->State() )
- << " from " << Name() << " " << Automaton()->StateName( State() )
- << endl ;
- if ( IsWaiting() && aRestartNode->IsSuspended() ) {
- RetVal = aRestartNode->Resume() ;
- }
- else if ( IsSuspended() ) {
- if ( strcmp( AtNodeName , Name() ) ) {
- aRestartNode->State( GraphExecutor::SuspendedSuccessedState ) ;
- }
- if ( AndSuspend ) {
- ReStartAction( aRestartNode , GraphExecutor::ReStartAndSuspendEvent ) ;
- }
- else {
- ReStartAction( aRestartNode , GraphExecutor::ReStartEvent ) ;
- }
- RetVal = true ;
- }
- cdebug_out << "<-- GraphExecutor::InNode::ReStartAt" << endl ;
+ cdebug_out << "GraphExecutor::InNode::Resume " << Name() << " " << RetVal << " "
+ << Automaton()->StateName( State() ) << endl ;
return RetVal ;
}
if ( aState == GraphExecutor::SuspendedReadyState ||
aState == GraphExecutor::SuspendedExecutingState ||
aState == GraphExecutor::SuspendedSuccessedState ||
- aState == GraphExecutor::SuspendedErroredState )
+ aState == GraphExecutor::SuspendedErroredState ||
+ aState == GraphExecutor::SuspendedState )
aret = true ;
// cdebug_out << "GraphExecutor::InNode::IsSuspended" << endl ;
return aret ;
<< " " << Automaton()->StateName( _currentState )
<< " pthread_cond_wait _RunningWait " << Name() << endl ;
while ( !RetVal && !IsDone() ) {
- cdebug << pthread_self() << " pthread_cond_wait RunningWait" << endl ;
+ cdebug << pthread_self() << " pthread_cond_wait RunningWait " << Name() << endl ;
pthread_cond_wait( &_RunningWait , &_MutexWait );
- RetVal = IsRunning() ;
+//We may have pthread_cond_waited but !IsRunning and !IsDone :
+ RetVal = IsRunning() || State() == GraphExecutor::SuccessedExecutingState ||
+ State() == GraphExecutor::ErroredExecutingState ;
cdebug << pthread_self() << " pthread_cond_waited RunningWait "
<< Automaton()->StateName( _currentState ) << " " << RetVal
- << endl ;
+ << " " << Name() << endl ;
}
cdebug_out << pthread_self() << " StateWait( Running ) " << RetVal
<< " " << Automaton()->StateName( _currentState )
}
bool GraphExecutor::InNode::RunningWait() {
-// cdebug_in << "GraphExecutor::InNode::RunningWait " << Name() << endl;
+ cdebug_in << pthread_self() << "GraphExecutor::InNode::RunningWait " << Name()
+ << " " << Automaton()->StateName( State() ) << endl;
bool aret ;
aret = StateWait( SUPERV::RunningState ) ;
+ cdebug_out << pthread_self() << "GraphExecutor::InNode::RunningWait " << Name()
+ << " " << Automaton()->StateName( State() ) << endl;
return aret ;
}
return aret ;
}
-void GraphExecutor::InNode::InitialState( GraphExecutor::OutNode * theOutNode )
+void GraphExecutor::InNode::InitialState()
{
cdebug_in << "GraphExecutor::InNode::InitialState Node " << Name() << endl;
- _OutNode = theOutNode ;
-
int i;
_ControlState = SUPERV::VoidState ;
CreateNewThread( false ) ;
CreateNewThreadIf( false ) ;
_SuspendSync = false ;
_ResumeSync = false ;
+ _InitLoop = false ;
+
+ // asv : 13.12.04 : Decided to set "Loading" state for factory and computing nodes ONLY.
+ // See extended comment in p.2.19 of "Bugs and Improvements" about IsLoading for InLine.
+ if ( IsComputingNode() || IsFactoryNode() ) {
+ IsLoading( true ) ;
+ }
+
// ThreadNo( pthread_self() ) ;
ThreadNo( 0 ) ;
CORBA::Any * anAny = new CORBA::Any() ;
*anAny <<= (long ) 1 ;
anOutPort->Value( anAny ) ;
+ _InitLoop = true ;
}
// JR 15_09_2004 if backward link from GOTONode or EndLoopNode ==> DataConnected
else if ( anInPort->IsGate() && anOutPort ) {
anOutPort->State( SUPERV::WaitingState ) ;
anOutPort->Done( false ) ;
const GraphBase::ComputingNode * aFromNode = _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() ) ;
- if ( aFromNode->IsGOTONode() || aFromNode->IsEndLoopNode() ) { // ASV: bug with synchronization of Inline nodes (via Gate ports) fixed.
- // before was "else if ( IsOneOfInlineNodes() )"
- // IsOneOfInline() == ( Inline || IsOneOfGOTO() ), so Inline are removed..
+//JR if ( aFromNode->IsGOTONode() || aFromNode->IsEndLoopNode() ) {
+ if ( aFromNode->IsGOTONode() || ( IsLoopNode() && CoupledNode() == aFromNode ) ) {
+// ASV: bug with synchronization of Inline nodes (via Gate ports) fixed.
+// before was "else if ( IsOneOfInlineNodes() )"
+// IsOneOfInline() == ( Inline || IsOneOfGOTO() ), so Inline are removed..
anOutPort->PortStatus( DataConnected );
anOutPort->State( SUPERV::ReadyState ) ;
anOutPort->Done( true ) ;
}
bool GraphExecutor::InNode::InitPythonFunctions(bool WithErr ) {
- cdebug_in << "GraphExecutor::InNode::InitPythonFunctions " << Name() << endl;
+ cdebug_in << "GraphExecutor::InNode::InitPythonFunctions " << Name() << " WithErr " << WithErr
+ << " PyFuncRunned() " << PyFuncRunned() << endl;
bool Err = false ;
if ( !PyFuncRunned() && IsOneOfInLineNodes() ) {
if ( IsLoopNode() ) {
const long GraphExecutor::InNode::CpuUsed( bool tot ) {
CORBA::Long cpu = 0 ;
-// cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
+// cout << "Begin CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
+// << theAutomaton->StateName( _currentState ) << endl ;
+ cdebug_in << "GraphExecutor::InNode::CpuUsed( " << tot << " )" << Name() << endl ;
if ( IsOneOfInLineNodes() ) {
// cdebug << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
// cout << "CpuUsed " << Name() << " --> PyCpuUsed()" << endl ;
}
}
}
-// cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
-// cout << "CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
+ cdebug_out << "GraphExecutor::InNode::CpuUsed " << Name() << " CpuUsed : " << cpu << endl ;
+// cout << "End CpuUsed " << Name() << " CpuUsed : " << cpu << " State "
+// << theAutomaton->StateName( _currentState ) << endl ;
return cpu ;
}
// << _PyCpuUsed << endl ;
}
+void GraphExecutor::InNode::IsLoading( bool Loading ) {
+ _Loading = Loading ;
+
+ // asv : 09.12.04 : "Bugs and Improvents" 2.19 : how it works:
+ // LoadingState is returned by OutNode::State( NodeName ) if InNode->IsLoading()
+ // after Loading is finished (here below), ExecutingState must be pushed for GUI.
+ if ( !Loading )
+ _OutNode->PushEvent( this, GraphExecutor::ExecuteEvent, GraphExecutor::ExecutingState );
+}
+
#include <Python.h>
+#include "SALOME_Container_i.hxx"
+
#include "DataFlowBase_Graph.hxx"
#include "DataFlowBase_FactoryNode.hxx"
#include "DataFlowBase_GOTONode.hxx"
GraphExecutor::AutomatonState _NextState ;
GraphExecutor::StateEventAction _NextAction ;
bool _PyFuncRunned ;
+ bool _Loading ;
pthread_mutex_t _MutexDataWait ;
bool _DataWait ;
GraphExecutor::OutNode * _OutNode ;
char * _DataFromNode ;
+ bool _InitLoop ;
public:
bool PyFuncRunned() {
return _PyFuncRunned ; } ;
+ void OutNode( GraphExecutor::OutNode * theOutNode ) {
+ _OutNode = theOutNode ; } ;
+
bool InitPython() ;
PyObject * InitPyDynInvoke( char * PyFuncName ,
const SUPERV::ListOfStrings * aPythonFunction ,
bool & Err ) ;
+ void RemovePyDynInvoke( char * PyFuncName ) ;
void LockDataWait() ;
void UnLockDataWait() ;
bool Suspend() ;
bool SuspendDone() ;
bool Resume() ;
- bool ReStart( const char * AtNodeName , const bool AndSuspend ) ;
bool Stop() ;
void CreateNewThread( bool k_create ) { _createNewThread = k_create ; } ;
bool IsSuspended() ;
bool IsKilled() ;
bool IsStopped() ;
+ void IsLoading( bool Loading );
+ bool IsLoading() { return _Loading ; } ;
bool StateWait( SUPERV::GraphState aState ) ;
bool ReadyWait() ;
bool DoneWait() ;
bool SuspendedWait() ;
- void InitialState( GraphExecutor::OutNode * theOutNode ) ;
+ void InitialState() ;
bool InitPythonFunctions(bool WithErr ) ;
void SetWaitingStates(GraphExecutor::InNode * EndNode ) ;
long PyCpu() ;
bool PyRunSimpleString( char* thePyString );
+ PyObject * PyEvalCallObject( PyObject * MyPyRunMethod ,
+ PyObject * ArgsList ) ;
} ;
} ;
cdebug << pthread_self() << "/" << ThreadNo()
<< "RunningAction pthread_cond_broadcast _RunningWait "
<< Name() << endl ;
+// That activate the pthread_cond_wait for RunninWait
if ( pthread_cond_broadcast( &_RunningWait ) ) {
perror("Running pthread_cond_broadcast ") ;
}
exit( 0 ) ;
}
if ( !_ThreadStartedSync ) {
- cdebug << "pthread_cond " << Name() << " ThreadStarted pthread_cond_wait"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStarted pthread_cond_wait"
<< endl ;
_ThreadStartedSync = true ;
if ( pthread_cond_wait( &_ThreadStartedWait , &_MutexWait ) ) {
perror("ThreadStarted pthread_cond_wait ") ;
}
- cdebug << "pthread_cond " << Name() << " ThreadStarted pthread_cond_waited"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStarted pthread_cond_waited"
<< endl ;
}
else {
- cdebug << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_wait"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_wait"
<< endl ;
//Debug :
_ThreadStartedSync = false ;
perror("ThreadStart pthread_cond_signal ") ;
}
//Debug
- cdebug << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_signaled"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStarted pthread_cond_signaled"
<< endl ;
}
if ( pthread_mutex_unlock( &_MutexWait ) ) {
exit( 0 ) ;
}
if ( _ThreadStartedSync ) {
- cdebug << "pthread_cond " << Name() << " ThreadStart pthread_cond_signal"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStart pthread_cond_signal"
<< endl ;
_ThreadStartedSync = false ;
if ( pthread_cond_signal( &_ThreadStartedWait ) ) {
perror("ThreadStart pthread_cond_broadcast ") ;
}
- cdebug << "pthread_cond " << Name() << " ThreadStart pthread_cond_signaled"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " ThreadStart pthread_cond_signaled"
<< endl ;
}
else {
- cdebug << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_signal"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_signal"
<< endl ;
_ThreadStartedSync = true ;
//Debug :
perror("ThreadStarted pthread_cond_wait ") ;
}
//Debug
- cdebug << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_waited"
+ cdebug << pthread_self() << "/" << ThreadNo()
+ << "pthread_cond " << Name() << " NO ThreadStart pthread_cond_waited"
<< endl ;
}
if ( pthread_mutex_unlock( &_MutexWait ) ) {
}
void GraphExecutor::InNode::coutbegin() {
- cdebug << ThreadNo() << " " << pthread_self() << " run_function begin"
+ cdebug << pthread_self() << "/" << ThreadNo() << " run_function begin"
<< " " << Name() << " " << Automaton()->StateName( State() ) << endl ;
}
void GraphExecutor::InNode::coutexit() {
int GraphExecutor::InNode::ExecuteAction() {
int sts ;
-// const char * nextactionname = Automaton()->ActionName( _NextAction ) ;
-// const char * statename = Automaton()->StateName( State() ) ;
-// const char * nextstatename = Automaton()->StateName( _NextState ) ;
-// cdebug << pthread_self() << "/" << ThreadNo() << " --> ExecuteAction "
-// << nextactionname << " " << statename << " NextState "
-// << nextstatename << endl ;
+ const char * nextactionname = Automaton()->ActionName( _NextAction ) ;
+ const char * statename = Automaton()->StateName( State() ) ;
+ const char * nextstatename = Automaton()->StateName( _NextState ) ;
+ cdebug_in << pthread_self() << "/" << ThreadNo() << " --> ExecuteAction "
+ << nextactionname << " " << statename << " NextState "
+ << nextstatename << endl ;
State( _NextState ) ;
switch ( _NextAction ) {
return 0 ;
}
}
-// cdebug << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction "
-// << Automaton()->ActionName( nextaction ) << endl ;
+ cdebug_out << pthread_self() << "/" << ThreadNo() << "<-- ExecuteAction "
+ << nextactionname << endl ;
return sts ;
}
unsigned int k;
int InReady = 0 ;
int res = 1;
- bool LoopFinished = false ;
bool LoopBeginning = false ;
+ bool LoopFinished = false ;
bool SwitchFinished = false ;
- if ( IsEndLoopNode() && !GetChangeNodeInLoop()->GetOutPort()->BoolValue() ) {
- LoopFinished = true ; // End of Loop
+ if ( IsLoopNode() ) {
+ GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ;
+ if ( anOutLoopPort && anOutLoopPort->BoolValue() ) {
+ LoopBeginning = true ; // Beginning of Loop
+ }
}
- if ( IsLoopNode() && GetChangeNodeInLoop()->GetOutPort()->BoolValue() ) {
- LoopBeginning = true ; // Beginning of Loop
+ if ( IsEndLoopNode() ) {
+ GraphBase::OutPort * anOutLoopPort = GetChangeNodeInLoop()->GetOutPort() ;
+ if ( anOutLoopPort && !anOutLoopPort->BoolValue() ) {
+ LoopFinished = true ; // End of Loop
+ }
}
- if ( IsEndSwitchNode() && !GetChangeNodeInGate()->GetOutPort()->BoolValue() ) {
- SwitchFinished = true ; // End of Switch
+ if ( IsEndSwitchNode() ) {
+ GraphBase::OutPort * anOutGateSwitchPort = GetChangeNodeInGate()->GetOutPort() ;
+ if ( anOutGateSwitchPort && !anOutGateSwitchPort->BoolValue() ) {
+ SwitchFinished = true ; // End of Switch
+ }
}
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " LoopFinished " << LoopFinished
<< " LoopBeginning " << LoopBeginning << " SwitchFinished " << SwitchFinished << endl ;
for ( k = 0 ; k < (unsigned int ) GetNodeInPortsSize() ; k++ ) {
GraphBase::InPort * anInPort = GetChangeNodeInPort(k) ;
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
- cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " << anInPort->PortName() << endl ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " InPort " << anInPort->PortName() << " " << anInPort->State() << " " << anInPort->PortStatus() << endl ;
if ( anInPort->IsGate() && anOutPort == NULL ) {
InReady += 1 ;
anInPort->State( SUPERV::ReadyState ) ;
if ( anInPort->State() == SUPERV::ReadyState ) {
InReady += 1 ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Was Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " ReadyState " ;
+ << anInPort->PortName() << " Was Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") ReadyState " ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
anInPort->State( SUPERV::ReadyState ) ;
InReady += 1 ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Was Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " LoopBeginning " << LoopBeginning ;
+ << anInPort->PortName() << " Was Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") LoopBeginning " << LoopBeginning ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
anInPort->State( SUPERV::ReadyState ) ;
InReady += 1 ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Was Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " LoopFinished" ;
+ << anInPort->PortName() << " Was Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") LoopFinished" ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
anInPort->State( SUPERV::ReadyState ) ;
InReady += 1 ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Was Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " SwitchFinished" ;
+ << anInPort->PortName() << " Was Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") SwitchFinished" ;
+#ifdef _DEBUG_
+ if ( GraphBase::Base::_prof_debug ) {
+ anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
+ }
+#endif
+ cdebug << endl ;
+ }
+ else if ( anInPort->IsGate() &&
+ _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() )->IsGOTONode() ) {
+// GateOutPort of GOTONodes are always opened
+ anInPort->State( SUPERV::ReadyState ) ;
+ InReady += 1 ;
+ CORBA::Any * anAny = new CORBA::Any() ;
+ *anAny <<= (long ) 1 ;
+ _OutNode->Graph()->GetGraphNode( anOutPort->NodeName() )->GetChangeNodeOutGate()->Value( anAny ) ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
+ << anInPort->PortName() << " Was Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") GOTONode" ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
}
else {
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Was NOT Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName() << " "
+ << anInPort->PortName() << " Was NOT Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") "
<< " " << Automaton()->StateName( State() ) << " DataConnected "
<< anInPort->IsDataConnected() << " LoopBeginning "
<< LoopBeginning << endl ;
InReady += 1 ;
anInPort->State( SUPERV::ReadyState ) ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " Gate is Opened from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " " ;
+ << anInPort->PortName() << " Gate is Opened from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") " ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
else if ( LoopFinished ) {
anInPort->State( SUPERV::ReadyState ) ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " GATE IS CLOSED from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " LoopFinished" ;
+ << anInPort->PortName() << " GATE IS CLOSED from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") LoopFinished" ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
}
else {
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " GATE IS CLOSED from "
- << anOutPort->NodeName() << " " << anOutPort->PortName()
- << " " ;
+ << anInPort->PortName() << " GATE IS CLOSED from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName()
+ << ") " ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
InReady += 1 ;
anInPort->State( SUPERV::ReadyState ) ;
cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " " << anInPort->PortStatus() << " is Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName() << " " << anOutPort->PortStatus() << " " ;
+ << anInPort->PortName() << " " << anInPort->PortStatus() << " is Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") "
+ << anOutPort->PortStatus() << " " ;
#ifdef _DEBUG_
if ( GraphBase::Base::_prof_debug ) {
anOutPort->StringValue( *GraphBase::Base::_fdebug ) ;
}
}
else {
- cdebug << pthread_self() << "/" << ThreadNo() << " " << Name() << " "
- << anInPort->PortName() << " " << anInPort->PortStatus() << " is NOT Done from "
- << anOutPort->NodeName() << " " << anOutPort->PortName() << " " << anOutPort->PortStatus() << " " ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " Node " << Name() << "( "
+ << anInPort->PortName() << ") " << anInPort->PortStatus()
+ << " is NOT Done from Node "
+ << anOutPort->NodeName() << "( " << anOutPort->PortName() << ") "
+ << anOutPort->PortStatus() << " " ;
}
}
ControlState() == SUPERV::ToKillDoneState ||
ControlState() == SUPERV::ToStopState ) {
cdebug << ThreadNo() << "StartComponent Error or ToKillState" << endl ;
+ MESSAGE(pthread_self() << "Executor::InNode::DataReady_ExecuteAction of " << Name()
+ << " ControlState " << Automaton()->ControlStateName( ControlState() )
+ << " BEFORE execution ThreadNo " << ThreadNo() ) ;
Err = true ;
}
else {
+ if ( ControlState() == SUPERV::ToSuspendState ) {
+ cdebug << ThreadNo() << "ToSuspendState before running." << endl ;
+ MESSAGE(ThreadNo() << "ToSuspendState before running.") ;
+ }
if ( !Err ) {
// ostringstream astr ;
// astr << "Graph " << _OutNode->Graph()->Name() << " Run of Node " << Name() ;
}
if ( IsOneOfInLineNodes() ) {
cdebug << " , PyFuncName '" << InLineNode()->PyFuncName() << "' PyRunMethod "
- << InLineNode()->PyRunMethod() << " length " << (*InLineNode()->PythonFunction()).length() ;
+ << InLineNode()->PyRunMethod() << " length "
+ << (*InLineNode()->PythonFunction()).length() ;
}
cdebug << ")" << endl ;
SetPyCpuUsed() ;
try {
// if ( IsInLineNode() && (*InLineNode()->PythonFunction()).length() &&
+ bool ItIsaLoop = false ;
bool CopyInOut = false ;
if ( IsInLineNode() && /*InLineNode()->PyRunMethod() &&*/
strlen( InLineNode()->PyFuncName() ) ) {
-// cdebug << ThreadNo() << " !ObjInterface " << Name() << " PyFuncName '"
-// << InLineNode()->PyFuncName()
-// << "' IsInLineNode PyDynInvoke" << endl ;
+ cdebug << ThreadNo() << " !ObjInterface " << Name() << " PyFuncName '"
+ << InLineNode()->PyFuncName()
+ << "' IsInLineNode PyDynInvoke" << endl ;
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
&InParametersList[0] , ServiceInParameter().length() ,
&OutParametersList[0] , ServiceOutParameter().length() ) ;
- }
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( InLineNode()->PyFuncName() ) ;
+ } }
else if ( IsLoopNode() ) {
+ ItIsaLoop = true ;
bool CopyOutIn = false ;
- if ( GetNodeInLoop()->GetOutPort()->BoolValue() && /*InLineNode()->PyRunMethod() &&*/
- strlen( InLineNode()->PyFuncName() ) ) { // InLoop Port
-// cdebug << ThreadNo() << " !ObjInterface " << Name()
-// << " IsLoopNode PyDynInvoke '" << InLineNode()->PyFuncName()
-// << "'" << endl ;
- StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
- InLineNode()->PyFuncName() ,
- &InParametersList[1] , ServiceInParameter().length() ,
- &OutParametersList[1] , ServiceOutParameter().length() ) ;
- CopyOutIn = true ;
+// Switch between Init() and Next()
+// if InLoop port is true and does not come from EndLoop ==> execute Init
+// if InLoop port is false or come from EndLoop ==> execute Next
+// GraphExecutor::InNode * anEndLoopNode = (GraphExecutor::InNode * ) CoupledNode()->GetInNode() ;
+// if ( GetNodeInLoop()->GetOutPort()->BoolValue() &&
+ if ( _InitLoop ) {
+ if ( strlen( InLineNode()->PyFuncName() ) ) { // InLoop Port = true ==> Init()
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode PyDynInvoke '" << InLineNode()->PyFuncName()
+ << "' InitLoop " << LoopNode()->PyRunMethod() << endl ;
+ StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
+ InLineNode()->PyFuncName() ,
+ &InParametersList[1] , ServiceInParameter().length() ,
+ &OutParametersList[1] , ServiceOutParameter().length() ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( InLineNode()->PyFuncName() ) ;
+ }
+ CopyOutIn = true ;
+ }
+ else {
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode NO PyDynInvoke Void PyFuncName InitLoop" << endl ;
+ }
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode _InitLoop Reset after Init() Python Function" << endl ;
+ _InitLoop = false ;
}
else if ( LoopNode()->PyNextMethod() &&
- strlen( LoopNode()->PyNextName() ) ){
-// cdebug << ThreadNo() << " !ObjInterface " << Name()
-// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyNextName()
-// << "'" << endl ;
+ strlen( LoopNode()->PyNextName() ) ){ // InLoop Port = false ==> Next()
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode PyDynInvoke '" << LoopNode()->PyNextName()
+ << "' " << LoopNode()->PyNextMethod() << endl ;
StsPyDynInvoke = PyDynInvoke( LoopNode()->PyNextMethod() ,
LoopNode()->PyNextName() ,
&InParametersList[1] , ServiceInParameter().length() ,
&OutParametersList[1] , ServiceOutParameter().length() ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( LoopNode()->PyNextName() ) ;
+ }
CopyOutIn = true ;
}
- if ( StsPyDynInvoke && CopyOutIn ) {
-// cdebug << ThreadNo() << " !ObjInterface " << Name()
-// << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName()
-// << "' Copy of " << ServiceInParameter().length()
-// << " OutParameters" << endl ;
- int i ;
- for ( i = 1 ; i <= (int ) ServiceInParameter().length() ; i++ ) {
- InParametersList[i].Value = OutParametersList[i].Value ;
- InParametersList[i].Name = OutParametersList[i].Name ;
+ else {
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode NO PyDynInvoke Void PyFuncName NextLoop" << endl ;
+ }
+ if ( StsPyDynInvoke ) {
+ if ( CopyOutIn ) {
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName()
+ << "' Copy of " << ServiceInParameter().length()
+ << " OutParameters" << endl ;
+ int i ;
+// Start at 1 : Do not copy InLoop ( InLoop == true <==> Init ; InLoop == false <==> Next )
+ for ( i = 1 ; i <= (int ) ServiceInParameter().length() ; i++ ) {
+ InParametersList[i].Value = OutParametersList[i].Value ;
+ InParametersList[i].Name = OutParametersList[i].Name ;
//#if 0
- switch ( InParametersList[i].Value.type()->kind() ) {
- case CORBA::tk_string :
- char * t;
- InParametersList[i].Value >>= t ;
- cdebug << "ArgOut->In" << i << " : "
- << InParametersList[i].Name.c_str()
- << " Value(string) " << t << endl ;
- break ;
- case CORBA::tk_double :
- double d;
- InParametersList[i].Value >>= d;
- cdebug << "ArgOut->In" << i << " : "
- << InParametersList[i].Name.c_str()
- << " Value(double) " << d << endl ;
- break ;
- case CORBA::tk_long :
- long l;
- InParametersList[i].Value >>= l;
- cdebug << "ArgOut->In" << i << " : "
- << InParametersList[i].Name.c_str()
- << " Value(long) " << l << endl ;
- break ;
- case CORBA::tk_objref :
- CORBA::Object_ptr obj ;
- char * retstr ;
- try {
- InParametersList[i].Value >>= obj ;
- retstr = ObjectToString( obj );
+ switch ( InParametersList[i].Value.type()->kind() ) {
+ case CORBA::tk_string :
+ char * t;
+ InParametersList[i].Value >>= t ;
cdebug << "ArgOut->In" << i << " : "
<< InParametersList[i].Name.c_str()
- << " Value(object reference) " << retstr << endl ;
- }
- catch ( ... ) {
+ << " Value(string) " << t << endl ;
+ break ;
+ case CORBA::tk_double :
+ double d;
+ InParametersList[i].Value >>= d;
cdebug << "ArgOut->In" << i << " : "
<< InParametersList[i].Name.c_str()
- << " Value(object reference) Catched ERROR" << endl ;
- }
- break ;
- default :
- cdebug << "ArgOut->In" << i << " : "
- << InParametersList[i].Name.c_str()
- << " Value(other) ERROR" << endl ;
- }
+ << " Value(double) " << d << endl ;
+ break ;
+ case CORBA::tk_long :
+ long l;
+ InParametersList[i].Value >>= l;
+ cdebug << "ArgOut->In" << i << " : "
+ << InParametersList[i].Name.c_str()
+ << " Value(long) " << l << endl ;
+ break ;
+ case CORBA::tk_objref :
+ CORBA::Object_ptr obj ;
+ char * retstr ;
+ try {
+ InParametersList[i].Value >>= obj ;
+ retstr = ObjectToString( obj );
+ cdebug << "ArgOut->In" << i << " : "
+ << InParametersList[i].Name.c_str()
+ << " Value(object reference) " << retstr << endl ;
+ }
+ catch ( ... ) {
+ cdebug << "ArgOut->In" << i << " : "
+ << InParametersList[i].Name.c_str()
+ << " Value(object reference) Catched ERROR" << endl ;
+ }
+ break ;
+ default :
+ cdebug << "ArgOut->In" << i << " : "
+ << InParametersList[i].Name.c_str()
+ << " Value(other) ERROR" << endl ;
+ }
//#endif
+ }
}
if ( LoopNode()->PyMoreMethod() && strlen( LoopNode()->PyMoreName() ) ) {
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName()
+ << "' " << LoopNode()->PyMoreMethod() << endl ;
StsPyDynInvoke = PyDynInvoke( LoopNode()->PyMoreMethod() ,
LoopNode()->PyMoreName() ,
&InParametersList[1] , ServiceInParameter().length() ,
&OutParametersList[0] , ServiceOutParameter().length()+1 ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( LoopNode()->PyMoreName() ) ;
+ }
}
else {
+ cdebug << ThreadNo() << " !ObjInterface " << Name()
+ << " IsLoopNode PyDynInvoke '" << LoopNode()->PyMoreName()
+ << "' No MoreMethod" << endl ;
CopyInOut = true ;
}
}
- else if ( !StsPyDynInvoke ) {
+ else {
Err = true ;
cdebug << ThreadNo() << " InLineNode " << Name() << " "
<< InLineNode()->PyFuncName() << "/" << LoopNode()->PyNextName()
InLineNode()->PyFuncName() ,
&InParametersList[0] , ServiceInParameter().length() ,
&OutParametersList[0] , ServiceOutParameter().length() ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( InLineNode()->PyFuncName() ) ;
+ }
}
// else if ( IsGOTONode() && (*GOTONode()->PythonFunction()).length() &&
else if ( IsGOTONode() && /*InLineNode()->PyRunMethod() &&*/
InLineNode()->PyFuncName() ,
&InParametersList[0] , ServiceInParameter().length() ,
&OutParametersList[0] , ServiceOutParameter().length() ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( GOTONode()->PyFuncName() ) ;
+ }
}
// else if ( IsEndSwitchNode() && (*InLineNode()->PythonFunction()).length() &&
else if ( ( IsEndSwitchNode() ) &&
InLineNode()->PyFuncName() ,
&InParametersList[0] , ServiceInParameter().length() ,
&OutParametersList[0] , ServiceOutParameter().length() ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( InLineNode()->PyFuncName() ) ;
+ }
}
else if ( ( IsEndLoopNode() ) &&
InLineNode()->PyRunMethod() && strlen( InLineNode()->PyFuncName() ) ) {
-// cdebug << ThreadNo() << " !ObjInterface " << Name() << " PyFuncName '"
-// << InLineNode()->PyFuncName()
-// << "' IsSwitchNode PyDynInvoke" << endl ;
+ cdebug << ThreadNo() << " !ObjInterface " << Name() << " PyFuncName '"
+ << InLineNode()->PyFuncName()
+ << "' IsSwitchNode PyDynInvoke" << endl ;
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
&InParametersList[0] , ServiceInParameter().length() + 1 ,
&OutParametersList[0] , ServiceOutParameter().length() + 1 ) ;
+ if ( !StsPyDynInvoke ) {
+ RemovePyDynInvoke( InLineNode()->PyFuncName() ) ;
+ }
}
+
// else if ( (*InLineNode()->PythonFunction()).length() == 0 ||
- if ( InLineNode()->PyRunMethod() == NULL ||
- strlen( InLineNode()->PyFuncName() ) == 0 || CopyInOut ) {
+ if ( (!ItIsaLoop && ( InLineNode()->PyRunMethod() == NULL ||
+ strlen( InLineNode()->PyFuncName() ) == 0 ) ) || CopyInOut ) {
+// This is a void Python Function : without code (No PyFuncName)
// cdebug << ThreadNo() << " !ObjInterface " << Name()
// << " Copy of " << ServiceInParameter().length()
// << " OutParameters" << endl ;
if ( IsLoopNode() || IsEndLoopNode() ) {
argout0 = 1 ;
argin0 = 1 ; // after DoLoop
- if ( IsLoopNode() ) {
- OutParametersList[0].Value = InParametersList[0].Value ; // DoLoop
+ if ( IsLoopNode() ) { // More() is void
+// OutParametersList[0].Value = InParametersList[0].Value ; // DoLoop
+ cdebug << Name() << " Not Beginning of loop and non void EndLoop : DoLoop = EndLoop(DoLoop)"
+ << endl ;
+ GraphExecutor::InNode * anEndLoopNode = (GraphExecutor::InNode * ) CoupledNode()->GetInNode() ;
+ OutParametersList[0].Value = *anEndLoopNode->GetNodeOutLoop()->Value() ; // DoLoop = EndLoop(DoLoop)
}
}
for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
}
catch( ... ) {
cdebug << "DynInvoke setProperties catched ERROR" << endl ;
- Err = true ;
+ Err = true;
}
}
if ( !Err && IsComputingNode() ) {
<< " IsComputingNode DynInvoke" << endl ;
cdebug << ServiceInParameter().length()-1 << " input parameters and "
<< ServiceOutParameter().length() << " output parameters" << endl ;
+ IsLoading( false ) ;
DynInvoke( myObjComponent,
ServiceName() ,
&InParametersList[1] , ServiceInParameter().length()-1 ,
&OutParametersList[0] , ServiceOutParameter().length() ) ;
}
- else if ( !Err &&IsFactoryNode() ) {
+ else if ( !Err && IsFactoryNode() ) {
cdebug << ThreadNo() << " !ObjInterface " << Name()
<< " IsFactoryNode DynInvoke" << endl ;
cdebug << ServiceInParameter().length() << " input parameters and "
<< ServiceOutParameter().length() << " output parameters" << endl ;
+ IsLoading( false ) ;
DynInvoke( myObjComponent,
ServiceName() ,
&InParametersList[0] , ServiceInParameter().length() ,
cdebug << ThreadNo() << " !ObjInterface " << Name()
<< " Node(Component) Dynamic Call Exception catched ERROR"
<< endl ;
+//Reset of _ThreadId in the Container ...
+ try {
+ myObjComponent->Kill_impl() ;
+ }
+ catch( ... ) {
+ }
}
}
}
}
}
-// else {
-// sleep( 1 ) ;
-// }
// ostringstream astr ;
// astr << "Graph " << _OutNode->Graph()->Name() << " Node " << Name() << " is done : "
// << Automaton()->StateName( State() ) ;
// _OutNode->Graph()->ObjImpl()->sendMessage( NOTIF_STEP, astr.str().c_str() ) ;
+
if ( Err ) {
+
+ // if exception or something else - IsLoading( false ) may not NOT has been called
+ if ( IsLoading() )
+ IsLoading( false );
+
if ( ControlState() == SUPERV::ToKillState ||
ControlState() == SUPERV::ToKillDoneState ||
ControlState() == SUPERV::ToStopState ) {
// cdebug << ThreadNo() << " --> Executing_SuccessAction " << Name() << endl;
_OutNode->PushEvent( this , GraphExecutor::SuccessedExecutingEvent ,
GraphExecutor::SuccessedState ) ;
+ MESSAGE(pthread_self() << "Executor::InNode::Executing_SuccessAction of " << Name()
+ << " ControlState " << Automaton()->ControlStateName( ControlState() )
+ << " AFTER execution ThreadNo " << ThreadNo() ) ;
SUPERV::ControlState aControl = ControlState() ;
switch ( aControl ) {
case SUPERV::VoidState : {
State( GraphExecutor::DataWaitingState ) ;
for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
GraphBase::InPort * anInPort = GetChangeNodeInPort( i ) ;
- if ( anInPort->IsGate() ) { // Loop : Open the doors
+ cdebug << "SetWaitingStates InPort " << Name() << "( " << anInPort->PortName() << " ) "
+ << anInPort->PortStatus() << " " << anInPort->State() << endl ;
+// JR Debug 07.01.2005 : Close the Gates instead of open !!!
+ if ( anInPort->IsGate() ) { // Loop : Close the doors
GraphBase::OutPort * anOutPort = anInPort->GetOutPort() ;
if ( anOutPort ) {
CORBA::Any * anAny = new CORBA::Any() ;
- *anAny <<= (long ) 1 ;
+// *anAny <<= (long ) 1 ;
+ *anAny <<= (long ) 0 ;
anOutPort->Value( anAny ) ;
- anInPort->State( SUPERV::ReadyState ) ;
+ anInPort->State( SUPERV::WaitingState ) ;
}
}
- else if ( anInPort->State() != SUPERV::WaitingState ) {
+ else if ( anInPort->State() != SUPERV::WaitingState &&
+ !anInPort->IsDataConnected() ) {
if ( !docdebug ) {
cdebug << ThreadNo()
<< " --> GraphExecutor::InNodeThreads::SetWaitingStates " << Name() << endl;
anInPort->State( SUPERV::WaitingState ) ;
}
}
+ cdebug << " --> " << Name() << "( " << anInPort->PortName() << " ) "
+ << anInPort->PortStatus() << " " << anInPort->State() << endl ;
}
for ( i = 0 ; i < GetNodeOutPortsSize() ; i++ ) {
GraphBase::OutPort * anOutPort = GetChangeNodeOutPort( i ) ;
for ( j = 0 ; j < anOutPort->InPortsSize() ; j++ ) {
if ( !( IsGOTONode() && anOutPort->IsGate() ) &&
- !( IsEndLoopNode() && ( anOutPort->IsGate() ||
- anOutPort->IsLoop() ) ) &&
+ !( IsEndLoopNode() && ( anOutPort->IsGate() || anOutPort->IsLoop() ) ) &&
!anOutPort->IsDataStream() &&
!anOutPort->ChangeInPorts( j )->IsDataStream() &&
!anOutPort->ChangeInPorts( j )->IsExternConnected() ) {
<< anOutPort->ChangeInPorts( j )->NodeName() << "( "
<< anOutPort->ChangeInPorts( j )->PortName() << " "
<< anOutPort->ChangeInPorts( j )->PortStatus() << " )" << endl;
- if ( strcmp( anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() , Name() ) ) {
+ GraphBase::ComputingNode * aToNode ;
+ aToNode = _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() ) ;
+// JR 12.01.2005 : the OutPort linked to the InPort of a EndSwitchNode was changed so final
+// values of InPorts of EndSwitchNode may be wrong
+ if ( !aToNode->IsEndSwitchNode() &&
+ strcmp( anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() , Name() ) ) {
// After EndLoopNode or GOTONode the Input Ports of LoopNode or LabelNode have their values from
// EndLoopNode or GOTONode. But if there is several nested loops we should re-establish.
cdebug << ThreadNo()
- << " InNodeThreads::SetWaitingStates OutPort->ChangeInPorts( j )->OutPort()->NodeName "
- << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << " != "
+ << " InNodeThreads::SetWaitingStates Node " << Name() << " "
+ << anOutPort->ChangeInPorts( j )->GetOutPort()->NodeName() << "( "
+ << anOutPort->ChangeInPorts( j )->GetOutPort()->PortName() << " ) != "
<< Name() << " : Restored to " << anOutPort->NodeName() << "( "
<< anOutPort->PortName() << " )" << endl ;
anOutPort->ChangeInPorts( j )->ChangeOutPort( anOutPort ) ;
}
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) _OutNode->Graph()->GetChangeGraphNode( anOutPort->ChangeInPorts( j )->NodeName() )->GetInNode() ;
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) aToNode->GetInNode() ;
if ( aNode != EndNode ) {
aNode->SetWaitingStates( EndNode ) ;
}
DoneAction() ;
if ( IsMacroNode() ) {
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " LinkedNodes->SomeDataReady already done"
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " LinkedNodes->SomeDataReady already done"
<< endl ;
return 1;
}
if ( IsGOTONode() ||
( IsEndLoopNode() && GetNodeInLoop()->GetOutPort()->BoolValue() ) ) {
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name()
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name()
<< " SetWaitingStates " << endl ;
const GraphBase::OutPort * aGateOutPort ;
if ( IsGOTONode() ) {
else {
aGateOutPort = GetNodeOutLoop() ;
}
+ if ( aGateOutPort->InPortsSize() != 1 ) {
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction aGateOutPort->InPortsSize "
+ << aGateOutPort->InPortsSize() << " != 1 ERROR " << Name() << endl ;
+ }
+ GraphExecutor::InNode * aLabelNode = NULL ;
for ( i = 0 ; i < aGateOutPort->InPortsSize() ; i++ ) {
const GraphBase::InPort * anInPort = aGateOutPort->InPorts( i ) ;
- GraphExecutor::InNode * aLabelNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode "
+ aLabelNode = (GraphExecutor::InNode *) _OutNode->Graph()->GetChangeGraphNode( anInPort->NodeName() )->GetInNode() ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " will Loop to HeadNode "
<< aLabelNode->Name() << " from port " << anInPort->PortName() << endl ;
aLabelNode->SetWaitingStates( this ) ;
+// JR 07.01.2005 Debug : Open the Gate of the coupledNode closed by SetWaitingStates
+ GraphBase::OutPort * anOutPort = aLabelNode->GetChangeNodeInGate()->GetOutPort() ;
+ if ( anOutPort ) {
+ CORBA::Any * anAny = new CORBA::Any() ;
+ *anAny <<= (long ) 1 ;
+ anOutPort->Value( anAny ) ;
+ aLabelNode->GetChangeNodeInGate()->State( SUPERV::ReadyState ) ;
+ }
for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) {
const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ;
if ( anInPort->GetOutPort() ) {
if ( !aBusParamOutPort->IsGate() ) {
GraphBase::InPort * aBusParamChangeInPort = NULL ;
if ( aBusParamOutPort->IsLoop() ) {
- aBusParamChangeInPort = aLabelNode->GetChangeNodeInLoop() ;
+// For EndLoop do not copy EndLoop(DoLoop) in Loop(InLoop)
+// aBusParamChangeInPort = aLabelNode->GetChangeNodeInLoop() ;
}
else {
aBusParamChangeInPort = aLabelNode->GetChangeInPort( aBusParamOutPort->PortName() ) ;
}
if ( aBusParamChangeInPort ) {
aBusParamChangeInPort->ChangeOutPort( aBusParamOutPort ) ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " ChangeOutPort to HeadNode "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " ChangeOutPort to HeadNode "
<< aLabelNode->Name() << "(" << aBusParamChangeInPort->PortName() << ") from port "
<< aBusParamOutPort->PortName() << endl ;
- if ( !aLabelNode->IsLockedDataWait() ) {
- res = aLabelNode->SendSomeDataReady( Name() ) ;
- if ( res ) {
- if ( firsttoNode == NULL &&
- aLabelNode->ThreadNo() == pthread_self() ) {
- firsttoNode = aLabelNode ;
- cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode "
- << aLabelNode->Name() << endl ;
- }
- else if ( firstzeroNode == NULL &&
- aLabelNode->ThreadNo() == 0 ) {
- firstzeroNode = aLabelNode ;
- }
- else {
- SomeDataNodes.push_back( aLabelNode ) ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
- << aLabelNode->Name() << " " << SomeDataNodes.size()
- << endl ;
- }
- }
- }
- else {
- cdebug << ThreadNo()
- << " Successed_SuccessAction Loop to HeadNode "
- << aLabelNode->Name() << " with datas from " << Name() << "("
- << aBusParamOutPort->PortName() << ") to port "
- << aBusParamChangeInPort->PortName() << endl;
- }
- }
- else {
- cdebug << ThreadNo() << " ERROR in Successed_SuccessAction of " << Name()
- << " NO port " << aBusParamOutPort->PortName() << " in "
- << aLabelNode->Name() << endl;
}
+ }
+ }
+ }
+
+ if ( aLabelNode && !aLabelNode->IsLockedDataWait() ) {
+ res = aLabelNode->SendSomeDataReady( Name() ) ;
+ if ( res ) {
+ if ( firsttoNode == NULL &&
+ aLabelNode->ThreadNo() == pthread_self() ) {
+ firsttoNode = aLabelNode ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode "
+ << aLabelNode->Name() << endl ;
}
+ else if ( firstzeroNode == NULL &&
+ aLabelNode->ThreadNo() == 0 ) {
+ firstzeroNode = aLabelNode ;
+ }
+ else {
+ SomeDataNodes.push_back( aLabelNode ) ;
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
+ << aLabelNode->Name() << " " << SomeDataNodes.size()
+ << endl ;
+ }
}
+
for ( j = 0 ; j < aLabelNode->GetNodeInPortsSize() ; j++ ) {
const GraphBase::InPort * anInPort = aLabelNode->GetNodeInPort( j ) ;
if ( anInPort->GetOutPort() ) {
if ( firsttoNode == NULL &&
aLabelNode->ThreadNo() == pthread_self() ) {
firsttoNode = aLabelNode ;
- cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode "
<< aLabelNode->Name() << endl ;
}
else if ( firstzeroNode == NULL &&
}
else {
SomeDataNodes.push_back( aLabelNode ) ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
<< aLabelNode->Name() << " " << SomeDataNodes.size()
<< endl ;
}
}
}
else {
- cdebug << ThreadNo() << " ERROR in Successed_SuccessAction of " << Name()
+ cdebug << pthread_self() << "/" << ThreadNo() << " ERROR in Successed_SuccessAction of " << Name()
<< " NO port " << aGateOutPort->PortName() << " in "
<< aLabelNode->Name() << endl;
}
GraphBase::ComputingNode * aComputingNode ;
aComputingNode = (GraphBase::ComputingNode * ) LinkedNodes( i ) ;
toNode = (GraphExecutor::InNode *) aComputingNode->GetInNode() ;
- cdebug << ThreadNo() << " Successed_SuccessAction of " << Name()
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction of " << Name()
<< " [" << i << "] " << LinkedNodes( i )->Name() << " toNode " << toNode << " IgnoreForEndLoop "
<< IgnoreForEndLoop ;
if ( toNode ) {
LoopOutPort->PortStatus( DataConnected );
LoopOutPort->State( SUPERV::ReadyState ) ;
LoopOutPort->Done( true ) ;
- CORBA::Any * anAny = new CORBA::Any() ;
+ CORBA::Any * anAny = new CORBA::Any() ; // InitLoop
*anAny <<= (long ) 1 ;
LoopOutPort->Value( anAny ) ;
int j ;
toNode->GetChangeNodeInPort( j )->InitialOutPort() ;
}
}
- cdebug << ThreadNo() << " Successed_SuccessAction " << toNode->Name() << "->SendSomeDataReady( "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << toNode->Name() << "->SendSomeDataReady( "
<< Name() << " )" << endl ;
res = toNode->SendSomeDataReady( Name() ) ;
if ( res ) {
if ( firsttoNode == NULL &&
toNode->ThreadNo() == pthread_self() ) {
firsttoNode = toNode ;
- cdebug << ThreadNo() << " Successed_SuccessAction firsttoNode "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction firsttoNode "
<< toNode->Name() << endl ;
}
else if ( firstzeroNode == NULL &&
}
else {
SomeDataNodes.push_back( toNode ) ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push "
<< toNode->Name() << " " << SomeDataNodes.size() << endl ;
}
}
if ( firsttoNode == NULL && firstzeroNode ) {
firsttoNode = firstzeroNode ;
- cdebug << ThreadNo()
+ cdebug << pthread_self() << "/" << ThreadNo()
<< " Successed_SuccessAction firsttoNode = firstzeroNode "
<< endl ;
}
else if ( firsttoNode && firstzeroNode ) {
SomeDataNodes.push_back( firstzeroNode ) ;
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode "
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " push firstzeroNode "
<< firstzeroNode->Name() << " " << SomeDataNodes.size() << endl ;
}
else {
- cdebug << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode
+ cdebug << pthread_self() << "/" << ThreadNo() << " Successed_SuccessAction " << Name() << " firsttoNode " << firsttoNode
<< " firstzeroNode " << firstzeroNode << endl ;
}
bool GraphExecutor::InNode::SendSomeDataReady( char * FromNodeName ) {
bool RetVal = false ;
if ( IsDataFlowNode() ) {
- cdebug << ThreadNo() << " ----> " << Name()
+ cdebug << ThreadNo() << "InNode::SendSomeDataReady ----> " << Name()
<< " send Result to graph " << Name() << endl;
}
else {
// << ThreadNo() << " " << endl ;
State( GraphExecutor::DataWaitingState ) ;
}
+// We begin that LoopNode if SendSomeDataReady does not come from the corresponding EndLoopNode
+ if ( IsLoopNode() && strcmp( LoopNode()->CoupledNodeName() , FromNodeName ) ) {
+ cdebug << ThreadNo() << "InNode::SendSomeDataReady " << Name() << " Set _InitLoop from "
+ << FromNodeName << endl ;
+ _InitLoop = true ;
+ }
LockDataWait() ;
DataFromNode( FromNodeName ) ;
RetVal = !SendEvent( GraphExecutor::SomeDataReadyEvent );
int nInParams ,
ServicesAnyData * InParametersList ) {
int i ;
+ cdebug << ThreadNo() << " InParametersSet " << Name() << endl ;
for ( i = 0 ; i < nInParams ; i++ ) {
ServicesAnyData D = InParametersList[i];
GraphBase::InPort * anInPort = GetChangeNodeInPort(i) ;
*anAny <<= (long ) 0 ;
theOutPort->Value( anAny ) ;
}
- if ( !anInPort->IsDataStream() ) {
+ if ( !anInPort->IsDataStream() &&
+ !anInPort->IsDataConnected() ) {
anInPort->State( SUPERV::WaitingState ) ;
}
D.Name = CORBA::string_dup( anInPort->GetServicesParameter().Parametername ) ;
- cdebug << ThreadNo() << " ArgIn" << i << " " << anInPort->Kind() ;
+ cdebug << ThreadNo() << " ArgIn" << i << " " << anInPort->Kind()
+ << " " << anInPort->State() ;
cdebug << " " << D.Name << " " << anInPort->GetServicesParameter().Parametertype << " : " ;
D.Value = *theOutPort->Value() ; // CORBA::Any
string _Type = CORBA::string_dup( anInPort->GetServicesParameter().Parametertype ) ;
int i ;
GraphBase::OutPort * aGateOutPort = NULL ;
bool OrSwitch = false ;
- cdebug << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState " << NewState << endl ;
+ cdebug_in << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState "
+ << NewState << endl ;
// cout << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState " << NewState << endl ;
if ( nOutParams && !IsMacroNode() ) {
GraphBase::OutPort * anOutPort ;
anOutPort->Value( OutParametersList[i].Value );
if ( anOutPort->InPortsSize() && anOutPort->ChangeInPorts( 0 )->IsGate() ) {
if ( OrSwitch && anOutPort->BoolValue() ) {
- cdebug << "GraphExecutor::InNodeThreads::OutParameters more than one switch is true WARNING"
+ cdebug << "GraphExecutor::InNodeThreads::OutParameters more than one switch is true ERROR"
<< endl ;
+ RetVal = false ;
}
else {
OrSwitch = OrSwitch | anOutPort->BoolValue() ;
+ cdebug << "InNodeThreads::OutParameters OrSwitch = true" << endl ;
}
}
- cdebug << "OrSwitch " << OrSwitch ;
+ cdebug << "OutParametersSet OrSwitch " << OrSwitch ;
}
else {
cdebug << " Param " ;
}
if ( aGateOutPort && IsSwitchNode() ) {
if ( OrSwitch ) {
-// cdebug << ThreadNo() << " " << "Out0 " << Name() << " Close of "
-// << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ;
+ cdebug << ThreadNo() << " " << "Out0 " << Name() << " Close of "
+ << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ;
long l = 0;
OutParametersList[0].Value <<= l ;
aGateOutPort->Value( OutParametersList[0].Value ) ;
}
else {
-// cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of "
-// << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ;
+ cdebug << ThreadNo() << " " << "Out0 " << Name() << " Open of "
+ << aGateOutPort->PortName() << " " << aGateOutPort->Kind() ;
long l = 1;
OutParametersList[0].Value <<= l ;
aGateOutPort->Value( OutParametersList[0].Value ) ;
}
}
}
+ cdebug_out << "OutParametersSet " << Name() << " nOutParams " << nOutParams << " NewState "
+ << NewState << " RetVal " << RetVal << endl ;
return RetVal ;
}
#include "DataFlowEditor_DataFlow.hxx"
+// asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+//extern Engines_Container_i * _TheContainer ;
+
extern GraphExecutor::FiniteStateMachine * theAutomaton ;
// static const char *ComponentName = "SalomeSuperVisionComponent" ;
GraphExecutor::OutNode::OutNode() {
// Graph() {
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
_prof_debug , _fdebug ) ;
_Graph = _StreamGraph ;
}
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
_prof_debug , _fdebug ) ;
_Graph = _StreamGraph ;
}
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_SuperVisionContainer = _TheContainer ;
+ //_MainThreadId = SuperVisionContainer()->MainThreadId() ;
_Valid = false ;
_Executable = false ;
_Done = false ;
_Executable = false ;
if ( !Graph()->CreateService() ) {
- cdebug << "This DataFlow has invalid type(s)." << endl ;
+ cdebug_out << "This DataFlow has invalid type(s)." << endl ;
return false ;
}
int SubStreamGraphsNumber = 0 ;
if ( !Graph()->Sort( SubStreamGraphsNumber ) ) {
- cdebug << "This DataFlow is not valid." << endl ;
+ cdebug_out << "This DataFlow is not valid." << endl ;
return false ;
}
if ( Graph()->IsDataStreamNode() ) {
StreamGraph()->SubStreamGraphsNumber( SubStreamGraphsNumber ) ;
}
+ if ( !Graph()->ValidLoops() ) {
+ cdebug_out << "This DataFlow have not valid Loops." << endl ;
+ return false ;
+ }
// CreateService() ;
bool GraphExecutor::OutNode::Run( const bool AndSuspend ) {
bool RetVal = false ;
- cdebug_in << "GraphExecutor::OutNode::Run( AndSuspend " << AndSuspend << " )" << endl;
+ cdebug_in << pthread_self() << "GraphExecutor::OutNode::Run( AndSuspend " << AndSuspend << " )"
+ << endl;
if ( Executable() ) {
_ControlState = SUPERV::VoidState ;
int i ;
for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
GraphExecutor::InNode * anInNode = (GraphExecutor::InNode *) Graph()->GraphNodes( i )->GetInNode() ;
+ anInNode->OutNode( this ) ;
+// Initialize in python interpretor the python functions
if ( !PyInitialized() && anInNode->IsOneOfInLineNodes() ) {
if ( !Py_IsInitialized() ) {
+// PyEval_InitThreads() ;
// Py_Initialize() ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ // 1 line below uncommented
PySys_SetArgv( _ArgC , _ArgV ) ;
}
anInNode->InitPython() ;
PyInitialized( true ) ;
}
- anInNode->InitialState( this ) ;
+ anInNode->InitialState() ;
if ( anInNode->IsOneOfInLineNodes() ) {
anInNode->InitPythonFunctions( false ) ;
}
}
// PushEvent( anInNode , GraphExecutor::ReadyEvent ,
// GraphExecutor::DataReadyState ) ;
+// We say that we have to create a thread for that HeadNode 'anInNode'
anInNode->CreateNewThread( true ) ;
anInNode->DataFromNode( Graph()->Name() ) ;
+// AndSuspend == true <==> Start()
if ( AndSuspend ) {
anInNode->State( GraphExecutor::DataWaitingState ) ;
anInNode->ControlState( SUPERV::ToSuspendStartState ) ;
+// We send SomeDataReadyEvent
+// It is a HeadNode ==> AllDataReadyEvent ==> InNode::executeAction() ==> pthread_create
if ( !anInNode->SendEvent( GraphExecutor::SomeDataReadyEvent ) ) {
cdebug << "InNode::SendEvent( SomeDataReadyEvent ) ERROR Node "
<< anInNode->Name() << endl ;
cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
return false ;
}
+// ==> We wait for SuspendedState
anInNode->SuspendedWait() ;
}
+// AndSuspend == false <==> Run()
else if ( anInNode->IsMacroNode() ) {
if ( !anInNode->SendEvent( GraphExecutor::SomeDataReadyEvent ) ) {
cdebug << "InNode::SendEvent( SomeDataReadyEvent ) ERROR Node "
}
cdebug << pthread_self() << " GraphExecutor::OutNode::Run " << anInNode->Name() << "->RunningWait"
<< endl ;
+// ==> We wait for RunningState
anInNode->RunningWait() ;
cdebug << pthread_self() << " GraphExecutor::OutNode::Run " << anInNode->Name() << "->RunningWaited"
<< endl ;
}
else if ( !anInNode->IsMacroNode() ) {
+// It is a HeadNode ==> AllDataReadyEvent ==> InNode::executeAction() ==> pthread_create
if ( !anInNode->SendEvent( GraphExecutor::ExecuteEvent ) ) {
cdebug << "InNode::SendEvent( ExecuteEvent ) ERROR Node "
<< anInNode->Name() << endl ;
cdebug_out << "GraphExecutor::OutNode::Run SendEvent ERROR" << endl ;
return false ;
}
+// ==> We wait for RunningState
anInNode->RunningWait() ;
}
}
}
}
- cdebug_out << "GraphExecutor::OutNode::Run " << Graph()->Name() << " GraphMacroLevel "
+ cdebug_out << pthread_self() << "GraphExecutor::OutNode::Run " << Graph()->Name()
+ << " GraphMacroLevel "
<< Graph()->GraphMacroLevel() << " RetVal " << RetVal << endl ;
return RetVal ;
}
-bool GraphExecutor::OutNode::Run( const char * aNodeName ,
- const char * AtNodeName ,
- const bool AndSuspend ) {
- bool RetVal = false ;
- cdebug_in << "GraphExecutor::OutNode::Run( " << aNodeName << " , "
- << AtNodeName << " , " << AndSuspend << ")" << endl;
- GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *) Graph()->GetGraphNode( aNodeName )->GetInNode() ;
- if ( anInNode ) {
- RetVal = anInNode->ReStart( AtNodeName , AndSuspend ) ;
- }
- cdebug_out << "GraphExecutor::OutNode::Run" << endl ;
- return RetVal ;
-}
-
void GraphExecutor::OutNode::CheckAllDone() {
int j ;
cdebug_in << "GraphExecutor::OutNode::CheckAllDone " << endl;
aState == SUPERV::RunningState ||
aState == SUPERV::SuspendDoneState ||
aState == SUPERV::SuspendErroredState ||
- aState == SUPERV::ReRunState ||
- aState == SUPERV::ReStartState ||
aState == SUPERV::SuspendState ) {
alivenodes += 1 ;
}
<< _SuspendedThreads << " EventQSize " << EventQSize() << endl ;
}
+// asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+//Engines_Container_i * GraphExecutor::OutNode::SuperVisionContainer() {
+// return _SuperVisionContainer ;
+//}
+
+//const pthread_t GraphExecutor::OutNode::MainThreadId() const {
+// return _MainThreadId ;
+//}
+
void GraphExecutor::OutNode::PThreadLock( pthread_mutex_t * aMutex , char * errmsg ) {
// if ( strcmp( errmsg , "EventLoop" ) && strcmp( errmsg , "EventW" ) ) {
// cdebug << "GraphExecutor::OutNode::PThreadLock " << pthread_self() << " " << aMutex << " "
aGraphEvent = SUPERV::ErroredEvent ;
break ;
}
- case GraphExecutor::ReStartEvent : {
- aGraphEvent = SUPERV::ReRunEvent ;
- break ;
- }
- case GraphExecutor::ReStartAndSuspendEvent : {
- aGraphEvent = SUPERV::ReStartEvent ;
- break ;
- }
case GraphExecutor::NoDataReadyEvent : {
aGraphEvent = SUPERV::WaitingEvent ;
break ;
aGraphEvent = SUPERV::StopEvent ;
break ;
}
- case GraphExecutor::ReStartedEvent : {
- aGraphEvent = SUPERV::ReRunEvent ;
- break ;
- }
- case GraphExecutor::ReStartedAndSuspendEvent : {
- aGraphEvent = SUPERV::ReStartEvent ;
- break ;
- }
case GraphExecutor::EndExecuteEvent : {
aGraphEvent = SUPERV::DoneEvent ;
break ;
aGraphState = SUPERV::StopState ;
break ;
}
- case GraphExecutor::ReRunnedState : {
- aGraphState = SUPERV::ReRunState ;
- break ;
- }
- case GraphExecutor::ReStartedState : {
- aGraphState = SUPERV::ReStartState ;
- break ;
+ case GraphExecutor::LoadingState : {
+ aGraphState = SUPERV::LoadingState ;
+ break;
}
default : {
cdebug << " GraphExecutor::OutNode::AutomatonGraphState Error Undefined State : "
int ThreadsNumber ;
int SuspendedThreadsNumber ;
+ bool cdebuginout = false ;
if ( _EventNodes.size() > 0 ) {
- cdebug_in << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue" << endl ;
+// cdebug_in << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue" << endl ;
+ cdebuginout = true ;
}
if ( pthread_mutex_lock( &_MutexWait ) ) {
perror("EventLoop pthread_mutex_lock ") ;
perror("EventLoop pthread_mutex_lock ") ;
exit( 0 ) ;
}
- if ( _EventNodes.size() > 0 ) {
- cdebug_out << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue "
- << *aNodeName << " " << anEvent << " " << aState << endl ;
+ if ( cdebuginout ) {
+// cdebug_out << "GraphExecutor::OutNode::Event " << _EventNodes.size() << " in queue"
+// << *aNodeName << " " << anEvent << " " << aState << endl ;
}
return RetVal ;
}
if ( aCNode ) {
GraphExecutor::InNode *anInNode = (GraphExecutor::InNode *)aCNode->GetInNode() ;
if ( anInNode ) {
- aret = anInNode->State() ;
+ if ( anInNode->IsLoading() )
+ aret = GraphExecutor::LoadingState;
+ else
+ aret = anInNode->State() ;
// cdebug << "GraphExecutor::OutNode::State( " << NodeName << " ) "
// << theAutomaton->StateName( AutomatonGraphState( aret ) ) << endl ;
}
bool GraphExecutor::OutNode::IsSuspended() {
// cdebug_in << "GraphExecutor::OutNode::IsSuspended" << endl;
bool aret = false ;
- if ( _SuspendedThreads == _Threads && _Threads != 0 ) {
+// if ( _SuspendedThreads == _Threads && _Threads != 0 ) {
+ if ( AutomatonGraphState( _State ) == SUPERV::SuspendState ) {
aret = true ;
}
// cdebug_out << "GraphExecutor::OutNode::IsSuspended" << endl ;
RetVal += 1 ;
cdebug << aNode->Name() << " Suspended" << endl ;
}
- else if ( aNode->IsWaiting() || aNode->IsDone() ) {
+ else if ( aNode->IsWaiting() || aNode->IsReady() ) {
+ RetVal += 1 ;
+ cdebug << aNode->Name() << " will be Suspended" << endl ;
+ }
+ else if ( aNode->IsDone() ) {
cdebug << aNode->Name() << " not Suspended : "
<< theAutomaton->StateName( aNode->State() ) << endl ;
}
else {
- RetVal += 1 ;
+// RetVal += 1 ;
cdebug << aNode->Name() << " cannot be Suspended : "
<< theAutomaton->StateName( aNode->State() ) << endl ;
}
MESSAGE( Graph()->Name() << " IS NOT SUSPENDED" ) ;
MESSAGE("================================================================================") ;
}
- cdebug_out << "GraphExecutor::OutNode::Suspend" << theAutomaton->StateName( State() ) << endl ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
+ MESSAGE(aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) ) ;
+ cdebug << aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) << endl ;
+ }
+ cdebug_out << "GraphExecutor::OutNode::Suspend " << theAutomaton->StateName( State() )
+ << " EventQSize " << EventQSize() << endl ;
return RetVal ;
}
bool GraphExecutor::OutNode::Resume() {
int RetVal = 0 ;
- cdebug_in << "GraphExecutor::OutNode::Resume" << endl;
+ cdebug_in << "GraphExecutor::OutNode::Resume "
+ << theAutomaton->StateName( State() ) << endl;
if ( IsSuspended() ) {
State( GraphExecutor::ExecutingState ) ;
int i ;
MESSAGE( Graph()->Name() << " IS NOT RESUMED" ) ;
MESSAGE("================================================================================") ;
}
- cdebug_out << "GraphExecutor::OutNode::Resume" << theAutomaton->StateName( State() ) << " " << RetVal << endl ;
+ int i ;
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
+ MESSAGE(aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) ) ;
+ cdebug << aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) << endl ;
+ }
+ cdebug_out << "GraphExecutor::OutNode::Resume" << theAutomaton->StateName( State() ) << " " << RetVal
+ << " EventQSize " << EventQSize() << endl ;
return RetVal ;
}
bool GraphExecutor::OutNode::Kill() {
- bool RetVal = true ;
- cdebug_in << "GraphExecutor::OutNode::Kill" << endl;
+ bool RetVal = false ;
+ cdebug_in << "GraphExecutor::OutNode::Kill"
+ << " EventQSize " << EventQSize() << endl;
_ControlState = SUPERV::ToSuspendState ;
int i ;
for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
bool sts = aNode->Kill() ;
- if ( sts && aNode->IsKilled() ) {
- cdebug << aNode->Name() << " killed" << endl ;
+ if ( sts && Threads() != 0 ) {
+ if ( !aNode->IsKilled() ) {
+ cdebug << aNode->Name() << " not killed : "
+ << theAutomaton->StateName( aNode->State() ) << " " << aNode->Name() << "->"
+ << "KilledAction()" << endl ;
+ MESSAGE( aNode->Name() << " not killed : KilledAction()" ) ;
+ aNode->KilledAction() ;
+ }
+ if ( aNode->IsKilled() ) {
+ cdebug << aNode->Name() << " killed" << endl ;
+ RetVal = true ;
+ }
}
else if ( aNode->IsWaiting() || aNode->IsDone() ) {
cdebug << aNode->Name() << " not killed : "
else {
cdebug << aNode->Name() << " cannot be killed : "
<< theAutomaton->StateName( aNode->State() ) << endl ;
- RetVal = false ;
- }
- }
- if ( !RetVal || Threads() != 0 ) {
- for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
- GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
- if ( !aNode->IsKilled() && !aNode->IsWaiting() && !aNode->IsDone() ) {
- cdebug << aNode->Name() << " not killed : "
- << theAutomaton->StateName( aNode->State() ) << " " << aNode->Name() << "->"
- << "KilledAction()" << endl ;
- aNode->KilledAction() ;
- }
}
- RetVal = true ;
}
- State( GraphExecutor::KilledState ) ;
if ( RetVal ) {
+ State( GraphExecutor::KilledState ) ;
MESSAGE("================================================================================") ;
MESSAGE( Graph()->Name() << " IS KILLED" << theAutomaton->StateName( AutomatonState() ) << " EventQSize "
<< EventQSize() ) ;
MESSAGE( Graph()->Name() << " IS NOT KILLED" ) ;
MESSAGE("================================================================================") ;
}
+ for ( i = 0 ; i < Graph()->GraphNodesSize() ; i++ ) {
+ GraphExecutor::InNode * aNode = (GraphExecutor::InNode * ) Graph()->GraphNodes( i )->GetInNode() ;
+ MESSAGE(aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) ) ;
+ cdebug << aNode->Name() << " " << theAutomaton->StateName( aNode->State() ) << endl ;
+ }
cdebug_out << "GraphExecutor::OutNode::Kill " << RetVal
- << " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads << endl ;
+ << " Threads " << _Threads << " SuspendedThreads " << _SuspendedThreads
+ << " EventQSize " << EventQSize() << endl ;
// remove "extra" events from the event queue
siftEvents();
}
return RetVal ;
}
-bool GraphExecutor::OutNode::ReRun() {
- bool RetVal = false ;
- cdebug_in << "GraphExecutor::OutNode::ReRun" << endl;
- if ( IsSuspended() ) {
- }
- cdebug_out << "GraphExecutor::OutNode::ReRun" << endl ;
- return RetVal ;
-}
-bool GraphExecutor::OutNode::ReStart() {
- bool RetVal = false ;
- cdebug_in << "GraphExecutor::OutNode::ReStart" << endl;
- if ( IsSuspended() ) {
- }
- cdebug_out << "GraphExecutor::OutNode::ReStart" << endl ;
- return RetVal ;
-}
bool GraphExecutor::OutNode::ReadyWait() {
cdebug_in << "GraphExecutor::OutNode::ReadyWait" << endl;
SUPERV::ControlState _ControlState ;
bool _Done ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Engines_Container_i * _SuperVisionContainer ;
+ //pthread_t _MainThreadId ;
pthread_mutex_t _PyMutexWait ;
pthread_mutex_t _MutexWait ;
pthread_cond_t _EventWait ;
return _Executable ; } ;
bool Run( const bool AndSuspend ) ;
- bool Run( const char * aNodeName , const char * AtNodeName ,
- const bool AndSuspend ) ;
void PyInitialized( bool init ) {
_PyInitialized = init ; } ;
void CheckAllDone() ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Engines_Container_i * SuperVisionContainer() ;
+ //const pthread_t MainThreadId() const ;
void PThreadLock( pthread_mutex_t * aMutex , char * errmsg ) ;
void PThreadUnLock( pthread_mutex_t * aMutex , char * errmsg ) ;
void PyThreadLock() ;
bool Resume() ;
bool Kill() ;
bool Stop() ;
- bool ReRun() ;
- bool ReStart() ;
bool IsWaiting() ;
bool IsReady() ;
#include "DataFlowExecutor_InNode.hxx"
#include "DataFlowExecutor_OutNode.hxx"
-#include "CASCatch_SignalsHandler.h" // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
-
using namespace CORBA ;
+//static PyObject * MyPyObjSignal = NULL ;
static PyObject * MyPyObjRef = NULL ;
static PyObject * MyPyObjIor = NULL ;
static PyObject * MyPyRunMethod = NULL ;
// PyObject * Module = Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
if ( !Automaton()->PyInitModule() ) {
Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod ) ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //_OutNode->SuperVisionContainer()->ActivatePythonExecution( "InitPyRunMethod" , MethodPyRunMethod ) ;
}
// PyObject * Dictionnary = PyModule_GetDict( Module ) ;
// InitPyDynInvokeError = PyErr_NewException( "InitPyDynInvokeError" , NULL , NULL ) ;
// PyDict_SetItemString( Dictionnary , InitPyDynInvokeError ) ;
cdebug << ThreadNo() << "Py_Initialized() " << endl ;
+#if 0
+//JR : Python documentation says that there is no sense to set a handler of synchronous
+// signals as SIGSEGV and SIGFPE !!!
+ if ( Automaton()->PyFunction( "PyObjSignal" ) == NULL ) {
+ string aPyFunc ;
+ aPyFunc = "import signal\n" ;
+ aPyFunc += "import InitPyRunMethod\n" ;
+ aPyFunc += "import sys\n" ;
+ aPyFunc += "import CORBA\n" ;
+ aPyFunc += "import omniORB\n" ;
+ aPyFunc += "def PySignalHandler( aSignal , aStackFrame ) :\n" ;
+ aPyFunc += " print 'PySignalHandler(aSignal =',aSignal,',aStackFrame= ',aStackFrame,')'\n" ;
+ aPyFunc += "InitPyRunMethod.RunMethod( PySignalHandler )\n" ;
+ aPyFunc += "PrevHandler = signal.signal( signal.SIGSEGV , PySignalHandler )\n" ;
+ aPyFunc += "print 'PyObjSignal PrevHandler of SIGSEGV :', PrevHandler\n" ;
+ aPyFunc += "print 'PyObjSignal actual handler of SIGSEGV :', signal.getsignal( signal.SIGSEGV )\n" ;
+// if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+ if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
+ cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
+ Automaton()->PyUnLock() ;
+ return false ;
+ }
+ MyPyObjSignal = MyPyRunMethod ;
+ Automaton()->PyFunction( "PyObjSignal" , MyPyObjSignal ) ;
+ }
+ else {
+ MyPyObjSignal = Automaton()->PyFunction( "PyObjSignal" ) ;
+ }
+#endif
+
+// PyObjRef convert an IOR (string) to an Python ObjectReference
if ( Automaton()->PyFunction( "PyObjRef" ) == NULL ) {
string aPyFunc ;
-// aPyFunc = "print 'InitPyRunMethod'\n" ;
aPyFunc = "import InitPyRunMethod\n" ;
-// aPyFunc += "print 'sys'\n" ;
aPyFunc += "import sys\n" ;
-// aPyFunc += "print 'CORBA'\n" ;
aPyFunc += "import CORBA\n" ;
-// aPyFunc += "print 'omniORB'\n" ;
aPyFunc += "import omniORB\n" ;
-// aPyFunc += "print 'PyObjRef'\n" ;
aPyFunc += "def PyObjRef( IORObjStr ) :\n" ;
-// aPyFunc += " print 'PyObjRef',IORObjStr\n" ;
aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
-// aPyFunc += " print 'PyObjRef orb',orb\n" ;
aPyFunc += " objref = orb.string_to_object( IORObjStr )\n" ;
-// aPyFunc += " print 'PyObjRef IORObjStr objref',IORObjStr,objref\n" ;
aPyFunc += " return objref\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ;
if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
Automaton()->PyUnLock() ;
return false ;
MyPyObjRef = Automaton()->PyFunction( "PyObjRef" ) ;
}
+// PyObjRef convert an Python ObjectReference to an IOR (string)
if ( Automaton()->PyFunction( "PyObjIor" ) == NULL ) {
string aPyFunc ;
aPyFunc = "import InitPyRunMethod\n" ;
aPyFunc += "import CORBA\n" ;
aPyFunc += "import omniORB\n" ;
aPyFunc += "def PyObjIor( ObjRef ) :\n" ;
-// aPyFunc += " print 'PyObjIor',ObjRef\n" ;
aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
-// aPyFunc += " print 'PyObjIor orb',orb\n" ;
aPyFunc += " objIor = orb.object_to_string( ObjRef )\n" ;
-// aPyFunc += " print 'PyObjIor ObjRef objIor',ObjRef,objIor\n" ;
aPyFunc += " return objIor\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ;
if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRun_SimpleString ERROR " << endl << aPyFunc << endl ;
Automaton()->PyUnLock() ;
return false ;
return true ;
}
+void GraphExecutor::InNode::RemovePyDynInvoke( char * PyFuncName ) {
+// Automaton()->PyLock() ; // Already done ...
+ if ( Automaton()->ErasePyFunction( PyFuncName ) ) {
+ cdebug << "InNode::RemovePyDynInvoke( " << PyFuncName << " ) success" << endl ;
+ }
+ else {
+ cdebug << "InNode::RemovePyDynInvoke( " << PyFuncName << " ) ERROR failed" << endl ;
+ }
+// Automaton()->PyUnLock() ;
+}
+
PyObject * GraphExecutor::InNode::InitPyDynInvoke( char * PyFuncName ,
const SUPERV::ListOfStrings * aPythonFunction ,
bool & Err ) {
aPyFunc += PyFuncName ;
aPyFunc += " )\n" ;
/*cdebug *///cout<< "InitPyDynInvoke PyRun_SimpleString " << endl << aPyFunc << endl ;
+// if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
if ( PyRunSimpleString( (char *) aPyFunc.c_str() ) ) {
cdebug << ThreadNo() << " " << Name() << " PyRunSimpleString ERROR " << endl << aPyFunc << endl ;
+ PyFuncRunned( false ) ;
RetVal = false ;
Err = true ;
}
Automaton()->PyUnLock() ;
}
- cdebug_out << "InitPyDynInvoke '" << PyFuncName << "' thePyRunMethod Null" << endl ;
+ cdebug_out << "InitPyDynInvoke '" << PyFuncName << "' thePyRunMethod Null Err " << Err << endl ;
return NULL ;
}
PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
cdebug << "ArgIn" << i << " : " << sname << " " << method << " " << " Value " << IORObjRef << " (objref) "
<< MyPyObjRef->ob_refcnt << "/" << MyPyObjRefList->ob_refcnt << endl ;
- ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ;
+// ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ;
+ ResultObj = PyEvalCallObject( MyPyObjRef , MyPyObjRefList ) ;
cdebug << "ObjValue->ob_refcnt" << ObjValue->ob_refcnt << endl ;
ArgValue = Py_BuildValue( "O" , ResultObj ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
}
}
- Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
+// Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
+ Result = PyEvalCallObject( MyPyRunMethod , ArgsList ) ;
cdebug << "ArgsList->ob_refcnt" << ArgsList->ob_refcnt << endl ;
Py_INCREF( ObjIor ) ;
// PyObject_Print( ObjIor , stdout , 0 ) ;
PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
- ResultIor = PyEval_CallObject( MyPyObjIor , MyPyObjIorList ) ;
+// ResultIor = PyEval_CallObject( MyPyObjIor , MyPyObjIorList ) ;
+ ResultIor = PyEvalCallObject( MyPyObjIor , MyPyObjIorList ) ;
cdebug << "ObjIor->ob_refcnt " << ObjIor->ob_refcnt-1 << endl ;
Py_DECREF( ObjIor ) ;
cdebug << "MyPyObjIorList->ob_refcnt " << MyPyObjIorList->ob_refcnt-1 << endl ;
}
-// This method was created in order to wrap PyRun_SimpleString() with exception handling wrapper.
-// Python does not throw usual C++ style exceptions, so try-catch construct does not work for this
-// purpose. Instead Python raises signals. If these signals are not caught by the application
-// it will be caught by the OS and the application will be terminated : BUG PAL6869
-// Declaring CASCatch_SignalsHandler object redefines (!) standard C++ reserved words "try" and "catch".
-// Standard_Failure "exception" is a signal in fact, and it will be caught in the catch section.
-// Why do we finalize and re-initialize Python after catching the signal? Because the Python stack
-// is corrupted after that.
-// Declaration of CASCatch_SignalsHandler forces us to add linkage with CASCADE libraries.. See Makefile.in.
bool GraphExecutor::InNode::PyRunSimpleString( char* thePyString )
{
- CASCatch_SignalsHandler aSignalsHandler;
const bool ErrorValue = true;
bool aRet;
try {
+ MESSAGE( pthread_self() << "Python method beginning : " << thePyString );
+ cdebug_in << pthread_self() << "Python method beginning : " << thePyString << endl ;
aRet = PyRun_SimpleString( thePyString );
- } catch( Standard_Failure ) {
- MESSAGE( "ERROR: Exception caught running Python method." );
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //aRet = _OutNode->SuperVisionContainer()->ActivatePythonExecution( thePyString ) ;
+ MESSAGE( pthread_self() << "Python method finished." );
+ cdebug_out << pthread_self() << "Python method finished." << endl ;
+ } catch( ... ) {
+ MESSAGE( pthread_self() << "ERROR: Exception caught running Python method." );
+ cdebug_out << pthread_self() << "ERROR: Exception caught running Python method."
+ << endl ;
MESSAGE( " Python was reinitialized. Previous Python definitions are lost" );
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
Py_Finalize();
Py_Initialize();
Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
}
return aRet;
}
+
+PyObject * GraphExecutor::InNode::PyEvalCallObject( PyObject * MyPyRunMethod ,
+ PyObject * ArgsList ) {
+ cdebug_in << "Executor::InNode::PyEvalCallObject " << Name() << endl ;
+ PyObject * Result = NULL ;
+ try {
+ MESSAGE( pthread_self() << "PyEval_CallObject method beginning : " );
+ cdebug << pthread_self() << "PyEval_CallObject method beginning : " << Name() << endl ;
+ Result = PyEval_CallObject( MyPyRunMethod , ArgsList ) ;
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ //Result = _OutNode->SuperVisionContainer()->ActivatePythonExecution( MyPyRunMethod , ArgsList ) ;
+ MESSAGE( pthread_self() << "PyEval_CallObject method finished. Result " << Result );
+ cdebug << pthread_self() << "PyEval_CallObject method finished. Result " << Result << endl ;
+ cdebug_out << "Executor::InNode::PyEvalCallObject " << Name() << endl ;
+ } catch( ... ) {
+ MESSAGE( pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result " << Result );
+ cdebug << pthread_self() << "ERROR: Exception caught PyEval_CallObject Python method. Result "
+ << Result << endl ;
+ MESSAGE( " Python was reinitialized. Previous Python definitions are lost Py_IsInitialized " << Py_IsInitialized() );
+//JR ===> fatal error in python : no current thread
+ // asv : 20.01.05 : changes involved with switching to old (HEAD) KERNEL
+ Py_Finalize();
+ Py_Initialize();
+ Automaton()->PyInitModule( false ) ;
+ Py_InitModule( "InitPyRunMethod" , MethodPyRunMethod );
+ _OutNode->PyInitialized( false );
+
+ if ( Result == NULL ) {
+ Kill() ; // Reset of _ThreadId
+ }
+ cdebug_out << "Executor::InNode::PyEvalCallObject ERROR catched " << Name()
+ << " Py_IsInitialized " << Py_IsInitialized() << endl ;
+ }
+ return Result ;
+}
-I${KERNEL_ROOT_DIR}/include/salome
CXXFLAGS+= -g -D__x86__ -D__linux__ -ftemplate-depth-42 -Wall \
-I${KERNEL_ROOT_DIR}/include/salome
-LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace -lCASCatch\
+LDFLAGS+= -export-dynamic -lSalomeNS -lSalomeLifeCycleCORBA -lSalomeSuperVisionBase -lSalomeSuperVisionEditor -lOpUtil -lSALOMELocalTrace\
-lc $(QT_MT_LIBS) $(OGL_LIBS) \
-L${KERNEL_ROOT_DIR}/lib/salome
#LIBS += -Xlinker -export-dynamic $(PYTHON_LIBS)
LIB = libSUPERVGUI.la
-LIB_SRC = SUPERVGUI.cxx \
- SUPERVGUI_Service.cxx \
- SUPERVGUI_Python.cxx \
- SUPERVGUI_Information.cxx \
- SUPERVGUI_Notification.cxx \
- SUPERVGUI_Main.cxx \
- SUPERVGUI_View.cxx \
- SUPERVGUI_Graph.cxx \
- SUPERVGUI_Array.cxx \
- SUPERVGUI_Node.cxx \
- SUPERVGUI_GraphNode.cxx \
- SUPERVGUI_ComputeNode.cxx \
- SUPERVGUI_ControlNode.cxx \
- SUPERVGUI_Port.cxx \
- SUPERVGUI_BrowseNodeDlg.cxx \
- SUPERVGUI_Link.cxx \
- SUPERVGUI_CtrlLink.cxx \
- SUPERVGUI_Label.cxx \
- SUPERVGUI_CanvasView.cxx \
- SUPERVGUI_Canvas.cxx \
- SUPERVGUI_CanvasNode.cxx \
- SUPERVGUI_CanvasNodePrs.cxx \
- SUPERVGUI_CanvasControlNode.cxx \
- SUPERVGUI_CanvasControlNodePrs.cxx \
- SUPERVGUI_CanvasPort.cxx \
- SUPERVGUI_CanvasLink.cxx
+LIB_SRC = SUPERVGUI.cxx \
+ SUPERVGUI_ArrayView.cxx \
+ SUPERVGUI_Canvas.cxx \
+ SUPERVGUI_CanvasArray.cxx \
+ SUPERVGUI_CanvasView.cxx \
+ SUPERVGUI_CanvasNode.cxx \
+ SUPERVGUI_CanvasNodePrs.cxx \
+ SUPERVGUI_CanvasControlNode.cxx \
+ SUPERVGUI_CanvasControlNodePrs.cxx \
+ SUPERVGUI_CanvasCellNodePrs.cxx \
+ SUPERVGUI_CanvasPort.cxx \
+ SUPERVGUI_CanvasLink.cxx \
+ SUPERVGUI_Service.cxx \
+ SUPERVGUI_Main.cxx \
+ SUPERVGUI_BrowseNodeDlg.cxx \
+ SUPERVGUI_Information.cxx \
+ SUPERVGUI_Notification.cxx \
+ SUPERVGUI_ManagePortsDlg.cxx \
+ SUPERVGUI_Library.cxx \
+ SUPERVGUI_Clipboard.cxx
-LIB_MOC = SUPERVGUI.h \
- SUPERVGUI_Service.h \
- SUPERVGUI_Python.h \
- SUPERVGUI_Information.h \
- SUPERVGUI_Notification.h \
- SUPERVGUI_Main.h \
- SUPERVGUI_View.h \
- SUPERVGUI_Graph.h \
- SUPERVGUI_Array.h \
- SUPERVGUI_Node.h \
- SUPERVGUI_GraphNode.h \
- SUPERVGUI_ComputeNode.h \
- SUPERVGUI_ControlNode.h \
- SUPERVGUI_Port.h \
- SUPERVGUI_BrowseNodeDlg.h \
- SUPERVGUI_Link.h \
- SUPERVGUI_Label.h \
- SUPERVGUI_Canvas.h \
- SUPERVGUI_CanvasView.h \
- SUPERVGUI_CanvasNode.h \
- SUPERVGUI_CanvasControlNode.h \
- SUPERVGUI_CanvasPort.h \
- SUPERVGUI_CanvasLink.h
+LIB_MOC = SUPERVGUI.h \
+ SUPERVGUI_ArrayView.h \
+ SUPERVGUI_Canvas.h \
+ SUPERVGUI_CanvasArray.h \
+ SUPERVGUI_CanvasView.h \
+ SUPERVGUI_CanvasNode.h \
+ SUPERVGUI_CanvasControlNode.h \
+ SUPERVGUI_CanvasPort.h \
+ SUPERVGUI_CanvasLink.h \
+ SUPERVGUI_Service.h \
+ SUPERVGUI_Main.h \
+ SUPERVGUI_BrowseNodeDlg.h \
+ SUPERVGUI_Information.h \
+ SUPERVGUI_Notification.h \
+ SUPERVGUI_ManagePortsDlg.h \
+ SUPERVGUI_Library.h \
+ SUPERVGUI_Clipboard.h
-LIB_CLIENT_IDL = SALOMEDS.idl \
+LIB_CLIENT_IDL = SALOMEDS.idl \
SALOMEDS_Attributes.idl \
- SALOME_ModuleCatalog.idl \
- SALOME_Component.idl \
- SUPERV.idl \
+ SALOME_ModuleCatalog.idl \
+ SALOME_Component.idl \
+ SUPERV.idl \
SALOME_Exception.idl
LIB_SERVER_IDL =
-lSalomeGUI -lSalomeNS -lqsplitterP -lEvent \
-lSalomeLifeCycleCORBA -lSalomeNotification -lSUPERVGraph \
-L${KERNEL_ROOT_DIR}/lib/salome
-
LIBS+=
@CONCLUDE@
}
}
-
void SUPERVGUI::exportDataflow() {
Trace("SUPERVGUI::exportDataflow")
- if (main==0) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_EXPORT"));
- } else {
+ if ( main==0 ) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_EXPORT"));
+ }
+ else if ( SUPERV_isNull( main->getDataflow() ) ) { // should not normally happen..
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_EXPORT"));
+ }
+ else {
QString f = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
"",
"*.xml",
tr("TTL_EXPORT_DATAFLOW"),
false);
- if (!f.isEmpty()) {
- if (main->exportDataflow(f)) {
+ if ( !f.isEmpty() ) {
+
+ // asv : bug [VSR Bugs and Improvements in Supervisor] 1.8 : when exporting a file,
+ // a backup copy of an existing file must be created (in case Export fails..)
+ QString aBackupFile = SUPERVGUI::createBackupFile( f );
+
+ if ( main->getDataflow()->Export(f.latin1()) ) {
unregisterGraph(main);
registerGraph(f, main);
+
+ // remove a backup file if export was successfull
+ if ( !aBackupFile.isNull() && !aBackupFile.isEmpty() )
+ QFile::remove( aBackupFile );
+ }
+ else {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_WRITING").arg(aBackupFile));
}
}
}
}
+/**
+ *If a file with theOriginalFileName exists, then the function tries to create
+ * its backup copy of it (the_name + ".bakX", X = 0,1,2,..,99). Returns backup file's name
+ * If a file with theOriginalFileName does not exist, or creation fails - Return empty string.
+ */
+QString SUPERVGUI::createBackupFile( const QString& theOriginalFileName ) {
+ QString theBackupFileName("");
+ if ( QFile::exists( theOriginalFileName ) ) {
+ // 1. construct a backup file name
+ int i = 0;
+ do {
+ theBackupFileName = theOriginalFileName;
+ theBackupFileName += ".bak";
+ theBackupFileName += QString::number(i++);
+ }
+ while ( QFile::exists( theBackupFileName ) && i < 100 ); // max 99 backup files
+ // if *.bak99 exists -- it will be overwritten
+
+ // 2. copy the original file to theBackupFileName
+ QString cmd( "cp \"");
+ cmd += theOriginalFileName;
+ cmd += "\" \"";
+ cmd += theBackupFileName;
+ cmd += "\"";
+ bool res = system( cmd.latin1() );
+ if ( res )
+ theBackupFileName = QString("");
+ }
+ return theBackupFileName;
+}
+
void SUPERVGUI::newDataflow() {
Trace("SUPERVGUI::editDataflow");
if (main==0) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
} else {
+ main->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
main->run();
};
}
if (main==0) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NOWINDOW_TO_RUN"));
} else {
+ main->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
main->startExecute();
}
}
}
}
-
-
void SUPERVGUI::deleteObject() {
SALOME_Selection* Sel = SALOME_Selection::Selection(study->getSelection() );
if ((Sel==NULL) || (Sel->IObjectCount() == 0)) return;
-
+
// sak : 24.11.04 : fix for PAL6899 : if the study is locked - warn the user and return.
SALOMEDS::Study_var aStudy = study->getStudyDocument();
if ( aStudy->GetProperties()->IsLocked() ) {
*/
void whatIsSelected(const Handle(SALOME_InteractiveObject)& theObj, bool& theIsOwner, bool& theIsDataflow);
+ /* asv : bug [VSR Bugs and Improvements in Supervisor] 1.8 : when exporting a file,
+ a backup copy of an existing file must be created (in case Export fails..)
+ This method creates a backup file and returns its name or QString::null if it fails
+ Function is static because it is called from
+ SUPERVGUI::exportDataflow() and SUPERVGUI_CanvasMacroNode::exportDataflow()
+ */
+ static QString createBackupFile( const QString& theOriginalFileName );
+
signals:
void KillMainThread(bool theValue);
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Array.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include "SUPERVGUI_Array.h"
-#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_ComputeNode.h"
-#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "SUPERVGUI_Node.h"
-#include "SUPERVGUI_GraphNode.h"
-#include "SUPERVGUI_ControlNode.h"
-#include <qtooltip.h>
-#include <qlayout.h>
-
-#define ADDNODES(NodesName,LevelHasDiffNT) \
- ncols = nodes->NodesName.length(); \
- for (int co=0; co<ncols; co++) { \
- SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[co]); \
- if (!LevelHasDiffNT) x = 50 + co * (CELL_WIDTH + CELL_SPACE); \
- else x += (CELL_WIDTH + CELL_SPACE); \
- SUPERVGUI_Node* aNode = new SUPERVGUI_Cell(viewport(), main, aCNode); \
- ResizeGraph(aNode, x, y); \
- addChild(aNode, x, y); \
- }
-
-
-
-#define ADDCONTROLNODES(NodesName,LevelHasDiffNT) \
- ncols = nodes->NodesName.length(); \
- if (!LevelHasDiffNT) x = 50; \
- else x += (CELL_WIDTH + CELL_SPACE); \
- for (int co=0; co<ncols; co++) { \
- SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[co]); \
- SUPERVGUI_Node* aNode = new SUPERVGUI_Cell(viewport(), main, aCNode); \
- ResizeGraph(aNode, x, y); \
- addChild(aNode, x, y); \
- y += (CELL_HEIGHT + CELL_SPACE); \
- SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[co]->Coupled()); \
- SUPERVGUI_Node* aNodeEnd = new SUPERVGUI_CellEndControl(viewport(), main, aCNodeEnd, dynamic_cast<SUPERVGUI_Cell*>(aNode)); \
- ResizeGraph(aNodeEnd, x, y); \
- addChild(aNodeEnd, x, y); \
- x += (CELL_WIDTH + CELL_SPACE); \
- }
-
-
-
-
-SUPERVGUI_Array::SUPERVGUI_Array(SUPERVGUI_Main* m):
- SUPERVGUI_View(m)
-{
- resizeContents(GRAPH_WIDTH, GRAPH_HEIGHT);
- setName("TableView");
- hide();
-}
-
-SUPERVGUI_Array::~SUPERVGUI_Array() {
- Trace("SUPERVGUI_Array::~SUPERVGUI_Array")
-}
-
-bool SUPERVGUI_Array::create() {
- Trace("SUPERVGUI_Array::create");
- SUPERV_Nodes nodes = main->getDataflow()->Nodes();
- int aCount = 0;
- aCount += nodes->CNodes.length();
- aCount += nodes->FNodes.length();
- aCount += nodes->INodes.length();
- aCount += nodes->GNodes.length();
- aCount += nodes->LNodes.length();
- aCount += nodes->SNodes.length();
- if (aCount == 0) {
- show();
- return true;
- }
-
- //SUPERV_Nodes nodes;
- SUPERVGUI_Cell* cell;
- QString aLabel;
- int x, y;
- int nligs = main->getDataflow()->LevelMax();
- int ncols = main->getDataflow()->ThreadsMax();
-
- // there is no any calculations
- if (ncols == 0) return false;
-
- for (int co=0; co<ncols; co++) {
- aLabel = QString("Thread %1").arg(co);
- QLabel* aTitle = new QLabel(aLabel, viewport());
- aTitle->setAlignment(QLabel::AlignCenter | QLabel::AlignVCenter);
- aTitle->setLineWidth(1);
- aTitle->setPaletteBackgroundColor(MAIN_TITLE);
- aTitle->setMinimumSize(CELL_WIDTH, CELL_HEIGHT);
- aTitle->setFrameStyle(QFrame::Panel | QFrame::Plain);
- addChild(aTitle, 50 + co * (CELL_WIDTH + CELL_SPACE), 20);
- }
- y = 60;
- bool LevelHasDiffNT = false;
- for (int li=0; li<=nligs; li++) {
- nodes = main->getDataflow()->LevelNodes(li);
- int aSumNum = nodes->CNodes.length()+nodes->FNodes.length()+nodes->INodes.length()+
- nodes->GNodes.length()+nodes->LNodes.length()+nodes->SNodes.length();
- if (nodes->CNodes.length() != 0 ) {
- ADDNODES(CNodes,LevelHasDiffNT);
- if (aSumNum > nodes->CNodes.length())
- LevelHasDiffNT = true;
- }
- if (nodes->FNodes.length() != 0 ) {
- ADDNODES(FNodes,LevelHasDiffNT);
- if (aSumNum > nodes->FNodes.length())
- LevelHasDiffNT = true;
- }
- if (nodes->INodes.length() != 0 ) {
- ADDNODES(INodes,LevelHasDiffNT);
- if (aSumNum > nodes->INodes.length())
- LevelHasDiffNT = true;
- }
- if (nodes->GNodes.length() != 0 ) {
- ADDNODES(GNodes,LevelHasDiffNT);
- if (aSumNum > nodes->GNodes.length())
- LevelHasDiffNT = true;
- }
- if (nodes->LNodes.length() != 0 ) {
- ADDCONTROLNODES(LNodes,LevelHasDiffNT);
- if (aSumNum > nodes->LNodes.length())
- LevelHasDiffNT = true;
- }
- if (nodes->SNodes.length() != 0 ) {
- ADDCONTROLNODES(SNodes,LevelHasDiffNT);
- if (aSumNum > nodes->SNodes.length())
- LevelHasDiffNT = true;
- }
- y += (CELL_HEIGHT + CELL_SPACE);
-
- LevelHasDiffNT = false;
- }
- nodeX = 50;
- nodeY = y + CELL_HEIGHT*2;
-
- show();
- return true;
-}
-
-void SUPERVGUI_Array::destroy() {
- Trace("SUPERVGUI_Array::destroy")
- hide();
-
- SUPERVGUI_Cell* cell;
- QObjectList* ihmList = queryList("SUPERVGUI_Cell");
- QObjectListIt i(*ihmList);
-
- while ((cell=(SUPERVGUI_Cell*)i.current()) != 0) {
- ++i;
- cell->updateStudy();
- cell->close(true);
- };
-
- delete ihmList;
-
- SUPERVGUI_CellEndControl* cellEC;
- QObjectList* ihmListEC = queryList("SUPERVGUI_CellEndControl");
- QObjectListIt iEC(*ihmListEC);
-
- while ((cellEC=(SUPERVGUI_CellEndControl*)iEC.current()) != 0) {
- ++iEC;
- cellEC->updateStudy();
- cellEC->close(true);
- };
-
- delete ihmListEC;
-
-}
-
-void SUPERVGUI_Array::sync() {
- Trace("SUPERVGUI_Array::sync")
- if (SUPERV_isNull(main->getDataflow())) return;
-
- SUPERVGUI_Cell* cell;
- QObjectList* ihmList = queryList("SUPERVGUI_Cell");
- QObjectListIt i(*ihmList);
- while ((cell=(SUPERVGUI_Cell*)i.current()) != 0) {
- ++i;
- cell->sync();
- }
- delete ihmList;
-}
-
-SUPERVGUI_Node* SUPERVGUI_Array::addNode(SUPERV_CNode node) {
- Trace("SUPERVGUI_Array::Array")
- SUPERVGUI_Node* n = new SUPERVGUI_ComputeNode(viewport(), main, node);
- ResizeGraph(n, nodeX, nodeY);
- addChild(n, nodeX, nodeY);
- nodeX += NODE_DX;
- nodeY += NODE_DY;
- n->sync();
- return(n);
-}
-
-void SUPERVGUI_Array::contentsMousePressEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Array::contentsMousePressEvent")
- if (e->button() == RightButton) {
- myPopup->exec(e->globalPos());
- };
-}
-
-
-
-
-
-// ------------------------------------
-// Cell widget of the table
-// ------------------------------------
-
-
-SUPERVGUI_Cell::SUPERVGUI_Cell(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n):
- SUPERVGUI_Node(parent, m, n),
- guiNode(NULL)
-{
- Trace("SUPERVGUI_Cell::SUPERVGUI_Cell");
- setLineWidth(2);
- setFrameStyle(QFrame::Panel | QFrame::Raised);
-
- QHBoxLayout* aBox = new QHBoxLayout(this);
- aBox->setMargin(3);
- aBox->setSpacing(3);
-
- QString aCommentVis;
- if (getNodeType() == SUPERV::FactoryNode)
- aCommentVis = QString(myNode->Service()->ServiceName) + QString(tr("COMMENT_FROM"))
- + QString(getFactoryNode()->GetComponentName());
- else
- //aCommentVis = tr("COMMENT_PYTHON");
- aCommentVis = tr("COMMENT_CNODE");
-
- component = new SUPERVGUI_Label(this, CELL_WIDTH_PART, LABEL_HEIGHT, aCommentVis, QLabel::AlignLeft);
- connect(component, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
-
- myTitle = new SUPERVGUI_Label(this, CELL_WIDTH_PART, LABEL_HEIGHT, name(), QLabel::AlignLeft);
- connect(myTitle, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
- myTitle->setMinimumSize(CELL_WIDTH_PART, LABEL_HEIGHT);
- myTitle->setMaximumSize(CELL_WIDTH_PART, LABEL_HEIGHT);
-
- // aBox->addWidget(service);
- aBox->addWidget(myTitle);
- aBox->addWidget(component);
-
- myStatus->reparent(this, pos());
- aBox->addWidget(myStatus);
-
- if(m->isEditable()) {
- // QToolTip::add(service, myNode->Name());
- QToolTip::add(myTitle, myTitle->text());
- QToolTip::add(component, component->text());
- }
-
- myPopup->setItemEnabled(myDeleteItem, false);
- adjustSize();
-
- myIsControl = false;
- myIsStart = false;
-
- //check for control nodes
- if (n->IsLoop() || n->IsSwitch()) {
- myIsControl = true;
- myIsStart = true;
- }
- if (n->IsEndLoop() || n->IsEndSwitch())
- myIsControl = true;
-}
-
-SUPERVGUI_Cell::~SUPERVGUI_Cell() {
- Trace("SUPERVGUI_Cell::~SUPERVGUI_Cell");
- QToolTip::remove(myTitle);
- if (guiNode != NULL) {
- guiNode->close();
- }
-}
-
-void SUPERVGUI_Cell::sync() {
- Trace("SUPERVGUI_Cell::sync");
- if (myMain == NULL) return;
- myTitle->setText(myNode->Name());
- //component->setText(myNode->Comment());
-
- if (guiNode != NULL) {
- guiNode->sync();
-
- SUPERVGUI_PortIn* pi;
- QObjectList* ihmList = guiNode->queryList("SUPERVGUI_PortIn");
- QObjectListIt i(*ihmList);
- while ((pi=(SUPERVGUI_PortIn*)i.current()) != 0) {
- ++i;
- pi->sync();
- }
- delete ihmList;
-
- SUPERVGUI_PortOut* po;
- ihmList = guiNode->queryList("SUPERVGUI_PortOut");
- i = *ihmList;
- while ((po=(SUPERVGUI_PortOut*)i.current()) != 0) {
- ++i;
- po->sync();
- }
- delete ihmList;
- }
- SUPERVGUI_Node::sync();
-}
-
-
-void SUPERVGUI_Cell::updateStudy()
-{
- Trace("SUPERVGUI_Cell::updateStudy")
- if (guiNode != NULL)
- {
- SUPERVGUI_PortOut* po;
- QObjectList* ihmList = guiNode->queryList("SUPERVGUI_PortOut");
- QObjectListIt i(*ihmList);
- while ((po=(SUPERVGUI_PortOut*)i.current()) != 0)
- {
- ++i;
- po->updateStudy();
- }
- delete ihmList;
- }
-}
-
-
-void SUPERVGUI_Cell::rename() {
- SUPERVGUI_Node::rename();
- if (!myIsControl) { //not ControlNode
- myTitle->setText(myNode->Name());
- }
- else {
- if (myIsStart) { //StartControlNode
- if (myPairCell) {
- QString nm = myNode->Name();
- if (!nm.isEmpty()) {
- myTitle->setText(nm);
- QString aStr(tr("ENDNODE_PREFIX"));
- aStr += nm;
- myPairCell->getTitle()->setText(aStr);
- myPairCell->setNodeName(aStr);
- // QToolTip::remove(myPairCell->getTitle());
- QToolTip::add(myPairCell->getTitle(), myPairCell->getTitle()->text());
-
- }
- }
- }
- }
-
- // QToolTip::remove(myTitle);
- QToolTip::add(myTitle, myTitle->text());
-}
-
-void SUPERVGUI_Cell::setPairCell(SUPERVGUI_Cell* thePairCell) {
- if (myIsControl) { //only for ControlNode
- myPairCell = thePairCell;
- }
- else
- myPairCell = 0;
-}
-
-SUPERVGUI_Cell* SUPERVGUI_Cell::getPairCell() {
- return myPairCell;
-}
-
-SUPERVGUI_CellEndControl::SUPERVGUI_CellEndControl(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n,
- SUPERVGUI_Cell* theStart)
- :SUPERVGUI_Cell(parent, m, n)
-{
- myPairCell = theStart; //set start cell for end cell as pair
- myPairCell->setPairCell(dynamic_cast<SUPERVGUI_Cell*>(this)); //set end cell for start cell as pair
-}
-
-SUPERVGUI_CellEndControl::~SUPERVGUI_CellEndControl() {
- Trace("SUPERVGUI_CellEndControl::~SUPERVGUI_CellEndControl");
- QToolTip::remove(myTitle);
- if (guiNode != NULL) {
- guiNode->close();
- }
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Array.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Array_H
-#define SUPERVGUI_Array_H
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include <qpopupmenu.h>
-#include "SUPERVGUI_Node.h"
-#include "SUPERVGUI_ControlNode.h"
-#include "SUPERVGUI_View.h"
-#include "SUPERVGUI_Label.h"
-
-class SUPERVGUI_Main;
-
-
-class SUPERVGUI_Array: public SUPERVGUI_View {
- Q_OBJECT
-
- public:
- SUPERVGUI_Array(SUPERVGUI_Main* m);
- virtual ~SUPERVGUI_Array();
-
- void sync();
- bool create();
- void destroy();
-
- SUPERVGUI_Node* addNode(SUPERV_CNode node);
-
- private:
- void contentsMousePressEvent(QMouseEvent* e);
-
-
- int nodeX;
- int nodeY;
-};
-
-
-
-
-
-
-
-class SUPERVGUI_Cell: public SUPERVGUI_Node {
- Q_OBJECT
-
- public:
- SUPERVGUI_Cell(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n);
- virtual ~SUPERVGUI_Cell();
-
- void sync();
- void hideAll() {};
- void showAll() {};
-
- void updateStudy();
- SUPERVGUI_Label* getTitle() { return myTitle; }
- SUPERVGUI_Label* getComponent() { return component; }
- void setPairCell(SUPERVGUI_Cell* thePairCell);
- SUPERVGUI_Cell* getPairCell();
-
- public slots:
- virtual void rename();
-
- protected:
- SUPERVGUI_Cell* myPairCell; //for ControlNodes
- SUPERVGUI_Label* myTitle;
- SUPERVGUI_Node* guiNode;
-
- private:
- SUPERVGUI_Label* component;
- //SUPERVGUI_Label* service;
-
- int myShowItem;
- bool myIsControl;
- bool myIsStart;
-};
-
-class SUPERVGUI_CellEndControl: public SUPERVGUI_Cell {
- Q_OBJECT
-
- public:
- SUPERVGUI_CellEndControl(QWidget* parent, SUPERVGUI_Main* m, SUPERV_CNode n, SUPERVGUI_Cell* theStart);
- virtual ~SUPERVGUI_CellEndControl();
-};
-
-#endif
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_ArrayView.cxx
+// Author :
+// Module : SUPERV
+
+
+using namespace std;
+#include "SUPERVGUI_ArrayView.h"
+#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI_CanvasCellNodePrs.h"
+
+#include <qcolordialog.h>
+
+#if QT_VERSION >= 0x030005
+QCursor PanCursor(Qt::SizeAllCursor);
+#else
+QCursor PanCursor(SizeAllCursor);
+#endif
+
+SUPERVGUI_ArrayView::SUPERVGUI_ArrayView(SUPERVGUI_CanvasArray* theArray, SUPERVGUI_Main* theMain):
+ QCanvasView(theArray, theMain),
+ myMain(theMain)
+{
+ setName("TableView");
+
+ myIsPanActivated = false;
+
+ myAddStudyItem = 0;
+ myCursor = cursor();
+
+ viewport()->setMouseTracking(true); //widget receives mouse move events
+ //even if no buttons are pressed down
+
+ myPopup = new QPopupMenu(viewport());
+
+ if (myMain->isEditable()) {
+ myPopup->insertItem(tr("MSG_ADD_NODE"), myMain, SLOT(addNode()));
+ myPopup->insertItem(tr("MSG_INS_FILE"), myMain, SLOT(insertFile()));
+ myPopup->insertSeparator();
+ }
+
+ QPopupMenu* aViewPopup = new QPopupMenu(viewport());
+ aViewPopup->insertItem(tr("POP_FULLVIEW"), myMain, SLOT(showCanvas()));
+ aViewPopup->insertItem(tr("POP_CONTROLVIEW"), myMain, SLOT(showContolFlow()));
+ aViewPopup->insertItem(tr("POP_TABLEVIEW"), myMain, SLOT(showCanvasTable()));
+
+ myPopup->insertItem(tr("POP_VIEW"), aViewPopup);
+ myPopup->insertSeparator();
+
+ /*QPopupMenu* aZoomPopup = new QPopupMenu(viewport());
+ aZoomPopup->insertItem("200%", this, SLOT(zoomIn()));
+ aZoomPopup->insertItem("100%", this, SLOT(zoomReset()));
+ aZoomPopup->insertItem("50%", this, SLOT(zoomOut()));
+ aZoomPopup->insertSeparator();
+ aZoomPopup->insertItem("Fit All", this, SLOT(fitAll()));
+
+ myPopup->insertItem("Zoom", aZoomPopup);
+ myPopup->insertSeparator();*/
+
+ myAddStudyItem = myPopup->insertItem(tr("MSG_ADD_STUDY"), this, SLOT(addToStudy()));
+ myPopup->insertItem(tr("MSG_CHANGE_INFO"), myMain, SLOT(changeInformation()));
+ myPopup->insertSeparator();
+
+ myPopup->insertItem(tr("MSG_COPY_DATAFLOW"), myMain, SLOT(copy()));
+ myPopup->insertItem(tr("MSG_FILTER_NOTIFY"), myMain, SLOT(filterNotification()));
+
+ myPopup->insertSeparator();
+ myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
+
+ hide();
+}
+
+
+SUPERVGUI_ArrayView::~SUPERVGUI_ArrayView()
+{
+}
+
+void SUPERVGUI_ArrayView::ActivatePanning()
+{
+ myIsPanActivated = true;
+ viewport()->setMouseTracking(false);
+}
+
+void SUPERVGUI_ArrayView::ResetView()
+{
+ setContentsPos(0,0);
+ QWMatrix m;
+ setWorldMatrix(m);
+}
+
+void SUPERVGUI_ArrayView::addToStudy()
+{
+ if (myMain->addStudy()) myMain->setAsFromStudy(true);
+}
+
+void SUPERVGUI_ArrayView::changeBackground()
+{
+ QColor aColor = QColorDialog::getColor(canvas()->backgroundColor(), this );
+ if ( aColor.isValid() ) {
+ canvas()->setBackgroundColor(aColor);
+ setPaletteBackgroundColor(aColor.light(120));
+ }
+}
+
+void SUPERVGUI_ArrayView::contentsMousePressEvent(QMouseEvent* theEvent) {
+ myGlobalPoint = theEvent->globalPos();
+
+ if (((theEvent->button() == Qt::MidButton)
+ &&
+ (theEvent->state() == Qt::ControlButton)) || myIsPanActivated) {
+ myIsPanActivated = true;
+ viewport()->setMouseTracking(false); //widget only receives mouse move events when at least one
+ //mouse button is pressed down while the mouse is being moved
+ myCursor = cursor();
+ setCursor(PanCursor);
+ return;
+ }
+
+ QPoint thePoint = inverseWorldMatrix().map(theEvent->pos());
+ // compute collision rectangle
+ QRect aSel(thePoint.x()-MARGIN, thePoint.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
+
+ if (theEvent->button() == RightButton) {
+ QCanvasItemList l = canvas()->collisions(aSel);
+ for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
+ SUPERVGUI_CanvasCellNodePrs* aNodePrs = (SUPERVGUI_CanvasCellNodePrs*) (*it);
+ QObject* anObj = aNodePrs->getObject(thePoint);
+ if (anObj->inherits("SUPERVGUI_CanvasCellNode")) {
+ myMain->showPopup(((SUPERVGUI_CanvasCellNode*)anObj)->getPopupMenu(viewport()),
+ theEvent);
+ return;
+ }
+ }
+ }
+
+ myPopup->setItemEnabled(myAddStudyItem, !myMain->isFromStudy());
+ myMain->showPopup(myPopup, theEvent);
+ return;
+ }
+}
+
+void SUPERVGUI_ArrayView::contentsMouseMoveEvent(QMouseEvent* theEvent) {
+ QPoint g = theEvent->globalPos();
+ if (myIsPanActivated) {
+ scrollBy(myGlobalPoint.x() - g.x(),
+ myGlobalPoint.y() - g.y());
+ myGlobalPoint = g;
+ return;
+ }
+
+ // QToolTip for title and label for SUPERVGUI_CanvasCellNode
+ SUPERVGUI_ToolTip* aTT = new SUPERVGUI_ToolTip(this);
+ QPoint aPoint1 = inverseWorldMatrix().map(theEvent->pos());
+ aTT->maybeTip(aPoint1);
+}
+
+void SUPERVGUI_ArrayView::contentsMouseReleaseEvent(QMouseEvent* theEvent) {
+ if (myIsPanActivated) {
+ myIsPanActivated = false;
+ viewport()->setMouseTracking(true);
+ setCursor(myCursor);
+ }
+}
+
+void SUPERVGUI_ToolTip::maybeTip(const QPoint& theP) {
+ // compute collision rectangle
+ QRect aSel(theP.x()-MARGIN, theP.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
+
+ QCanvasItemList l = ((SUPERVGUI_ArrayView*)parentWidget())->canvas()->collisions(aSel);
+ for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
+ SUPERVGUI_CanvasCellNodePrs* aNodePrs = (SUPERVGUI_CanvasCellNodePrs*) (*it);
+ QObject* anObj = aNodePrs->getObject(theP);
+ if (anObj->inherits("SUPERVGUI_CanvasCellNode")) {
+
+ QRect aTitleRect = aNodePrs->getTitleRect();
+ if (aTitleRect.contains(theP, true)) {
+ tip(aTitleRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getEngine()->Name());
+ return;
+ }
+
+ QRect aLabelRect = aNodePrs->getLabelRect();
+ if (aLabelRect.contains(theP, true)) {
+ tip(aLabelRect, ((SUPERVGUI_CanvasCellNode*)anObj)->getLabelText());
+ return;
+ }
+ }
+ }
+ }
+}
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_ArrayView.h
+// Author :
+// Module : SUPERV
+
+#ifndef SUPERVGUI_ArrayView_H
+#define SUPERVGUI_ArrayView_H
+
+#include "SUPERVGUI_CanvasArray.h"
+#include <qpopupmenu.h>
+#include <qtooltip.h>
+
+//VRV: porting on Qt 3.0.5
+#if QT_VERSION >= 0x030005
+#include <qcursor.h>
+#endif
+//VRV: porting on Qt 3.0.5
+
+class SUPERVGUI_Main;
+
+class SUPERVGUI_ArrayView: public QCanvasView {
+ Q_OBJECT
+
+ public:
+ SUPERVGUI_ArrayView(SUPERVGUI_CanvasArray* theArray, SUPERVGUI_Main* theMain);
+ virtual ~SUPERVGUI_ArrayView();
+
+ SUPERVGUI_Main* getMain() const { return myMain; }
+
+ void ActivatePanning();
+ void ResetView();
+
+ public slots:
+ void addToStudy();
+ void changeBackground();
+
+ private:
+ void contentsMousePressEvent(QMouseEvent* theEvent);
+ void contentsMouseMoveEvent(QMouseEvent* theEvent);
+ void contentsMouseReleaseEvent(QMouseEvent* theEvent);
+
+ SUPERVGUI_Main* myMain;
+ QPopupMenu* myPopup;
+ int myAddStudyItem;
+
+ QCursor myCursor;
+
+ QPoint myGlobalPoint;
+
+ bool myIsPanActivated;
+
+};
+
+class SUPERVGUI_ToolTip: public QToolTip {
+
+ public:
+ SUPERVGUI_ToolTip(QWidget* theWidget, QToolTipGroup* theGroup = 0):
+ QToolTip(theWidget, theGroup) {}
+ ~SUPERVGUI_ToolTip() { remove(parentWidget()); }
+
+ virtual void maybeTip(const QPoint& theP);
+};
+
+#endif
// Module : SUPERV
using namespace std;
+
#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "SUPERVGUI_Node.h"
#include "SUPERVGUI_CanvasNode.h"
-#include "SUPERVGUI_Port.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI.h"
+
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
}
-/**
- * Constructor (SUPERVGUI_Node)
- */
-SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode )
- : QDialog( theNode, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
-{
- myNode = theNode;
- myNodeCanvas = 0;
-
- init();
-}
-
/**
* Constructor (SUPERVGUI_CanvasNode)
*/
SUPERVGUI_BrowseNodeDlg::SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode )
: QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
{
- myNode = 0;
myNodeCanvas = theNode;
init();
setSizeGripEnabled( true );
myPortsList.setAutoDelete( true );
- SUPERV_CNode aEngine;
- if (myNode != 0)
- aEngine = myNode->getEngine();
- else
- aEngine = myNodeCanvas->getEngine();
+ SUPERV_CNode aEngine = myNodeCanvas->getEngine();
mySelection = SALOME_Selection::Selection( Supervision.getActiveStudy()->getSelection() );
// mySelection->ClearIObjects();
if ( ports[i]->IsInput() ) {
if ( !ports[i]->IsGate() ) { // not a gate
SUPERVGUI_PortField* aField = new SUPERVGUI_PortField( aInBox, ports[i] );
- if ( aField->isEditable() ) myIsEditable = true;
+ if ( aField->isEditable() )
+ myIsEditable = true;
myPortsList.append( aField );
if ( !myActiveField )
myActiveField = aField;
aBtnLayout->addStretch();
connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- if (myNode != 0)
- myNode->getMain()->lockedGraph(true);
- else
- myNodeCanvas->getMain()->lockedGraph(true);
+ myNodeCanvas->getMain()->lockedGraph(true);
}
/**
for ( aField = myPortsList.first(); aField; aField = myPortsList.next() ) {
aField->setNewValue();
}
- if (myNode != 0)
- myNode->sync();
- else {
- myNodeCanvas->sync();
- myNodeCanvas->getMain()->getCanvas()->update();
- }
+ myNodeCanvas->sync();
+ myNodeCanvas->getMain()->getCanvas()->update();
}
- if (myNode != 0)
- myNode->getMain()->lockedGraph(false);
- else
- myNodeCanvas->getMain()->lockedGraph(false);
+ myNodeCanvas->getMain()->lockedGraph(false);
QDialog::accept();
close();
}
* Closes and destroys dialog
*/
void SUPERVGUI_BrowseNodeDlg::reject() {
- if (myNode != 0)
- myNode->getMain()->lockedGraph(false);
- else
- myNodeCanvas->getMain()->lockedGraph(false);
+ myNodeCanvas->getMain()->lockedGraph(false);
QDialog::reject();
close();
}
}
}
-/**
- * Constructor (SUPERVGUI_PortIn)
- */
-SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort )
- : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
-{
- myPort = thePort;
- myPortESNode = 0;
- myPortCanvas = 0;
-
- init();
-}
-
-/**
- * Constructor (SUPERVGUI_PortInESNode)
- */
-SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort )
- : QDialog( thePort, 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
-{
- myPort = 0;
- myPortESNode = thePort;
- myPortCanvas = 0;
-
- init();
-}
/**
* Constructor (SUPERVGUI_CanvasPort)
SUPERVGUI_GetValueDlg::SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort )
: QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
{
- myPort = 0;
- myPortESNode = 0;
myPortCanvas = thePort;
init();
QLabel* aInfoLab = new QLabel( tr( "ENTER_OR_SELECT_LBL" ), aBox );
QFont fnt = aInfoLab->font(); fnt.setBold( true ); aInfoLab->setFont( fnt );
aBoxLayout->addMultiCellWidget( aInfoLab, 0, 0, 0, 1 );
- SUPERV_Port aEngine;
- if (myPort != 0)
- aEngine = myPort->getPort();
- else if (myPortESNode != 0)
- aEngine = myPortESNode->getPort();
- else {
- aEngine = myPortCanvas->getEngine();
- }
+ SUPERV_Port aEngine = myPortCanvas->getEngine();
+
myField = new SUPERVGUI_PortField( aBox, aEngine );
bool myIsEditable = myField->isEditable();
aBoxLayout->addWidget( myField->myLabel, 1, 0 );
myField->updateGUI();
connect( mySelection, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- if (myPort != 0)
- myPort->getMain()->lockedGraph(true);
- else if (myPortESNode != 0)
- myPortESNode->getMain()->lockedGraph(true);
- else
- myPortCanvas->getMain()->lockedGraph(true);
+
+ myPortCanvas->getMain()->lockedGraph(true);
}
/**
void SUPERVGUI_GetValueDlg::accept() {
if ( myField->setNewValue() ) {
- if (myPort != 0)
- myPort->sync();
- else if (myPortESNode != 0)
- myPortESNode->sync();
- else {
- myPortCanvas->sync();
+ myPortCanvas->sync();
- // asv : 19.11.04 : fix for 6170, last comment of it about BrowsePort - update node status
- if ( myPortCanvas->parent() && myPortCanvas->parent()->inherits( "SUPERVGUI_CanvasNode" ) ) {
- SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*)myPortCanvas->parent();
- aNode->sync();
- }
+ // asv : 19.11.04 : fix for 6170, last comment of it about BrowsePort - update node status
+ // asv : 13.12.04 : commented out sync() of Node. See 2.21.
+ //if ( myPortCanvas->parent() && myPortCanvas->parent()->inherits( "SUPERVGUI_CanvasNode" ) ) {
+ // SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*)myPortCanvas->parent();
+ // aNode->sync();
+ //}
- myPortCanvas->getMain()->getCanvas()->update();
- }
+ myPortCanvas->getMain()->getCanvas()->update();
}
else {
if ( QMessageBox::warning( QAD_Application::getDesktop(),
return;
}
- if (myPort != 0)
- myPort->getMain()->lockedGraph(false);
- else if (myPortESNode != 0)
- myPortESNode->getMain()->lockedGraph(false);
- else
- myPortCanvas->getMain()->lockedGraph(false);
+ myPortCanvas->getMain()->lockedGraph(false);
+
QDialog::accept();
close();
}
* Closes and destroys dialog
*/
void SUPERVGUI_GetValueDlg::reject() {
- if (myPort != 0)
- myPort->getMain()->lockedGraph(false);
- else if (myPortESNode != 0)
- myPortESNode->getMain()->lockedGraph(false);
- else
- myPortCanvas->getMain()->lockedGraph(false);
+ myPortCanvas->getMain()->lockedGraph(false);
QDialog::reject();
close();
}
// Stream Ports
// ----------------------------
-SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_StreamPortIn* thePort)
- :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
-{
- myPort = thePort;
- myPortCanvas = 0;
- init();
-}
-
SUPERVGUI_StreamInDlg::SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort)
:QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
{
- myPort = 0;
myPortCanvas = thePort;
init();
}
SUPERV::KindOfInterpolation aInterpolat;
SUPERV::KindOfExtrapolation aExtrapolat;
- if (myPort != 0)
- myPort->getStreamPort()->Params(aSchema, aInterpolat, aExtrapolat);
- else
- myPortCanvas->getStreamEngine()->Params(aSchema, aInterpolat, aExtrapolat);
+ myPortCanvas->getStreamEngine()->Params(aSchema, aInterpolat, aExtrapolat);
mySchemaCombo->setCurrentItem((int)aSchema);
myInterCombo->setCurrentItem((int)aInterpolat);
}
void SUPERVGUI_StreamInDlg::accept() {
- if (myPort != 0)
- myPort->getStreamPort()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
- (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
- (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
- else
- myPortCanvas->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
- (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
- (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
+ myPortCanvas->getStreamEngine()->SetParams((SUPERV::KindOfSchema) mySchemaCombo->currentItem(),
+ (SUPERV::KindOfInterpolation) myInterCombo->currentItem(),
+ (SUPERV::KindOfExtrapolation) myExterCombo->currentItem());
QDialog::accept();
}
//-------------------------------------------------------------------------
-SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_StreamPortOut* thePort)
- :QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
-{
- myPort = thePort;
- myPortCanvas = 0;
- init();
-}
SUPERVGUI_StreamOutDlg::SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort)
:QDialog( QAD_Application::getDesktop(), "", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
{
- myPort = 0;
myPortCanvas = thePort;
init();
}
myValEdit = new QLineEdit( aCtrlPane, "ValEdit" );
myValEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
myValEdit->setValidator( new QIntValidator(this) );
- SUPERV_StreamPort aEngine;
- if (myPort != 0)
- aEngine = myPort->getStreamPort();
- else
- aEngine = myPortCanvas->getStreamEngine();
+ SUPERV_StreamPort aEngine = myPortCanvas->getStreamEngine();
myValEdit->setText(QString("%1").arg(aEngine->NumberOfValues()));
aCtrlLayout->addWidget(myValEdit, 0, 1);
TopLayout->addWidget( aCtrlPane );
QString aStr = myValEdit->text();
if (!aStr.isEmpty())
aRes = aStr.toLong();
- if (myPort != 0)
- myPort->getStreamPort()->SetNumberOfValues(aRes);
- else
- myPortCanvas->getStreamEngine()->SetNumberOfValues(aRes);
+ myPortCanvas->getStreamEngine()->SetNumberOfValues(aRes);
QDialog::accept();
}
/**
* Browse Node Dialog box
*/
-class SUPERVGUI_Node;
class SUPERVGUI_CanvasNode;
class SUPERVGUI_BrowseNodeDlg: public QDialog {
Q_OBJECT
public:
- SUPERVGUI_BrowseNodeDlg( SUPERVGUI_Node* theNode );
SUPERVGUI_BrowseNodeDlg( SUPERVGUI_CanvasNode* theNode );
virtual ~SUPERVGUI_BrowseNodeDlg();
private:
void init();
- SUPERVGUI_Node* myNode;
SUPERVGUI_CanvasNode* myNodeCanvas;
bool myIsEditable;
/**
* Get Value dialog box
*/
-class SUPERVGUI_PortIn;
-class SUPERVGUI_PortInESNode;
class SUPERVGUI_CanvasPort;
class SUPERVGUI_GetValueDlg: public QDialog {
Q_OBJECT
public:
-// SUPERVGUI_GetValueDlg( SUPERVGUI_Port thePort );
- SUPERVGUI_GetValueDlg( SUPERVGUI_PortIn* thePort );
- SUPERVGUI_GetValueDlg( SUPERVGUI_PortInESNode* thePort );
SUPERVGUI_GetValueDlg( SUPERVGUI_CanvasPort* thePort );
~SUPERVGUI_GetValueDlg();
QPushButton* myCancelBtn;
SUPERVGUI_PortField* myField;
- SUPERVGUI_PortIn* myPort;
- SUPERVGUI_PortInESNode* myPortESNode; //last correction
SUPERVGUI_CanvasPort* myPortCanvas;
SALOME_Selection* mySelection;
/**
* Stream Port Parameter dialog box
*/
-class SUPERVGUI_StreamPortIn;
class SUPERVGUI_CanvasStreamPortIn;
class SUPERVGUI_StreamInDlg: public QDialog
{
Q_OBJECT
public:
- SUPERVGUI_StreamInDlg(SUPERVGUI_StreamPortIn* thePort);
SUPERVGUI_StreamInDlg(SUPERVGUI_CanvasStreamPortIn* thePort);
virtual ~SUPERVGUI_StreamInDlg() {};
void init();
void setData();
- SUPERVGUI_StreamPortIn* myPort;
SUPERVGUI_CanvasStreamPortIn* myPortCanvas;
QComboBox* mySchemaCombo;
QComboBox* myInterCombo;
QComboBox* myExterCombo;
};
-class SUPERVGUI_StreamPortOut;
class SUPERVGUI_CanvasStreamPortOut;
class SUPERVGUI_StreamOutDlg: public QDialog
{
Q_OBJECT
public:
- SUPERVGUI_StreamOutDlg(SUPERVGUI_StreamPortOut* thePort);
SUPERVGUI_StreamOutDlg(SUPERVGUI_CanvasStreamPortOut* thePort);
virtual ~SUPERVGUI_StreamOutDlg() {};
private:
void init();
- SUPERVGUI_StreamPortOut* myPort;
SUPERVGUI_CanvasStreamPortOut* myPortCanvas;
QLineEdit* myValEdit;
};
SUPERVGUI_Canvas::~SUPERVGUI_Canvas() {
+ // asv : 17.01.05 : why delete its own children (CanvasNode-s)?
+ // they must be destroyed automatically.
QObjectList* aNodeList = queryList("SUPERVGUI_CanvasNode");
QObjectListIt aIt(*aNodeList);
QObject* anObj;
- while ((anObj = aIt.current()) != 0) {
+ while ( (anObj = aIt.current()) != 0 ) {
++aIt;
+ aNodeList->removeRef(anObj);
delete anObj;
}
+ // asv : list returned by queryList() must be removed
+ delete aNodeList;
}
void SUPERVGUI_Canvas::addView(QCanvasView* theView)
}
void SUPERVGUI_Canvas::sync() {
- // MESSAGE("===> SUPERVGUI_Canvas::sync()");
if (SUPERV_isNull(myMain->getDataflow())) return;
SUPERVGUI_CanvasNode* ihmNode;
* Synchronizes Graph presentation with internal graph structure
*/
void SUPERVGUI_Canvas::merge() {
- // MESSAGE("===> SUPERVGUI_Canvas::merge()");
if (SUPERV_isNull(myMain->getDataflow())) return;
SUPERVGUI_CanvasNode* ihmNode;
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_CanvasArray.cxx
+// Author :
+// Module : SUPERV
+
+using namespace std;
+#include "SUPERVGUI_CanvasArray.h"
+#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI_BrowseNodeDlg.h"
+#include "QAD_Config.h"
+#include "SUPERVGUI_CanvasCellNodePrs.h"
+
+#include <qtooltip.h>
+#define TEXT_MARGIN 5
+
+#define ADDNODES(NodesName,LevelHasDiffNT) \
+ ncols = nodes->NodesName.length(); \
+ for (int co=0; co<ncols; co++) { \
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[co]); \
+ if (!LevelHasDiffNT) x = 50 + co * (CELL_WIDTH + CELL_SPACE); \
+ else x += (CELL_WIDTH + CELL_SPACE); \
+ cell = getCellNode(aCNode); \
+ if (cell == NULL) { \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ aNode->move(x, y); \
+ aNode->show(); \
+ aNode->sync(); \
+ } else { \
+ cell->move(x, y); \
+ cell->show(); \
+ } \
+ update(); \
+ }
+
+
+
+#define ADDCONTROLNODES(NodesName,LevelHasDiffNT) \
+ ncols = nodes->NodesName.length(); \
+ if (!LevelHasDiffNT) x = 50; \
+ else x += (CELL_WIDTH + CELL_SPACE); \
+ for (int co=0; co<ncols; co++) { \
+ SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[co]); \
+ SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[co]->Coupled()); \
+ cell = getCellNode(aCNode); \
+ if (cell == NULL) { \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ aNode->move(x, y); \
+ aNode->show(); \
+ aNode->sync(); \
+ y += (CELL_HEIGHT + CELL_SPACE); \
+ SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode(this, myMain, aCNodeEnd, aNode); \
+ aNodeEnd->move(x, y); \
+ aNodeEnd->show(); \
+ aNodeEnd->sync(); \
+ } else { \
+ cell->move(x, y); \
+ cell->show(); \
+ y += (CELL_HEIGHT + CELL_SPACE); \
+ cell = getCellNode(aCNodeEnd); \
+ cell->move(x, y); \
+ cell->show(); \
+ } \
+ update(); \
+ if (co < (ncols-1)) x += (CELL_WIDTH + CELL_SPACE); \
+ }
+
+
+// ----------------------------------------------------------
+// SUPERVGUI_Array on QCanvas
+// ----------------------------------------------------------
+
+SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m):
+ QCanvas(),
+ myMain(m)
+{
+ Trace("SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray");
+ //resize(GRAPH_WIDTH, GRAPH_HEIGHT);
+ resize(800, 600);
+ setDoubleBuffering(true);
+
+ QColor aColor(MAIN_COLOR);
+ QString aRed = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorRed");
+ QString aGreen = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen");
+ QString aBlue = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue");
+ if( (!aRed.isEmpty()) && (!aGreen.isEmpty()) && (!aBlue.isEmpty()) )
+ aColor = QColor(aRed.toInt(), aGreen.toInt(), aBlue.toInt());
+ setBackgroundColor(aColor);
+}
+
+SUPERVGUI_CanvasArray::~SUPERVGUI_CanvasArray() {
+ Trace("SUPERVGUI_Array::~SUPERVGUI_CanvasArray");
+ //delete all cells which SUPERVGUI_CanvasArray contains
+ //destroy();
+ QObjectList* aCellList = queryList("SUPERVGUI_CanvasCellNode");
+ QObjectListIt aIt(*aCellList);
+ QObject* anObj;
+ while ((anObj = aIt.current()) != 0) {
+ ++aIt;
+ delete anObj;
+ }
+ delete aCellList;
+}
+
+void SUPERVGUI_CanvasArray::sync() {
+ if (SUPERV_isNull(myMain->getDataflow())) return;
+
+ SUPERVGUI_CanvasCellNode* ihmNode;
+ QObjectList* ihmList = queryList("SUPERVGUI_CanvasCellNode");
+ QObjectListIt it(*ihmList);
+ while ((ihmNode=(SUPERVGUI_CanvasCellNode*)it.current()) != 0) {
+ ++it;
+ ihmNode->sync();
+ }
+ delete ihmList;
+}
+
+bool SUPERVGUI_CanvasArray::create() {
+ Trace("SUPERVGUI_Array::create");
+ SUPERV_Nodes nodes = myMain->getDataflow()->Nodes();
+ int aCount = 0;
+ aCount += nodes->CNodes.length();
+ aCount += nodes->FNodes.length();
+ aCount += nodes->INodes.length();
+ aCount += nodes->GNodes.length();
+ aCount += nodes->LNodes.length();
+ aCount += nodes->SNodes.length();
+ if (aCount == 0) return true;
+
+ SUPERVGUI_CanvasCellNode* cell;
+ QString aLabel;
+ int x, y;
+ int nligs = myMain->getDataflow()->LevelMax();
+ int ncols = myMain->getDataflow()->ThreadsMax();
+
+ // there is no any calculations
+ if (ncols == 0) return false;
+
+ QPen pen(Qt::SolidLine);
+ pen.setWidth(1);
+ QBrush br(MAIN_TITLE);
+
+ for (int co = 0; co < ncols; co++) {
+ aLabel = QString("Thread %1").arg(co);
+ QRect aRect = QRect(50 + co * (CELL_WIDTH + CELL_SPACE), 20, CELL_WIDTH, CELL_HEIGHT);
+ QCanvasRectangle* aThread = new QCanvasRectangle(aRect, this);
+ aThread->setPen(pen);
+ aThread->setBrush(br);
+ aThread->setZ(0);
+ aThread->show();
+
+ QCanvasText* aText = new QCanvasText(aLabel, this);
+ QRect aBRect = aText->boundingRect();
+ aText->setX(aRect.x() + aRect.width()/2 - aBRect.width()/2);
+ aText->setY(aRect.y() + aRect.height()/2 - aBRect.height()/2);
+ aText->setZ(1);
+ aText->show();
+ }
+
+ y = 60;
+ bool LevelHasDiffNT = false;
+ for (int li = 0; li <= nligs; li++) {
+ nodes = myMain->getDataflow()->LevelNodes(li);
+ int aSumNum = nodes->CNodes.length()+nodes->FNodes.length()+nodes->INodes.length()+
+ nodes->GNodes.length()+nodes->LNodes.length()+nodes->SNodes.length();
+ if (nodes->CNodes.length() != 0 ) {
+ ADDNODES(CNodes,LevelHasDiffNT);
+ if (aSumNum > nodes->CNodes.length())
+ LevelHasDiffNT = true;
+ }
+ if (nodes->FNodes.length() != 0 ) {
+ ADDNODES(FNodes,LevelHasDiffNT);
+ if (aSumNum > nodes->FNodes.length())
+ LevelHasDiffNT = true;
+ }
+ if (nodes->INodes.length() != 0 ) {
+ ADDNODES(INodes,LevelHasDiffNT);
+ if (aSumNum > nodes->INodes.length())
+ LevelHasDiffNT = true;
+ }
+ if (nodes->GNodes.length() != 0 ) {
+ ADDNODES(GNodes,LevelHasDiffNT);
+ if (aSumNum > nodes->GNodes.length())
+ LevelHasDiffNT = true;
+ }
+ if (nodes->LNodes.length() != 0 ) {
+ ADDCONTROLNODES(LNodes,LevelHasDiffNT);
+ if (aSumNum > nodes->LNodes.length())
+ LevelHasDiffNT = true;
+ }
+ if (nodes->SNodes.length() != 0 ) {
+ ADDCONTROLNODES(SNodes,LevelHasDiffNT);
+ if (aSumNum > nodes->SNodes.length())
+ LevelHasDiffNT = true;
+ }
+ y += (CELL_HEIGHT + CELL_SPACE);
+
+ LevelHasDiffNT = false;
+ }
+ nodeX = 50;
+ nodeY = y + CELL_HEIGHT*2;
+
+ return true;
+
+}
+
+void SUPERVGUI_CanvasArray::destroy() {
+ Trace("SUPERVGUI_Array::destroy");
+
+ QObjectList* aCellList = queryList("SUPERVGUI_CanvasCellNode");
+ QObjectListIt aIt(*aCellList);
+ QObject* anObj;
+ while ((anObj = aIt.current()) != 0) {
+ ++aIt;
+ ((SUPERVGUI_CanvasCellNode*)anObj)->getPrs()->hide();
+ }
+ delete aCellList;
+
+ // mkr : delete QCanvasRectangle and QCanvasText canvas items for each Thread.
+ // Threads will be recreate when create() function is called
+ QCanvasItemList aTextList = allItems();
+ for (QCanvasItemList::Iterator aItText = aTextList.begin(); aItText != aTextList.end(); ++aItText) {
+ SUPERVGUI_CanvasCellNodePrs* aPrs = dynamic_cast<SUPERVGUI_CanvasCellNodePrs*>(*aItText);
+ if (!aPrs) {
+ (*aItText)->hide();
+ delete *aItText;
+ }
+ }
+}
+
+SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::getCellNode(SUPERV::CNode_ptr theNode) const
+{
+ return (SUPERVGUI_CanvasCellNode*)
+ ((SUPERVGUI_CanvasArray*)this)->child(theNode->Name(), "SUPERVGUI_CanvasCellNode");
+}
+
+SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::addNode(SUPERV_CNode node) {
+ Trace("SUPERVGUI_CanvasArray::addNode");
+ SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode(this, myMain, node);
+ n->move(nodeX, nodeY);
+ n->show();
+ update();
+ nodeX += NODE_DX;
+ nodeY += NODE_DY;
+ n->sync();
+ return(n);
+}
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_CanvasArray.h
+// Author :
+// Module : SUPERV
+
+#ifndef SUPERVGUI_CanvasArray_H
+#define SUPERVGUI_CanvasArray_H
+
+using namespace std;
+#include "SUPERVGUI_Def.h"
+#include "SUPERVGUI_CanvasControlNode.h"
+
+#include <qpopupmenu.h>
+#include <qcanvas.h>
+
+class SUPERVGUI_Main;
+
+class SUPERVGUI_CanvasArray: public QCanvas {
+ Q_OBJECT
+
+ public:
+ SUPERVGUI_CanvasArray(SUPERVGUI_Main* m);
+ virtual ~SUPERVGUI_CanvasArray();
+
+ void sync();
+ bool create();
+ void destroy();
+
+ SUPERVGUI_CanvasCellNode* getCellNode(SUPERV::CNode_ptr theNode) const;
+
+ SUPERVGUI_CanvasCellNode* addNode(SUPERV_CNode node);
+
+ private:
+
+ SUPERVGUI_Main* myMain;
+
+ int nodeX;
+ int nodeY;
+
+};
+
+#endif
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_CanvasCellNodePrs.cxx
+// Author :
+// Module : SUPERV
+
+#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_Canvas.h"
+
+#define TEXT_MARGIN 5
+
+// ----------------------------------------------------------
+// Cell widget of the table on QCanvas
+// ----------------------------------------------------------
+SUPERVGUI_CanvasCellNodePrs::SUPERVGUI_CanvasCellNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode):
+ myTitleWidth(CELL_WIDTH_PART),
+ myLabelWidth(CELL_WIDTH_PART),
+ myStatusWidth(CELL_WIDTH_PART),
+ SUPERVGUI_CanvasNodePrs(theCanvas, theNode, true)
+{
+ myPortVisible = false;
+}
+
+SUPERVGUI_CanvasCellNodePrs::~SUPERVGUI_CanvasCellNodePrs()
+{
+}
+
+void SUPERVGUI_CanvasCellNodePrs::moveBy(double dx, double dy) {
+//Trace("SUPERVGUI_CanvasCellNodePrs::moveBy");
+ int aX = (int) (x()+dx);
+ int aY = (int) (y()+dy);
+
+ int w = aX + width() + GRAPH_MARGIN;
+ int h = aY + height() + GRAPH_MARGIN;
+ if (canvas()->width() > w) w = canvas()->width();
+ if (canvas()->height() > h) h = canvas()->height();
+ if (canvas()->width() < w || canvas()->height() < h)
+ canvas()->resize(w, h);
+ QCanvasPolygonalItem::moveBy(dx, dy);
+}
+
+void SUPERVGUI_CanvasCellNodePrs::drawShape(QPainter& thePainter) {
+ drawTitle(thePainter);
+ drawLabel(thePainter);
+ drawStatus(thePainter);
+ drawFrame(thePainter);
+}
+
+void drawCellText(QPainter& thePainter, const QString& theText,
+ const QRect& theRect, int theHAlign = Qt::AlignAuto)
+{
+ int flags = theHAlign | Qt::AlignVCenter;
+ QRect r(theRect.x() + TEXT_MARGIN, theRect.y(),
+ theRect.width() - 2*TEXT_MARGIN, theRect.height());
+
+ QWMatrix aMat = thePainter.worldMatrix();
+ if (aMat.m11() != 1.0) {
+ // for scaled picture only
+ QRect r1 = aMat.mapRect(r);
+ QFont saved = thePainter.font();
+ QFont f(saved);
+ if (f.pointSize() == -1) {
+ f.setPixelSize((int)(f.pixelSize()*aMat.m11()));
+ }
+ else {
+ f.setPointSize((int)(f.pointSize()*aMat.m11()));
+ }
+ thePainter.save();
+ QWMatrix m;
+ thePainter.setWorldMatrix(m);
+ thePainter.setFont(f);
+ thePainter.drawText(r1, flags, theText);
+ thePainter.setFont(saved);
+ thePainter.restore();
+ }
+ else {
+ thePainter.drawText(r, flags, theText);
+ }
+}
+
+void SUPERVGUI_CanvasCellNodePrs::drawTitle(QPainter& thePainter) {
+ QBrush saved = thePainter.brush();
+ if (getNode()->getEngine()->IsLoop() || getNode()->getEngine()->IsEndLoop()
+ ||
+ getNode()->getEngine()->IsSwitch() || getNode()->getEngine()->IsEndSwitch())
+ thePainter.setBrush(Qt::red.light());
+ else if (getNode()->getEngine()->IsGOTO())
+ thePainter.setBrush(Qt::green.light());
+ else {
+ QBrush br(MAIN_TITLE);
+ thePainter.setBrush(br);
+ }
+ drawTitleShape(thePainter);
+ thePainter.setBrush(saved);
+
+ drawCellText(thePainter, getNode()->getEngine()->Name(), getTitleRect(), Qt::AlignLeft);
+}
+
+void SUPERVGUI_CanvasCellNodePrs::drawLabel(QPainter& thePainter)
+{
+ QRect r = getLabelRect();
+
+ QPen saved = thePainter.pen();
+ thePainter.setPen(NoPen);
+ thePainter.drawRect(r);
+ thePainter.setPen(saved);
+
+ drawCellText(thePainter, getNode()->getLabelText(), r, Qt::AlignLeft);
+}
+
+void SUPERVGUI_CanvasCellNodePrs::drawStatus(QPainter& thePainter)
+{
+ QRect r = getStatusRect();
+
+ QBrush savedB = thePainter.brush();
+ thePainter.setBrush(getStatusColor());
+ drawStatusShape(thePainter);
+ thePainter.setBrush(savedB);
+
+ drawCellText(thePainter, getStatus(), r, Qt::AlignHCenter);
+}
+
+QRect SUPERVGUI_CanvasCellNodePrs::getTitleRect() const
+{
+ return QRect((int)x(), (int)y(), getTitleWidth(), getTitleHeight());
+}
+
+QRect SUPERVGUI_CanvasCellNodePrs::getLabelRect() const
+{
+ return QRect(((int)x())+getTitleWidth(), (int)y(), getLabelWidth(), getLabelHeight());
+}
+
+QRect SUPERVGUI_CanvasCellNodePrs::getStatusRect() const
+{
+ return QRect(((int)x())+getTitleWidth()+getLabelWidth(), (int)y(),
+ getStatusWidth(), getStatusHeight());
+}
+
+int SUPERVGUI_CanvasCellNodePrs::getTitleWidth() const {
+ return myTitleWidth;
+}
+
+int SUPERVGUI_CanvasCellNodePrs::getLabelWidth() const {
+ return myLabelWidth;
+}
+
+int SUPERVGUI_CanvasCellNodePrs::getStatusWidth() const {
+ return myStatusWidth;
+}
+
+int SUPERVGUI_CanvasCellNodePrs::width() const
+{
+ return myTitleWidth + myLabelWidth + myStatusWidth;
+}
+
+int SUPERVGUI_CanvasCellNodePrs::height() const
+{
+ return getTitleHeight();
+}
+
+void SUPERVGUI_CanvasCellNodePrs::setState(SUPERV::GraphState theState)
+{
+ switch(theState) {
+ case SUPERV_Waiting:
+ setStatus("Waiting");
+ setStatusColor(QColor(35, 192, 255));
+ break;
+
+ case SUPERV_Running:
+ case SUPERV::ReadyState:
+ setStatus("Running");
+ setStatusColor(QColor(32,210,32));
+ break;
+
+ case SUPERV_Suspend:
+ case SUPERV::SuspendReadyState:
+ setStatus("Suspended");
+ setStatusColor(QColor(255,180, 0));
+ break;
+
+ case SUPERV_Done:
+ setStatus("Finished");
+ setStatusColor(QColor(255, 158, 255));
+ break;
+
+ case SUPERV_Error:
+ setStatus("Aborted");
+ setStatusColor(Qt::red);
+ break;
+
+ case SUPERV_Kill:
+ setStatus("Killed");
+ setStatusColor(Qt::red);
+ break;
+
+ case SUPERV::LoadingState:
+ setStatus("Loading");
+ setStatusColor(QColor(56,255,56));
+ break;
+
+ default:
+ setStatus("No Status");
+ setStatusColor(MAIN_BACK);
+ break;
+ }
+
+ canvas()->setChanged(getStatusRect());
+ canvas()->update();
+}
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE
+//
+// File : SUPERVGUI_CanvasCellNodePrs.h
+// Author :
+// Module : SUPERV
+
+#ifndef SUPERVGUI_CanvasCellNodePrs_H
+#define SUPERVGUI_CanvasCellNodePrs_H
+
+using namespace std;
+#include "SUPERVGUI_Def.h"
+#include "SUPERVGUI_CanvasNodePrs.h"
+#include "SUPERVGUI_CanvasControlNode.h"
+
+class SUPERVGUI_CanvasCellNodePrs: public SUPERVGUI_CanvasNodePrs {
+
+ public:
+ SUPERVGUI_CanvasCellNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode);
+ virtual ~SUPERVGUI_CanvasCellNodePrs();
+
+ virtual void moveBy(double dx, double dy);
+
+ virtual QRect getTitleRect() const;
+ virtual QRect getLabelRect() const;
+ virtual QRect getStatusRect() const;
+
+ int getTitleWidth() const;
+ int getLabelWidth() const;
+ int getStatusWidth() const;
+
+ virtual int width() const;
+ virtual int height() const;
+
+ virtual void setState(SUPERV::GraphState theState);
+
+ protected:
+ virtual void drawShape(QPainter& thePainter);
+
+ virtual void drawTitle(QPainter& thePainter);
+ virtual void drawLabel(QPainter& thePainter);
+ virtual void drawStatus(QPainter& thePainter);
+
+ private:
+ int myTitleWidth;
+ int myLabelWidth;
+ int myStatusWidth;
+
+};
+
+#endif
using namespace std;
#include "SUPERVGUI_CanvasControlNode.h"
#include "SUPERVGUI_CanvasControlNodePrs.h"
+#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI.h"
#include "SUPERVGUI_Canvas.h"
-#include "SUPERVGUI_ControlNode.h" // access to SelectInlineDlg
#include "QAD_FileDlg.h"
#include "QAD_Application.h"
+#include <qlayout.h>
+
//=====================================================================
// Compute node
//=====================================================================
SUPERVGUI_Canvas* aCanvas = getMain()->getCanvas();
setDestroyed();
- if (myCoupled) myCoupled->setDestroyed();
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ if (myCoupled) {
+
+ //set myCopyPort from Main object to empty if engine of this port is deleted
+ //check if any port of this deleted node has been copied
+ if ( aCB->isCopyPort() )
+ if ( QString(getEngine()->Name()) == QString(aCB->getCopyPort()->Node()->Name()) ||
+ QString(myCoupled->getEngine()->Name()) == QString(aCB->getCopyPort()->Node()->Name()) )
+ aCB->setCopyPort( 0 );
+
+ myCoupled->setDestroyed();
+ }
+
+ //set myCopyNode from Main object to empty if engine of this node is deleted
+ //check if myCopyNode and this node engine is equal
+ if ( aCB->isCopyNode() )
+ if ( QString(getEngine()->Name()) == QString(aCB->getCopyNode()->Name()) )
+ aCB->setCopyNode( 0 );
+
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node
+ getMain()->removeArrayChild(getEngine());
+ getMain()->removeArrayChild(myCoupled->getEngine());
getEngine()->destroy();
- if (myCoupled) delete myCoupled;
+ if (myCoupled)
+ delete myCoupled;
+
delete this;
aCanvas->update();
SUPERVGUI_CanvasNode::addOutputPort();
if (myCoupled) myCoupled->merge();
}
+
+void SUPERVGUI_CanvasStartNode::pastePort()
+{
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ SUPERVGUI_CanvasNode::pastePort();
+ if ( aCB->getCopyPort()->IsInput() && getEngine()->IsLoop() )
+ merge();
+ if ( myCoupled )
+ myCoupled->merge();
+}
//=====================================================================
// End control node
"*.xml",
tr("TTL_EXPORT_DATAFLOW"),
false);
- if (!aFileName.isEmpty()) {
+ if ( !aFileName.isEmpty() ) {
+ // asv : bug [VSR Bugs and Improvements in Supervisor] 1.8 : when exporting a file,
+ // a backup copy of an existing file must be created (in case Export fails..)
+ QString aBackupFile = SUPERVGUI::createBackupFile( aFileName );
+
if (!aGraph->Export(aFileName.latin1())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_WRITING"));
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_WRITING").arg(aBackupFile));
+ }
+ // remove a backup file if export was successfull
+ else if ( !aBackupFile.isNull() && !aBackupFile.isEmpty() ) {
+ QFile::remove( aBackupFile );
}
}
}
}
+
+//=====================================================================
+// Cell node: node for table view
+//=====================================================================
+SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode(theParent, theMain, theNode, true)
+{
+ Trace("SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode");
+
+ myIsControl = false;
+ myIsStart = false;
+
+ //check for control nodes
+ if (getEngine()->IsLoop() || getEngine()->IsSwitch()) {
+ myIsControl = true;
+ myIsStart = true;
+ }
+ if (getEngine()->IsEndLoop() || getEngine()->IsEndSwitch())
+ myIsControl = true;
+}
+
+SUPERVGUI_CanvasCellNode::~SUPERVGUI_CanvasCellNode()
+{
+}
+
+QPopupMenu* SUPERVGUI_CanvasCellNode::getPopupMenu(QWidget* theParent)
+{
+ QPopupMenu* popup = SUPERVGUI_CanvasNode::getPopupMenu(theParent);
+ popup->setItemEnabled(myDeleteItem, false);
+ return popup;
+}
+
+void SUPERVGUI_CanvasCellNode::setPairCell(SUPERVGUI_CanvasCellNode* thePairCell) {
+ if (myIsControl) { //only for ControlNode
+ myPairCell = thePairCell;
+ }
+ else
+ myPairCell = 0;
+}
+
+SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasCellNode::getPairCell() {
+ return myPairCell;
+}
+
+void SUPERVGUI_CanvasCellNode::sync() {
+ const bool isExecuting = getMain()->getDataflow()->IsExecuting();
+ //if getEngine() is a MacroNode then set it state to state of its subgraph
+ if ( getEngine()->IsMacro() && isExecuting ) {
+ // get SubGraph from MacroNode
+ SUPERV_Graph aMacro = SUPERV::Graph::_narrow(getEngine());
+ if (!SUPERV_isNull(aMacro)) {
+ SUPERV_Graph aGraph;
+ if (aMacro->IsStreamMacro())
+ aGraph = aMacro->StreamObjRef();
+ else
+ aGraph = aMacro->FlowObjRef();
+ if (!SUPERV_isNull(aGraph)) {
+ if (aGraph->State() != SUPERV::UndefinedState && aGraph->State() != SUPERV::NoState)
+ getPrs()->setState(aGraph->State());
+ else
+ getPrs()->setState(getEngine()->State());
+ }
+ }
+ }
+ else {
+ getPrs()->setState(getEngine()->State());
+ }
+}
+
+bool SUPERVGUI_CanvasCellNode::setNodeName(QString aName)
+{
+ bool result = SUPERVGUI_CanvasNode::setNodeName(aName);
+ if (result && myPairCell) {
+ result = myPairCell->setNodeName(QString(tr("ENDNODE_PREFIX"))+aName);
+ }
+ return result;
+}
+
+SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasCellNode::createPrs() const
+{
+ SUPERVGUI_CanvasNodePrs* aPrs =
+ new SUPERVGUI_CanvasCellNodePrs(getMain()->getCanvasArray(),
+ (SUPERVGUI_CanvasCellNode*)this);
+ return aPrs;
+}
+
+SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode,
+ SUPERVGUI_CanvasCellNode* theStart):
+ SUPERVGUI_CanvasCellNode(theParent, theMain, theNode)
+{
+ //set start cell for end cell as pair
+ myPairCell = theStart;
+ //set end cell for start cell as pair
+ myPairCell->setPairCell(dynamic_cast<SUPERVGUI_CanvasCellNode*>(this));
+}
+
+bool SUPERVGUI_CanvasCellEndNode::setNodeName(QString theName)
+{
+ return SUPERVGUI_CanvasNode::setNodeName(theName);
+}
+
+//-----------------------------------------------------------
+//*************** Select Inline node dialog******************
+// Taken from SUPERVGUI_ControlNode.cxx without change
+//-----------------------------------------------------------
+
+SUPERVGUI_SelectInlineDlg::SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain)
+ :QDialog(theMain, 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+{
+ setSizeGripEnabled( true );
+ setCaption(tr("TIT_FUNC_PYTHON"));
+ QGridLayout* aMainLayout = new QGridLayout(this, 2, 2, 7, 4);
+
+ QLabel* aLabel = new QLabel("Connect to", this );
+ aMainLayout->addWidget(aLabel, 0, 0);
+
+ myCombo = new QComboBox(this);
+ myCombo->clear(); //for the additional check from GUI side for bug PAL7007
+ SUPERV_Nodes aNodesList = theMain->getDataflow()->Nodes();
+ int i;
+ for (i = 0; i < aNodesList->INodes.length(); i++) {
+ myCombo->insertItem(QString(aNodesList->INodes[i]->Name()));
+ }
+ for (i = 0; i < aNodesList->LNodes.length(); i++) {
+ myCombo->insertItem(QString(aNodesList->LNodes[i]->Name()));
+ }
+ for (i = 0; i < aNodesList->SNodes.length(); i++) {
+ myCombo->insertItem(QString(aNodesList->SNodes[i]->Name()));
+ }
+ aMainLayout->addWidget(myCombo, 0, 1);
+
+ QGroupBox* aBtnBox = new QGroupBox( this );
+ aBtnBox->setColumnLayout( 0, Qt::Vertical );
+ aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
+ QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
+ aBtnLayout->setAlignment( Qt::AlignTop );
+ aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
+
+ QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
+ connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ aBtnLayout->addWidget( aOKBtn );
+
+ aBtnLayout->addStretch();
+
+ QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
+ connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ aBtnLayout->addWidget( aCancelBtn );
+
+ aMainLayout->addMultiCellWidget(aBtnBox, 1, 1, 0, 1);
+}
using namespace std;
#include "SUPERVGUI_Def.h"
#include "SUPERVGUI_CanvasNode.h"
-
+#include <qdialog.h>
+#include <qcombobox.h>
class SUPERVGUI_CanvasComputeNode : public SUPERVGUI_CanvasNode {
Q_OBJECT
virtual void addInputPort();
virtual void addOutputPort();
+ virtual void pastePort();
protected:
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
};
+class SUPERVGUI_CanvasCellNode : public SUPERVGUI_CanvasNode {
+ Q_OBJECT
+
+ public:
+ SUPERVGUI_CanvasCellNode(QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode);
+ virtual ~SUPERVGUI_CanvasCellNode();
+
+ virtual QPopupMenu* getPopupMenu(QWidget* theParent);
+
+ void setPairCell(SUPERVGUI_CanvasCellNode* thePairCell);
+ SUPERVGUI_CanvasCellNode* getPairCell();
+
+ virtual void sync();
+ virtual bool setNodeName(QString aName);
+
+ protected:
+ virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
+
+ protected:
+ SUPERVGUI_CanvasCellNode* myPairCell; //for ControlNodes
+
+ private:
+ bool myIsControl;
+ bool myIsStart;
+
+};
+
+class SUPERVGUI_CanvasCellEndNode: public SUPERVGUI_CanvasCellNode {
+
+ public:
+ SUPERVGUI_CanvasCellEndNode(QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode,
+ SUPERVGUI_CanvasCellNode* theStart);
+ virtual ~SUPERVGUI_CanvasCellEndNode() {}
+
+ virtual bool setNodeName(QString theName);
+};
+
+/**
+ * Taken from SUPERVGUI_ControlNode.h without change
+ */
+class SUPERVGUI_SelectInlineDlg: public QDialog {
+ Q_OBJECT
+
+ public:
+ SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain);
+ virtual ~SUPERVGUI_SelectInlineDlg() {};
+
+ QString getName() { return myCombo->currentText(); }
+
+ private:
+ QComboBox* myCombo;
+};
+
+
#endif
}
void SUPERVGUI_CanvasLink::remove() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
QString aValue;
SUPERVGUI_CanvasPortIn* aPort = 0;
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
bool SUPERVGUI_CanvasLinkBuilder::canCreateEngine(SUPERVGUI_CanvasPort* thePort)
{
- bool result = false;
if (thePort && myPort) {
SUPERVGUI_CanvasPort* aInPort;
SUPERVGUI_CanvasPort* aOutPort;
aInPort = thePort;
}
- // control if node is different
+ // control if nodes are different, not the same node
QString aInNode(aInPort->getEngine()->Node()->Name());
QString aOutNode(aOutPort->getEngine()->Node()->Name());
- if (aInNode.compare(aOutNode) == 0)
- return false;
-
- // control if no port is "Default"
- QString aInName(aInPort->getEngine()->Name());
- QString aOutName(aOutPort->getEngine()->Name());
- if (aInName.compare("Default") == 0 ||
- aOutName.compare("Default") == 0)
+ if (aInNode.compare(aOutNode) == 0) // linking outport and inport of the same node
return false;
// control types of ports
(aOutKind == SUPERV::DataStreamParameter && aInKind != SUPERV::DataStreamParameter))
return false;
- // connect gate port with gate or inline port
- if (aInKind == SUPERV::GateParameter || aOutKind == SUPERV::GateParameter) {
- if (aInKind != aOutKind &&
- aInKind != SUPERV::InLineParameter &&
- aOutKind != SUPERV::InLineParameter)
- return false;
- }
+ // asv : 15.12.04 : NOT allow to connect Gate-to-InLine --> it does not make sence!
+ // Out Gate port can be connected only to In Gate port
+ if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter )
+ return false;
- // control if port is already linked except for input port of end switch node
- if (!(aInKind == SUPERV::EndSwitchParameter ||
- aInPort->getEngine()->Node()->Kind() == SUPERV::EndSwitchNode)) {
- if (aInPort->getEngine()->IsLinked())
+ // In Gate can be connected to (receive links from) Gate port and InLine ports (important for Switch nodes)
+ if ( aInKind == SUPERV::GateParameter && aOutKind != SUPERV::GateParameter && aOutKind != SUPERV::InLineParameter )
return false;
- }
- result = true;
+
+ // asv : 15.12.04 : PAL7374, p.2.2 "Bugs and Improvements": multiple links into Gate port
+ // for InGate it's OK to accept more than 1 link
+ // THESE NEEDS REVISION, ALSO DON'T ALLOW MANY LINKS TO "DEFAULT" PORT OF EndSwitch
+ //if ( aInPort->getEngine()->IsLinked() && aInKind != SUPERV::GateParameter )
+
+ // control if port is already linked except for input inline ports of end switch node (check for EndSwitchParameter)
+ // and "Default" port of Switch node (check for aNode->isEndSwitch()). "Default" port is linked by default, but we
+ // let it to be "re-linked" to another port.
+ const bool isEndSwitch = ( aInKind == SUPERV::EndSwitchParameter || aInPort->getEngine()->Node()->IsEndSwitch() );
+ if ( !isEndSwitch && aInPort->getEngine()->IsLinked() )
+ return false;
+
+ return true;
}
- return result;
+ return false;
}
void SUPERVGUI_CanvasLinkBuilder::setCoords(SUPERV::Link_ptr theLink)
void SUPERVGUI_CanvasPointPrs::setInEdge(SUPERVGUI_CanvasEdgePrs* theEdge)
{
myInEdge = theEdge;
- theEdge->setFromPoint((int)x(), (int)y());
+ theEdge->setFromPoint(this);
}
void SUPERVGUI_CanvasPointPrs::setOutEdge(SUPERVGUI_CanvasEdgePrs* theEdge)
{
myOutEdge = theEdge;
- theEdge->setToPoint((int)x(), (int)y());
+ theEdge->setToPoint(this);
}
void SUPERVGUI_CanvasPointPrs::moveBy(double dx, double dy)
{
QCanvasEllipse::moveBy(dx, dy);
- if (myInEdge) myInEdge->setFromPoint((int)x(), (int)y());
- if (myOutEdge) myOutEdge->setToPoint((int)x(), (int)y());
+ if (myInEdge) myInEdge->setFromPoint(this);
+ if (myOutEdge) myOutEdge->setToPoint(this);
//resize canvas view if mouse is outside
int w = (int)(x()+dx) + width() + GRAPH_MARGIN;
int h = (int)(y()+dy) + height() + GRAPH_MARGIN;
return SUPERVGUI_Canvas::Rtti_LinkEdge;
}
-void SUPERVGUI_CanvasEdgePrs::setFromPoint(int x, int y)
+void SUPERVGUI_CanvasEdgePrs::setFromPoint(SUPERVGUI_CanvasPointPrs* thePoint)
{
- setPoints(x, y, endPoint().x(), endPoint().y());
+ myStartPoint = thePoint;
+ setPoints((int)(thePoint->x()), (int)(thePoint->y()), endPoint().x(), endPoint().y());
}
-void SUPERVGUI_CanvasEdgePrs::setToPoint(int x, int y)
+void SUPERVGUI_CanvasEdgePrs::setToPoint(SUPERVGUI_CanvasPointPrs* thePoint)
{
- setPoints(startPoint().x(), startPoint().y(), x, y);
+ myEndPoint = thePoint;
+ setPoints(startPoint().x(), startPoint().y(), (int)(thePoint->x()), (int)(thePoint->y()));
}
void SUPERVGUI_CanvasEdgePrs::setColor(const QColor& theColor)
{
setPen(QPen(theColor, LINE_WIDTH));
}
+
+void SUPERVGUI_CanvasEdgePrs::moveBy(double dx, double dy)
+{
+ //mkr: for moving segment of link
+ if (myStartPoint && myEndPoint) {
+ myStartPoint->setMoving(true);
+ myStartPoint->moveBy(dx, dy);
+
+ myEndPoint->setMoving(true);
+ myEndPoint->moveBy(dx,dy);
+ }
+}
+
SUPERVGUI_CanvasLink* getLink() const { return myLink; }
- void setFromPoint(int x, int y);
- void setToPoint(int x, int y);
+ void setFromPoint(SUPERVGUI_CanvasPointPrs* thePoint);
+ void setToPoint(SUPERVGUI_CanvasPointPrs* thePoint);
- void moveBy(double dx, double dy) {}
+ void moveBy(double dx, double dy);
void setColor(const QColor& theColor);
+ void setMoving(bool b) { myMoving = b; }
+ bool isMoving() const { return myMoving; }
+
virtual int rtti() const;
private:
+ bool myMoving;
SUPERVGUI_CanvasLink* myLink;
+
+ //mkr: for moving segment of link
+ SUPERVGUI_CanvasPointPrs* myStartPoint;
+ SUPERVGUI_CanvasPointPrs* myEndPoint;
};
#endif
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasNodePrs.h"
#include "SUPERVGUI_CanvasPort.h"
+#include "SUPERVGUI_Clipboard.h"
#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_Python.h"
#include "SUPERVGUI.h"
#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "SALOMEGUI_NameDlg.h"
+#include "SUPERVGUI_ManagePortsDlg.h"
#include "SUPERVGUI_Information.h"
-/*
-#include "SUPERVGUI_CanvasControlNode.h"
+#include "SUPERVGUI_Library.h"
-#include <qtooltip.h>
-*/
+#include "SALOMEGUI_NameDlg.h"
+#include "QAD_MessageBox.h"
-SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
QObject(theParent),
myMain(theMain),
myNode(theNode),
myLabelText = aNewComment;
- // create node ports
- isIgnore = true;
- //cout << " get port list... " ;
- SUPERV_Ports aPortList = myNode->Ports();
- //cout << aPortList->length() << endl;
- for (int i = 0; i < aPortList->length(); i++) {
- createPort(aPortList[i].in());
- }
-
- //cout << " get stream port list... " ;
- SUPERV_StreamPorts aStreamPortList = myNode->StreamPorts();
- //cout << aStreamPortList->length() << endl;
- for (int i = 0; i < aStreamPortList->length(); i++) {
- createStreamPort(aStreamPortList[i].in());
+ // mkr : if the SUPERVGUI_CavasCellNode created (for CANVASTABLE view),
+ // we haven't create its ports
+ if (!theIsCell) {
+ // create node ports
+ isIgnore = true;
+ SUPERV_Ports aPortList = myNode->Ports();
+ for (int i = 0; i < aPortList->length(); i++)
+ createPort(aPortList[i].in());
+
+ SUPERV_StreamPorts aStreamPortList = myNode->StreamPorts();
+ for (int i = 0; i < aStreamPortList->length(); i++) {
+ createStreamPort(aStreamPortList[i].in());
+ }
}
isIgnore = false;
SUPERVGUI_CanvasNode::~SUPERVGUI_CanvasNode()
{
isIgnore = true;
- if (myPrs) delete myPrs;
+ if ( myPrs ) {
+ myPrs->hide();
+ delete myPrs;
+ myPrs = 0;
+ }
}
void SUPERVGUI_CanvasNode::setDestroyed()
getPrs()->hide();
}
-SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::getPrs() const
+SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::getPrs()
{
- if (myPrs == 0) {
- ((SUPERVGUI_CanvasNode*)this)->myPrs = createPrs();
- }
+ if ( !myPrs )
+ myPrs = createPrs();
+
return myPrs;
}
return new SUPERVGUI_CanvasNodePrs(myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
}
-void SUPERVGUI_CanvasNode::createPort(SUPERV::Port_ptr thePort) const
+void SUPERVGUI_CanvasNode::createPort(SUPERV::Port_ptr thePort)
{
SUPERVGUI_CanvasPort* aPort = 0;
if (thePort->IsInput())
}
}
-void SUPERVGUI_CanvasNode::createStreamPort(SUPERV::StreamPort_ptr thePort) const
+void SUPERVGUI_CanvasNode::createStreamPort(SUPERV::StreamPort_ptr thePort)
{
SUPERVGUI_CanvasPort* aPort = 0;
if (thePort->IsInput())
QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent)
{
QPopupMenu* popup = new QPopupMenu(theParent);
- if (myMain->getDataflow()->IsExecuting()) {
- popup->insertItem((myNode->IsSuspended()?tr("MSG_RESUME"):tr("MSG_SUSPEND")),
- this, SLOT(suspendResume()));
+
+ if (myMain->getDataflow()->IsExecuting()) { // Execution time
+ popup->insertItem((myNode->IsSuspended()?tr("MSG_RESUME"):tr("MSG_SUSPEND")), this, SLOT(suspendResume()));
popup->insertItem(tr("MSG_KILL"), this, SLOT(kill()));
}
- else {
- if (myMain->isEditable() && getNodeType() != SUPERV::EndLoopNode
- && getNodeType() != SUPERV::EndSwitchNode) {
+ else { // Edition time
+ const int type = getNodeType();
+
+ // for all nodes except EndLoop and EndSwitch : Rename, Delete, Copy
+ if ( myMain->isEditable() && type != SUPERV::EndLoopNode && type != SUPERV::EndSwitchNode ) {
popup->insertItem(tr("MSG_RENAME"), this, SLOT(rename()));
- popup->insertItem(tr("MSG_DELETE"), this, SLOT(remove()));
- popup->insertSeparator();
+ myDeleteItem = popup->insertItem(tr("MSG_DELETE"), this, SLOT(remove()));
}
+
+ // tmp: Copy temporary does not work for Macro nodes...
+ if ( type != SUPERV::MacroNode )
+ popup->insertItem(tr("ITM_COPY_NODE"), this, SLOT(copy())); // Copy Node functionality
+ popup->insertSeparator();
+
+ // for all nodes : Browse
popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
- if (getNodeType() != SUPERV::EndLoopNode &&
- getNodeType() != SUPERV::EndSwitchNode)
+ // for all nodes except EndLoop and EndSwitch : Change info
+ if (type != SUPERV::EndLoopNode && type != SUPERV::EndSwitchNode)
popup->insertItem(tr("MSG_CHANGE_INFO"), this, SLOT(changeInformation()));
- if (myMain->isEditable() && getNodeType() != SUPERV::FactoryNode
- && getNodeType() != SUPERV::ComputingNode
- && getNodeType() != SUPERV::EndLoopNode
- && getNodeType() != SUPERV::MacroNode) {
- QPopupMenu* addPortMenu = new QPopupMenu(theParent);
- addPortMenu->insertItem("Input", this, SLOT(addInputPort()));
- if (getNodeType() != SUPERV::LoopNode)
- addPortMenu->insertItem("Output", this, SLOT(addOutputPort()));
-
- popup->insertSeparator();
- if ((getNodeType() != SUPERV::EndSwitchNode))
- popup->insertItem("Edit Function", this, SLOT(editFunction()));
- popup->insertItem("Add Port", addPortMenu);
+ // for all InLine nodes
+ if ( type != SUPERV::FactoryNode && type != SUPERV::ComputingNode && type != SUPERV::MacroNode ) {
+ if ( myMain->isEditable() ) {
+ popup->insertSeparator();
+ popup->insertItem( tr( "MNU_EDIT_FUNC" ), this, SLOT(editFunction()));
+ }
+
+ // for all InLine, regardless isEditable() : Export to Library
+ popup->insertItem( tr( "MNU_EXPORT" ), this, SLOT( exportToLib()));
+
+ // for all InLine except EndLoop : Add Ports menu, Paste, Manage Ports
+ if ( myMain->isEditable() && type != SUPERV::EndLoopNode ) {
+ QPopupMenu* addPortMenu = new QPopupMenu(theParent);
+ addPortMenu->insertItem( tr( "MNU_INPUT" ), this, SLOT(addInputPort()));
+ if (getNodeType() != SUPERV::LoopNode)
+ addPortMenu->insertItem( tr( "MNU_OUTPUT" ), this, SLOT(addOutputPort()));
+
+ popup->insertItem( tr( "MNU_ADD_PORT" ), addPortMenu);
+ popup->insertItem( tr( "MNU_MANAGE_PORTS" ), this, SLOT(managePorts()));
+
+ // Paste Port functionality
+ int aPasteItem = popup->insertItem(tr("ITM_PASTE_PORT"), this, SLOT(pastePort()));
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ if ( !aCB->isCopyPort() || (type == SUPERV::LoopNode && !aCB->getCopyPort()->IsInput()) )
+ popup->setItemEnabled( aPasteItem, false );
+ }
}
}
-
return popup;
}
void SUPERVGUI_CanvasNode::merge()
{
- //MESSAGE("===> SUPERVGUI_CanvasNode::merge() " << myNode->Name());
// synchronize port list
bool update = false;
isIgnore = true;
SUPERVGUI_CanvasPort* aPort;
QObjectList* aPortList = queryList("SUPERVGUI_CanvasPort");
- //cout << " get port list... " ;
SUPERV_Ports aPorts = myNode->Ports();
- //cout << aPorts->length() << endl;
for (int i = 0; i < aPorts->length(); i++) {
aPort = (SUPERVGUI_CanvasPort*)
child(myMain->getCanvas()->getPortName(aPorts[i].in()), "SUPERVGUI_CanvasPort");
if (aPort) {
- //cout << " update port " << aPort->name() << endl;
aPortList->removeRef(aPort);
aPort->update();
}
else {
- //cout << " create port " << myMain->getCanvas()->getPortName(aPorts[i].in()) << endl;
createPort(aPorts[i].in());
update = true;
}
}
- //cout << " get stream port list... " ;
SUPERV_StreamPorts aStreamPorts = myNode->StreamPorts();
- //cout << aStreamPorts->length() << endl;
for (int i = 0; i < aStreamPorts->length(); i++) {
aPort = (SUPERVGUI_CanvasPort*)
child(myMain->getCanvas()->getPortName(aStreamPorts[i].in()), "SUPERVGUI_CanvasPort");
if (aPort) {
- //cout << " update stream port " << aPort->name() << endl;
aPortList->removeRef(aPort);
aPort->update();
}
else {
- //cout << " create stream port " << myMain->getCanvas()->getPortName(aStreamPorts[i].in()) << endl;
createPort(aStreamPorts[i].in());
update = true;
}
}
- //cout << " remove inexistant " << endl;
QObjectListIt it(*aPortList);
while ((aPort=(SUPERVGUI_CanvasPort*)it.current()) != 0) {
++it;
sync(); // update node state also
}
-void SUPERVGUI_CanvasNode::sync()
-{
- //MESSAGE("===> SUPERVGUI_CanvasNode::sync() " << myNode->Name() << ", state " << myNode->State());
-
+void SUPERVGUI_CanvasNode::sync() {
const bool isExecuting = myMain->getDataflow()->IsExecuting();
- //if myNode is a MacroNode then set it state to state of its subgraph
if ( myNode->IsMacro() && isExecuting ) {
// get SubGraph from MacroNode
SUPERV_Graph aMacro = SUPERV::Graph::_narrow(myNode);
SUPERV::GraphState aState = myNode->State();
// asv : 18.11.04 : fix for 6170 : after execution is finished, nodes' status must be reset.
- if ( !isExecuting && myMain->IsGUIEventLoopFinished() && (aState == SUPERV::DoneState ||
- aState == SUPERV::KillState || aState == SUPERV::StopState ) )
- aState = SUPERV::EditingState;
+ // asv : 13.12.04 : commented out setting EditingState. See 2.21.
+ //if ( !isExecuting && myMain->IsGUIEventLoopFinished() && (aState == SUPERV::DoneState ||
+ // aState == SUPERV::KillState || aState == SUPERV::StopState ) )
+ // aState = SUPERV::EditingState;
getPrs()->setState(aState);
}
getPrs()->setState(theStateFromEvent);
}
-bool SUPERVGUI_CanvasNode::setNodeName(QString aName)
-{
+bool SUPERVGUI_CanvasNode::setNodeName(QString aName) {
bool result = myNode->SetName(aName.latin1());
if (result) {
setName(myNode->Name());
return result;
}
-void SUPERVGUI_CanvasNode::rename()
-{
+void SUPERVGUI_CanvasNode::rename() {
QString aName = SALOMEGUI_NameDlg::getName(QAD_Application::getDesktop(), myNode->Name());
if (!aName.isEmpty()) {
setNodeName(aName);
void SUPERVGUI_CanvasNode::remove() {
Trace("SUPERVGUI_CanvasNode::remove");
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
+ //set myCopyPort from Main object to empty if engine of this port is deleted
+ //check if any port of this deleted node has been copied
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ if ( aCB->isCopyPort() )
+ if ( QString(myNode->Name()) == QString(aCB->getCopyPort()->Node()->Name()) )
+ aCB->setCopyPort( 0 );
+
+ //set myCopyNode from Main object to empty if engine of this node is deleted
+ //check if myCopyNode and this node engine is equal
+ if ( aCB->isCopyNode() )
+ if ( QString(myNode->Name()) == QString(aCB->getCopyNode()->Name()) )
+ aCB->setCopyNode( 0 );
+
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node
+ myMain->removeArrayChild(myNode);
+
SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
setDestroyed();
myNode->destroy();
aCanvas->update();
}
+void SUPERVGUI_CanvasNode::copy() {
+ Trace("SUPERVGUI_CanvasNode::copy()");
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ const int aKind = getNodeType();
+ if ( aKind == SUPERV::EndLoopNode || aKind == SUPERV::EndSwitchNode )
+ aCB->setCopyNode( SUPERV::CNode::_duplicate(SUPERV::GNode::_narrow(getEngine())->Coupled()) );
+ else
+ aCB->setCopyNode( SUPERV::CNode::_duplicate( getEngine() ) );
+}
+
void SUPERVGUI_CanvasNode::suspendResume() {
Trace("SUPERVGUI_CanvasNode::suspendResume");
int n = queryList("SUPERVGUI_CanvasNode")->count();
myMain->getMyThread()->stopThread(tr("MSG_NODE_KILLED1")+myNode->Name()+tr("MSG_NODE_KILLED2"));
}
}
-
+/* asv : 15.12.04 : commented out stopRestart() in Main and CanvasNode because it's not called from anywhere,
+ the comment from kloss (in Main.cxx) may be explaining it, but it's in French and I do not understand it..
void SUPERVGUI_CanvasNode::stopRestart() {
Trace("SUPERVGUI_CanvasNode::stopRestart");
}
}
}
-
+*/
void SUPERVGUI_CanvasNode::changeInformation() {
SUPERVGUI_Information* aDlg = new SUPERVGUI_Information(myNode, !myMain->isEditable());
if (aDlg->exec()) {
delete aDlg;
}
+/* asv : 13.12.04 : The functions below are not called from anywhere, so commenting them out...
void SUPERVGUI_CanvasNode::configure()
{
Trace("SUPERVGUI_CanvasNode::configure");
SUPERVGUI_Python cp(myMain->getStudy()->get_PyInterp(), !myMain->isEditable());
cp.exec();
}
+*/
bool SUPERVGUI_CanvasNode::isWarning()
{
void SUPERVGUI_CanvasNode::browse()
{
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
if (!myBrowseDlg) {
myBrowseDlg = new SUPERVGUI_BrowseNodeDlg(this);
myBrowseDlg->installEventFilter(this);
{
if (o == myBrowseDlg && e->type() == QEvent::Close)
myBrowseDlg = 0;
-
return QObject::eventFilter(o, e);
}
}
void SUPERVGUI_CanvasNode::addInputPort() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
SUPERV_Port aPort = createInPort();
if (aPort == NULL) return;
void SUPERVGUI_CanvasNode::addOutputPort() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
SUPERV_Port aPort = createOutPort();
if (aPort == NULL) return;
}
-void SUPERVGUI_CanvasNode::editFunction()
-{
+void SUPERVGUI_CanvasNode::editFunction() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
if (getNodeType() == SUPERV::LoopNode) {
SUPERVGUI_EditPythonDlg* aDlg = new SUPERVGUI_EditPythonDlg(true);
SUPERV_LNode aLNode = getLoopNode();
delete aDlg;
}
}
+
+/**
+ * Called on "Paste port" command of popup menu
+ */
+void SUPERVGUI_CanvasNode::pastePort() {
+ SUPERVGUI_Clipboard::getClipboard()->pastePort( this );
+}
+
+/**
+ * Called on "Edit ports" popup menu command. See SUPERVGUI_ManagePortsDlg.h
+ * for detailed description of the functionality
+ */
+void SUPERVGUI_CanvasNode::managePorts() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
+ SUPERVGUI_ManagePortsDlg* aDlg = new SUPERVGUI_ManagePortsDlg( this );
+ aDlg->exec();
+ delete aDlg;
+}
+
+/**
+ * Called on "Export to Library" popup menu command. See SUPERVGUI_Library.h
+ * for details on InLine nodes library functionality
+ */
+void SUPERVGUI_CanvasNode::exportToLib() {
+ SUPERV::INode_var anINode = SUPERV::INode::_narrow( getEngine() );
+ if ( !CORBA::is_nil( anINode ) )
+ SUPERVGUI_Library::getLibrary()->Export( anINode );
+ else
+ QAD_MessageBox::error1( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_BAD_INODE" ), tr( "OK" ) );
+}
class SUPERVGUI_CanvasNodePrs;
class SUPERVGUI_CanvasNode : public QObject {
+ friend class SUPERVGUI_ManagePortsDlg;
+ friend class SUPERVGUI_Clipboard;
+
Q_OBJECT
public:
- SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+ SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell=false);
virtual ~SUPERVGUI_CanvasNode();
// done to ignore port update when node is removed
virtual void showAll();
virtual bool setNodeName(QString aName);
- SUPERV_CNode getEngine() const { return myNode; }
- SUPERVGUI_Main* getMain() const { return myMain; }
- SUPERVGUI_CanvasNodePrs* getPrs() const;
+ SUPERV_CNode getEngine() const { return myNode; }
+ SUPERVGUI_Main* getMain() const { return myMain; }
+ SUPERVGUI_CanvasNodePrs* getPrs();
bool isWarning();
bool isStep();
SUPERV_INode getInlineNode() const { return SUPERV::INode::_narrow(myNode); }
SUPERV_GNode getGotoNode() const { return SUPERV::GNode::_narrow(myNode); }
SUPERV_LNode getLoopNode() const { return SUPERV::LNode::_narrow(myNode); }
- SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode); }
+ SUPERV_ELNode getEndLoopNode() const { return SUPERV::ELNode::_narrow(myNode);}
SUPERV_SNode getSwitchNode() const { return SUPERV::SNode::_narrow(myNode); }
- SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode); }
- SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
+ SUPERV_ESNode getEndSwitchNode() const { return SUPERV::ESNode::_narrow(myNode);}
+ SUPERV_Graph getMacroNode() const { return SUPERV::Graph::_narrow(myNode); }
SUPERV_Port createInPort();
SUPERV_Port createOutPort();
public slots:
void suspendResume();
void kill();
- void stopRestart();
- void configure();
- void showPython();
+ //void stopRestart();
+
+ //asv: 13.12.04: ??? --> void configure();
+ //asv: 13.12.04: ??? --> void showPython();
virtual void rename();
virtual void remove();
+ void copy();
void changeInformation();
void browse();
virtual void addInputPort();
virtual void addOutputPort();
virtual void editFunction();
+ virtual void pastePort();
+ void managePorts();
+ void exportToLib();
protected:
+ // redefined by most of CanvasNode successors
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
- virtual void createPort(SUPERV::Port_ptr thePort) const;
- virtual void createStreamPort(SUPERV::StreamPort_ptr thePort) const;
+
+ void createPort(SUPERV::Port_ptr thePort);
+ void createStreamPort(SUPERV::StreamPort_ptr thePort);
virtual bool eventFilter(QObject* o, QEvent* e);
SUPERVGUI_BrowseNodeDlg* myBrowseDlg;
bool isIgnore;
+ int myDeleteItem;
protected slots:
virtual void onDestroyed(QObject*);
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_Canvas.h"
+#include "SUPERVGUI_CanvasCellNodePrs.h"
//#define CHECKTIME
// Node presentation
//=====================================================================
SUPERVGUI_CanvasNodePrs::SUPERVGUI_CanvasNodePrs(QCanvas* theCanvas,
- SUPERVGUI_CanvasNode* theNode):
+ SUPERVGUI_CanvasNode* theNode,
+ bool theCellPrs):
QCanvasPolygonalItem(theCanvas),
myNode(theNode)
{
myLabelVisible = true;
myPortVisible = true;
+ myCellPrs = theCellPrs;
myColor = MAIN_BACK;
- // create in/out connection points prs
- myPointIn = new SUPERVGUI_CanvasHookPrs(theCanvas, this, true);
- myPointOut = new SUPERVGUI_CanvasHookPrs(theCanvas, this, false);
+ if (!myCellPrs) {
+ // create in/out connection points prs
+ myPointIn = new SUPERVGUI_CanvasHookPrs(theCanvas, this, true);
+ myPointOut = new SUPERVGUI_CanvasHookPrs(theCanvas, this, false);
- setZ(0);
- setState(myNode->getEngine()->State());
- updatePorts();
+ setZ(0);
+ setState(myNode->getEngine()->State());
+ updatePorts();
+ }
}
SUPERVGUI_CanvasNodePrs::~SUPERVGUI_CanvasNodePrs()
{
- Trace("SUPERVGUI_CanvasNodePrs::~SUPERVGUI_CanvasNodePrs");
- if (myPointIn) delete myPointIn;
- if (myPointOut) delete myPointOut;
- hide();
+ if ( !myCellPrs ) {
+ if ( myPointIn ) {
+ delete myPointIn;
+ myPointIn = 0;
+ }
+ if ( myPointOut ) {
+ delete myPointOut;
+ myPointOut = 0;
+ }
+ }
}
int SUPERVGUI_CanvasNodePrs::rtti() const
}
}
- myPointIn->moveBy(dx, dy);
- myPointOut->moveBy(dx, dy);
+ if (!myCellPrs) {
+ myPointIn->moveBy(dx, dy);
+ myPointOut->moveBy(dx, dy);
+ }
}
void SUPERVGUI_CanvasNodePrs::setZ(double z)
myLabelVisible = b;
updatePorts();
- if (!isPortVisible()) updatePoints();
+ if (!isPortVisible() && !myCellPrs) updatePoints();
if (aDisp) {
show();
myPortVisible = b;
if (b) {
- myPointIn->hide();
- myPointOut->hide();
+ if (!myCellPrs) {
+ myPointIn->hide();
+ myPointOut->hide();
+ }
updateGates();
}
else {
- updatePoints();
-
- myPointIn->show();
- myPointOut->show();
+ if (!myCellPrs) {
+ updatePoints();
+
+ myPointIn->show();
+ myPointOut->show();
+ }
}
const QObjectList* list = myNode->children();
QFont saved = thePainter.font();
QFont f(saved);
if (f.pointSize() == -1) {
- f.setPixelSize(f.pixelSize()*aMat.m11());
+ f.setPixelSize((int)(f.pixelSize()*aMat.m11()));
}
else {
- f.setPointSize(f.pointSize()*aMat.m11());
+ f.setPointSize((int)(f.pointSize()*aMat.m11()));
}
thePainter.save();
QWMatrix m;
QRect r = getGateRect();
// r.setHeight(r.height()+1);
thePainter.drawRect(r);
- int x0 = (r.left() + r.right())/2;
+ //int x0 = (r.left() + r.right())/2;
// thePainter.drawLine(x0, r.top(), x0, r.bottom());
const QObjectList* list = myNode->children();
myStatusColor = red;
break;
+ case SUPERV::LoadingState:
+ myStatus = "Loading";
+ myStatusColor = QColor(56,255,56);
+ break;
+
default:
myStatus = "No Status";
myStatusColor = MAIN_BACK;
SUPERVGUI_CanvasHookPrs::~SUPERVGUI_CanvasHookPrs()
{
hide();
- if (myLine) {
+ if ( myLine ) {
delete myLine;
myLine = 0;
}
QObject* SUPERVGUI_CanvasHookPrs::getObject() const
{
QObject* anObj = 0;
- if (myNodePrs)
+ if ( myNodePrs )
anObj = myNodePrs->getNode();
- else if (myPortPrs)
+ else if ( myPortPrs )
anObj = myPortPrs->getPort();
return anObj;
}
class SUPERVGUI_CanvasNodePrs: public QCanvasPolygonalItem {
public:
- SUPERVGUI_CanvasNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode);
+ SUPERVGUI_CanvasNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode, bool theCellPrs=false);
virtual ~SUPERVGUI_CanvasNodePrs();
SUPERVGUI_CanvasNode* getNode() const { return myNode; }
QObject* getObject(const QPoint& thePos) const;
+ QString getStatus() const { return myStatus; }
+ QColor getStatusColor() const { return myStatusColor; }
+
+ void setStatus(QString theStatus) { myStatus = theStatus; }
+ void setStatusColor(QColor theStatusColor) { myStatusColor = theStatusColor; }
+
virtual int width() const;
virtual int height() const;
protected:
void draw(QPainter& thePainter);
- void drawShape(QPainter& thePainter);
+ virtual void drawShape(QPainter& thePainter);
virtual void drawTitle(QPainter& thePainter);
virtual void drawLabel(QPainter& thePainter);
virtual void drawTitleShape(QPainter& thePainter);
virtual void drawStatusShape(QPainter& thePainter);
+ bool myPortVisible;
+
private:
SUPERVGUI_CanvasNode* myNode;
int myGateHeight;
bool myLabelVisible;
- bool myPortVisible;
+ bool myCellPrs;
bool myMoving;
QString myStatus;
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasLink.h"
#include "SUPERVGUI_CanvasNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI.h"
#include "SUPERVGUI_BrowseNodeDlg.h"
QPopupMenu* SUPERVGUI_CanvasPort::getPopupMenu(QWidget* theParent)
{
QPopupMenu* popup = new QPopupMenu(theParent);
- if (myMain->isEditable()) {
+ if ( myMain->isEditable() && !myMain->getDataflow()->IsExecuting() ) {
int anItem = popup->insertItem(tr("MSG_SKETCH_LINK"), this, SLOT(sketchLink()));
if (myMain->getDataflow()->IsExecuting())
popup->setItemEnabled(anItem, false);
|| myPort->Kind() == SUPERV::EndSwitchParameter);
popup->insertSeparator();
}
- if (myMain->isEditable()
+ if (myMain->isEditable() && !myMain->getDataflow()->IsExecuting()
&&
((myPort->IsEndSwitch() && myPort->IsInput())
||
!(myPort->Node()->Kind() == SUPERV::LoopNode && !myPort->IsInput())))) {
popup->insertItem(tr("ITM_DEL_PORT"), this, SLOT(remove()));
}
+ // Copy Port functionality
+ if (myMain->isEditable() && !myPort->Node()->IsFactory()
+ && !myPort->Node()->IsComputing()
+ && !myPort->Node()->IsMacro())
+ popup->insertItem(tr("ITM_COPY_PORT"), this, SLOT(copy()));
- int anItem = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
+//int anItem = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
// if (getEngine()->IsLinked())
// popup->setItemEnabled(anItem, getEngine()->State() == SUPERV_Ready);
// else
getPrs()->update();
}
-void SUPERVGUI_CanvasPort::sketchLink()
-{
+void SUPERVGUI_CanvasPort::sketchLink() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
myMain->getCanvasView()->startSketch(this);
}
void SUPERVGUI_CanvasPort::remove() {
+ myMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
+ //set myCopyPort from Main object to empty if engine of this port is deleted
+ //check if myCopyPort and this port engine is equal
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ if ( aCB->isCopyPort() )
+ if ( QString(myPort->Node()->Name()) == QString(aCB->getCopyPort()->Node()->Name()) &&
+ QString(myPort->Name()) == QString(aCB->getCopyPort()->Name()) &&
+ myPort->IsInput() == aCB->getCopyPort()->IsInput() )
+ aCB->setCopyPort( 0 );
+
Trace("SUPERVGUI_CanvasPort::remove");
myPort->destroy();
delete this;
QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), aMes);
}
+void SUPERVGUI_CanvasPort::copy()
+{
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ aCB->setCopyPort(SUPERV::Port::_duplicate(getEngine()));
+}
//***********************************************************
// Input Port
QPopupMenu* SUPERVGUI_CanvasPortIn::getPopupMenu(QWidget* theParent)
{
QPopupMenu* popup = SUPERVGUI_CanvasPort::getPopupMenu(theParent);
- bool editable = getEngine()->IsInput() && (!getEngine()->IsLinked());
+ bool editable = getEngine()->IsInput() && !getEngine()->IsLinked() && !getMain()->getDataflow()->IsExecuting();
if (!getEngine()->IsGate() && editable)
popup->insertItem(tr("MSG_SETVALUE"), this, SLOT(setInput()));
void SUPERVGUI_CanvasPortIn::setInput()
{
+ getMain()->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
if (!myDlg) {
myDlg = new SUPERVGUI_GetValueDlg(this);
myDlg->installEventFilter(this);
myDlg->setActiveWindow();
myDlg->setFocus();
}
-
}
bool SUPERVGUI_CanvasPortIn::eventFilter(QObject* o, QEvent* e)
void sketchLink();
virtual void remove();
void browse();
+ void copy();
protected:
virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
// Module : SUPERV
using namespace std;
+
#include "SUPERVGUI_CanvasView.h"
#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_CanvasNode.h"
#include "SUPERVGUI_CanvasPort.h"
#include "SUPERVGUI_CanvasLink.h"
#include "SUPERVGUI_CanvasNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
+
#include "QAD_Config.h"
+#include "QAD_MessageBox.h"
#include <qpixmap.h>
#include <qcolordialog.h>
QPixmap zoomPix(imageZoomCursor);
QCursor zoom2Cursor(zoomPix);
+QCursor handCursor(Qt::PointingHandCursor);
#if QT_VERSION >= 0x030005
QCursor pan2Cursor(Qt::SizeAllCursor);
myIsPanBtnClicked = false;
myIsPanActivated = false;
+ myIsFitWRActivated = false;
myIsZoomActivated = false;
myIsLinkCreating = false;
myAddStudyItem = 0;
+ mySelectedRect = 0;
myCursor = cursor();
myTimer = new QTimer(this);
const bool isEdit = myMain->isEditable();
if (isEdit) {
myPopup->insertItem(tr("MSG_ADD_NODE"), myMain, SLOT(addNode()));
+
+ // Paste Node functionality
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ myPasteNodeItem = myPopup->insertItem(tr("ITM_PASTE_NODE"), aCB, SLOT(pasteNode()));
+
myPopup->insertItem(tr("MSG_INS_FILE"), myMain, SLOT(insertFile()));
myPopup->insertSeparator();
}
QPopupMenu* aViewPopup = new QPopupMenu(viewport());
- // aViewPopup->insertItem(tr("POP_FULLVIEW"), myMain, SLOT(showFullGraph()));
aViewPopup->insertItem(tr("POP_FULLVIEW"), myMain, SLOT(showCanvas()));
aViewPopup->insertItem(tr("POP_CONTROLVIEW"), myMain, SLOT(showContolFlow()));
- aViewPopup->insertItem(tr("POP_TABLEVIEW"), myMain, SLOT(showTable()));
- // aViewPopup->insertItem("Previous Full View", myMain, SLOT(showFullGraph()));
- // aViewPopup->insertItem(tr("POP_CANVASVIEW"), myMain, SLOT(showCanvas()));
+ aViewPopup->insertItem(tr("POP_TABLEVIEW"), myMain, SLOT(showCanvasTable()));
myPopup->insertItem(tr("POP_VIEW"), aViewPopup);
myPopup->insertSeparator();
aZoomPopup->insertItem("100%", this, SLOT(zoomReset()));
aZoomPopup->insertItem("50%", this, SLOT(zoomOut()));
aZoomPopup->insertSeparator();
- aZoomPopup->insertItem("Fit All", this, SLOT(fitAll()));
+ //mkr: "Fit within rectangle" functionality
+ aZoomPopup->insertItem(tr("POP_FITWITHINRECT"), this, SLOT(fitWithinRect()));
+ aZoomPopup->insertSeparator();
+ aZoomPopup->insertItem(tr("POP_FITALL"), this, SLOT(fitAll()));
+
- myPopup->insertItem("Zoom", aZoomPopup);
+ myPopup->insertItem(tr("POP_ZOOM"), aZoomPopup);
myPopup->insertSeparator();
myAddStudyItem = myPopup->insertItem(tr("MSG_ADD_STUDY"), this, SLOT(addToStudy()));
void SUPERVGUI_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent)
{
- // MESSAGE("===> SUPERVGUI_CanvasView::contentsMousePressEvent(...) ");
myPoint = inverseWorldMatrix().map(theEvent->pos());
myGlobalPoint = theEvent->globalPos();
myCurrentItem = 0;
}
myPopup->setItemEnabled(myAddStudyItem, !myMain->isFromStudy());
+ // Paste Node functionality
+ SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+ myPopup->setItemEnabled(myPasteNodeItem, aCB->isCopyNode() );
myMain->showPopup(myPopup, theEvent);
return;
}
if (theEvent->button() == Qt::LeftButton) {
- QCanvasItemList l = canvas()->collisions(myPoint);
- if (myIsLinkCreating) {
- for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
- if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
- SUPERVGUI_CanvasNodePrs* aNodePrs = (SUPERVGUI_CanvasNodePrs*) (*it);
- QObject* anObj = aNodePrs->getObject(myPoint);
- if (anObj->inherits("SUPERVGUI_CanvasPort")) {
- endSketch((SUPERVGUI_CanvasPort*)anObj);
- return;
+ if (!myIsFitWRActivated) {//not moving items if fit within rectangle
+ //functionality is enable
+ QCanvasItemList l = canvas()->collisions(myPoint);
+ if (myIsLinkCreating) {
+ for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
+ SUPERVGUI_CanvasNodePrs* aNodePrs = (SUPERVGUI_CanvasNodePrs*) (*it);
+ QObject* anObj = aNodePrs->getObject(myPoint);
+ if (anObj->inherits("SUPERVGUI_CanvasPort")) {
+ endSketch((SUPERVGUI_CanvasPort*)anObj);
+ return;
+ }
+ else {
+ myCurrentItem = *it;
+ ((SUPERVGUI_CanvasNodePrs*)myCurrentItem)->setZ(2);
+ ((SUPERVGUI_CanvasNodePrs*)myCurrentItem)->setMoving(true);
+ return;
+ }
}
- else {
- myCurrentItem = *it;
- ((SUPERVGUI_CanvasNodePrs*)myCurrentItem)->setZ(2);
- ((SUPERVGUI_CanvasNodePrs*)myCurrentItem)->setMoving(true);
- return;
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Hook) {
+ SUPERVGUI_CanvasHookPrs* aHookPrs = (SUPERVGUI_CanvasHookPrs*) (*it);
+ QObject* anObj = aHookPrs->getObject();
+ if (anObj->inherits("SUPERVGUI_CanvasPort")) {
+ endSketch((SUPERVGUI_CanvasPort*)anObj);
+ return;
+ }
}
}
- if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Hook) {
- SUPERVGUI_CanvasHookPrs* aHookPrs = (SUPERVGUI_CanvasHookPrs*) (*it);
- QObject* anObj = aHookPrs->getObject();
- if (anObj->inherits("SUPERVGUI_CanvasPort")) {
- endSketch((SUPERVGUI_CanvasPort*)anObj);
- return;
- }
+ if (myLinkBuilder) {
+ myLinkBuilder->addNextPoint(myPoint, mySketchPopup->isItemChecked(myOrtoItem));
+ canvas()->update();
+ mySketchPopup->setItemEnabled(myDelPntItem, true);
+ return;
}
}
- if (myLinkBuilder) {
- myLinkBuilder->addNextPoint(myPoint, mySketchPopup->isItemChecked(myOrtoItem));
- canvas()->update();
- mySketchPopup->setItemEnabled(myDelPntItem, true);
- return;
- }
- }
-
+
// if (myMain->isEditable()) { // allow to move nodes and link point on imported graph
for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_Node) {
return;
}
}
+ if ((*it)->rtti() == SUPERVGUI_Canvas::Rtti_LinkEdge) {
+ //mkr: for moving segment of link
+ SUPERVGUI_CanvasEdgePrs* aPrs = (SUPERVGUI_CanvasEdgePrs*) (*it);
+ if (aPrs->getLink()->getInputPort()->getConnectionPoint() == aPrs->startPoint()
+ ||
+ aPrs->getLink()->getInputPort()->getConnectionPoint() == aPrs->endPoint()
+ ||
+ aPrs->getLink()->getOutputPort()->getConnectionPoint() == aPrs->startPoint()
+ ||
+ aPrs->getLink()->getOutputPort()->getConnectionPoint() == aPrs->endPoint()) {
+ return;
+ }
+ myCurrentItem = *it;
+ aPrs->setMoving(true);
+ return;
+ }
}
// }
+ }
}
}
if (myCurrentItem) {
// setHilighted(0);
- double cx = myCurrentItem->x() - myPoint.x();
- double cy = myCurrentItem->y() - myPoint.y();
- if (p.x()+cx < 0) p.setX(-(int)cx);
- if (p.y()+cy < 0) p.setY(-(int)cy);
+ if (myCurrentItem->x() && myCurrentItem->y()) {
+ double cx = myCurrentItem->x() - myPoint.x();
+ double cy = myCurrentItem->y() - myPoint.y();
+
+ if (p.x()+cx < 0) p.setX(-(int)cx);
+ if (p.y()+cy < 0) p.setY(-(int)cy);
+ }
myCurrentItem->moveBy(p.x() - myPoint.x(),
p.y() - myPoint.y());
myPoint = p;
return;
}
+ //mkr: "Fit within rectangle" functionality
+ if (myIsFitWRActivated) {
+ int aLX, aTY; //left x and top y
+ if (myPoint.x() < p.x()) aLX = myPoint.x();
+ else aLX = p.x();
+ if (myPoint.y() < p.y()) aTY = myPoint.y();
+ else aTY = p.y();
+ QRect aRect(aLX, aTY, abs(myPoint.x()-p.x()), abs(myPoint.y()-p.y()));
+ QCanvasRectangle* aRect1 = new QCanvasRectangle(aRect, canvas());
+
+ //hide old selected rectangle
+ if (mySelectedRect)
+ mySelectedRect->hide();
+ //draw new selected rectangle
+ QPen pen(Qt::SolidLine);
+ pen.setWidth(1);
+ aRect1->setPen(pen);
+ aRect1->setZ(3);
+ aRect1->show();
+
+ mySelectedRect = aRect1;
+ canvas()->update();
+ }
+
if (!myIsLinkCreating && myMain->isEditable() &&
!myMain->getCanvas()->isControlView()) {
// compute collision rectangle
void SUPERVGUI_CanvasView::contentsMouseReleaseEvent(QMouseEvent* theEvent)
{
- // MESSAGE("===> SUPERVGUI_CanvasView::contentsMouseReleaseEvent(...) ");
if (myTimer->isActive()) myTimer->stop();
if (myCurrentItem) {
myIsZoomActivated = false;
setCursor(myCursor);
}
+
+ //mkr: "Fit within rectangle" functionality
+ if (myIsFitWRActivated) {
+ if (mySelectedRect) {
+ mySelectedRect->hide();
+ mySelectedRect = 0;
+ canvas()->update();
+ }
+
+ //myPoint is the start point for selecting rectangle now
+ QPoint anEndPoint = inverseWorldMatrix().map(theEvent->pos());
+ int aLX, aTY; //left x and top y
+ if (myPoint.x() < anEndPoint.x()) aLX = myPoint.x();
+ else aLX = anEndPoint.x();
+ if (myPoint.y() < anEndPoint.y()) aTY = myPoint.y();
+ else aTY = anEndPoint.y();
+
+ //calculate width and height for new view and new zoom factor
+ double aXzoom = ((double)visibleWidth())/((double)(abs(myPoint.x()-anEndPoint.x())));
+ double aYzoom = ((double)visibleHeight())/((double)(abs(myPoint.y()-anEndPoint.y())));
+ if (aXzoom > aYzoom) aXzoom = aYzoom;
+
+ QWMatrix m;
+ m.scale(aXzoom, aXzoom);
+ setWorldMatrix(m);
+ setContentsPos((int)(aLX*aXzoom), (int)(aTY*aYzoom));
+
+ canvas()->update();
+
+ myIsFitWRActivated = false;
+ viewport()->setMouseTracking(true);
+ setCursor(myCursor);
+ }
}
void SUPERVGUI_CanvasView::contentsMouseDoubleClickEvent(QMouseEvent* theEvent)
{
- // MESSAGE("===> SUPERVGUI_CanvasView::contentsMouseDoubleClickEvent(...) ");
QPoint p = inverseWorldMatrix().map(theEvent->pos());
// compute collision rectangle
- QRect aSel(p.x()-MARGIN, p.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
+ //QRect aSel(p.x()-MARGIN, p.y()-MARGIN, 1+2*MARGIN, 1+2*MARGIN);
if (theEvent->button() == Qt::LeftButton) {
QCanvasItemList l = canvas()->collisions(p);
void SUPERVGUI_CanvasView::endSketch(SUPERVGUI_CanvasPort* thePort)
{
- // MESSAGE("===> SUPERVGUI_CanvasView::endSketch(" << thePort->name() << ")");
if (!myIsLinkCreating) return;
if (myLinkBuilder && myLinkBuilder->canCreateEngine(thePort)) {
SUPERVGUI_CanvasPort* aOutPort = (input ? myLinkBuilder->getStartPort() : thePort);
aLinkEngine = myMain->getDataflow()->Link(aOutPort->getEngine(), aInPort->getEngine());
}
- if (SUPERV_isNull(aLinkEngine)) return;
+ if (SUPERV_isNull(aLinkEngine))
+ return;
+
+ // here, in fact, aLinkEngine may NOT be a newly created link. If a link already existed between the
+ // the 2 given ports - it will be return (NOT created again).
+ // this should be checked and new presentation should NOT be created for existing link.
+ // Solution 1: NOT to allow creation of a link if it already exists between the ports in
+ // myLinkBuilder->canCreateEngine()
+ // Solution 2: check here if aLinkEngine is "new" or "old"
+ // Implement 2nd solution, because canCreateEngine() checks for types of ports, etc.. - it's another thing
+ // THE CHECK:
+ QObjectList* canvasLinks = canvas()->queryList("SUPERVGUI_CanvasLink");
+ SUPERVGUI_CanvasLink* canvasLink = 0;
+ QObjectListIt it(*canvasLinks);
+ bool prsAlreadyExists = false;
+ while ( (canvasLink=(SUPERVGUI_CanvasLink*)it.current()) ) {
+ ++it;
+ SUPERV_Link existingLinkWithPrs = canvasLink->getEngine();
+ if ( !SUPERV_isNull( existingLinkWithPrs ) ) {
+ if ( existingLinkWithPrs->IsEqual( aLinkEngine ) ) {
+ prsAlreadyExists = true;
+ break;
+ }
+ }
+ }
+ delete canvasLinks;
+ if ( prsAlreadyExists ) { // aLinkEngine is already bound with a SUPERVGUI_CanvasLink object
+ //return; // -> if return here, than the old CanvasLink is kept
+
+ // we want to delete old and create a new CanvasLink for this Link
+ delete canvasLink;
+ canvasLink = 0;
+ // clear old corrdinates in Engine link
+ for ( int i = 1; i <= aLinkEngine->CoordsSize(); i++ )
+ aLinkEngine->RemoveCoord( i );
+ // now we are ready to set coords for a link and create a new CanvasLink presentation that will use them.
+ }
myLinkBuilder->setCoords(aLinkEngine.in());
canvas()->update();
myIsLinkCreating = false;
+
+ // asv : 13.12.04 : introducing a check for ports' types compatibility (Bugs and Improvements p.1.16, PAL7380)
+ if ( !aLinkEngine->IsValid() ) {
+ const int id = QAD_MessageBox::warn2( this, tr( "TLT_INVALID_LINK" ), tr( "MSG_INVALID_LINK" ),
+ tr( "Keep" ), tr( "Remove" ), 0, 1, 0 );
+ if ( id == 1 ) { // "Remove" was selected in Message Box
+ aLink->remove(); // the new link did not live long...
+ }
+ }
}
}
setWorldMatrix(m);
canvas()->update();
}
+
+void SUPERVGUI_CanvasView::fitWithinRect()
+{
+ //mkr: "Fit within rectangle" functionality
+ myIsFitWRActivated = true;
+ viewport()->setMouseTracking(false);
+ myCursor = cursor();
+ setCursor(handCursor);
+}
void zoomOut();
void zoomReset();
void fitAll();
+ void fitWithinRect();
void changeBackground();
protected:
SUPERVGUI_Main* myMain;
QPopupMenu* myPopup;
int myAddStudyItem;
+ int myPasteNodeItem;
QPopupMenu* mySketchPopup;
int myDelPntItem;
int myOrtoItem;
bool myIsPanBtnClicked;
bool myIsPanActivated;
+ bool myIsFitWRActivated;
bool myIsZoomActivated;
bool myIsLinkCreating;
- QCanvasItem* myCurrentItem;
- QPoint myPoint;
- QCursor myCursor;
+ QCanvasItem* myCurrentItem;
+ QPoint myPoint;
+ QCanvasRectangle* mySelectedRect;
+ QCursor myCursor;
QTimer* myTimer;
QPoint myGlobalPoint;
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SUPERVGUI_Clipboard.cxx
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+
+#include "SUPERVGUI_Clipboard.h"
+#include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI.h"
+
+
+SUPERVGUI_Clipboard* SUPERVGUI_Clipboard::myCB = 0;
+
+
+/**
+ * Compute the next valid name for a Python function (add "_N" if a function with given name already exists)
+ */
+QString getNewName( QStringList& allNames, const QString& oldName ) {
+ QString newName;
+ int id = 1; //increment index
+ newName = oldName + QString("_") + QString::number( id );
+ while ( allNames.contains( newName ) )
+ newName = oldName + QString("_") + QString::number( ++id );
+
+ return newName;
+}
+
+/**
+ * Replaces origName string with newName string in all lines of theFunc
+ * origName must be preceeded by space and end by space or '('.
+ * asv : 14.01.05 : fix of a bug (exception on node creation):
+ * if origName and theFunc is null, return non-null empty strings!
+ */
+void replaceName( SUPERV::ListOfStrings_var& theFunc, const QString& origName, const QString& newName ) {
+ for ( int i = 0, n = theFunc->length(); i < n; i++ ) {
+ QString aLine( theFunc[i] );
+ int index = aLine.find( origName, 0 ); // find FIRST occurance of origName in aLine
+ while ( index >= 0 ) {
+ bool preceedingCharOk = ( index==0 || ( index > 0 && aLine[index-1].isSpace() ) );
+ const int ll = aLine.length();
+ const int ol = origName.length();
+ const int ni = index + ol;
+ bool nextCharOk = ( ll==ni || ( ll>ni && ( aLine[ni].isSpace() || aLine[ni]=='(' ) ) );
+ if ( preceedingCharOk && nextCharOk ) {
+ aLine = aLine.replace( index, origName.length(), newName );
+ theFunc[i] = aLine.latin1();
+ }
+ index = aLine.find( origName, index+newName.length() ); // find NEXT occurance of origName in aLine
+ }
+ }
+}
+
+/**
+ * "Copies" all ports from fromNode to toNode: creates the sames ports in toNode in fact
+ */
+void copyPorts( const SUPERV::CNode_var& fromNode, const SUPERV::INode_var& toNode ) {
+ if ( CORBA::is_nil( fromNode ) || CORBA::is_nil( toNode ) )
+ return;
+ SUPERV::ListOfPorts_var aPList = fromNode->Ports();
+ QString aName, aType;
+ for (int i = 0; i < aPList->length(); i++) {
+ aName = aPList[i].in()->Name();
+ aType = aPList[i].in()->Type();
+ if ( aPList[i].in()->IsInput() )
+ toNode->InPort( aName.latin1(), aType.latin1() );
+ else
+ toNode->OutPort( aName.latin1(), aType.latin1() );
+ }
+}
+
+/**
+ * Constructor
+ */
+SUPERVGUI_Clipboard::SUPERVGUI_Clipboard( QObject* parent )
+: QObject( parent ) {
+}
+
+/**
+ * Destructor
+ */
+SUPERVGUI_Clipboard::~SUPERVGUI_Clipboard() {
+}
+
+/**
+ * Returns all inline functions defined in inline (switch, loop, goto) nodes of given dataflow
+ */
+QStringList getAllFunctions( SUPERV::Graph_var dataflow ) {
+ QStringList aFuncNames;
+ if ( !CORBA::is_nil( dataflow ) ) {
+ SUPERV::ListOfNodes_var nodes = dataflow->Nodes();
+ //InLine nodes
+ for(int i = 0; i < nodes->INodes.length(); i++)
+ aFuncNames.append(nodes->INodes[i]->PyFuncName());
+ //Loop nodes
+ for(int i = 0; i < nodes->LNodes.length(); i++) {
+ aFuncNames.append(nodes->LNodes[i]->PyInitName());
+ aFuncNames.append(nodes->LNodes[i]->PyMoreName());
+ aFuncNames.append(nodes->LNodes[i]->PyNextName());
+ }
+ //Switch nodes
+ for(int i = 0; i < nodes->SNodes.length(); i++)
+ aFuncNames.append(nodes->SNodes[i]->PyFuncName());
+ //GOTO nodes
+ for(int i = 0; i < nodes->GNodes.length(); i++)
+ aFuncNames.append(nodes->GNodes[i]->PyFuncName());
+ }
+ return aFuncNames;
+}
+
+/**
+ * Called on Paste Node command. Inserts a new node to the dataflow equal to the copied node.
+ * For InLine nodes the Python function name is changed ("_N" added).
+ */
+void SUPERVGUI_Clipboard::pasteNode() {
+ Trace("SUPERVGUI_Main::pasteNode");
+ SUPERV::CNode_var aNode = getCopyNode();
+ if ( !CORBA::is_nil( aNode ) ) {
+
+ SUPERV::Graph_var dataflow = Supervision.getMain()->getDataflow();
+
+ switch ( aNode->Kind() ) {
+
+ case SUPERV::FactoryNode :
+ {
+ SUPERV::FNode_var aFNode = dataflow->FNode( SUPERV::FNode::_narrow(aNode)->GetComponentName(),
+ SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
+ *SUPERV::FNode::_narrow(aNode)->Service() );
+ if (CORBA::is_nil(aFNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+
+ SUPERV::INode_var aDummyEndNode;
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aFNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::ComputingNode :
+ {
+ SUPERV::CNode_var aCNode = dataflow->CNode(*SUPERV::CNode::_narrow(aNode)->Service());
+ if (CORBA::is_nil(aCNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+
+ SUPERV::INode_var aDummyEndNode;
+ Supervision.getBrowser()->addNode(aCNode, aDummyEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::InLineNode :
+ {
+ QString aFName; // new node's Py_function name
+ SUPERV::ListOfStrings_var aFunc; // new node's Py_function body
+
+ // Automatic change of Py_function name ( + "_1", etc.)
+ // 1. collect all python functions names of allready exist InLine nodes
+ QStringList aFuncNames = getAllFunctions( dataflow );
+ // 2. "fix" Main function_name and Main function_strings
+ QString aOriginalName = SUPERV::INode::_narrow(aNode)->PyFuncName();
+ if ( !aOriginalName.isEmpty() ) {
+ aFName = getNewName( aFuncNames, aOriginalName );
+ aFunc = SUPERV::INode::_narrow(aNode)->PyFunction();
+ replaceName( aFunc, aOriginalName, aFName );
+ }
+ else { // empty function name and body
+ aFName = QString( "" );
+ aFunc = new SUPERV::ListOfStrings();
+ }
+
+ // create the Engine's node
+ SUPERV::INode_var aINode = dataflow->INode( aFName, aFunc );
+
+ if (CORBA::is_nil(aINode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ copyPorts( aNode, aINode );
+
+ SUPERV::INode_var aDummyEndNode;
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aINode), aDummyEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::LoopNode :
+ {
+ QString aInitFName, aMoreFName, aNextFName; // new node's Py_functions names
+ SUPERV::ListOfStrings_var aInitFunc, aMoreFunc, aNextFunc; // new node's Py_functions bodies
+
+ // Automatic change of Py_function name ( + "_1", etc.)
+ // 1. collect all python functions names of allready exist InLine nodes
+ QStringList aFuncNames = getAllFunctions( dataflow );
+ // 2.1 "fix" Init function_name and Init function_strings
+ QString aOriginalName = SUPERV::LNode::_narrow(aNode)->PyInitName();
+ if (!aOriginalName.isEmpty()) {
+ aInitFName = getNewName( aFuncNames, aOriginalName );
+ aInitFunc = SUPERV::LNode::_narrow(aNode)->PyInit();
+ replaceName( aInitFunc, aOriginalName, aInitFName );
+ }
+ else { // empty function name and body
+ aInitFName = QString( "" );
+ aInitFunc = new SUPERV::ListOfStrings();
+ }
+ // 2.2 "fix" More function_name and More function_strings
+ aOriginalName = SUPERV::LNode::_narrow(aNode)->PyMoreName();
+ if (!aOriginalName.isEmpty()) {
+ aMoreFName = getNewName( aFuncNames, aOriginalName );
+ aMoreFunc = SUPERV::LNode::_narrow(aNode)->PyMore();
+ replaceName( aMoreFunc, aOriginalName, aMoreFName );
+ }
+ else { // empty function name and body
+ aMoreFName = QString( "" );
+ aMoreFunc = new SUPERV::ListOfStrings();
+ }
+ // 2.3 "fix" Next function_name and Next function_strings
+ aOriginalName = SUPERV::LNode::_narrow(aNode)->PyNextName();
+ if (!aOriginalName.isEmpty()) {
+ aNextFName = getNewName( aFuncNames, aOriginalName );
+ aNextFunc = SUPERV::LNode::_narrow(aNode)->PyNext();
+ replaceName( aNextFunc, aOriginalName, aNextFName );
+ }
+ else { // empty function name and body
+ aNextFName = QString( "" );
+ aNextFunc = new SUPERV::ListOfStrings();
+ }
+
+ // create the Engine's node
+ SUPERV::INode_var aEndNode;
+ SUPERV::LNode_var aStartNode = dataflow->LNode(aInitFName, aInitFunc, aMoreFName, aMoreFunc, aNextFName, aNextFunc, aEndNode);
+ if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ copyPorts( aNode, SUPERV::INode::_narrow( aStartNode ) );
+
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::SwitchNode :
+ {
+ QString aFName; // new node's Py_function name
+ SUPERV::ListOfStrings_var aFunc; // new node's Py_function body
+
+ // Automatic change of Py_function name ( + "_1", etc.)
+ // 1. collect all python functions names of allready exist InLine nodes
+ QStringList aFuncNames = getAllFunctions( dataflow );
+ // 2. "fix" Main function_name and Main function_strings
+ QString aOriginalName = SUPERV::INode::_narrow(aNode)->PyFuncName();
+ if ( !aOriginalName.isEmpty() ) {
+ aFName = getNewName( aFuncNames, aOriginalName );
+ aFunc = SUPERV::INode::_narrow(aNode)->PyFunction();
+ replaceName( aFunc, aOriginalName, aFName );
+ }
+ else { // empty function name and body
+ aFName = QString( "" );
+ aFunc = new SUPERV::ListOfStrings();
+ }
+
+ // create the Engine's node
+ SUPERV::INode_var aEndNode;
+ SUPERV::SNode_var aStartNode = dataflow->SNode(aFName, aFunc, aEndNode);
+ if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ copyPorts( aNode, SUPERV::INode::_narrow( aStartNode ) );
+ SUPERV::INode_var aNodeEnd = SUPERV::SNode::_narrow(aNode)->Coupled();
+ copyPorts( SUPERV::CNode::_narrow( aNodeEnd ), aEndNode );
+
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::GOTONode :
+ {
+ QString aFName; // new node's Py_function name
+ SUPERV::ListOfStrings_var aFunc; // new node's Py_function body
+
+ // Automatic change of Py_function name ( + "_1", etc.)
+ // 1. collect all python functions names of allready exist InLine nodes
+ QStringList aFuncNames = getAllFunctions( dataflow );
+ // 2. "fix" Main function_name and Main function_strings
+ QString aOriginalName = SUPERV::INode::_narrow(aNode)->PyFuncName();
+ if ( !aOriginalName.isEmpty() ) {
+ aFName = getNewName( aFuncNames, aOriginalName );
+ aFunc = SUPERV::INode::_narrow(aNode)->PyFunction();
+ replaceName( aFunc, aOriginalName, aFName );
+ }
+ else { // empty function name and body
+ aFName = QString( "" );
+ aFunc = new SUPERV::ListOfStrings();
+ }
+
+ // create the Engine's node
+ SUPERV::GNode_var aGNode = dataflow->GNode(aFName, aFunc, "");
+ if (CORBA::is_nil(aGNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+ copyPorts( aNode, SUPERV::INode::_narrow( aGNode ) );
+
+ SUPERV::INode_var aDummyEndNode;
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aGNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+ }
+ break;
+
+ case SUPERV::MacroNode :
+ {
+ /* to implement in the future */
+ /*
+ //get SubGraph from MacroNode
+ SUPERV::Graph_var aMacro = SUPERV::Graph::_narrow(aNode);
+ SUPERV::Graph_var aGraph;
+ if (aMacro->IsStreamMacro())
+ aGraph = aMacro->StreamObjRef();
+ else
+ aGraph = aMacro->FlowObjRef();
+ SUPERV::Graph_var aMacroNode = dataflow->GraphMNode(aGraph);
+
+ if (CORBA::is_nil(aMacroNode)) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+ return;
+ }
+
+ SUPERV::INode_var aDummyEndNode;
+ Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aMacroNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+ */
+ }
+ break;
+ }
+ }
+}
+
+
+/**
+ * Called from CanvasNode on "Paste port" command of popup menu
+ */
+void SUPERVGUI_Clipboard::pastePort( SUPERVGUI_CanvasNode* node )
+{
+ SUPERV::Port_var aPort = getCopyPort();
+ if ( !CORBA::is_nil(aPort) ) {
+ SUPERV::INode_var aNode = node->getInlineNode();
+ if (!CORBA::is_nil(aNode)) {
+ QString aName = aPort->Name();
+ QString aType = aPort->Type();
+ SUPERV::Port_var aPastePort;
+ if (aPort->IsInput()) {
+ //check if port with such name is alredy exists
+ QStringList aNames = node->getPortsNamesIN(aNode, true);
+ if (aNames.contains(aName))
+ QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+ else
+ aPastePort = aNode->InPort(aName.latin1(), aType.latin1());
+ }
+ else {
+ //check if port with such name is already exists
+ QStringList aNames = node->getPortsNamesIN(aNode, false);
+ if (aNames.contains(aName))
+ QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+ else
+ aPastePort = aNode->OutPort(aName.latin1(), aType.latin1());
+ }
+ if ( !CORBA::is_nil(aPastePort) )
+ node->createPort( aPastePort.in() );
+ }
+ }
+}
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SUPERVGUI_Clipboard.h
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+#ifndef SUPERVGUI_Clipboard_H
+#define SUPERVGUI_Clipboard_H
+
+#include <qobject.h>
+
+#include "utilities.h"
+#include "SALOME_LifeCycleCORBA.hxx"
+#include "QAD_Application.h"
+#include "QAD_Desktop.h"
+#include CORBA_CLIENT_HEADER(SUPERV)
+
+class SUPERVGUI_CanvasNode;
+
+class SUPERVGUI_Clipboard : public QObject {
+
+Q_OBJECT
+
+protected:
+ // constructor made protected. Access via getClipboard() member function.
+ SUPERVGUI_Clipboard( QObject* parent );
+ virtual ~SUPERVGUI_Clipboard();
+
+public:
+
+ static SUPERVGUI_Clipboard* getClipboard() {
+ if ( !myCB )
+ myCB = new SUPERVGUI_Clipboard( QAD_Application::getDesktop() );
+ return myCB;
+ }
+
+ bool isCopyPort() const { return ( myCopyPort && !CORBA::is_nil( myCopyPort ) ); }
+ SUPERV::Port_var getCopyPort() const { return myCopyPort; }
+ void setCopyPort( SUPERV::Port_var theObj ) { myCopyPort = theObj; }
+
+ bool isCopyNode() const { return ( myCopyNode && !CORBA::is_nil( myCopyNode ) ); }
+ SUPERV::CNode_var getCopyNode() const { return myCopyNode; }
+ void setCopyNode( SUPERV::CNode_var theObj ) { myCopyNode = theObj; }
+
+public slots:
+ void pasteNode();
+ void pastePort( SUPERVGUI_CanvasNode* node );
+
+private:
+ static SUPERVGUI_Clipboard* myCB;
+
+ SUPERV::Port_var myCopyPort;
+ SUPERV::CNode_var myCopyNode;
+ int myXCopyNode;
+ int myYCopyNode;
+};
+
+#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_ComputeNode.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_ComputeNode.h"
-#include "SUPERVGUI_Main.h"
-#include <qapplication.h>
-#include <qtooltip.h>
-
-
-SUPERVGUI_ComputeNode::SUPERVGUI_ComputeNode(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
-:SUPERVGUI_GraphNode(theParent, theMain, theNode)
-{
- setLineWidth(2);
- setFrameStyle(QFrame::Panel | QFrame::Raised);
-
- QGridLayout* aGridLayout = new QGridLayout(this, 0, 2, 3, 1);
-
- myTitle->setPaletteBackgroundColor(QColor(63, 213, 255));
- myTitle->reparent(this, pos());
- aGridLayout->addMultiCellWidget(myTitle, 0, 0, 0, 1);
-
- QString aComment(theNode->Comment());
-
- QString aCommentVis = aComment;
- if (getNodeType() == SUPERV::FactoryNode)
- aCommentVis = QString(myNode->Service()->ServiceName) + QString(tr("COMMENT_FROM"))
- + QString(getFactoryNode()->GetComponentName());
- else
- //aCommentVis = tr("COMMENT_PYTHON");
- aCommentVis = tr("COMMENT_CNODE");
-
- if (aComment.isNull() || aComment.isEmpty()) {
- theNode->SetComment(aCommentVis.latin1());
- }
-
- myServiceBox = new QVBox(this, "service");
- myComment = new SUPERVGUI_Label(myServiceBox, LABEL_WIDTH, LABEL_HEIGHT, aCommentVis, QLabel::AlignLeft);
- connect(myComment, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
- QToolTip::add(myTitle, myTitle->text());
- QToolTip::add(myComment, myComment->text());
- aGridLayout->addMultiCellWidget(myServiceBox, 1, 1, 0, 1);
-
- myStatus->reparent(this, pos());
- myTime->reparent(this, pos());
- aGridLayout->addWidget(myStatus, 2, 0);
- aGridLayout->addWidget(myTime, 2, 1);
-
- myPortsBox->reparent(this, pos());
-
- aGridLayout->addMultiCellWidget(myPortsBox, 3, 3, 0, 1);
- adjustSize();
-
- myShowPopup = new QPopupMenu(this);
- myServiceItem = myShowPopup->insertItem(tr("POP_SHOWTITLES"), this, SLOT(switchService()));
- myPortsItem = myShowPopup->insertItem(tr("POP_SHOWPORTS"), this, SLOT(switchPorts()));
-
- myPopup->insertSeparator();
- myPopup->insertItem(tr("POP_SHOW"), myShowPopup);
- myShowPopup->setItemChecked(myServiceItem, true);
- myShowPopup->setItemChecked(myPortsItem, true);
-
- show();
-}
-
-
-SUPERVGUI_ComputeNode::~SUPERVGUI_ComputeNode() {
- QToolTip::remove(myTitle);
- QToolTip::remove(myComment);
-}
-
-
-void SUPERVGUI_ComputeNode::sync()
-{
- Trace("SUPERVGUI_Node::sync");
- setName(myNode->Name());
- myTitle->setText(name());
-
- //myComment->setText(myNode->Comment());
-
- bool editing = myMain->getDataflow()->IsEditing();
- myPopup->setItemEnabled(myKillItem, !editing);
- if (myMain->isEditable()) {
- myPopup->setItemEnabled(myRenameItem, editing);
- myPopup->setItemEnabled(myDeleteItem, editing);
- }
- SUPERVGUI_GraphNode::sync();
-}
-
-
-
-/**
- * Hides services info and ports
- */
-void SUPERVGUI_ComputeNode::hideAll() {
- myServiceBox->hide();
- myShowPopup->setItemChecked(myServiceItem, false);
- myPortsBox->hide();
- myShowPopup->setItemChecked(myPortsItem, false);
-
- updateShape();
-}
-
-
-/**
- * Shows services info and ports
- */
-void SUPERVGUI_ComputeNode::showAll() {
- myServiceBox->show();
- myShowPopup->setItemChecked(myServiceItem, true);
- myPortsBox->show();
- myShowPopup->setItemChecked(myPortsItem, true);
-
- updateShape();
-}
-
-
-/**
- * Switches visibility of Service names in the node
- */
-void SUPERVGUI_ComputeNode::switchService() {
- bool aIsVisible = myServiceBox->isVisible();
- if (aIsVisible) myServiceBox->hide();
- else myServiceBox->show();
- updateShape();
- myShowPopup->setItemChecked(myServiceItem, !aIsVisible);
-}
-
-
-/**
- * Switches visibility of Ports in the node
- */
-void SUPERVGUI_ComputeNode::switchPorts() {
- bool aIsVisible = myPortsBox->isVisible();
- if (aIsVisible) myPortsBox->hide();
- else myPortsBox->show();
- updateShape();
- myShowPopup->setItemChecked(myPortsItem, !aIsVisible);
-}
-
-void SUPERVGUI_ComputeNode::rename() {
- SUPERVGUI_Node::rename();
- // QToolTip::remove(myTitle);
- QToolTip::add(myTitle, myTitle->text());
-}
-
-void SUPERVGUI_ComputeNode::updateShape() {
- qApp->processEvents();
- adjustSize();
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_ComputeNode.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_ComputeNode_H
-#define SUPERVGUI_ComputeNode_H
-
-#include "SUPERVGUI_GraphNode.h"
-
-
-class SUPERVGUI_ComputeNode: public SUPERVGUI_GraphNode {
- Q_OBJECT
-
- public:
- SUPERVGUI_ComputeNode(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
- virtual ~SUPERVGUI_ComputeNode();
-
- void sync();
- void hideAll();
- void showAll();
- SUPERVGUI_Label* getCommLabel() { return myComment; }
- SUPERVGUI_Label* getTitleLabel() { return myTitle; }
- virtual void updateShape();
-
- public slots:
- void switchService();
- void switchPorts();
- virtual void rename();
-
-
- private:
- QPopupMenu* myShowPopup;
- int myServiceItem;
- int myPortsItem;
-
- //int myPIcount;
- //int myPOcount;
-
- SUPERVGUI_Label* myComment;
- QVBox* myServiceBox;
- //QFrame* myPortsBox;
- //QGridLayout* myPortLayout;
-};
-
-#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_ControlNode.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_ControlNode.h"
-#include <qapplication.h>
-#include "SUPERVGUI_Main.h"
-#include <qgroupbox.h>
-
-#define TITLECOLOR Qt::red.light()
-#define BACKCOLOR Qt::cyan.light()
-
-//-----------------------------------------------------------
-//******************* Start Node ****************************
-//-----------------------------------------------------------
-SUPERVGUI_StartControlNode::SUPERVGUI_StartControlNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode):
- SUPERVGUI_GraphNode(theParent, theMain, theNode)
-{
- setPaletteBackgroundColor(BACKCOLOR);
- QGridLayout* aGridLayout = new QGridLayout(this, 0, 3, 0, 0);
- aGridLayout->setColStretch(0, 1);
- aGridLayout->setColStretch(1, 1);
- aGridLayout->addColSpacing(2, LABEL_HEIGHT/2);
-
- myTitle->setAlignment(Qt::AlignHCenter);
- myTitle->reparent(this, pos());
- myTitle->setPaletteBackgroundColor(TITLECOLOR);
-
- aGridLayout->addMultiCellWidget(myTitle, 0, 0, 0, 2);
-
- myPortsBox->reparent(this, pos());
- aGridLayout->addMultiCellWidget(myPortsBox, 1, 1, 0, 1);
- // myGatesBox->setPaletteBackgroundColor(backgroundColor().dark(105));
-
- myStatus->reparent(this, pos());
- myTime->reparent(this, pos());
- aGridLayout->addWidget(myStatus, 2, 0);
- aGridLayout->addMultiCellWidget(myTime, 2, 2, 1, 2);
-
- myPopup->insertSeparator();
- myPortsItem = myPopup->insertItem(tr("POP_HIDEPORTS"), this, SLOT(switchPorts()));
-
- adjustSize();
- setShape();
- show();
-}
-
-
-void SUPERVGUI_StartControlNode::switchPorts() {
- bool aIsVisible = myPortsBox->isVisible();
- if (aIsVisible) myPortsBox->hide();
- else myPortsBox->show();
- updateShape();
- myPopup->setItemChecked(myPortsItem, aIsVisible);
-}
-
-
-void SUPERVGUI_StartControlNode::hideAll() {
- myPortsBox->hide();
- updateShape();
- myPopup->setItemChecked(myPortsItem, true);
-}
-
-
-void SUPERVGUI_StartControlNode::showAll() {
- myPortsBox->show();
- updateShape();
- myPopup->setItemChecked(myPortsItem, false);
-}
-
-
-void SUPERVGUI_StartControlNode::rename() {
- SUPERVGUI_Node::rename();
- QString aStr(tr("ENDNODE_PREFIX"));
- aStr+=name();
- myEndNode->setNodeName(aStr);
-}
-
-
-void SUPERVGUI_StartControlNode::remove() {
- myEndNode->deleteLinks();
- deleteLinks();
- myNode->destroy();
- myMain->getGraph()->deleteNode(myEndNode);
- myMain->getGraph()->deleteNode(this);
-}
-
-
-void SUPERVGUI_StartControlNode::setEndNode(SUPERVGUI_EndControlNode* theEndNode) {
- myEndNode = theEndNode;
-}
-
-SUPERVGUI_EndControlNode* SUPERVGUI_StartControlNode::getEndNode() {
- return myEndNode;
-}
-
-
-void SUPERVGUI_StartControlNode::setShape() {
- int aH = height();
- int aW = width();
- int aOffset = LABEL_HEIGHT/2;
- QPointArray aArray(8);
- aArray.setPoint(0, aOffset, aH);
- aArray.setPoint(1, 0, aH-LABEL_HEIGHT);
- aArray.setPoint(2, 0, LABEL_HEIGHT);
- aArray.setPoint(3, aOffset, 0);
- aArray.setPoint(4, aW, 0);
- aArray.setPoint(5, aW-aOffset, LABEL_HEIGHT);
- aArray.setPoint(6, aW-aOffset, aH-LABEL_HEIGHT);
- aArray.setPoint(7, aW, aH);
- QRegion aRegion(aArray);
-
- setMask(aRegion);
-}
-
-
-void SUPERVGUI_StartControlNode::updateShape() {
- qApp->processEvents();
- adjustSize();
- setShape();
-}
-
-
-void SUPERVGUI_StartControlNode::addOutputPort() {
- SUPERVGUI_GraphNode::addOutputPort();
- myEndNode->updatePorts();
- myEndNode->updateShape();
- updateLinksPrs(true);
- myEndNode->updateLinksPrs(true);
-}
-
-void SUPERVGUI_StartControlNode::addInputPort() {
- SUPERVGUI_GraphNode::addInputPort();
- myEndNode->updatePorts();
- myEndNode->updateShape();
- updateLinksPrs(true);
- myEndNode->updateLinksPrs(true);
-}
-
-void SUPERVGUI_StartControlNode::deletePort(SUPERVGUI_Port* thePort) {
- if (getNodeType() == SUPERV::LoopNode) {
-
- SUPERV_Port aPortEngine = thePort->getPort();
- QString aName(aPortEngine->Name());
- QString aNameIn = aName + "Input";
- QString aNameOut = aName + "Output";
-
- SUPERVGUI_Port* aPort = (SUPERVGUI_Port*) child(aNameOut, "SUPERVGUI_Port");
- aPort->deleteLinks();
- aPort->close(true);
-
- aPort = (SUPERVGUI_Port*) child(aNameIn, "SUPERVGUI_Port");
- aPort->deleteLinks();
- aPort->close(true);
-
- aPort = (SUPERVGUI_Port*) myEndNode->child(aNameIn, "SUPERVGUI_Port");
- aPort->deleteLinks();
- aPort->close(true);
-
- aPort = (SUPERVGUI_Port*) myEndNode->child(aNameOut, "SUPERVGUI_Port");
- aPort->deleteLinks();
- aPort->close(true);
-
- myPIcount--;
- myPOcount--;
-
- myEndNode->getPIcount()--;
- myEndNode->getPOcount()--;
-
- aPortEngine->destroy();
-
- updatePorts();
- updateShape();
- myEndNode->updatePorts();
- myEndNode->updateShape();
- } else {
- SUPERVGUI_GraphNode::deletePort(thePort);
- }
-}
-
-
-QPoint SUPERVGUI_StartControlNode::getOutConnectPnt() {
- return QPoint(pos().x() + width() - LABEL_HEIGHT/2,
- pos().y() + (height()/2));
-}
-
-
-//-----------------------------------------------------------
-//******************* End Node ******************************
-//-----------------------------------------------------------
-
-SUPERVGUI_EndControlNode::SUPERVGUI_EndControlNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode, SUPERVGUI_StartControlNode* theStart):
- SUPERVGUI_GraphNode(theParent, theMain, theNode)
-{
- myStartNode = theStart;
-
- setPaletteBackgroundColor(BACKCOLOR);
-
- QGridLayout* aGridLayout = new QGridLayout(this, 0, 3, 0, 0);
- aGridLayout->setColStretch(1, 1);
- aGridLayout->setColStretch(2, 1);
- aGridLayout->addColSpacing(0, LABEL_HEIGHT/2);
-
- myTitle->setAlignment(Qt::AlignHCenter);
- myTitle->reparent(this, pos());
- myTitle->setPaletteBackgroundColor(TITLECOLOR);
- aGridLayout->addMultiCellWidget(myTitle, 0, 0, 0, 2);
-
- myPortsBox->reparent(this, pos());
-
- aGridLayout->addMultiCellWidget(myPortsBox, 1, 1, 1, 2);
-
- myStatus->reparent(this, pos());
- myTime->reparent(this, pos());
- aGridLayout->addMultiCellWidget(myStatus, 2, 2, 0, 1);
- aGridLayout->addWidget(myTime, 2, 2);
-
- adjustSize();
- setShape();
-
- myPopup->removeItem(myRenameItem);
- myPopup->removeItem(myDeleteItem);
- myPopup->removeItem(mySeparatorId);
-
- myPopup->insertSeparator();
- myPortsItem = myPopup->insertItem(tr("POP_HIDEPORTS"), this, SLOT(switchPorts()));
- myStartNode->setEndNode(this);
- show();
-}
-
-
-void SUPERVGUI_EndControlNode::switchPorts() {
- bool aIsVisible = myPortsBox->isVisible();
- if (aIsVisible) myPortsBox->hide();
- else myPortsBox->show();
- updateShape();
- myPopup->setItemChecked(myPortsItem, aIsVisible);
-}
-
-void SUPERVGUI_EndControlNode::hideAll() {
- myPortsBox->hide();
- updateShape();
- myPopup->setItemChecked(myPortsItem, true);
-}
-
-
-void SUPERVGUI_EndControlNode::showAll() {
- myPortsBox->show();
- updateShape();
- myPopup->setItemChecked(myPortsItem, false);
-}
-
-
-void SUPERVGUI_EndControlNode::setShape() {
- int aH = height();
- int aW = width();
- int aOffset = LABEL_HEIGHT/2;
- QPointArray aArray(8);
- aArray.setPoint(0, 0, aH);
- aArray.setPoint(1, aOffset, aH-LABEL_HEIGHT);
- aArray.setPoint(2, aOffset, LABEL_HEIGHT);
- aArray.setPoint(3, 0, 0);
- aArray.setPoint(4, aW-aOffset, 0);
- aArray.setPoint(5, aW, LABEL_HEIGHT);
- aArray.setPoint(6, aW, aH-LABEL_HEIGHT);
- aArray.setPoint(7, aW-aOffset, aH);
- QRegion aRegion(aArray);
-
- setMask(aRegion);
-}
-
-
-void SUPERVGUI_EndControlNode::updateShape() {
- qApp->processEvents();
- adjustSize();
- setShape();
-}
-
-
-QPoint SUPERVGUI_EndControlNode::getInConnectPnt() {
- return QPoint(pos().x() + LABEL_HEIGHT/2,
- pos().y() + (height()/2));
-}
-
-
-//-----------------------------------------------------------
-//******************* GoTo Node *****************************
-//-----------------------------------------------------------
-SUPERVGUI_GotoNode::SUPERVGUI_GotoNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode):
- SUPERVGUI_GraphNode(theParent, theMain, theNode)
-{
- setPaletteBackgroundColor(BACKCOLOR);
-
- QGridLayout* aGridLayout = new QGridLayout(this, 3, 2, 0, 0);
-
- myTitle->setAlignment(Qt::AlignHCenter);
- myTitle->reparent(this, pos());
- myTitle->setPaletteBackgroundColor(Qt::green.light());
- aGridLayout->addMultiCellWidget(myTitle, 0, 0, 0, 1);
-
- myPortsBox->reparent(this, pos());
- aGridLayout->addMultiCellWidget(myPortsBox, 1, 1, 0, 1);
-
- myStatus->reparent(this, pos());
- myTime->reparent(this, pos());
- aGridLayout->addWidget(myStatus, 2, 0);
- aGridLayout->addWidget(myTime, 2, 1);
-
- myPopup->insertSeparator();
- myPopup->insertItem("Link to Node...", this, SLOT(linkToNode()));
-
- adjustSize();
- setShape();
- show();
-
- //SUPERV_Ports aPorts = getEngine()->Ports(); //existing
- //int n = aPorts->length();
-}
-
-
-void SUPERVGUI_GotoNode::setShape() {
- int aH = height();
- int aW = width();
- QPointArray aArray(8);
- aArray.setPoint(0, LABEL_HEIGHT, aH);
- aArray.setPoint(1, 0, aH-LABEL_HEIGHT);
- aArray.setPoint(2, 0, LABEL_HEIGHT);
- aArray.setPoint(3, LABEL_HEIGHT, 0);
- aArray.setPoint(4, aW-LABEL_HEIGHT, 0);
- aArray.setPoint(5, aW, LABEL_HEIGHT);
- aArray.setPoint(6, aW, aH-LABEL_HEIGHT);
- aArray.setPoint(7, aW-LABEL_HEIGHT, aH);
- QRegion aRegion(aArray);
-
- setMask(aRegion);
-}
-
-
-void SUPERVGUI_GotoNode::hideAll() {
- myPortsBox->hide();
- updateShape();
- //myPopup->setItemChecked(myPortsItem, true);
-}
-
-
-void SUPERVGUI_GotoNode::showAll() {
- myPortsBox->show();
- updateShape();
- //myPopup->setItemChecked(myPortsItem, false);
-}
-
-void SUPERVGUI_GotoNode::updateShape() {
- qApp->processEvents();
- adjustSize();
- setShape();
-}
-
-
-void SUPERVGUI_GotoNode::linkToNode() {
- SUPERVGUI_SelectInlineDlg* aDlg = new SUPERVGUI_SelectInlineDlg(getMain());
- if (aDlg->exec()) {
- setLinkedNode((char*)aDlg->getName().latin1());
- myMain->getGraph()->sync();
- }
- delete aDlg;
-}
-
-
-void SUPERVGUI_GotoNode::setLinkedNode(char* theNodeName) {
- getGotoNode()->SetCoupled(theNodeName);
-}
-
-
-
-//-----------------------------------------------------------
-//*************** Select Inline node dialog******************
-//-----------------------------------------------------------
-
-SUPERVGUI_SelectInlineDlg::SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain)
- :QDialog(theMain, 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
-{
- setSizeGripEnabled( true );
- setCaption(tr("TIT_FUNC_PYTHON"));
- QGridLayout* aMainLayout = new QGridLayout(this, 2, 2, 7, 4);
-
- QLabel* aLabel = new QLabel("Connect to", this );
- aMainLayout->addWidget(aLabel, 0, 0);
-
- myCombo = new QComboBox(this);
- myCombo->clear(); //for the additional check from GUI side for bug PAL7007
- SUPERV_Nodes aNodesList = theMain->getDataflow()->Nodes();
- int i;
- for (i = 0; i < aNodesList->INodes.length(); i++) {
- myCombo->insertItem(QString(aNodesList->INodes[i]->Name()));
- }
- for (i = 0; i < aNodesList->LNodes.length(); i++) {
- myCombo->insertItem(QString(aNodesList->LNodes[i]->Name()));
- }
- for (i = 0; i < aNodesList->SNodes.length(); i++) {
- myCombo->insertItem(QString(aNodesList->SNodes[i]->Name()));
- }
- aMainLayout->addWidget(myCombo, 0, 1);
-
- QGroupBox* aBtnBox = new QGroupBox( this );
- aBtnBox->setColumnLayout( 0, Qt::Vertical );
- aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
- QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
- aBtnLayout->setAlignment( Qt::AlignTop );
- aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
-
- QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
- connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
- aBtnLayout->addWidget( aOKBtn );
-
- aBtnLayout->addStretch();
-
- QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
- connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- aBtnLayout->addWidget( aCancelBtn );
-
- aMainLayout->addMultiCellWidget(aBtnBox, 1, 1, 0, 1);
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_ControlNode.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_ControlNode_H
-#define SUPERVGUI_ControlNode_H
-
-#include "SUPERVGUI_GraphNode.h"
-#include <qlayout.h>
-#include <qdialog.h>
-#include <qcombobox.h>
-
-
-class SUPERVGUI_EndControlNode;
-
-
-/**
- * Start node of Switch and Loop
- */
-class SUPERVGUI_StartControlNode: public SUPERVGUI_GraphNode {
- Q_OBJECT
-
- public:
- SUPERVGUI_StartControlNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode);
- virtual ~SUPERVGUI_StartControlNode() {};
-
- virtual void hideAll();
- virtual void showAll();
- virtual void updateShape();
- virtual void deletePort(SUPERVGUI_Port* thePort);
-
- void setEndNode(SUPERVGUI_EndControlNode* theEndNode);
- SUPERVGUI_EndControlNode* getEndNode();
-
- virtual QPoint getOutConnectPnt();
-
- public slots:
- void switchPorts();
- virtual void rename();
- virtual void remove();
- virtual void addInputPort();
- virtual void addOutputPort();
-
- private:
- void setShape();
-
- SUPERVGUI_EndControlNode* myEndNode;
- int myPortsItem;
-};
-
-
-
-
-/**
- * End node of Switch and Loop
- */
-class SUPERVGUI_EndControlNode: public SUPERVGUI_GraphNode {
- Q_OBJECT
-
- public:
- SUPERVGUI_EndControlNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode, SUPERVGUI_StartControlNode* theStart);
- virtual ~SUPERVGUI_EndControlNode() {};
-
- virtual void hideAll();
- virtual void showAll();
- virtual void updateShape();
-
- virtual QPoint getInConnectPnt();
-
- public slots:
- void switchPorts();
-
- private:
- void setShape();
-
- SUPERVGUI_StartControlNode* myStartNode;
- int myPortsItem;
-};
-
-
-class SUPERVGUI_SelectInlineDlg: public QDialog {
- Q_OBJECT
-
- public:
- SUPERVGUI_SelectInlineDlg(SUPERVGUI_Main* theMain);
- virtual ~SUPERVGUI_SelectInlineDlg() {};
-
- QString getName() { return myCombo->currentText(); }
-
- private:
- QComboBox* myCombo;
-};
-
-
-/**
- * GOTO node
- */
-class SUPERVGUI_GotoNode: public SUPERVGUI_GraphNode {
- Q_OBJECT
-
- public:
- SUPERVGUI_GotoNode(QWidget* theParent, SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode);
- virtual ~SUPERVGUI_GotoNode() {};
-
- virtual void hideAll();
- virtual void showAll();
- virtual void updateShape();
-
- void setLinkedNode(char* theNodeName);
-
- public slots:
- void linkToNode();
-
- private:
- void setShape();
-
-
-};
-
-
-#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_CtrlLink.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_CtrlLink.h"
-#include "SUPERVGUI_Graph.h"
-#include "SUPERVGUI_GraphNode.h"
-
-#define LINE_WIDTH 2
-#define DRAW_CLR Qt::black
-
-SUPERVGUI_CtrlLink::SUPERVGUI_CtrlLink(SUPERVGUI_Graph* theGraph,
- SUPERVGUI_GraphNode* theFromNode,
- SUPERVGUI_GraphNode* theToNode)
-{
- myOutNode = theFromNode;
- myInNode = theToNode;
- myGraph = theGraph;
-}
-
-
-
-void SUPERVGUI_CtrlLink::paint(QPainter* thePainter, bool toErase) {
- if ((myGraph == NULL) || (myInNode == NULL) || (myOutNode == NULL))
- return;
- thePainter->save();
-
- QPen aDataPen;
- aDataPen.setWidth(LINE_WIDTH);
- if (toErase) {
- aDataPen.setColor(myGraph->viewport()->paletteBackgroundColor());
- } else {
- aDataPen.setColor(DRAW_CLR);
- }
- thePainter->setPen(aDataPen);
- thePainter->moveTo(myOutNode->getOutConnectPnt());
- thePainter->lineTo(myInNode->getInConnectPnt());
-
- thePainter->restore();
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_CtrlLink.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_CTRLLink_H
-#define SUPERVGUI_CTRLLink_H
-
-
-#include "SUPERVGUI_Def.h"
-
-class SUPERVGUI_Graph;
-class SUPERVGUI_GraphNode;
-
-class SUPERVGUI_CtrlLink {
-public:
- SUPERVGUI_CtrlLink() { myOutNode=NULL; myInNode=NULL; myGraph=NULL; }
-
- SUPERVGUI_CtrlLink(SUPERVGUI_Graph* theGraph,
- SUPERVGUI_GraphNode* theFromNode,
- SUPERVGUI_GraphNode* theToNode);
-
- ~SUPERVGUI_CtrlLink() {};
-
-
- void paint(QPainter* thePainter, bool toErase);
-
-private:
- SUPERVGUI_GraphNode* myOutNode;
- SUPERVGUI_GraphNode* myInNode;
- SUPERVGUI_Graph* myGraph;
-};
-
-#endif
#define CELL_SPACE 5
+#define MARGIN 2
+
// Noeuds
// ------
/*
#define SUPERV_isNull(oc) (CORBA::is_nil(oc))
-enum GraphViewType { GRAPH, CONTROLFLOW, TABLE, CANVAS };
+enum GraphViewType { CONTROLFLOW, CANVAS, CANVASTABLE };
//enum NodeType { COMPUTE, SWITCH, LOOP, GOTO, LABEL };
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Graph.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include "SUPERVGUI_Graph.h"
-#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_ComputeNode.h"
-#include "SUPERVGUI_ControlNode.h"
-#include "SUPERVGUI.h"
-
-#include <qapplication.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qlayout.h>
-
-//#define CHECKTIME
-
-#ifdef CHECKTIME
-#include <sys/timeb.h>
-#endif
-
-
-#define UPDATECONTROLNODES(NodesName) \
- n = nodes->NodesName.length(); \
- for (int i=0; i<n; i++) { \
- SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[i]); \
- SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[i]->Coupled()); \
- ihmNode = (SUPERVGUI_Node *)child(aCNode->Name(), "SUPERVGUI_Node"); \
- if (ihmNode == NULL) { \
- main->addControlNode(aCNode, aCNodeEnd, false); \
- } else { \
- ResizeGraph(ihmNode, aCNode->X(), aCNode->Y()); \
- moveChild(ihmNode, aCNode->X(), aCNode->Y()); \
- ihmList->removeRef(ihmNode); \
- ihmNode->sync(); \
- aEndNodePrs = (SUPERVGUI_EndControlNode*)child(aCNodeEnd->Name(), "SUPERVGUI_EndControlNode"); \
- ResizeGraph(aEndNodePrs, aCNodeEnd->X(), aCNodeEnd->Y()); \
- moveChild(aEndNodePrs, aCNodeEnd->X(), aCNodeEnd->Y()); \
- ihmList->removeRef(aEndNodePrs); \
- aEndNodePrs->sync(); \
- } \
- }
-
-
-#define UPDATENODES(NodesName, FuncName) \
- n = nodes->NodesName.length(); \
- for (int i=0; i<n; i++) { \
- SUPERV_CNode aCNode = SUPERV::CNode::_narrow(nodes->NodesName[i]); \
- ihmNode = (SUPERVGUI_Node *)child(aCNode->Name(), "SUPERVGUI_Node"); \
- if (ihmNode == NULL) { \
- main->FuncName(aCNode); \
- } else { \
- ResizeGraph(ihmNode, aCNode->X(), aCNode->Y()); \
- moveChild(ihmNode, aCNode->X(), aCNode->Y()); \
- ihmList->removeRef(ihmNode); \
- ihmNode->sync(); \
- } \
- }
-
-
-SUPERVGUI_Graph::SUPERVGUI_Graph(SUPERVGUI_Main* m):
- SUPERVGUI_View(m),
- myNewLink(0)
-{
- Trace("SUPERVGUI_Graph::SUPERVGUI_Graph");
- myIsControlView = false;
- myLinksList.setAutoDelete(true);
- viewport()->setMouseTracking(true);
-
- resizeContents(GRAPH_WIDTH, GRAPH_HEIGHT);
-
- if (SUPERV_isNull(main->getDataflow())) return;
-
-
- //create sketching popup menu
- mySketchPopup = new QPopupMenu(viewport());
- if (!mySketchPopup->isCheckable())
- mySketchPopup->setCheckable(true);
- myDelPntItem = mySketchPopup->insertItem(tr("MSG_DEL_LAST_PNT"), this, SLOT(delLastPnt()));
- mySketchPopup->insertItem(tr("MSG_DEL_LINK"), this, SLOT(delCreatingLink()));
- myOrtoItem = mySketchPopup->insertItem(tr("MSG_ORTHO_LINE"), this, SLOT(setOrtho()));
-
- //create link popup menu
- myLinkPopup = new QPopupMenu(viewport());
- myDelLinkItem = myLinkPopup->insertItem(tr("MSG_DELLINK"), this, SLOT(deleteLink()));
- myAddLinkPntItem = myLinkPopup->insertItem(tr("MSG_ADD_POINT"), this, SLOT(addPoint()));
- myDelLinkPntItem = myLinkPopup->insertItem(tr("MSG_DEL_POINT"), this, SLOT(deletePoint()));
-}
-
-
-
-SUPERVGUI_Graph::~SUPERVGUI_Graph() {
-}
-
-/**
- * Synchronizes Graph presentation with internal graph structure
- */
-void SUPERVGUI_Graph::sync() {
- if (SUPERV_isNull(main->getDataflow())) return;
-
- myLinksList.clear();
-
- SUPERVGUI_Node* ihmNode;
- QObjectList* ihmList = queryList("SUPERVGUI_Node");
- SUPERV_Nodes nodes = main->getDataflow()->Nodes();
-
- MESSAGE("CNodes="<<nodes->CNodes.length());
- MESSAGE("FNodes="<<nodes->FNodes.length());
- MESSAGE("INodes="<<nodes->INodes.length());
- MESSAGE("GNodes="<<nodes->GNodes.length());
- MESSAGE("LNodes="<<nodes->LNodes.length());
- MESSAGE("SNodes="<<nodes->SNodes.length());
-
- int n;
- UPDATENODES(CNodes, addComputeNode);
- UPDATENODES(FNodes, addComputeNode);
- UPDATENODES(INodes, addComputeNode);
- UPDATENODES(GNodes, addGOTONode);
-
- SUPERVGUI_EndControlNode* aEndNodePrs;
- UPDATECONTROLNODES(LNodes);
- UPDATECONTROLNODES(SNodes);
-
- QObjectListIt i(*ihmList);
- while ((ihmNode=(SUPERVGUI_Node*)i.current()) != 0) {
- ++i;
- ihmNode->close(true);
- }
- delete ihmList;
-
- ihmList = queryList("SUPERVGUI_GraphNode");
- i=(*ihmList);
- SUPERVGUI_GraphNode* aGraphNode;
- while ((aGraphNode=(SUPERVGUI_GraphNode*)i.current()) != 0) {
- ++i;
- aGraphNode->updateLinksPrs();
- }
- delete ihmList;
-
- draw();
-}
-
-
-/**
- * Reimplemented for repainting links
- */
-bool SUPERVGUI_Graph::eventFilter(QObject* object, QEvent* event) {
- if (event->type() == QEvent::Paint) {
- draw();
- return true;
- }
- return QScrollView::eventFilter(object, event);
-}
-
-
-/**
- * Clears content of Graph (links)
- */
-void SUPERVGUI_Graph::clearView() {
- QPainter aPainter(viewport());
- aPainter.eraseRect(viewport()->rect());
-}
-
-
-/**
- * Draws links using off screen buffer
- */
-void SUPERVGUI_Graph::draw() {
-#ifdef CHECKTIME
- struct timeb aTm1;
- ftime(&aTm1);
-#endif
- if (myLinksList.count() == 0) {
- return;
- }
- int aWidth = viewport()->width();
- int aHeight = viewport()->height();
- QPixmap aPixmap(aWidth, aHeight);
- aPixmap.setOptimization(QPixmap::BestOptim);
- aPixmap.fill(viewport()->paletteBackgroundColor());
-
- QPainter aPainter(&aPixmap);
- QPoint aPos = viewportToContents(viewport()->pos());
-
- if (myIsControlView) {
- SUPERVGUI_CtrlLink* aLink;
- QMap<QString, SUPERVGUI_CtrlLink>::Iterator it;
- for ( it = myCtrlLinks.begin(); it != myCtrlLinks.end(); ++it ) {
- it.data().paint(&aPainter, false);
- }
- } else {
- SUPERVGUI_Link* aLink;
- for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
- aLink->isInRect(aPos.x(), aPos.y(), aWidth, aHeight);
- if (aLink->isInRect(aPos.x(), aPos.y(), aWidth, aHeight)) {
- aLink->paint(&aPainter, false);
- }
- }
- }
- bitBlt(viewport(), 0, 0,
- &aPixmap, 0, 0, aWidth, aHeight,
- Qt::CopyROP, true);
-
- if (myNewLink) {
- myNewLink->repaintSketch();
- }
-#ifdef CHECKTIME
- struct timeb aTm2;
- ftime(&aTm2);
- ulong aTm = 1000*(aTm2.time-aTm1.time)+(aTm2.millitm-aTm1.millitm);
- //cout<<"### Time="<<aTm<<endl;
-#endif
-}
-
-
-void SUPERVGUI_Graph::contentsMousePressEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Graph::contentsMousePressEvent");
- if ( e->button() == Qt::RightButton) {
- if (myNewLink) {
- main->showPopup(mySketchPopup, e);
- } else {
- SUPERVGUI_Link* aLink = SUPERVGUI_Link::getSelectedLink();
- if (aLink && main->isEditable()) {
- myLinkPopup->setItemEnabled(myAddLinkPntItem,
- !aLink->haveSelectedPoint());
- myLinkPopup->setItemEnabled(myDelLinkPntItem,
- aLink->haveSelectedPoint());
-
-
- if (!aLink->isESInputPort()) {
- SUPERV::KindOfPort aOutType = aLink->getOutputPort()->getPort()->Kind();
- SUPERV::KindOfPort aInType = aLink->getInputPort()->getPort()->Kind();
- myLinkPopup->setItemEnabled(myDelLinkItem,
- ((aOutType != SUPERV::LoopParameter)
- &&
- (aInType != SUPERV::LoopParameter)));
- }
-
- myMousePos = e->pos();
- mySelectedLink = aLink;
- mySelectedPoint = mySelectedLink->getSelectedPoint();
- main->showPopup(myLinkPopup, e);
- } else {
- mySelectedLink = 0;
- addDSPopupItem();
- main->showPopup(myPopup, e);
- }
- }
- }
- emit mousePressed(e);
-
- SUPERVGUI_View::contentsMousePressEvent(e);
-}
-
-
-void SUPERVGUI_Graph::contentsMouseReleaseEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Graph::contentsMouseReleaseEvent");
- if (myNewLink && (e->button() == Qt::LeftButton)) {
- myNewLink->addTmpPoint(e->pos());
- mySketchPopup->setItemEnabled(myDelPntItem, true);
- }
- emit mouseReleased(e);
- SUPERVGUI_View::contentsMouseReleaseEvent(e);
-}
-
-
-void SUPERVGUI_Graph::contentsMouseMoveEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Graph::contentsMouseMoveEvent");
- if (myNewLink) {
- myNewLink->drawTo(e->pos());
- }
- emit mouseMoved(e);
- SUPERVGUI_View::contentsMouseMoveEvent(e);
-}
-
-
-void SUPERVGUI_Graph::addPoint() {
- mySelectedLink->addPoint(myMousePos.x(), myMousePos.y());
-}
-
-
-void SUPERVGUI_Graph::deletePoint() {
- mySelectedLink->removePoint(mySelectedPoint);
-}
-
-
-void SUPERVGUI_Graph::deleteLink() {
- QString aName;
- if (mySelectedLink->isESInputPort())
- aName = mySelectedLink->getInputPortES()->getPort()->Name();
- else
- aName = mySelectedLink->getInputPort()->getPort()->Name();
-
- if (aName != "Default") {
- deleteLink(mySelectedLink);
- mySelectedLink = 0;
- repaintContents();
- }
-}
-
-
-void SUPERVGUI_Graph::deleteLink(SUPERVGUI_Link* theLink) {
- if (getMain()->getDataflow()->IsDone()) {
- //update values of input ports of theLink if theLink is deleted and dataflow has been executed any times
- SUPERVGUI_PortIn* aInPort = theLink->getInputPort();
- if ( aInPort ) {
- //input port exist
- QString aPortValue = QString(aInPort->getPort()->ToString());
- if ( (aInPort->getPort()->IsParam() || aInPort->getPort()->IsInLine())
- &&
- !aPortValue.isNull()) {
- //gives a value to an input port
- theLink->destroyEngine();
- aInPort->getPort()->Input( Supervision.getEngine()->StringValue( aPortValue ) );
- aInPort->sync();
- }
- else
- theLink->destroyEngine();
- }
- else
- theLink->destroyEngine();
- }
- else
- theLink->destroyEngine();
-
- myLinksList.removeRef(theLink);
- if (myLinksList.count() == 0) clearView();
-}
-
-
-void SUPERVGUI_Graph::setAsFromStudy(bool theToStudy) {
- SUPERVGUI_View::setAsFromStudy(theToStudy);
- if (theToStudy) return;
-
- SUPERVGUI_PortOut* aPortOut;
- QObjectList* aPortsList = queryList("SUPERVGUI_PortOut");
- QObjectListIt aPortIt(*aPortsList);
- while ((aPortOut=(SUPERVGUI_PortOut*)aPortIt.current()) != 0) {
- ++aPortIt;
- if (aPortOut->isInStudy()) {
- aPortOut->setStudyState(false);
- aPortOut->sync();
- }
- }
- delete aPortsList;
-}
-
-
-/**
- * Begins Link sketching
- */
-void SUPERVGUI_Graph::sketchBegin(SUPERVGUI_Port* thePort) {
- if (thePort == 0) return;
-
- SUPERV_Port aPort = thePort->getPort();
- myNewLink = new SUPERVGUI_Link(this);
- mySketchPopup->setItemEnabled(myDelPntItem, false);
- mySketchPopup->setItemChecked(myOrtoItem, myNewLink->isOrthoMode());
-
- myNewLink->setBeginPort(thePort);
-
- if (aPort->IsInput()) {
- if (aPort->Kind() == SUPERV::EndSwitchParameter
- ||
- aPort->Node()->Kind() == SUPERV::EndSwitchNode) {
- myNewLink->setInputPortES(dynamic_cast<SUPERVGUI_PortInESNode*>(thePort));
- }
- else
- myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
- }
- else
- myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
-}
-
-
-void SUPERVGUI_Graph::sketchEnd(SUPERVGUI_Port* thePort) {
- if (!myNewLink) return;
-
- bool aIsInput = myNewLink->getBeginPort()->getPort()->IsInput();
- if (aIsInput && thePort->getPort()->IsInput()
- ||
- !aIsInput && !thePort->getPort()->IsInput()) {
- return;
- }
-
-
- SUPERV_Port aPort = thePort->getPort();
- if (aPort->IsInput()) {
-
- int aKind = myNewLink->getOutputPort()->getPort()->Kind();
-
- if ((aPort->Kind() == SUPERV::EndSwitchParameter
- ||
- aPort->Node()->Kind() == SUPERV::EndSwitchNode)
- &&
- (aKind == SUPERV::InLineParameter || aKind == SUPERV::ServiceParameter))
- {
- QString aName(aPort->Name());
- if (aName != "Default")
- myNewLink->setInputPortES(dynamic_cast<SUPERVGUI_PortInESNode*>(thePort));
- }
- else if (aPort->Kind() == SUPERV::DataStreamParameter){
- myNewLink->setInputPort(dynamic_cast<SUPERVGUI_StreamPortIn*>(thePort));
- } else {
- if (aPort->IsLinked()) return;
-
- if (aKind == SUPERV::GateParameter || aPort->Kind() == SUPERV::GateParameter) {
- if (aKind != aPort->Kind() && aKind != SUPERV::InLineParameter
- && aPort->Kind() != SUPERV::InLineParameter) {
- return;
- }
- else { //connection like Gate <--> Gate
- myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
- }
- } else {
- myNewLink->setInputPort(dynamic_cast<SUPERVGUI_PortIn*>(thePort));
- }
- }
-
- } else {
- if (myNewLink->isESInputPort()) {
- if(aPort->Kind() == SUPERV::InLineParameter || aPort->Kind() == SUPERV::ServiceParameter)
- {
- myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
- }
- else
- return;
- } else {
- int aKind = myNewLink->getInputPort()->getPort()->Kind();
-
- if (aKind == SUPERV::GateParameter || aPort->Kind() == SUPERV::GateParameter) {
- if (aKind != aPort->Kind() &&
- aKind != SUPERV::InLineParameter &&
- aPort->Kind() != SUPERV::InLineParameter) {
- return;
- } else //connection like Gate <--> Gate
- myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
- } else if (aPort->Kind() == SUPERV::DataStreamParameter){
- myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_StreamPortOut*>(thePort));
- } else
- myNewLink->setOutputPort(dynamic_cast<SUPERVGUI_PortOut*>(thePort));
- }
- }
-
- if (myNewLink->isCreationComplete()) { // if everything is defined
- if (myNewLink->createEngine()) {
- myLinksList.append(myNewLink);
- myNewLink = 0;
- } else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_LINK"));
- delete myNewLink;
- }
- }
-}
-
-
-/**
- * Returns true if presentation of link exists
- */
-bool SUPERVGUI_Graph::isLinkPrsExists(SUPERV_Link theLink) {
- SUPERVGUI_Link* aTmpLink;
- for (aTmpLink = myLinksList.first(); aTmpLink; aTmpLink = myLinksList.next()) {
- SUPERVGUI_PortOut* aOutPort = aTmpLink->getOutputPort();
- if (strcmp(aOutPort->getPort()->Node()->Name(),
- theLink->OutPort()->Node()->Name()) == 0) {
- QString aName(theLink->OutPort()->Name());
- aName += "Output";
- if (aOutPort->name() == aName) {
- return true;
- }
- }
- }
- return false;
-}
-
-
-/**
- * Creates link presentation from link engine
- * Returns false if fails
- */
-bool SUPERVGUI_Graph::createLinkPrs(SUPERV_Link theLink) {
- SUPERVGUI_Link* aNewLink = new SUPERVGUI_Link(this, theLink);
-
- // Find output node
- SUPERVGUI_Node* aOutNode = (SUPERVGUI_Node*)
- child(theLink->OutPort()->Node()->Name(), "SUPERVGUI_Node");
- if (aOutNode) {
- QString aName(theLink->OutPort()->Name());
- aName += "Output";
- SUPERVGUI_PortOut* aOutPort = (SUPERVGUI_PortOut*)
- aOutNode->child(aName, "SUPERVGUI_PortOut");
- if (aOutPort)
- aNewLink->setOutputPort(aOutPort);
- else {
- delete aNewLink;
- return false;
- }
- } else {
- delete aNewLink;
- return false;
- }
- // Find input node
- SUPERVGUI_Node* aInNode = (SUPERVGUI_Node*)
- child(theLink->InPort()->Node()->Name(), "SUPERVGUI_Node");
- if (aInNode) {
- QString aName(theLink->InPort()->Name());
- aName += "Input";
- if (theLink->InPort()->Kind() == SUPERV::EndSwitchParameter) {
- //If input port is EndSwitchParameter
- SUPERVGUI_PortInESNode* aInPortES =(SUPERVGUI_PortInESNode*)
- aInNode->child(aName, "SUPERVGUI_PortInESNode"); //returns null
- if (aInPortES)
- aNewLink->setInputPortES(aInPortES);
- else {
- delete aNewLink;
- return false;
- }
- } else {
- SUPERVGUI_PortIn* aInPort =(SUPERVGUI_PortIn*)
- aInNode->child(aName, "SUPERVGUI_PortIn");
- if (aInPort)
- aNewLink->setInputPort(aInPort);
- else {
- delete aNewLink;
- return false;
- }
- }
- } else {
- delete aNewLink;
- return false;
- }
- aNewLink->setVisible(!myIsControlView);
- myLinksList.append(aNewLink);
- return true;
-}
-
-
-void SUPERVGUI_Graph::delLastPnt() {
- if (myNewLink) {
- myNewLink->delLastTmpPoint();
- }
-}
-
-void SUPERVGUI_Graph::delCreatingLink() {
- myNewLink->abortCreation();
- delete myNewLink;
- myNewLink=0;
- repaintContents();
-}
-
-void SUPERVGUI_Graph::setOrtho() {
- if (myNewLink) {
- bool aIsOrtho = !mySketchPopup->isItemChecked(myOrtoItem);
- myNewLink->setOrthoMode(aIsOrtho);
- mySketchPopup->setItemChecked(myOrtoItem, aIsOrtho);
- }
-}
-
-
-
-void SUPERVGUI_Graph::setFullView() {
- QObjectList* aNodeList = queryList("SUPERVGUI_Node");
- QObjectListIt aIt(*aNodeList);
- SUPERVGUI_Node* aNode;
- while ((aNode=(SUPERVGUI_Node*)aIt.current()) != 0) {
- ++aIt;
- aNode->showAll();
- }
- delete aNodeList;
-
- myCtrlLinks.clear();
- SUPERVGUI_Link* aLink;
- for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
- aLink->setVisible(true);
- }
- draw();
- myIsControlView = false;
-}
-
-
-void SUPERVGUI_Graph::setControlView() {
- QObjectList* aNodeList = queryList("SUPERVGUI_Node");
- QObjectListIt aIt(*aNodeList);
- SUPERVGUI_Node* aNode;
- while ((aNode=(SUPERVGUI_Node*)aIt.current()) != 0) {
- ++aIt;
- aNode->hideAll();
- }
- delete aNodeList;
- myCtrlLinks.clear();
- SUPERVGUI_Link* aLink;
- for (aLink = myLinksList.first(); aLink; aLink = myLinksList.next()) {
- aLink->setVisible(false);
-
- QString aOutName(aLink->getEngineLink()->OutPort()->Node()->Name());
- QString aInName(aLink->getEngineLink()->InPort()->Node()->Name());
- QString aKey = aOutName + aInName;
-
- if (!myCtrlLinks.contains(aKey)) {
- SUPERVGUI_GraphNode* aOutNode = (SUPERVGUI_GraphNode*)
- child(aOutName, "SUPERVGUI_GraphNode");
- if (!aOutNode) continue;
- SUPERVGUI_GraphNode* aInNode = (SUPERVGUI_GraphNode*)
- child(aInName, "SUPERVGUI_GraphNode");
- if (!aInNode) continue;
-
- myCtrlLinks[aKey] = SUPERVGUI_CtrlLink(this, aOutNode, aInNode);
- }
- }
- draw();
- myIsControlView = true;
-}
-
-
-void SUPERVGUI_Graph::deleteNode(SUPERVGUI_Node* theNode) {
- theNode->close(true);
- draw();
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Graph.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Graph_H
-#define SUPERVGUI_Graph_H
-
-using namespace std;
-//#include "SUPERVGUI.h"
-#include "SUPERVGUI_View.h"
-#include "SUPERVGUI_Node.h"
-#include "SUPERVGUI_Link.h"
-#include "SUPERVGUI_CtrlLink.h"
-#include "SUPERVGUI_Def.h"
-#include "QAD_SpinBoxDbl.h"
-#include <qmap.h>
-#include <qcombobox.h>
-#include <qspinbox.h>
-
-
-class SUPERVGUI_Main;
-
-class SUPERVGUI_Graph: public SUPERVGUI_View {
- Q_OBJECT
-
- public:
- SUPERVGUI_Graph(SUPERVGUI_Main* m);
- virtual ~SUPERVGUI_Graph();
-
- void sync();
- void contentsMousePressEvent(QMouseEvent* e);
- void contentsMouseReleaseEvent(QMouseEvent* e);
- void contentsMouseMoveEvent(QMouseEvent* e);
-
-
- virtual void setAsFromStudy(bool theToStudy);
-
- bool isLinkPrsExists(SUPERV_Link theLink);
- bool createLinkPrs(SUPERV_Link theLink);
- void removeLinks()
- { myLinksList.clear(); };
-
- void setFullView();
- void setControlView();
- bool isControlView() { return myIsControlView; }
-
- void deleteLink(SUPERVGUI_Link* theLink);
-
- void deleteNode(SUPERVGUI_Node* theNode);
-
- void draw();
- void clearView();
-
- bool isAnyLinkCreating() { return (myNewLink != 0);};
-
-signals:
- void mouseMoved(QMouseEvent* theEvent);
- void mousePressed(QMouseEvent* theEvent);
- void mouseReleased(QMouseEvent* theEvent);
-
-public slots:
- void sketchBegin(SUPERVGUI_Port* thePort);
- void sketchEnd(SUPERVGUI_Port* thePort);
-
-
-private slots:
- void addPoint();
- void deleteLink();
- void deletePoint();
- void delLastPnt();
- void delCreatingLink();
- void setOrtho();
-
- protected:
- bool eventFilter(QObject* object, QEvent* event);
-
- private:
-
- QPoint myMousePos;
- SUPERVGUI_Link* mySelectedLink;
- int mySelectedPoint;
-
- // Popup menu for link creation management
- QPopupMenu* mySketchPopup;
- int myDelPntItem;
- int myOrtoItem;
-
- // Popup menu for link
- QPopupMenu* myLinkPopup;
- int myDelLinkPntItem;
- int myAddLinkPntItem;
- int myDelLinkItem;
-
- bool myIsControlView;
- SUPERVGUI_Link* myNewLink;
- QPtrList<SUPERVGUI_Link> myLinksList;
- QMap<QString, SUPERVGUI_CtrlLink> myCtrlLinks;
-};
-
-#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_ComputeNode.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_GraphNode.h"
-#include "SUPERVGUI_Graph.h"
-#include "SUPERVGUI_Main.h"
-
-
-SUPERVGUI_GraphNode::SUPERVGUI_GraphNode(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode)
- :SUPERVGUI_Node(theParent, theMain, theNode),
- MouseX(MouseNo),
- MouseY(MouseNo)
-{
- //disconnect(myTitle, 0, this, 0);
- myTitle = new SUPERVGUI_Label(this, LABEL_WIDTH, LABEL_HEIGHT, name(), QLabel::AlignLeft);
- myTitle->hide();
- connect(myTitle, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(mouseTitlePress(QMouseEvent*)));
- connect(myTitle, SIGNAL(MouseMove (QMouseEvent*)), this, SLOT(mouseTitleMove(QMouseEvent*)));
- connect(myTitle, SIGNAL(MouseRelease(QMouseEvent*)), this, SLOT(mouseTitleRelease(QMouseEvent*)));
-
- myPortsBox = new QVBox(0);
- myPortsBox->setSpacing(3);
- myValuesBox = new QWidget(myPortsBox);
- myPortLayout = new QGridLayout(myValuesBox, 0, 2, 0, 1);
-
- SUPERV_StreamPorts aStreamPorts = myNode->StreamPorts();
- int aStreamNb = aStreamPorts->length();
- if (aStreamNb) {
- myStreamBox = new QFrame(myPortsBox);
- myStreamBox->setPaletteForegroundColor(red.dark());
- myStreamBox->setPaletteBackgroundColor(paletteBackgroundColor());
- myStreamBox->setFrameStyle( QFrame::Box | QFrame::Plain );
- myStreamBox->setLineWidth(1);
- myStreamLayout = new QGridLayout(myStreamBox, 0, 2, 2, 3);
- } else {
- myStreamBox = 0;
- myStreamLayout = 0;
- }
- myGatesBox = new QFrame(myPortsBox);
- myGatesBox->setFrameStyle( QFrame::Panel | QFrame::Raised );
- myGatesBox->setLineWidth(2);
- // myGatesBox->setPaletteBackgroundColor(backgroundColor().dark(105));
- myGatesBox->setPaletteBackgroundColor(green.light(170));
- myGatesLayout = new QGridLayout(myGatesBox, 0, 2);
- myGatesLayout->setMargin(3);
-
- myTimer = new QTimer(this);
- connect(myTimer, SIGNAL(timeout()), this, SLOT(movingNode(/*QMouseEvent* e*/)));
- myStopFlag = true;
-
- myX = -1;
- myY = -1;
- myDifX = 0;
- myDifY = 0;
- myFirstDifX = 0;
- myFirstDifY = 0;
-
- myPIcount = 0;
- myPOcount = 0;
- SUPERV_Ports ports = myNode->Ports();
- int n = ports->length();
-
- for (int i=0; i<n; i++) {
- if (ports[i]->IsInput()) {
- if (getComputingNode()->IsEndSwitch()) {
- if (ports[i]->IsGate())
- myGatesLayout->addWidget(new SUPERVGUI_PortInESNode(myGatesBox, myMain, ports[i].in()),
- 0, 0);
- else {
- myPortLayout->addWidget(new SUPERVGUI_PortInESNode(myValuesBox, myMain, ports[i].in()),
- myPIcount, 0);
- myPIcount++;
- }
- } else {
- if (ports[i]->IsGate())
- myGatesLayout->addWidget(new SUPERVGUI_PortIn(myGatesBox, myMain, ports[i].in()),
- 0, 0);
- else {
- myPortLayout->addWidget(new SUPERVGUI_PortIn(myValuesBox, myMain, ports[i].in()),
- myPIcount, 0);
- myPIcount++;
- }
- }
- } else {
- if (ports[i]->IsGate())
- myGatesLayout->addWidget(new SUPERVGUI_PortOut(myGatesBox, myMain, ports[i].in()),
- 0, 1, Qt::AlignRight);
- else {
- myPortLayout->addWidget(new SUPERVGUI_PortOut(myValuesBox, myMain, ports[i].in()),
- myPOcount, 1, Qt::AlignRight);
- myPOcount++;
- }
- }
- }
- myStrPIcount = 0;
- myStrPOcount = 0;
- for (int i=0; i < aStreamNb; i++) {
- if (aStreamPorts[i]->IsInput()) {
- myStreamLayout->addWidget(new SUPERVGUI_StreamPortIn(myStreamBox, myMain, aStreamPorts[i].in()),
- myStrPIcount, 0);
- myStrPIcount++;
- } else {
- myStreamLayout->addWidget(new SUPERVGUI_StreamPortOut(myStreamBox, myMain, aStreamPorts[i].in()),
- myStrPOcount, 1, Qt::AlignRight);
- myStrPOcount++;
- }
- }
-}
-
-
-
-SUPERVGUI_GraphNode::~SUPERVGUI_GraphNode() {
-}
-
-void SUPERVGUI_GraphNode::mouseTitlePress(QMouseEvent* e) {
- if (!myMain->getGraph()->isAnyLinkCreating()) {
- if (e->button() == RightButton) {
- MouseLeft = 0;
- showPopup(e);
- } else {
- MouseLeft = 1;
- SUPERVGUI_Graph* sv = myMain->getGraph();
- MouseX = sv->childX(this) - e->globalX();
- MouseY = sv->childY(this) - e->globalY();
- }
- }
-}
-
-void SUPERVGUI_GraphNode::mouseTitleMove(QMouseEvent* e) {
- Trace("SUPERVGUI_Node::moveAgain")
- SUPERVGUI_Graph* sv = myMain->getGraph();
-
- if ((MouseX == MouseNo) && (MouseY == MouseNo)) {
- MouseX = sv->childX(this) - e->globalX();
- MouseY = sv->childY(this) - e->globalY();
- MouseLeft = (e->state() == RightButton? 0: 1);
- };
-
- if (MouseLeft == 1) {
-
- int x = e->globalX()+MouseX;
- int y = e->globalY()+MouseY;
- x = x<0? 0: x;
- y = y<0? 0: y;
-
- if (x > myMain->getGraph()->horizontalScrollBar()->value()
- + myMain->getGraph()->viewport()->width() - width()/2
- ||
- y > myMain->getGraph()->verticalScrollBar()->value()
- + myMain->getGraph()->viewport()->height() - height()/2
- ||
- x < myMain->getGraph()->horizontalScrollBar()->value()
- ||
- y < myMain->getGraph()->verticalScrollBar()->value()){
- if (!myTimer->isActive()) {
- myX = x;
- myY = y;
- myDifX = x - myNode->X();
- myDifY = y - myNode->Y();
- myFirstDifX = myDifX;
- myFirstDifY = myDifY;
- }
-
- StartTimer();
- myStopFlag = false;
-
- if (x - myNode->X() > 15 && abs(myDifX) < abs(myDifY)) {
- if (x > myMain->getGraph()->horizontalScrollBar()->value()
- + myMain->getGraph()->viewport()->width() - width()/2)
- myDifX = 5; // or another positive number
- else {
- //not out of the right boundary
- sv->moveChild(this, x, myNode->Y()); //new X and old Y
- myNode->Coords(x, myNode->Y());
- myX = x;
- }
- }
-
- if (x - myNode->X() < -15 && abs(myDifX) < abs(myDifY)) {
- if(x < myMain->getGraph()->horizontalScrollBar()->value())
- myDifX = -5; //or another negative number
- else {
- //not out of the left boundary
- sv->moveChild(this, x, myNode->Y()); //new X and old Y
- myNode->Coords(x, myNode->Y());
- myX = x;
- }
- }
-
- if (y - myNode->Y() > 15 && abs(myDifX) > abs(myDifY)) {
- if (y > myMain->getGraph()->verticalScrollBar()->value()
- + myMain->getGraph()->viewport()->height() - height()/2)
- myDifY = 5; //or another positive number
- else {
- //not out of the lower boundary
- sv->moveChild(this, myNode->X(), y); //old X and new Y
- myNode->Coords(myNode->X(), y);
- myY = y;
- }
- }
-
- if (y - myNode->Y() < -15 && abs(myDifX) > abs(myDifY)) {
- if (y < myMain->getGraph()->verticalScrollBar()->value())
- myDifY = -5; //or another negative number
- else {
- //not out of the upper boundary
- sv->moveChild(this, myNode->X(), y); //old X and new Y
- myNode->Coords(myNode->X(), y);
- myY = y;
- }
- }
-
- }
- else {
- if ((myDifX*(x - myNode->X()) < 0 || myDifY*(y - myNode->Y()) < 0)) {
- StopTimer();
- myStopFlag = true;
- }
- //for mouse moving to boundaries from outside space (chack then node must be move)
- int xp1, yp1, xp2, yp2;
- xp1 = myMain->getGraph()->horizontalScrollBar()->value();
- xp2 = myMain->getGraph()->horizontalScrollBar()->value() +
- myMain->getGraph()->viewport()->width();
- yp1 = myMain->getGraph()->verticalScrollBar()->value();
- yp2 = myMain->getGraph()->verticalScrollBar()->value() +
- myMain->getGraph()->viewport()->height();
- if (x >= xp1
- && x <= xp1+myMain->getGraph()->viewport()->visibleRect().width()
- && y >= yp1
- && y <= yp1+myMain->getGraph()->viewport()->visibleRect().height()) {
- sv->moveChild(this, x, y);
- myNode->Coords(x, y);
- }
-
- }
- }
-}
-
-void SUPERVGUI_GraphNode::mouseTitleRelease(QMouseEvent* e) {
- StopTimer();
- myStopFlag = true;
-}
-
-void SUPERVGUI_GraphNode::movingNode() {
- SUPERVGUI_Graph* sv = myMain->getGraph();
-
- myX = myX<0 ? 0: myX;
- myY = myY<0 ? 0: myY;
-
- if (myDifX > 0)
- myX = myX + 5;
- if (myDifX < 0)
- myX = myX - 5;
- if (myDifY > 0)
- myY = myY + 5;
- if (myDifY < 0)
- myY = myY - 5;
-
- myMain->getGraph()->ResizeGraph(this, myX, myY);
- myMain->getGraph()->scrollBy( myX - myNode->X(), myY - myNode->Y() );
- sv->moveChild(this, myX, myY);
- myNode->Coords(myX, myY);
-}
-
-void SUPERVGUI_GraphNode::StartTimer() {
- Trace("SUPERVGUI_Main::StartTimer")
- if (!myTimer->isActive()) {
- myTimer->start(170);
- };
-}
-
-void SUPERVGUI_GraphNode::StopTimer() {
- Trace("SUPERVGUI_Main::StopTimer")
- if (myTimer->isActive()) {
- myTimer->stop();
- };
-}
-
-void SUPERVGUI_GraphNode::deleteLinks() {
- QObjectList* aList = queryList("SUPERVGUI_Port");
- SUPERVGUI_Port* aPort;
- QObjectListIt aIt(*aList);
- while ((aPort=(SUPERVGUI_Port*)aIt.current()) != 0) {
- ++aIt;
- aPort->deleteLinks();
- }
- delete aList;
-}
-
-
-void SUPERVGUI_GraphNode::sync() {
- SUPERVGUI_Node::sync();
-
- SUPERVGUI_Port* pi;
- QObjectList* ihmList = queryList("SUPERVGUI_Port");
- QObjectListIt i(*ihmList);
- while ((pi=(SUPERVGUI_Port*)i.current()) != 0) {
- ++i;
- pi->sync();
- }
- delete ihmList;
-
- //check: is creation of link is complete
- if (myMain->getGraph()->isAnyLinkCreating()) {
- //not creation complete
- myPopup->setItemEnabled(myDeleteItem, false);
- }
- else {
- //creation complete
- myPopup->setItemEnabled(myDeleteItem, true);
- }
-}
-
-
-/**
- * Creates presentation of links to In ports
- * If toCheckExisting = false the links will be created without checking
- * of their existing in Graph
- * If toCheckExisting = true the existing of links will be checked before creation
- */
-void SUPERVGUI_GraphNode::updateLinksPrs(bool toCheckExisting) {
-
- SUPERVGUI_Graph* aGraph= myMain->getGraph();
- //Find PortInESNode
- SUPERVGUI_PortInESNode* piES;
- QObjectList* ihmListES = queryList("SUPERVGUI_PortInESNode");
- QObjectListIt iES(*ihmListES);
- if (iES.count()) {
- while ((piES=(SUPERVGUI_PortInESNode*)iES.current()) != 0) {
- ++iES;
- if (piES->getPort()->IsLinked()) {
- SUPERV_Links aLinks = piES->getPort()->Links();
- for (int j=0; j<aLinks->length(); j++) {
- if (toCheckExisting) {
- if (aGraph->isLinkPrsExists(aLinks[j]))
- continue;
- }
- aGraph->createLinkPrs(aLinks[j]);
- }
- }
- }
- }
- else {
- SUPERVGUI_PortIn* pi;
- QObjectList* ihmList = queryList("SUPERVGUI_PortIn");
- QObjectListIt i(*ihmList);
- while ((pi=(SUPERVGUI_PortIn*)i.current()) != 0) {
- ++i;
- if (pi->getPort()->IsLinked()) {
- SUPERV_Link aLink = pi->getPort()->Link();
- if (toCheckExisting) {
- if (aGraph->isLinkPrsExists(aLink))
- continue;
- }
- aGraph->createLinkPrs(aLink);
- }
- }
- delete ihmList;
- }
-
- delete ihmListES;
-}
-
-
-void SUPERVGUI_GraphNode::setNodeName(QString theName) {
- SUPERVGUI_Node::setNodeName(theName);
- myTitle->setText(name());
-}
-
-
-void SUPERVGUI_GraphNode::deletePort(SUPERVGUI_Port* thePort) {
- if (thePort->isA("SUPERVGUI_PortIn") || thePort->isA("SUPERVGUI_PortInESNode")) {
- myPIcount--;
- }
- else {
- myPOcount--;
- }
- thePort->deleteLinks();
-
- thePort->getPort()->destroy();
-
- thePort->close(true);
-
- updatePorts();
- updateShape();
-}
-
-
-void SUPERVGUI_GraphNode::addInputPort() {
- SUPERV_Port aPort = createInPort();
- if (aPort == NULL) return;
-
- if (getNodeType() == SUPERV::EndSwitchNode) {
- SUPERVGUI_PortInESNode* aPortPrs = new SUPERVGUI_PortInESNode(myValuesBox, myMain, aPort.in());
- myPortLayout->addWidget(aPortPrs, myPIcount, 0);
-
- if (myPortsBox->isVisible()) {
- aPortPrs->show();
- }
- }
- else {
- SUPERVGUI_PortIn* aPortPrs = new SUPERVGUI_PortIn(myValuesBox, myMain, aPort.in());
- myPortLayout->addWidget(aPortPrs, myPIcount, 0);
-
- if (myPortsBox->isVisible()) {
- aPortPrs->show();
- }
- }
-
- myPIcount++;
- updatePorts();
- updateShape();
-}
-
-
-void SUPERVGUI_GraphNode::addOutputPort() {
- SUPERV_Port aPort = createOutPort();
- if (aPort == NULL) return;
-
- SUPERVGUI_PortOut* aPortPrs = new SUPERVGUI_PortOut(myValuesBox, myMain, aPort.in());
- myPortLayout->addWidget(aPortPrs, myPOcount, 1, Qt::AlignRight);
- myPOcount++;
- if (myPortsBox->isVisible()) {
- aPortPrs->show();
- }
- updatePorts();
- updateShape();
-}
-
-
-void SUPERVGUI_GraphNode::updatePorts() {
- bool isAdded = false;
- SUPERV_Ports aPorts = getEngine()->Ports();
- int n = aPorts->length();
- SUPERVGUI_Port* aPortPrs;
- bool aIsVisible = myPortsBox->isVisible();
- for (int i=0; i < n; i++) {
- QString aName(aPorts[i]->Name());
- aName += (aPorts[i]->IsInput())? "Input":"Output";
- aPortPrs = (SUPERVGUI_Port*) child(aName, "SUPERVGUI_Port");
- if (aPortPrs == NULL) {
- if (aPorts[i]->IsInput()) {
- SUPERVGUI_PortIn* aPortIn;
- if (aPorts[i]->IsGate()) {
- aPortIn = new SUPERVGUI_PortIn(myGatesBox, myMain, aPorts[i].in());
- myGatesLayout->addWidget(aPortIn, myPIcount, 0);
- } else {
- aPortIn = new SUPERVGUI_PortIn(myValuesBox, myMain, aPorts[i].in());
- myPortLayout->addWidget(aPortIn, myPIcount, 0);
- myPIcount++;
- }
- if (aIsVisible) aPortIn->show();
- isAdded = true;
- } else {
- SUPERVGUI_PortOut* aPortOut;
- if (aPorts[i]->IsGate()) {
- aPortOut = new SUPERVGUI_PortOut(myGatesBox, myMain, aPorts[i].in());
- myGatesLayout->addWidget(aPortOut, myPOcount, 1, Qt::AlignRight);
- } else {
- aPortOut = new SUPERVGUI_PortOut(myValuesBox, myMain, aPorts[i].in());
- myPortLayout->addWidget(aPortOut, myPOcount, 1, Qt::AlignRight);
- myPOcount++;
- }
- if (aIsVisible) aPortOut->show();
- isAdded = true;
- }
- }
- }
-
- QObjectList* aShownPortsList = queryList("SUPERVGUI_Port");
- QObjectListIt aLI(*aShownPortsList);
- SUPERVGUI_Port* aVisPort;
-
-
- while ((aVisPort=(SUPERVGUI_Port*)aLI.current()) != 0) {
- ++aLI;
- QString aNameVisible(aVisPort->getPort()->Name());
-
- bool aIsExists = false;
- for (int i=0; i < n; i++) {
- QString aName(aPorts[i]->Name());
- if (aName == aNameVisible)
- aIsExists = true;
- }
-
- if (!aIsExists) { //we have a visible object, which has no engine entity
- aVisPort->close(true);
- }
- }
-}
-
-
-/**
- * Returns coordinates of connection point in content coordinates
- */
-QPoint SUPERVGUI_GraphNode::getInConnectPnt() {
- return QPoint(pos().x(),
- pos().y() + (height()/2));
-}
-QPoint SUPERVGUI_GraphNode::getOutConnectPnt() {
- return QPoint(pos().x() + width(),
- pos().y() + (height()/2));
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_GraphNode.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_GraphNode_H
-#define SUPERVGUI_GraphNode_H
-
-#include "SUPERVGUI_Node.h"
-#include <qlayout.h>
-
-
-class SUPERVGUI_GraphNode: public SUPERVGUI_Node {
- Q_OBJECT
-
- public:
- SUPERVGUI_GraphNode(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
- virtual ~SUPERVGUI_GraphNode();
-
- virtual void hideAll() {};
- virtual void showAll() {};
-
- virtual void deleteLinks();
- virtual void sync();
-
- virtual void updateLinksPrs(bool toCheckExisting = false);
- virtual void setNodeName(QString aName);
-
- virtual void deletePort(SUPERVGUI_Port* thePort);
-
- virtual QPoint getInConnectPnt();
- virtual QPoint getOutConnectPnt();
-
- virtual void updateShape() {};
- virtual void updatePorts();
-
- int& getPIcount()
- { return myPIcount;}
-
- int& getPOcount()
- { return myPOcount;}
-
- public slots:
- void mouseTitlePress(QMouseEvent* e);
- void mouseTitleMove(QMouseEvent* e);
- void mouseTitleRelease(QMouseEvent* e);
- void movingNode();
- virtual void addInputPort();
- virtual void addOutputPort();
-
-// virtual void addInputPortES();
-// virtual void addOutputPortES();
-
- protected:
- SUPERVGUI_Label* myTitle;
-
- QVBox* myPortsBox;
- QWidget* myValuesBox;
- QGridLayout* myPortLayout;
-
- QFrame* myGatesBox;
- QGridLayout* myGatesLayout;
-
- QFrame * myStreamBox;
- QGridLayout* myStreamLayout;
-
- QTimer* myTimer;
- int myPIcount;
- int myPOcount;
-
- int myStrPIcount;
- int myStrPOcount;
-
- private:
- void StartTimer();
- void StopTimer();
- int MouseX;
- int MouseY;
- int MouseLeft;
- int myX;
- int myY;
- int myDifX;
- int myDifY;
- int myFirstDifX;
- int myFirstDifY;
- bool myStopFlag;
-
-};
-#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Label.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Label.h"
-#include "SUPERVGUI_Def.h"
-
-SUPERVGUI_Label::SUPERVGUI_Label(QWidget* parent, int dx, int dy, const char* text, int a)
- : QLabel(parent) {
- Trace("SUPERVGUI_Label::SUPERVGUI_Label")
- setMinimumSize(dx, dy);
- setMaximumSize(dx, dy);
- setText((QString)text);
- setAlignment(a | QLabel::AlignVCenter);
-}
-
-SUPERVGUI_Label::~SUPERVGUI_Label() {
- Trace("SUPERVGUI_Label::~SUPERVGUI_Label")
-}
-
-void SUPERVGUI_Label::mousePressEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Label::mousePressEvent")
- emit MousePress(e);
-}
-
-void SUPERVGUI_Label::mouseReleaseEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Label::mouseReleaseEvent")
- emit MouseRelease(e);
-}
-
-void SUPERVGUI_Label::mouseMoveEvent(QMouseEvent* e) {
- Trace("SUPERVGUI_Label::mouseMoveEvent")
- emit MouseMove(e);
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Label.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Label_H
-#define SUPERVGUI_Label_H
-
-using namespace std;
-#include <qlabel.h>
-
-class SUPERVGUI_Label: public QLabel {
- Q_OBJECT
-
- public:
- SUPERVGUI_Label(QWidget* parent, int dx, int dy, const char* text, int a);
- virtual ~SUPERVGUI_Label();
-
- void mousePressEvent(QMouseEvent* e);
- void mouseReleaseEvent(QMouseEvent* e);
- void mouseMoveEvent(QMouseEvent* e);
-
- signals:
- void MousePress(QMouseEvent* e);
- void MouseRelease(QMouseEvent* e);
- void MouseMove(QMouseEvent* e);
-};
-
-#endif
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SUPERVGUI_Library.cxx
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+
+#include "SUPERVGUI_Library.h"
+#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI.h"
+
+#include "QAD_MessageBox.h"
+#include "QAD_Application.h"
+
+#include <qlistbox.h>
+#include <qlayout.h>
+#include <qgroupbox.h>
+#include <qpushbutton.h>
+#include <qfile.h>
+
+using namespace std;
+
+#define LIBFILE "/.salome/InLineLibrary.xml" // $HOME+LIBFILE
+#define DOCTYPE "InLineNodesLibrary" // XML DocType
+#define ROOT_ELEMENT "inlinenodeslibrary" // XML Element and Attribute tags (many)
+#define NODE_ELEMENT "INode"
+#define NODE_NAME_ATT "Name"
+#define NODE_KIND_ATT "Kind"
+#define PORT_ELEMENT "Port"
+#define ES_PORT_ELEMENT "ESPort"
+#define PORT_INPUT_ATT "IsInput"
+#define PORT_NAME_ATT "Name"
+#define PORT_TYPE_ATT "Type"
+
+#define FUNC_NAME_ATT "PyFuncName" // XML attributes and elements
+#define FUNC_ELEMENT "PyFunc" // for Python functions defined
+#define FUNC_INIT_NAME_ATT "InitFuncName" // in different types of InLine nodes
+#define FUNC_INIT_ELEMENT "InitPyFunc"
+#define FUNC_MORE_NAME_ATT "MoreFuncName"
+#define FUNC_MORE_ELEMENT "MorePyFunc"
+#define FUNC_NEXT_NAME_ATT "NextFuncName"
+#define FUNC_NEXT_ELEMENT "NextPyFunc"
+#define FUNC_EL_NAME_ATT "ELFuncName" // EndLoop
+#define FUNC_EL_ELEMENT "ELPyFunc"
+#define FUNC_ES_NAME_ATT "ESFuncName" // EndSwitch
+#define FUNC_ES_ELEMENT "ESPyFunc"
+
+
+SUPERVGUI_Library* SUPERVGUI_Library::myLibrary = 0;
+
+/**
+ * Inline nodes library. constructor.
+ */
+SUPERVGUI_Library::SUPERVGUI_Library() {
+}
+
+/**
+ * Returns the XML file name used as InLine nodes repository
+ */
+const char* SUPERVGUI_Library::GetLibraryFileName() const {
+ string aFileName = getenv( "HOME" );
+ aFileName += LIBFILE;
+ return aFileName.c_str();
+}
+
+/**
+ * Creates a new library file, truncates the length to zero, writes an empty
+ * XML stub to it. If fails - displays an error message box and returns false
+ */
+bool SUPERVGUI_Library::createLibFile() const {
+ QFile libFile( GetLibraryFileName() );
+ try {
+ if ( libFile.open( IO_WriteOnly | IO_Truncate ) ) {
+ QDomDocument doc( DOCTYPE ); // create a simple XML stub
+ doc.appendChild( doc.createElement( ROOT_ELEMENT ) ); // IMPORTANT: do not delete this root element
+ QTextStream stream( &libFile );
+ doc.save( stream, 0 );
+ libFile.close();
+ return true;
+ }
+ else {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB1" ), tr( "OK" ) );
+ return false; // error opening library file for writing
+ }
+ }
+ catch ( ... ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_IO" ), tr( "OK" ) );
+ }
+ return false;
+}
+
+/**
+ * Save Function Name as attribute of given DomElement, and Function strings as its children with CDATASection
+ * saveStrings() is called to save 'main' Py function of a node, and Init(), More(), Next() for Loop node
+ */
+void saveStrings( QDomDocument doc, QDomElement element, const char* theNameAtt, const char* theFuncName,
+ const char* theFuncElem, SUPERV::ListOfStrings_var pyFunc ) {
+ QString pyFuncName( theFuncName );
+ element.setAttribute( theNameAtt, pyFuncName ); // store Py function name
+
+ // store Py functions as children of 'element'.
+ for ( int i = 0, n = pyFunc->length(); i < n; i++ ) {
+ QString pyFuncStr( pyFunc[i] );
+ QDomCDATASection aCDATA = doc.createCDATASection( pyFuncStr );
+ QDomElement funcElement = doc.createElement( theFuncElem );
+ element.appendChild( funcElement );
+ funcElement.appendChild( aCDATA );
+ }
+}
+
+/**
+ * Export an InLine node to Library
+ */
+bool SUPERVGUI_Library::Export( SUPERV::INode_var theNode ) const {
+ try {
+ if ( CORBA::is_nil( theNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_NIL_NODE" ), tr( "OK" ) );
+ return false; // null node
+ }
+
+ // open existing library file or create a new one and set some empty XML content
+ QFile libFile( GetLibraryFileName() );
+ if ( !libFile.exists() ) { // new library
+ if ( !createLibFile() )
+ return false; // error opening library file for writing. MB was already displayed
+ }
+
+ // create the main XML document object
+ QString docName( DOCTYPE ) ;
+ QDomDocument doc( docName );
+ bool xmlOk = doc.setContent( &libFile );
+ if ( xmlOk )
+ xmlOk = ( doc.elementsByTagName( ROOT_ELEMENT ).length() == 1 ); // find "root" element
+ QDomNode rootElement;
+ if ( xmlOk ) {
+ rootElement = doc.elementsByTagName( ROOT_ELEMENT ).item( 0 );
+ xmlOk = ( !rootElement.isNull() );
+ }
+ if ( !xmlOk ) {
+ const int toRecreate = QAD_MessageBox::error2( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ),
+ tr( "MSG_ERROR_LIB_IS_RECREATE" ), tr( "BUT_YES" ), tr( "BUT_NO" ), 1, 0, 0 );
+ if ( toRecreate ) { // user selected to recreate a bad XML file
+ libFile.close(); // in case it was opened by doc.setContent()
+ if ( !createLibFile() )
+ return false; // error opening library file for writing. MB was already displayed
+
+ // library file was successfully recreated. now re-set content, init rooElement. No checking - it MUST be OK.
+ libFile.setName( GetLibraryFileName() ); // IMPORTANT: re-read the file
+ doc.setContent( &libFile ); // no checking of setContent() and find root element is done, since we are sure
+ rootElement = doc.elementsByTagName( ROOT_ELEMENT ).item( 0 ); // that in newly created file everything is OK
+ }
+ else // user chose not to recreate a bad library file
+ return false; // library file is corrupt (bad XML structure), don't recreate
+ }
+
+ // if theNode is EndSwitch or EndLoop -> first export Switch or Loop node
+ if ( theNode->IsEndLoop() || theNode->IsEndSwitch() ) {
+ SUPERV::GNode_var aTmpNode = SUPERV::GNode::_narrow( theNode );
+ theNode = aTmpNode->Coupled();
+ if ( CORBA::is_nil( theNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_NIL_COUPLED" ), tr( "OK" ) );
+ return false; // null coupled node
+ }
+ }
+
+ // create element under main document
+ QDomElement element = doc.createElement( NODE_ELEMENT ) ;
+ rootElement.appendChild( element );
+
+ // save node's name and kind
+ element.setAttribute( NODE_NAME_ATT, theNode->Name() );
+ element.setAttribute( NODE_KIND_ATT, theNode->Kind() );
+ // save the 'main' Py function of the node
+ saveStrings( doc, element, FUNC_NAME_ATT, theNode->PyFuncName(), FUNC_ELEMENT, theNode->PyFunction() );
+
+ // create DOM elements for ports
+ SUPERV::ListOfPorts_var aPorts = theNode->Ports();
+ for ( int i = 0, n = aPorts->length(); i < n; i++) {
+ if ( !CORBA::is_nil( aPorts[i] ) && !aPorts[i]->IsGate() ) {
+ QDomElement portElement = doc.createElement( PORT_ELEMENT );
+ portElement.setAttribute( PORT_INPUT_ATT, aPorts[i]->IsInput() );
+ portElement.setAttribute( PORT_NAME_ATT, aPorts[i]->Name() );
+ portElement.setAttribute( PORT_TYPE_ATT, aPorts[i]->Type() );
+ element.appendChild( portElement );
+ }
+ }
+
+ // if the node is Loop -> additionally export Init(), More(), Next() and EndLoop's function
+ if ( theNode->IsLoop() ) {
+ SUPERV::LNode_var aLoopNode = SUPERV::LNode::_narrow( theNode );
+ if ( CORBA::is_nil( aLoopNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_BAD_LOOP" ), tr( "OK" ) );
+ return false;
+ }
+ SUPERV::INode_var aEndLoopNode = aLoopNode->Coupled();
+ if ( CORBA::is_nil( aEndLoopNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_BAD_LOOP" ), tr( "OK" ) );
+ return false;
+ }
+ // save init, more, next, end-loop functions of the Loop node
+ saveStrings( doc, element, FUNC_INIT_NAME_ATT, aLoopNode->PyInitName(), FUNC_INIT_ELEMENT, aLoopNode->PyInit() );
+ saveStrings( doc, element, FUNC_MORE_NAME_ATT, aLoopNode->PyMoreName(), FUNC_MORE_ELEMENT, aLoopNode->PyMore() );
+ saveStrings( doc, element, FUNC_NEXT_NAME_ATT, aLoopNode->PyNextName(), FUNC_NEXT_ELEMENT, aLoopNode->PyNext() );
+ saveStrings( doc, element, FUNC_EL_NAME_ATT, aEndLoopNode->PyFuncName(), FUNC_EL_ELEMENT, aEndLoopNode->PyFunction() );
+ }
+
+ // if the node is Switch -> additionally export EndSwitch's function and ports
+ if ( theNode->IsSwitch() ) {
+ SUPERV::SNode_var aSwitchNode = SUPERV::SNode::_narrow( theNode );
+ if ( CORBA::is_nil( aSwitchNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_BAD_SWITCH" ), tr( "OK" ) );
+ return false;
+ }
+ SUPERV::INode_var aEndSwitchNode = aSwitchNode->Coupled();
+ if ( CORBA::is_nil( aEndSwitchNode ) ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_BAD_SWITCH" ), tr( "OK" ) );
+ return false;
+ }
+ // save EndSwitch function
+ saveStrings( doc, element, FUNC_ES_NAME_ATT, aEndSwitchNode->PyFuncName(), FUNC_ES_ELEMENT, aEndSwitchNode->PyFunction() );
+
+ // save ports of EndSwitch
+ SUPERV::ListOfPorts_var aESPorts = aEndSwitchNode->Ports();
+ for ( int i = 0, n = aESPorts->length(); i < n; i++) {
+ if ( !CORBA::is_nil( aESPorts[i] ) && !aESPorts[i]->IsGate() ) {
+ QDomElement portElement = doc.createElement( ES_PORT_ELEMENT );
+ portElement.setAttribute( PORT_INPUT_ATT, aESPorts[i]->IsInput() );
+ portElement.setAttribute( PORT_NAME_ATT, aESPorts[i]->Name() );
+ portElement.setAttribute( PORT_TYPE_ATT, aESPorts[i]->Type() );
+ element.appendChild( portElement );
+ }
+ }
+ } // end of IsSwitch()
+
+ // OK, done with file export. write the document to the file
+ libFile.close(); // it seems that QDomDocument opens the file when doing
+ // setContent() and does not close it
+ if ( libFile.open( IO_WriteOnly ) ) { // IO_WriteOnly truncates the file!
+ QTextStream stream( &libFile );
+ doc.save( stream, 0 );
+ libFile.close();
+ return true;
+ }
+ else { // error opening library file for final writing
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_LIB_WRITE" ), tr( "OK" ) );
+ return false;
+ }
+ } // try
+ catch ( ... ) {
+ }
+
+ // should get here only in case of exception
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_EXPORT_EXCEPTION" ), tr( "OK" ) );
+ return false;
+}
+
+/**
+ * Returns in out parameters Py function name and Py function body
+ */
+void getStrings( QDomElement element, const char* pyFuncName, QString& thePyFuncName,
+ const char* theFuncElem, SUPERV::ListOfStrings_var& pyFunc ) {
+ QDomNamedNodeMap aNodeAtt = element.attributes();
+ if ( !aNodeAtt.namedItem( pyFuncName ).isNull() ) { // if pyFuncName is found - fill pyFunc.
+ thePyFuncName = aNodeAtt.namedItem( pyFuncName ).nodeValue();
+
+ // every 'theFuncElem' element has a CDATA child - one line
+ // iterate through all of them twice: 1) to count the number of these items (number of strings)
+ // 2) to fill pyFunc out-parameter
+ int nStrings( 0 );
+ QDomNode n = element.firstChild();
+ while ( !n.isNull() ) {
+ if ( n.isElement() && n.nodeName() == theFuncElem && n.firstChild().isCDATASection() )
+ nStrings++;
+ n = n.nextSibling();
+ }
+
+ pyFunc->length( nStrings );
+
+ int i( 0 );
+ n = element.firstChild();
+ while ( !n.isNull() ) {
+ if ( n.isElement() && n.nodeName() == theFuncElem && n.firstChild().isCDATASection() ) {
+ QDomCDATASection aCDATA = n.firstChild().toCDATASection();
+ pyFunc[i++] = aCDATA.nodeValue();
+ }
+ n = n.nextSibling();
+ }
+ } // if ( pyFuncName )
+}
+/**
+ * Adds ports stored in Dom node to the CNode
+ */
+void addPorts( SUPERV::INode_var theINode, QDomElement element, const char* portElement ) {
+ QDomNodeList aPorts = element.elementsByTagName( portElement );
+ for ( int i = 0, n = aPorts.length(); i < n; i++ ) {
+ QDomNode aPort = aPorts.item( i );
+ QDomNamedNodeMap anAtt = aPort.attributes();
+ bool isInput = ( anAtt.namedItem( PORT_INPUT_ATT ).nodeValue() == "1" );
+ QString portName = anAtt.namedItem( PORT_NAME_ATT ).nodeValue();
+ QString portType = anAtt.namedItem( PORT_TYPE_ATT ).nodeValue();
+ if ( isInput )
+ theINode->InPort( portName.latin1(), portType.latin1() );
+ else
+ theINode->OutPort( portName.latin1(), portType.latin1() );
+ }
+}
+
+/**
+ * Import an InLine node from Library into the dataflow
+ */
+bool SUPERVGUI_Library::Import( SUPERV::Graph_var theDataflow, SUPERV::INode_var& theNode,
+ SUPERV::INode_var& theEndNode, const int i ) const {
+ try {
+ QDomNodeList aNodes;
+ QDomDocument doc;
+ if ( getNodes( doc, aNodes ) ) { // xml is ok
+ if ( i >=0 && i < aNodes.length() ) { // index is ok
+ // 1. retrieve the node with given index
+ QDomElement aNode = aNodes.item( i ).toElement();
+ // 2. create an Engines node
+ QDomNamedNodeMap aNodeAtt = aNode.attributes();
+ const int aKind = aNodeAtt.namedItem( NODE_KIND_ATT ).nodeValue().toInt();
+ QString aNodeName = aNodeAtt.namedItem( NODE_NAME_ATT ).nodeValue();
+ switch ( aKind ) {
+ case SUPERV::InLineNode : // PyFunction
+ case SUPERV::GOTONode :
+ {
+ // get all the Python function
+ QString aPyFuncName;
+ SUPERV::ListOfStrings_var aPyFunc = new SUPERV::ListOfStrings();
+ getStrings( aNode, FUNC_NAME_ATT, aPyFuncName, FUNC_ELEMENT, aPyFunc );
+
+ // create the corresponding Engines node
+ SUPERV::INode_var aINode;
+ if ( aKind == SUPERV::InLineNode )
+ aINode = theDataflow->INode( aPyFuncName.latin1(), aPyFunc );
+ else
+ aINode = theDataflow->GNode( aPyFuncName.latin1(), aPyFunc, "" );
+
+ aINode->SetName( aNodeName.latin1() ); // try to set the same name of node (might be changed by CNode::SetName)
+ addPorts( aINode, aNode, PORT_ELEMENT ); // add stored ports
+
+ theNode = aINode; // init out-parameter
+ return true;
+ }
+ case SUPERV::LoopNode : // PyInit, PyNext, PyMore, PyEndLoopFunction
+ {
+ // get all required Python function
+ QString aInitName, aMoreName, aNextName, aELName;
+ SUPERV::ListOfStrings_var aInitFunc = new SUPERV::ListOfStrings(),
+ aMoreFunc = new SUPERV::ListOfStrings(),
+ aNextFunc = new SUPERV::ListOfStrings(),
+ aELFunc = new SUPERV::ListOfStrings();
+ getStrings( aNode, FUNC_INIT_NAME_ATT, aInitName, FUNC_INIT_ELEMENT, aInitFunc );
+ getStrings( aNode, FUNC_MORE_NAME_ATT, aMoreName, FUNC_MORE_ELEMENT, aMoreFunc );
+ getStrings( aNode, FUNC_NEXT_NAME_ATT, aNextName, FUNC_NEXT_ELEMENT, aNextFunc );
+ getStrings( aNode, FUNC_EL_NAME_ATT, aELName, FUNC_EL_ELEMENT, aELFunc );
+
+ // create Engines Loop node
+ SUPERV::INode_var aELNode;
+ SUPERV::INode_var aINode = theDataflow->LNode( aInitName.latin1(), aInitFunc,
+ aMoreName.latin1(), aMoreFunc,
+ aNextName.latin1(), aNextFunc, aELNode );
+ // EndLoop node may have or may NOT have pyFunc. set it if it was stored.
+ if ( !aELName.isEmpty() )
+ aELNode->SetPyFunction( aELName.latin1(), aELFunc );
+
+ aINode->SetName( aNodeName.latin1() );// try to set the same name of node (might be changed by CNode::SetName)
+ addPorts( aINode, aNode, PORT_ELEMENT ); // add stored ports
+
+ theNode = aINode; // init out-parameters
+ theEndNode = aELNode;
+ return true;
+ }
+ case SUPERV::SwitchNode : // PyFunction, PyESFunction, ESPorts
+ {
+ // get all required Python function
+ QString aPyFuncName, aESPyFuncName;
+ SUPERV::ListOfStrings_var aPyFunc = new SUPERV::ListOfStrings(),
+ aESPyFunc = new SUPERV::ListOfStrings();
+ getStrings( aNode, FUNC_NAME_ATT, aPyFuncName, FUNC_ELEMENT, aPyFunc );
+ getStrings( aNode, FUNC_ES_NAME_ATT, aESPyFuncName, FUNC_ES_ELEMENT, aESPyFunc );
+
+ // create Engines Switch node
+ SUPERV::INode_var aESNode;
+ SUPERV::INode_var aINode = theDataflow->SNode( aPyFuncName.latin1(), aPyFunc, aESNode );
+
+ // EndSwitch node may have or may NOT have pyFunc
+ if ( !aESPyFuncName.isEmpty() )
+ aESNode->SetPyFunction( aESPyFuncName.latin1(), aESPyFunc );
+
+ aINode->SetName( aNodeName.latin1() );// try to set the same name of node (might be changed by CNode::SetName)
+ addPorts( aINode, aNode, PORT_ELEMENT ); // add stored ports
+ addPorts( aESNode, aNode, ES_PORT_ELEMENT ); // add stores ports of EndSwitch
+
+ theNode = aINode; // init out-parameters
+ theEndNode = aESNode;
+ return true;
+ }
+ default: // wrong kind of node error
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_IMPORT_BAD_KIND_OF_NODE" ), tr( "OK" ) );
+ return false;
+ } // switch ( kind_of_node )
+ } // if ( index >= 0...)
+ else {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_IMPORT_BAD_INDEX" ), tr( "OK" ) );
+ }
+ } // if ( getNodes() )
+ else {
+ return false; // no MB, getNodes() in case of errors displays MB itself
+ }
+ } // try
+ catch ( ... ) {
+ }
+
+ // Normally we get here ONLY if an exception occured. All other paths of execution must return before.
+ // But - who knows, maybe we can get here by some other means.. anyway, it's an error and we report it here
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_IMPORT_EXCEPTION" ), tr( "OK" ) );
+ return false;
+}
+
+/**
+ * Returns list of NODE_ELEMENT-s and error result (false) if failed (also displays MB)
+ */
+bool SUPERVGUI_Library::getNodes( QDomDocument& doc, QDomNodeList& theNodes ) const {
+ QFile libFile( GetLibraryFileName() ); // open existing library file
+ if ( !libFile.exists() ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_IMPORT_LIB_NO_XML" ), tr( "OK" ) );
+ return false;
+ }
+
+ // create the main XML document object
+ QString docName( DOCTYPE ) ;
+ doc = QDomDocument( docName );
+ bool xmlOk = doc.setContent( &libFile );
+ // check XML for validity: 1) find root element with predefined name 2) check xml doctype
+ if ( xmlOk )
+ xmlOk = ( doc.doctype().name() == DOCTYPE && doc.elementsByTagName( ROOT_ELEMENT ).length() == 1 );
+ if ( !xmlOk ) {
+ QAD_MessageBox::error1( (QWidget*)QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_ERROR_IMPORT_LIB_BAD_XML" ), tr( "OK" ) );
+ return false;
+ }
+
+ theNodes = doc.elementsByTagName( NODE_ELEMENT );
+ return true;
+}
+
+/**
+ * Remove an InLine node with given index from Library
+ */
+bool SUPERVGUI_Library::Remove( const int i ) const {
+ QDomNodeList aNodes;
+ QDomDocument doc;
+ if ( getNodes( doc, aNodes ) && doc.elementsByTagName( ROOT_ELEMENT ).length() == 1 ) { // xml is ok
+ if ( i >=0 && i < aNodes.length() ) {
+ // 1. remove the child element (node) from Dom Document
+ QDomElement root = doc.elementsByTagName( ROOT_ELEMENT ).item( 0 ).toElement();
+ root.removeChild( aNodes.item( i ) );
+ // 2. write the modified document to the file
+ QFile libFile( GetLibraryFileName() );
+ if ( libFile.open( IO_WriteOnly | IO_Truncate ) ) {
+ QTextStream stream( &libFile );
+ doc.save( stream, 0 );
+ libFile.close();
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+/**
+ * Returns a string descriptor of KindOfNode enumeration
+ */
+QString getKindStr( const QString& theKind ) {
+ switch ( theKind.toInt() ) {
+ case SUPERV::InLineNode : return "InLine";
+ case SUPERV::LoopNode : return "Loop";
+ case SUPERV::SwitchNode : return "Switch";
+ case SUPERV::GOTONode : return "GOTO";
+ case SUPERV::FactoryNode :
+ case SUPERV::DataFlowGraph :
+ case SUPERV::ComputingNode :
+ case SUPERV::EndLoopNode :
+ case SUPERV::EndSwitchNode :
+ case SUPERV::DataStreamGraph :
+ case SUPERV::MacroNode :
+ case SUPERV::UnknownNode :
+ default:
+ ;
+ }
+ return "INCORRECT kind";
+}
+
+/**
+ * returns a list of node names currently stored in the library. Indexes of the nodes in
+ * this list can be used for futher calls to Import(.., index)
+ */
+SUPERV::ListOfStrings SUPERVGUI_Library::GetLibraryNodesNames() const {
+ SUPERV::ListOfStrings aNodesNames;
+ aNodesNames.length( 0 );
+
+ QDomNodeList aNodes;
+ QDomDocument doc;
+ if ( !getNodes( doc, aNodes ) )
+ return aNodesNames;
+
+ const int n = aNodes.length();
+ aNodesNames.length( n );
+ QDomNode aNode;
+ for ( int i = 0; i < n; i++ ) {
+ QString aNodeName( "" );
+ aNode = aNodes.item( i );
+ if ( !aNode.isNull() ) {
+ QDomNode aNameAtt = aNode.attributes().namedItem( NODE_NAME_ATT );
+ QDomNode aTypeAtt = aNode.attributes().namedItem( NODE_KIND_ATT );
+ if ( !aNameAtt.isNull() && !aTypeAtt.isNull() ) {
+ aNodeName = QString( "%1 ( %2 )" ).arg( aNameAtt.toAttr().value() ).arg(
+ getKindStr( aTypeAtt.toAttr().value() ) );
+ }
+ }
+ // if NodeName attribute was not found or some error (NULL node),
+ // then an empty string is added for that index in the list
+ aNodesNames[i] = aNodeName.latin1();
+ }
+
+ return aNodesNames;
+}
+
+/**
+ * returns status of library: false indicates that library file does not exist or can not be opened
+ */
+bool SUPERVGUI_Library::CanImport() const {
+ try {
+ QDomNodeList aNodes;
+ QDomDocument doc;
+ return getNodes( doc, aNodes );
+ }
+ catch ( ... ) {
+ }
+ return false;
+}
+
+
+
+
+
+/**
+ * Inline nodes library management dialog. constructor.
+ */
+SUPERVGUI_LibDlg::SUPERVGUI_LibDlg( QWidget* parent, int& theX, int& theY )
+ :QDialog( parent, "SUPERVGUI_LibDlg", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu),
+ myX( theX ), myY( theY )
+{
+ setSizeGripEnabled( true );
+ setCaption(tr("TIT_LIB_DLG"));
+ resize( 350, 400 );
+ QGridLayout* aMainLayout = new QGridLayout( this, 4, 4, 11, 6 );
+
+ myLB = new QListBox( this );
+
+ QPushButton* anAddBtn = new QPushButton( tr("TIT_ADDFNODE"), this );
+ connect( anAddBtn, SIGNAL( clicked() ), this, SLOT( add() ) );
+ QPushButton* aRemBtn = new QPushButton( tr("BUT_REMOVE"), this );
+ connect( aRemBtn, SIGNAL( clicked() ), this, SLOT( remove() ) );
+
+ aMainLayout->addMultiCellWidget( myLB, 0, 2, 0, 2 );
+ aMainLayout->addWidget( anAddBtn, 0, 3 );
+ aMainLayout->addWidget( aRemBtn, 1, 3 );
+
+ QGroupBox* aBtnBox = new QGroupBox( 0, Qt::Vertical, this );
+ aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
+ QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
+ aBtnLayout->setAlignment( Qt::AlignTop );
+ aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
+
+ QPushButton* aCloseBtn = new QPushButton( tr("BUT_CLOSE"), aBtnBox );
+ connect( aCloseBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ aBtnLayout->addStretch();
+ aBtnLayout->addWidget( aCloseBtn );
+ aBtnLayout->addStretch();
+
+ aMainLayout->addMultiCellWidget( aBtnBox, 3, 3, 0, 3 );
+ aMainLayout->setRowStretch( 2, 1 );
+
+ initList();
+}
+
+/**
+ * Inline nodes library management dialog. destructor.
+ */
+SUPERVGUI_LibDlg::~SUPERVGUI_LibDlg() {}
+
+/**
+ * Called when user presses "Add" button. Add a selected node from library to graph
+ */
+void SUPERVGUI_LibDlg::add() {
+ const int i = myLB->currentItem();
+ if ( i >= 0 && i < myLB->count() ) {
+ SUPERV::Graph_var aDataflow = Supervision.getMain()->getDataflow();
+ SUPERV::INode_var aNode, aEndNode;
+ if ( SUPERVGUI_Library::getLibrary()->Import( aDataflow, aNode, aEndNode, i ) ) {
+ SUPERVGUI_Service::addNode( SUPERV::CNode::_narrow( aNode ), aEndNode, myX, myY );
+ Supervision.getMain()->sync();
+ }
+ else { // all errors must be reported to user in Import(), MB shown, etc..
+ } // so we don't need to report errors if Import() returned false.
+ }
+}
+
+/**
+ * Called when user presses "Remove" button. Remove a selected node from library
+ */
+void SUPERVGUI_LibDlg::remove() {
+ const int i = myLB->currentItem();
+ if ( i >= 0 && i < myLB->count() ) {
+ SUPERVGUI_Library::getLibrary()->Remove( i );
+ initList(); // re-initialize the list to reflect the changes
+ }
+}
+
+/**
+ * Fills the list with names of nodes currently stored in the library. Indexes in the list
+ * can be used for calls to Library::Import()
+ */
+void SUPERVGUI_LibDlg::initList() {
+ myLB->clear();
+ SUPERV::ListOfStrings aNodesNames = SUPERVGUI_Library::getLibrary()->GetLibraryNodesNames();
+ for ( int i = 0, n = aNodesNames.length(); i < n; i++ )
+ myLB->insertItem( (const char*)aNodesNames[i] );
+}
+
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+//
+//
+//
+// File : SUPERVGUI_Library.h
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+#ifndef SUPERVGUI_Library_H
+#define SUPERVGUI_Library_H
+
+#include <qdialog.h>
+#include <qdom.h>
+
+#include "utilities.h"
+#include "SALOME_LifeCycleCORBA.hxx"
+#include CORBA_CLIENT_HEADER(SUPERV)
+
+class QListBox;
+
+/**
+ * SUPERVGUI_Library class is intended for management of InLine nodes library.
+ * InLine nodes library is an XML repository (currently it is a predefined user-dependant XML file)
+ * with InLine nodes stored in it. InLine node in a library contains its Python code and lists of
+ * input and output ports.
+ */
+class SUPERVGUI_Library : QObject { // extending QObject to enable slot/signals
+
+ Q_OBJECT
+
+protected:
+ SUPERVGUI_Library(); // constructor is protected, use static function getLibrary()
+
+public:
+ static SUPERVGUI_Library* getLibrary() {
+ if ( !myLibrary )
+ myLibrary = new SUPERVGUI_Library();
+ return myLibrary;
+ }
+
+ // Returns the XML file name used as InLine nodes repository
+ const char* GetLibraryFileName() const;
+
+ // Export an InLine node to Library
+ bool Export( SUPERV::INode_var theNode ) const;
+
+ // Import an InLine node from Library into the dataflow
+ bool Import( SUPERV::Graph_var theDataflow, SUPERV::INode_var& theNode,
+ SUPERV::INode_var& theEndNode, const int theLibIndex ) const;
+
+ // Remove an InLine node with given index from Library
+ bool Remove( const int i ) const;
+
+ // returns a list of node names currently stored in the library. Indexes of the nodes in
+ // this list can be used for futher calls to Import(.., index)
+ SUPERV::ListOfStrings GetLibraryNodesNames() const;
+
+ // returns status of library: false indicates that library file does not exist or can not be opened
+ bool CanImport() const;
+
+private:
+ static SUPERVGUI_Library* myLibrary;
+
+ bool createLibFile() const; // returns false on file creation error (also displays MB)
+
+ // returns list of NODE_ELEMENT-s and error result (false) if failed (also displays MB)
+ bool getNodes( QDomDocument& theDoc, QDomNodeList& theNodes ) const;
+
+};
+
+/**
+ * Dialog box for Add/Remove InLine nodes to Library, Add node to Graph from Library
+ */
+class SUPERVGUI_LibDlg: public QDialog {
+
+ Q_OBJECT
+
+public:
+ SUPERVGUI_LibDlg( QWidget* parent, int& theX, int& theY );
+ ~SUPERVGUI_LibDlg();
+
+private slots:
+ void add(); // add selected node from library to graph
+ void remove(); // remove selected node from library
+
+private:
+ void initList(); // clear and fill list with nodes from Library
+
+ QListBox* myLB;
+ int& myX; // comes from caller - SUPERVGUI_Service, used for calculating next node_s position
+ int& myY; // comes from caller - SUPERVGUI_Service
+};
+
+#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_Link.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Graph.h"
-#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_Link.h"
-
-
-
-#define SKETCH_CLR Qt::green
-#define DRAW_CLR Qt::black
-#define HLT_CLR Qt::magenta
-#define CTRL_CLR Qt::red
-
-#define LINE_WIDTH 2
-#define PNT_SIZE 6
-
-
-// Prevents moving of several links at once
-bool SUPERVGUI_Link::LinkIsMoving=false;
-
-bool SUPERVGUI_Link::OrthoMode = false;
-
-SUPERVGUI_Link* SUPERVGUI_Link::SelectedLink=0;
-
-/**
- * Consructor:
- * If link is NULL - this must be defined later
- */
-SUPERVGUI_Link::SUPERVGUI_Link(SUPERVGUI_Graph* theGraph, SUPERV_Link theLink) {
- myGraph = theGraph;
- myEngine = theLink;
- myPortIn = 0;
- myPortInES = 0;
- myPortOut = 0;
- myStartPort = 0;
- myHltPnt = -1;
- myPntMovingState = false;
- myPainter = 0;
- myIsVisible = true;
- myTmpPen.setColor(SKETCH_CLR);
- myTmpPen.setWidth(LINE_WIDTH);
- myIsSelected = false;
- myTmpPoints.clear();
-
- if (!SUPERV_isNull(myEngine))
- connectToEvents();
-}
-
-
-//**********************************************************************
-SUPERVGUI_Link::~SUPERVGUI_Link() {
- if (!SUPERV_isNull(myEngine)) {
- disconnect(myGraph, 0, this, 0);
- }
- if (SelectedLink == this) SelectedLink=0;
- emit linkDeleted(this);
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::setInputPort(SUPERVGUI_PortIn* thePortIn) {
- myPortIn = thePortIn;
- myPortIn->setLinkPrs(this);
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::setInputPortES(SUPERVGUI_PortInESNode* thePortInES) {
- myPortInES = thePortInES;
- myPortInES->setLinkPrs(this);
-}
-
-//**********************************************************************
-bool SUPERVGUI_Link::isESInputPort() {
- if (myPortInES)
- return true;
- else
- return false;
-}
-
-//**********************************************************************
-void SUPERVGUI_Link::destroyEngine() {
- if (!SUPERV_isNull(myEngine)) {
- myEngine->destroy();
- }
-}
-
-//**********************************************************************
-void SUPERVGUI_Link::setOutputPort(SUPERVGUI_PortOut* thePortOut){
- myPortOut = thePortOut;
- myPortOut->addLinkPrs(this);
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::addPoint(long theX, long theY) {
- if (SUPERV_isNull(myEngine)) return;
-
- if (myEngine->CoordsSize() <= 0) {
- myEngine->AddCoord(1, theX, theY);
- return;
- } else {
- QPoint aPnt(theX, theY);
- long aX, aY;
- myEngine->Coords(1, aX, aY);
- if (!isESInputPort()) {
- if (distance(aPnt, myGraph->viewportToContents(myPortIn->getConnectPnt()),
- QPoint(aX, aY)) <= 0) {
- myEngine->AddCoord(1, theX, theY);
- return;
- }
- }
- else {
- if (distance(aPnt, myGraph->viewportToContents(myPortInES->getConnectPnt()),
- QPoint(aX, aY)) <= 0) {
- myEngine->AddCoord(1, theX, theY);
- return;
- }
- }
-
- int i = 2;
- long aNextX, aNextY;
- for (i = 2; i <= myEngine->CoordsSize(); i++) {
- myEngine->Coords(i, aNextX, aNextY);
- if (distance(aPnt, QPoint(aX, aY),
- QPoint(aNextX, aNextY)) <= 0) {
- myEngine->AddCoord(i, theX, theY);
- return;
- }
- aX = aNextX;
- aY = aNextY;
- }
- if (distance(aPnt, QPoint(aX, aY),
- myGraph->viewportToContents(myPortOut->getConnectPnt())) <= 0) {
- myEngine->AddCoord(myEngine->CoordsSize()+1, theX, theY);
- return;
- }
- }
- repaint();
-}
-
-
-//**********************************************************************
-/**
- * Can be used only in Sketching mode
- */
-void SUPERVGUI_Link::addTmpPoint(QPoint thePnt) {
- if (OrthoMode) {
- int aSize = myTmpPoints.size();
- QPoint aPrevPnt;
- // Previous point
- if (aSize > 0)
- aPrevPnt = myTmpPoints[aSize-1];
- else
- aPrevPnt = myStartPort->getConnectPnt();
-
- // Next point
- QPoint aNewPoint;
- if (Abs(thePnt.x() - aPrevPnt.x()) >
- Abs(thePnt.y() - aPrevPnt.y())) {
- aNewPoint = QPoint(thePnt.x(), aPrevPnt.y());
- } else {
- aNewPoint = QPoint(aPrevPnt.x(), thePnt.y());
- }
- // repaint last line
-
- myPainter->drawLine(aPrevPnt, thePnt);
- myPainter->moveTo(aPrevPnt);
- myPainter->lineTo(aNewPoint);
- myPainter->lineTo(thePnt);
-
- myTmpPoints.push_back(aNewPoint);
- } else
- myTmpPoints.push_back(thePnt);
-}
-
-
-//**********************************************************************
-/**
- * Can be used only in Sketching mode
- */
-void SUPERVGUI_Link::delLastTmpPoint() {
- int aSize = myTmpPoints.size();
- if (aSize > 0) {
- QPoint aRemPnt = myTmpPoints[aSize-1];
-
- QPoint aLastPnt;
- if (aSize > 1)
- aLastPnt = myTmpPoints[aSize-2];
- else
- aLastPnt = myStartPort->getConnectPnt();
-
- myPainter->moveTo(aLastPnt);
- myPainter->lineTo(aRemPnt);
- myPainter->lineTo(myPrevPoint);
-
- myPainter->drawLine(aLastPnt, myPrevPoint);
-
- myTmpPoints.pop_back();
- }
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::removeLastPoint() {
- if (myEngine && (!SUPERV_isNull(myEngine)))
- myEngine->RemoveCoord(myEngine->CoordsSize());
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::removePoint(int thePnt) {
- if ((thePnt > -1) && (!SUPERV_isNull(myEngine))) {
- paint(true);
- myEngine->RemoveCoord(thePnt);
- paint(false);
- }
-}
-
-//**********************************************************************
-/**
- * Repaints the link
- */
-void SUPERVGUI_Link::repaint() {
- paint(true);
- paint(false);
-}
-
-
-//**********************************************************************
-/**
- * Paints or erases the link
- * if toErase = true then it draws link by background color
- */
-void SUPERVGUI_Link::paint(bool toErase) {
- if ((!myGraph) || (!myIsVisible)) return;
- if (!myEngine && SUPERV_isNull(myEngine)) return;
- // if (!isCreationComplete()) return;
-
- QPainter aPainter(myGraph->viewport());
- QPen aDataPen;
- aDataPen.setWidth(LINE_WIDTH);
-
- if (toErase) {
- aDataPen.setColor(myGraph->viewport()->paletteBackgroundColor());
- } else {
- if ((strcmp(myEngine->InPort()->Name(), "InVoid")==0) ||
- (myEngine->InPort()->Kind() == SUPERV::DataStreamParameter ))
- aDataPen.setColor(CTRL_CLR);
- else
- aDataPen.setColor(DRAW_CLR);
- }
- aPainter.setPen(aDataPen);
- drawLink(&aPainter);
-}
-
-
-//**********************************************************************
-/**
- * Defines a pen and draws link using given painter
- */
-void SUPERVGUI_Link::paint(QPainter* thePainter, bool toErase) {
- if ((!myGraph) || (!myIsVisible)) return;
- if (!myEngine && SUPERV_isNull(myEngine)) return;
- // if (!isCreationComplete()) return;
- thePainter->save();
-
- QPen aDataPen;
- aDataPen.setWidth(LINE_WIDTH);
-
- if (toErase) {
- aDataPen.setColor(myGraph->viewport()->paletteBackgroundColor());
- } else {
- if ((strcmp(myEngine->InPort()->Name(), "InVoid")==0)||
- (myEngine->InPort()->Kind() == SUPERV::DataStreamParameter ))
- aDataPen.setColor(CTRL_CLR);
- else
- aDataPen.setColor(DRAW_CLR);
- }
- thePainter->setPen(aDataPen);
- drawLink(thePainter);
- thePainter->restore();
-}
-
-
-//**********************************************************************
-/**
- * Draws link using given painter
- */
-void SUPERVGUI_Link::drawLink(QPainter* thePainter) {
- if (!myIsVisible) return;
- if (!isESInputPort())
- thePainter->moveTo(myPortIn->getConnectPnt());
- else
- thePainter->moveTo(myPortInES->getConnectPnt());
- long aX, aY;
- QPoint aPnt;
- for (int i=0; i < myEngine->CoordsSize(); i++) {
- myEngine->Coords(i+1, aX, aY);
- aPnt = myGraph->contentsToViewport(QPoint(aX, aY));
- thePainter->lineTo(aPnt);
- thePainter->drawEllipse(aPnt.x()-PNT_SIZE/2, aPnt.y()-PNT_SIZE/2,
- PNT_SIZE, PNT_SIZE);
- }
- thePainter->lineTo(myPortOut->getConnectPnt());
-}
-
-
-//**********************************************************************
-/**
- * Repaints whole link when it is sketching
- */
-void SUPERVGUI_Link::repaintSketch() {
- if (!myStartPort) return;
- if (!myPainter) return;
-
- // myPainter->save();
- //myPainter->setRasterOp(Qt::CopyROP);
- myPainter->moveTo(myStartPort->getConnectPnt());
- for (int i = 0; i< myTmpPoints.size(); i++) {
- myPainter->lineTo(myGraph->contentsToViewport(myTmpPoints[i]));
- }
- myPainter->lineTo(myPrevPoint);
- //myPainter->restore();
-}
-
-
-//**********************************************************************
-/**
- * Drawing of non created link following to mouse pointer
- */
-void SUPERVGUI_Link::drawTo(QPoint thePnt) {
- if (!myStartPort) {
- if (myPortIn)
- myStartPort = myPortIn;
- else if (myPortInES)
- myStartPort = myPortInES;
- else if (myPortOut)
- myStartPort = myPortOut;
- else
- return;
- }
- if (!myPainter) {
- myPainter = new QPainter(myGraph->viewport());
- myPainter->setPen(myTmpPen);
- myPainter->setRasterOp(Qt::XorROP);
- myPrevPoint = myStartPort->getConnectPnt();
- LinkIsMoving = true;
- }
-
- long aX, aY;
-
- QPoint aStartPnt;
- if (myTmpPoints.size() > 0)
- aStartPnt = myGraph->contentsToViewport(myTmpPoints[myTmpPoints.size()-1]);
- else
- aStartPnt = myStartPort->getConnectPnt();
-
- // erase old line
- myPainter->drawLine(aStartPnt, myPrevPoint);
-
- // draw new line
- QPoint aNewPoint = myGraph->contentsToViewport(thePnt);
- myPainter->drawLine(aStartPnt, aNewPoint);
- myPrevPoint = aNewPoint;
-
-}
-
-
-//**********************************************************************
-/**
- * Set link non visible
- */
-void SUPERVGUI_Link::setVisible(bool theVisible) {
- myIsVisible = theVisible;
- if (myIsVisible) {
- connectToEvents();
- } else {
- disconnect(myGraph, 0, this, 0);
- }
-}
-
-
-//**********************************************************************
-/**
- * Checks full definition of the link
- */
-bool SUPERVGUI_Link::isCreationComplete() {
- bool aIsBoth = myPortIn && myPortOut;
- if (myPortIn && myPortOut) {
- // Check: is the same node?
- SUPERV_Port aInPort = myPortIn->getPort();
- QString aInNodeName(aInPort->Node()->Name());
- SUPERV_Port aOutPort = myPortOut->getPort();
- QString aOutNodeName(aOutPort->Node()->Name());
-
- bool aCanCreate = true;
- // Stream port can be connected only with stream port
- if (myPortIn->getPort()->Kind() == SUPERV::DataStreamParameter)
- aCanCreate = (myPortOut->getPort()->Kind() == SUPERV::DataStreamParameter);
- else if (myPortOut->getPort()->Kind() == SUPERV::DataStreamParameter)
- aCanCreate = (myPortIn->getPort()->Kind() == SUPERV::DataStreamParameter);
-
- return aCanCreate && (aInNodeName != aOutNodeName);
- }
- else if (myPortInES && myPortOut) {
- SUPERV_Port aInPortES = myPortInES->getPort();
- QString aInNodeName(aInPortES->Node()->Name());
- SUPERV_Port aOutPort = myPortOut->getPort();
- QString aOutNodeName(aOutPort->Node()->Name());
-
- return (aInNodeName != aOutNodeName);
- }
- else
- return false;
-}
-
-//**********************************************************************
-/**
- * Abort creation of link
- */
-void SUPERVGUI_Link::abortCreation() {
- LinkIsMoving = false;
-}
-
-//**********************************************************************
-/**
- * Final procedure of link creation
- */
-bool SUPERVGUI_Link::createEngine() {
- // clear temporary drawing
- QPen aOldPen(myGraph->viewport()->paletteBackgroundColor(), LINE_WIDTH);
- //check if myPainter not null
- if (myPainter) {
- myPainter->setPen(aOldPen);
- myPainter->setRasterOp(Qt::CopyROP);
-
- QPoint aStartPnt;
- if (myTmpPoints.size() > 0)
- aStartPnt = myGraph->contentsToViewport(myTmpPoints[myTmpPoints.size()-1]);
- else
- aStartPnt = myStartPort->getConnectPnt();
-
- myPainter->drawLine(aStartPnt, myPrevPoint);
-
- delete myPainter;
- myPainter = 0;
- }
-
- // Create engine
- if (!isESInputPort()) {
- if (myStartPort->getPort()->Kind() == SUPERV::DataStreamParameter) {
- SUPERVGUI_StreamPortOut* aOut = dynamic_cast<SUPERVGUI_StreamPortOut*>(myPortOut);
- SUPERVGUI_StreamPortIn* aIn = dynamic_cast<SUPERVGUI_StreamPortIn*>(myPortIn);
- // myEngine = myGraph->getMain()->getDataflow()->StreamLink(aOut->getStreamPort(), aIn->getStreamPort());
- SUPERV_StreamGraph aSGraph = myGraph->getMain()->getDataflow()->ToStreamGraph();
- if (!SUPERV_isNull(aSGraph))
- myEngine = aSGraph->StreamLink(aOut->getStreamPort(), aIn->getStreamPort());
- } else
- myEngine = myGraph->getMain()->getDataflow()->
- Link(myPortOut->getPort(), myPortIn->getPort());
- } else
- myEngine = myGraph->getMain()->getDataflow()->
- Link(myPortOut->getPort(), myPortInES->getPort());
-
- if (SUPERV_isNull(myEngine)) return false;
-
- // remember all points
- QPoint aPnt;
- if (myStartPort == myPortOut) {
- int aSize = myTmpPoints.size();
- for (int i = aSize; i > 0; i--) {
- aPnt = myTmpPoints[i-1];
- myEngine->AddCoord(aSize+1-i, aPnt.x(), aPnt.y());
- }
- } else {
- for (int i = 0; i < myTmpPoints.size(); i++) {
- aPnt = myTmpPoints[i];
- myEngine->AddCoord(i+1, aPnt.x(), aPnt.y());
- }
- }
- LinkIsMoving = false;
-
- // empty temporary resources
- myTmpPoints.clear();
- myStartPort = 0;
- connectToEvents();
- paint(false);
- return true;
-}
-
-
-
-//**********************************************************************
-void SUPERVGUI_Link::onMouseMove(QMouseEvent * theEvent) {
- if (myPntMovingState) {
- drawSegments();
-
- QPoint aPos = myGraph->contentsToViewport(theEvent->pos());
- int aX = (aPos.x() > 0)? aPos.x(): 1;
- int aY = (aPos.y() > 0)? aPos.y(): 1;
- aX = (aX < myGraph->contentsWidth())? aX: myGraph->contentsWidth()-1;
- aY = (aY < myGraph->contentsHeight())? aY: myGraph->contentsHeight()-1;
-
- myMovedPnt = QPoint(aX, aY);
- drawSegments();
- return;
- }
-
- if (LinkIsMoving) return;
-
- // Points highlighting
- QPoint aPos = theEvent->pos();
- if (myEngine->CoordsSize() > 0 ) {
- long aX, aY;
- bool aIsFound = false;
- for (int i=0; i < myEngine->CoordsSize(); i++) {
- myEngine->Coords(i+1, aX, aY);
- if (distance(aX, aY,
- aPos.x(),
- aPos.y()) < (PNT_SIZE+2)) {
- myHltPnt = i+1;
- aIsFound = true;
- break;
- }
- }
- if (!aIsFound) myHltPnt = -1;
- }
-
- // Highlight line
- if (isSelected(aPos)) {
- if (SelectedLink==0) {
- QPen aNewPen(HLT_CLR, LINE_WIDTH);
- QPainter aPainter(myGraph->viewport());
- aPainter.setPen(aNewPen);
- drawLink(&aPainter);
- myIsSelected = true;
- SelectedLink = this;
- }
- } else if (myIsSelected) {
- myIsSelected = false;
- if (SelectedLink == this) SelectedLink = 0;
- paint(false);
- }
-}
-
-
-//**********************************************************************
-/**
- * For internal using only
- * Draws segments by current Pen when point is moving
- */
-void SUPERVGUI_Link::drawSegments() {
- myPainter->drawLine(myBeforePnt, myMovedPnt);
- myPainter->drawLine(myMovedPnt, myAfterPnt);
- myPainter->drawEllipse(myMovedPnt.x()-PNT_SIZE/2,
- myMovedPnt.y()-PNT_SIZE/2,
- PNT_SIZE, PNT_SIZE);
-}
-
-
-//**********************************************************************
-void SUPERVGUI_Link::onMousePress(QMouseEvent * theEvent) {
- if (LinkIsMoving) {
- return;
- }
- if (theEvent->button() != Qt::LeftButton) {
- SelectedLink = 0;
- myHltPnt = -1;
- return;
- }
- if (myHltPnt > -1) { // start point moving
- if (myHltPnt == 1) {
- if (!isESInputPort()) {
- myBeforePnt = myPortIn->getConnectPnt();
- }
- else {
- myBeforePnt = myPortInES->getConnectPnt();
- }
- }
- else {
- long aX, aY;
- myEngine->Coords(myHltPnt-1, aX, aY);
- myBeforePnt = myGraph->contentsToViewport(QPoint(aX, aY));
- }
- if (myHltPnt == myEngine->CoordsSize())
- myAfterPnt = myPortOut->getConnectPnt();
- else {
- long aX, aY;
- myEngine->Coords(myHltPnt+1, aX, aY);
- myAfterPnt = myGraph->contentsToViewport(QPoint(aX, aY));
- }
- long aX, aY;
- myEngine->Coords(myHltPnt, aX, aY);
- myMovedPnt = myGraph->contentsToViewport(QPoint(aX, aY));
-
- myPainter = new QPainter(myGraph->viewport());
- QPen aOldPen(myGraph->viewport()->paletteBackgroundColor(), LINE_WIDTH);
-
- myPainter->setPen(aOldPen);
- drawSegments();
-
- myPainter->setPen(myTmpPen);
- myPainter->setRasterOp(Qt::XorROP);
- drawSegments();
-
- myPntMovingState = true;
- LinkIsMoving = true;
- } else if (myHltPnt > -1)
- paint(false);
-}
-
-//**********************************************************************
-void SUPERVGUI_Link::onMouseRelease(QMouseEvent * theEvent){
- if (theEvent->button() != Qt::LeftButton) return;
-
- if (myPntMovingState) {
- myPntMovingState = false;
- LinkIsMoving = false;
- drawSegments();
- delete myPainter;
- myPainter = 0;
-
- int aX = (theEvent->pos().x() > 0)? theEvent->pos().x(): 1;
- int aY = (theEvent->pos().y() > 0)? theEvent->pos().y(): 1;
- aX = (aX < myGraph->contentsWidth())? aX: myGraph->contentsWidth()-1;
- aY = (aY < myGraph->contentsHeight())? aY: myGraph->contentsHeight()-1;
- myEngine->ChangeCoord(myHltPnt, aX, aY);
-
- paint(false);
- }
-}
-
-//**********************************************************************
-/**
- * Connects to the Graph mouse events
- */
-void SUPERVGUI_Link::connectToEvents() {
- connect(myGraph, SIGNAL(mouseMoved(QMouseEvent*)),
- this, SLOT(onMouseMove(QMouseEvent*)));
-
- connect(myGraph, SIGNAL(mousePressed(QMouseEvent*)),
- this, SLOT(onMousePress(QMouseEvent*)));
-
- connect(myGraph, SIGNAL(mouseReleased(QMouseEvent*)),
- this, SLOT(onMouseRelease(QMouseEvent*)));
-}
-
-
-//**********************************************************************
-bool SUPERVGUI_Link::isSelected(QPoint thePnt) {
- if (myEngine->CoordsSize() == 0) {
- if (!isESInputPort()) {
- return (distance(thePnt, myGraph->viewportToContents(myPortOut->getConnectPnt()),
- myGraph->viewportToContents(myPortIn->getConnectPnt())) <= 0);
- }
- else {
- return (distance(thePnt, myGraph->viewportToContents(myPortOut->getConnectPnt()),
- myGraph->viewportToContents(myPortInES->getConnectPnt())) <= 0);
- }
- }
- else {
- long aX, aY;
- myEngine->Coords(1, aX, aY);
- if (!isESInputPort()) {
- if (distance(thePnt, myGraph->viewportToContents(myPortIn->getConnectPnt()),
- QPoint(aX, aY)) <= 0) {
- return true;
- }
- }
- else {
- if (distance(thePnt, myGraph->viewportToContents(myPortInES->getConnectPnt()),
- QPoint(aX, aY)) <= 0) {
- return true;
- }
- }
-
- int i = 2;
- long aNextX, aNextY;
- for (i = 2; i <= myEngine->CoordsSize(); i++) {
- myEngine->Coords(i, aNextX, aNextY);
- if (distance(thePnt, QPoint(aX, aY),
- QPoint(aNextX, aNextY)) <= 0) {
- return true;
- }
- aX = aNextX;
- aY = aNextY;
- }
- if (distance(thePnt, QPoint(aX, aY),
- myGraph->viewportToContents(myPortOut->getConnectPnt())) <= 0) {
- return true;
- }
- }
- return false;
-}
-
-
-//**********************************************************************
-/**
- * Returns true if at least one point is within the rect.
- * Rect must be in contents coordinate space
- */
-bool SUPERVGUI_Link::isInRect(int theX, int theY, int theW, int theH) {
- QRect aRect(theX, theY, theW, theH);
- if (aRect.contains(myGraph->viewportToContents(myPortOut->getConnectPnt()), true))
- return true;
-
- if (!isESInputPort()) {
- if (aRect.contains(myGraph->viewportToContents(myPortIn->getConnectPnt()), true)) {
- return true;
- }
- }
- else {
- if (aRect.contains(myGraph->viewportToContents(myPortInES->getConnectPnt()), true)) {
- return true;
- }
- }
-
- long aX, aY;
- QPoint aPrevPnt;
- if (!isESInputPort())
- aPrevPnt = myGraph->viewportToContents(myPortIn->getConnectPnt());
- else
- aPrevPnt = myGraph->viewportToContents(myPortInES->getConnectPnt());
- for (int i = 1; i <= myEngine->CoordsSize(); i++) {
- myEngine->Coords(i, aX, aY);
- if (aRect.contains(aX, aY, true))
- return true;
- else {
- QRect aTmpRect(QPoint(QMIN(aPrevPnt.x(), aX),
- QMIN(aPrevPnt.y(), aY)),
- QPoint(QMAX(aPrevPnt.x(), aX),
- QMAX(aPrevPnt.y(), aY)));
- if (aRect.intersects(aTmpRect))
- return true;
- aPrevPnt = QPoint(aX, aY);
- }
- }
- QPoint aLastPnt = myGraph->viewportToContents(myPortOut->getConnectPnt());
- QRect aLastRect(QPoint(QMIN(aPrevPnt.x(), aLastPnt.x()),
- QMIN(aPrevPnt.y(), aLastPnt.y())),
- QPoint(QMAX(aPrevPnt.x(), aLastPnt.x()),
- QMAX(aPrevPnt.y(), aLastPnt.y())));
- if (aRect.intersects(aLastRect))
- return true;
-
- return false;
-}
-
-
-//**********************************************************************
-/**
- * Calculates distance between points
- */
-int distance(int x1, int y1, int x2, int y2) {
- int x = x2 - x1;
- x = x * x;
- int y = y2 - y1;
- y = y * y;
- return (int) sqrt((double)(x + y));
-}
-
-
-//**********************************************************************
-/**
- * Finds distance between thePnt and line(thePntLn1, thePntLn2)
- * Returned value is not an mathematical value - this is only estimation of
- * of closing point to the line. 0 - means that point belongs to the line
- */
-int distance(QPoint thePnt, QPoint thePntLn1, QPoint thePntLn2) {
- int r, s;
- int a, b, c;
-
- int px = thePnt.x();
- int py = thePnt.y();
- int lx = thePntLn1.x();
- int ly = thePntLn1.y();
- int nx = thePntLn2.x();
- int ny = thePntLn2.y();
-
- r = px - lx;
- r = r * r;
- s = py - ly;
- s = s * s;
- a = (int) sqrt((double)(r + s));
-
- r = px - nx;
- r = r * r;
- s = py - ny;
- s = s * s;
- b = (int) sqrt((double)(r + s));
-
- r = nx - lx;
- r = r * r;
- s = ny - ly;
- s = s * s;
- c = (int) sqrt((double)(r + s));
-
- return (a+b-c);
-}
-
-void SUPERVGUI_Link::setBeginPort(SUPERVGUI_Port* theBeginPort) {
- myBeginPort = theBeginPort;
-}
-
-SUPERVGUI_Port* SUPERVGUI_Link::getBeginPort() {
- return myBeginPort;
-}
-
-
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_Link.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Link_H
-#define SUPERVGUI_Link_H
-
-using namespace std;
-
-#include "SUPERVGUI_Def.h"
-#include "SUPERVGUI_Port.h"
-//_CS_PhB BUG QT erreur de compilation #include <qvaluevector.h>
-#include <vector.h>
-
-class SUPERVGUI_Graph;
-
-int distance(int x1, int y1, int x2, int y2);
-int distance(QPoint thePnt, QPoint thePntLn1, QPoint thePntLn2);
-
-
-class SUPERVGUI_Link: public QObject {
- Q_OBJECT
-
-public:
- SUPERVGUI_Link(SUPERVGUI_Graph* theGraph, SUPERV_Link theLink=0);
-
- virtual ~SUPERVGUI_Link();
-
- void setBeginPort(SUPERVGUI_Port* theBeginPort);
- SUPERVGUI_Port* getBeginPort();
-
- void setInputPort(SUPERVGUI_PortIn* thePortIn);
- SUPERVGUI_PortIn* getInputPort()
- { return myPortIn; };
-
- void setInputPortES(SUPERVGUI_PortInESNode* thePortInES);
- SUPERVGUI_PortInESNode* getInputPortES()
- { return myPortInES; };
-
- bool isESInputPort();
-
- void destroyEngine();
-
- void setOutputPort(SUPERVGUI_PortOut* thePortOut);
- SUPERVGUI_PortOut* getOutputPort()
- { return myPortOut; };
-
- void addPoint(long theX, long theY);
- void removeLastPoint();
-
- void repaint();
- void paint(bool toErase);
- void paint(QPainter* thePainter, bool toErase);
- void drawLink(QPainter* thePainter);
-
- bool isInRect(int theX, int theY, int theW, int theH);
-
- SUPERV_Link getEngineLink()
- { return myEngine; };
-
- void drawTo(QPoint thePnt);
- void abortCreation();
-
- void repaintSketch();
- void addTmpPoint(QPoint thePnt);
- void delLastTmpPoint();
-
- bool isCreationComplete();
- bool createEngine();
-
- bool isSelected()
- { return myIsSelected; };
-
- bool haveSelectedPoint()
- { return (myHltPnt > -1); };
-
- int getSelectedPoint()
- { return myHltPnt; };
-
- void removePoint(int thePnt);
-
- void setVisible(bool theVisible);
-
- static void setOrthoMode(bool theIsOrtho)
- { OrthoMode = theIsOrtho; };
-
- static bool isOrthoMode()
- { return OrthoMode; };
-
- static SUPERVGUI_Link* getSelectedLink()
- { return SelectedLink; };
-
-signals:
- void linkDeleted(SUPERVGUI_Link*);
-
-public slots:
- void onMouseMove(QMouseEvent* theEvent);
- void onMousePress(QMouseEvent* theEvent);
- void onMouseRelease(QMouseEvent* theEvent);
-
-
-private:
- void connectToEvents();
- bool isSelected(QPoint thePnt);
-
-
- SUPERVGUI_Graph* myGraph;
- SUPERVGUI_Port* myBeginPort;
- SUPERVGUI_PortIn* myPortIn;
- SUPERVGUI_PortInESNode* myPortInES;
- SUPERVGUI_PortOut* myPortOut;
-
- SUPERV_Link myEngine;
-
- QPoint myPrevPoint; // used for sketching only
- //_CS_PhB BUG QT erreur de compilation QValueVector<QPoint> myTmpPoints;
- vector<QPoint> myTmpPoints;
-
- SUPERVGUI_Port* myStartPort;
-
- QPen myTmpPen;
-
- // Points highlighting management
- int myHltPnt; // number of point or -1
-
- // Points moving management
- void drawSegments();
- bool myPntMovingState;
- QPoint myBeforePnt, myMovedPnt, myAfterPnt;
- QPainter* myPainter;
-
- // Selection of Link
- bool myIsSelected;
-
- bool myIsVisible;
-
- static bool OrthoMode;
- static bool LinkIsMoving;
- static SUPERVGUI_Link* SelectedLink;
-};
-
-#endif
// Module : SUPERV
using namespace std;
+
#include "QAD_Splitter.h"
#include "QAD_LeftFrame.h"
#include "QAD_ObjectBrowser.h"
#include "QAD_Message.h"
#include "QAD_FileDlg.h"
#include "QAD_Application.h"
-#include "SUPERVGUI_Def.h"
#include "QAD_RightFrame.h"
+#include "QAD_SpinBoxDbl.h"
+
+#include "NOTIFICATION.hxx"
#include "SALOME_Event.hxx"
+#include "SALOMEGUI_ImportOperation.h"
#include "SUPERVGraph_ViewFrame.h"
-#include <qlayout.h>
-#include <qfile.h>
-#include "SUPERVGUI_Main.h"
+
#include "SUPERVGUI.h"
-#include "SUPERVGUI_ComputeNode.h"
-#include "SUPERVGUI_ControlNode.h"
-#include "NOTIFICATION.hxx"
+#include "SUPERVGUI_Def.h"
+#include "SUPERVGUI_Main.h"
#include "SUPERVGUI_Notification.h"
-#include "SALOMEGUI_ImportOperation.h"
#include "SUPERVGUI_Information.h"
#include "SUPERVGUI_CanvasControlNode.h"
-#include <qvalidator.h>
-/*
-asv 20.10.04: removed 2 SUPERVGUI_Main constructors. there is only ONE way
-to create a Main object now: with a non-null DataFlow as a 3d parameter
-SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, bool fromIOR)
- : SUPERVGraph_View(theParent),
- myLogged( false ),
- myFiltered( false ),
- myLogFileName( QString::null ),
- myLogFile( NULL ),
- myWarning( false ),
- myStep( false ),
- myTrace( false ),
- myVerbose( false )
-{
- Trace("SUPERVGUI_Main::SUPERVGUI_Main (new)");
- theParent->setViewWidget(this);
- if (fromIOR) {
- //SUPERVGUI_Main* am = Supervision.getMain();
- QAD_ObjectBrowser* ob = ((QAD_StudyFrame*)(theDesktop->getMainFrame()->activeWindow()))->getLeftFrame()->getObjectBrowser();
- // if (am == 0) {
- // ob = ((QAD_StudyFrame*)(theDesktop->getMainFrame()->activeWindow()))->getLeftFrame()->getObjectBrowser();
- //} else {
- //ob = am->objectBrowser;
- //};
- QAD_ObjectBrowserItem* item = (QAD_ObjectBrowserItem*)(ob->getListView()->currentItem());
- SALOMEDS::SObject_var obj = theDesktop->getActiveStudy()->getStudyDocument()->FindObjectID(item->getEntry().latin1());
- SALOMEDS::GenericAttribute_var anAttr;
- if (obj->FindAttribute(anAttr, "AttributeIOR")) {
- SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
- Standard_CString ior = anIOR->Value();
- dataflow = Supervision.getEngine()->getStreamGraph(ior);
- if (SUPERV_isNull(dataflow)) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_ACCESS_BAD_IOR"));
- close();
- } else {
- init(theDesktop);
- }
- } else {
- QMessageBox::warning(0, tr("ERROR"), tr("MSG_NOACCESS_BY_IOR"));
- close();
- }
- } else {
- dataflow = Supervision.getEngine()->StreamGraph(MAIN_NEW);
- if (SUPERV_isNull(dataflow)) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_DF"));
- close();
- } else {
- init(theDesktop);
- }
- }
-}
+#include <qvalidator.h>
+#include <qlayout.h>
+#include <qfile.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
-SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, bool isModify, const char* f)
- : SUPERVGraph_View(theParent),
- myLogged( false ),
- myFiltered( false ),
- myLogFileName( QString::null ),
- myLogFile( NULL ),
- myWarning( false ),
- myStep( false ),
- myTrace( false ),
- myVerbose( false )
-{
- Trace("SUPERVGUI_Main::SUPERVGUI_Main (file)")
- theParent->setViewWidget(this);
- if (isModify) {
- dataflow = Supervision.getEngine()->StreamGraph(f);
- } else {
- dataflow = Supervision.getEngine()->StreamGraphE(f);
- }
- if (SUPERV_isNull(dataflow)) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_FILE").arg(f));
- close();
- } else {
- init(theDesktop);
- }
-}
-*/
SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* theDesktop, SUPERV_Graph theDataFlow )
: SUPERVGraph_View(theParent),
myThread = new SUPERVGUI_Thread();
myThread->setMain(this);
- myIsKilled = false;
myCurrentView = CANVAS;
myIsFromStudy = false;
myLastGraph = 0;
objectBrowser = study->getActiveStudyFrame()->getLeftFrame()->getObjectBrowser();
-
- graph = new SUPERVGUI_Graph(this);
- graph->hide();
- array = new SUPERVGUI_Array(this);
+ myArray = new SUPERVGUI_CanvasArray(this);
+ myArrayView = new SUPERVGUI_ArrayView(myArray, this);
myCanvas = new SUPERVGUI_Canvas(this);
myCanvasView = new SUPERVGUI_CanvasView(myCanvas, this);
QBoxLayout * layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
- layout->addWidget(graph);
- layout->addWidget(array);
layout->addWidget(myCanvasView);
+ layout->addWidget(myArrayView);
if (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
myCanvas->merge();
}
+
sync();
show();
if ( myLogged && !myLogFileName.isEmpty() && QFile::exists( myLogFileName ) ) {
if ( myLogFile != NULL) {
fclose( myLogFile );
}
- graph->removeLinks();
- //delete myCanvas;
+
// delete notification; // kloss : nota bene : quand un datalow est detruit : verifier que les canaux de notification sont aussi detruit
notification->_remove_ref(); // kloss : nota bene : quand un datalow est detruit : verifier que les canaux de notification sont aussi detruit
delete myCanvas;
+ delete myArray;
}
void SUPERVGUI_Main::filterNotification() {
}
}
-void SUPERVGUI_Main::changeDSGraphParameters() {
- SUPERVGUI_DSGraphParameters* aDlg = new SUPERVGUI_DSGraphParameters(dataflow, dataflow->IsReadOnly());
- if (aDlg->exec() )
- sync();
- delete aDlg;
-}
-
void SUPERVGUI_Main::syncAsync() {
- Trace("SUPERVGUI_Main::syncAsync")
+ Trace("SUPERVGUI_Main::syncAsync");
QTimer::singleShot(1, this, SLOT(sync()));
}
-/**
+/**
* Called by thread when dataflow is executing
*/
void SUPERVGUI_Main::execute(char * theNodeName, SUPERV::GraphState theNodeState) {
if (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
SUPERVGUI_CanvasNode* aNode = (SUPERVGUI_CanvasNode*) myCanvas->child(theNodeName, "SUPERVGUI_CanvasNode");
- if (aNode) aNode->sync();
- }
- else {
- SUPERVGUI_Node* aNodePrs;
- SUPERVGUI_GraphNode* aGraphNodePrs;
- if (myCurrentView == TABLE) {
- aNodePrs = (SUPERVGUI_Node*) array->child(theNodeName, "SUPERVGUI_Node");
- aGraphNodePrs = (SUPERVGUI_GraphNode*) array->child(theNodeName, "SUPERVGUI_GraphNode");
- } else {
- aNodePrs = (SUPERVGUI_Node*) graph->child(theNodeName, "SUPERVGUI_Node");
- aGraphNodePrs = (SUPERVGUI_GraphNode*) graph->child(theNodeName, "SUPERVGUI_GraphNode");
- }
- if (aGraphNodePrs) {
- aGraphNodePrs->sync();
- }
- else if (aNodePrs) {
- aNodePrs->syncOnEvent(theNodeState);
+ if ( aNode ) {
+ aNode->sync();
}
}
+ else if (myCurrentView == CANVASTABLE) {
+ SUPERVGUI_CanvasCellNode* aNode = (SUPERVGUI_CanvasCellNode*) myArray->child(theNodeName, "SUPERVGUI_CanvasCellNode");
+ if (aNode) aNode->sync();
+ }
}
void SUPERVGUI_Main::sync() {
- Trace("SUPERVGUI_Main::sync")
- if ((SUPERV_isNull(dataflow))) return;
- QString t = tr("GRAPH_TITLE");
-
- t += dataflow->Name();
- setCaption(t);
-
- study->updateObjBrowser();
- if (myCurrentView == TABLE) {
- array->sync();
- } else if (myCurrentView == GRAPH) {
- graph->sync();
- } else {
- myCanvas->sync();
- myCanvas->update();
- }
-}
-
-
-void SUPERVGUI_Main::showTable() {
- if (myCurrentView == TABLE) return;
+ Trace("SUPERVGUI_Main::sync");
+ if ((SUPERV_isNull(dataflow)))
+ return;
+ QString t = tr("GRAPH_TITLE");
+
+ t += dataflow->Name();
+ setCaption(t);
- if (array->create()) {
- if (myCurrentView == GRAPH)
- graph->hide();
- else
- myCanvasView->hide();
- myCurrentView = TABLE;
+ study->updateObjBrowser();
+ if (myCurrentView == CANVASTABLE) {
+ myArray->sync();
+ myArray->update();
+ } else {
+ myCanvas->sync();
+ myCanvas->update();
}
- sync();
}
+void SUPERVGUI_Main::showCanvasTable() {
+ if (myCurrentView == CANVASTABLE)
+ return;
-void SUPERVGUI_Main::showFullGraph() {
- if (myCurrentView == TABLE) {
- array->destroy();
- graph->show();
- }
- else if (myCurrentView != GRAPH) { // (myCurrentView == CANVAS) {
+ if (myArray->create()) {
myCanvasView->hide();
- graph->show();
+ myArrayView->show();
+ myCurrentView = CANVASTABLE;
}
- myCurrentView = GRAPH;
- graph->sync();
- graph->setFullView();
+ sync();
}
-
void SUPERVGUI_Main::showContolFlow() {
bool merge = false;
- if (myCurrentView == TABLE) {
- array->destroy();
- merge = true;
- }
- else if (myCurrentView == GRAPH) {
- graph->hide();
+ if (myCurrentView == CANVASTABLE) {
+ myArrayView->hide();
+ myArray->destroy();
merge = true;
}
myCurrentView = CONTROLFLOW;
}
void SUPERVGUI_Main::showCanvas() {
- if (myCurrentView == CANVAS) return;
+ if (myCurrentView == CANVAS)
+ return;
bool merge = false;
- if (myCurrentView == TABLE) {
- array->destroy();
- merge = true;
- }
- else if (myCurrentView == GRAPH) {
- graph->hide();
+ if (myCurrentView == CANVASTABLE) {
+ myArrayView->hide();
+ myArray->destroy();
merge = true;
}
myCurrentView = CANVAS;
}
}
-
-bool SUPERVGUI_Main::exportDataflow(QString theFile) {
- Trace("SUPERVGUI_Main::exportDataflow");
- if ((SUPERV_isNull(dataflow))) return false;
-
- if (!theFile.isEmpty()) {
- if (!dataflow->Export(theFile.latin1())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_WRITING"));
- return false;
- }
- }
- return true;
-}
-
void SUPERVGUI_Main::insertFile() {
- Trace("SUPERVGUI_Main::insertFile")
+ Trace("SUPERVGUI_Main::insertFile");
if ((SUPERV_isNull(dataflow))) return;
+ Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
QString f = QAD_FileDlg::getFileName(QAD_Application::getDesktop(),
"",
"*.xml",
tr("MSG_GRAPH_INSERT"),
true);
if (!f.isEmpty()) {
- if (dataflow->Import(f.latin1())) {
- if (myCurrentView == TABLE) {
- array->destroy();
- array->create();
- }
- else if (myCurrentView != GRAPH) { // (myCurrentView == CANVAS) {
- myCanvas->merge();
- }
- sync();
- } else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_FILE").arg(f));
- };
- };
+ if (dataflow->Import(f.latin1())) {
+ if (myCurrentView == CANVASTABLE) {
+ myArray->destroy();
+ myArray->create();
+ }
+ else { // (myCurrentView == CANVAS || myCurrentView == CONTROLFLOW) {
+ myCanvas->merge();
+ }
+ sync();
+ } else {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_BAD_FILE").arg(f));
+ }
+ }
}
void SUPERVGUI_Main::copy() {
}
void SUPERVGUI_Main::run() {
- Trace("SUPERVGUI_Main::run")
+ Trace("SUPERVGUI_Main::run");
if ((SUPERV_isNull(dataflow))) return;
if (dataflow->IsEditing()) {
if (!dataflow->IsValid()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTVALID"));
- } else if (!dataflow->IsExecutable()) {
+ }
+ else if (!dataflow->IsExecutable()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE"));
- } else if (graph->isAnyLinkCreating() || myCanvasView->isAnyLinkCreating()) {
+ }
+ else if (myCanvasView->isAnyLinkCreating()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CRL_NOTCOMPLETE"));
- } else {
+ }
+ else {
myRunTime = QDateTime::currentDateTime();
- if (myIsKilled) {
- //if (myIsRunned) {
- if (!dataflow->ReRun()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
- if (dataflow->State() == SUPERV::ErrorState) {
- kill();
- }
- } else {
- myThread->startThread(tr("MSG_GRAPH_STARTED"));
- //sync();
- }
- } else {
- if (!dataflow->Run()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
- if (dataflow->State() == SUPERV::ErrorState) {
- kill();
- }
- } else {
- myThread->startThread(tr("MSG_GRAPH_STARTED"));
- //sync();
+ if ( !dataflow->Run() ) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
+ if ( dataflow->State() == SUPERV::ErrorState ) {
+ kill();
}
+ }
+ else {
+ myThread->startThread(tr("MSG_GRAPH_STARTED"));
}
}
- } else {
+ }
+ else {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_RUNNING"));
}
}
void SUPERVGUI_Main::startExecute() {
- Trace("SUPERVGUI_Main::startExecute")
+ Trace("SUPERVGUI_Main::startExecute");
if ((SUPERV_isNull(dataflow))) return;
if (dataflow->IsEditing()) {
if (!dataflow->IsValid()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTVALID"));
- } else if (!dataflow->IsExecutable()) {
+ }
+ else if (!dataflow->IsExecutable()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTEXECUTABLE"));
- } else if (graph->isAnyLinkCreating() || myCanvasView->isAnyLinkCreating()) {
+ }
+ else if (myCanvasView->isAnyLinkCreating()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CRL_NOTCOMPLETE"));
- } else {
+ }
+ else {
myRunTime = QDateTime::currentDateTime();
- if (myIsKilled) {
- //if (myIsRunned) {
- if (!dataflow->ReStart()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
- } else {
- myThread->startThread(tr("MSG_GRAPH_STARTED"));
- }
- }
+ if (!dataflow->Start()) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
+ }
else {
- if (!dataflow->Start()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_BADEXECUTE"));
- } else {
- myThread->startThread(tr("MSG_GRAPH_STARTED"));
- }
+ myThread->startThread(tr("MSG_GRAPH_STARTED"));
}
}
- } else {
+ }
+ else {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_RUNNING"));
}
}
void SUPERVGUI_Main::kill() {
- Trace("SUPERVGUI_Main::kill")
- if ((SUPERV_isNull(dataflow))) return;
+ Trace("SUPERVGUI_Main::kill");
+ if ((SUPERV_isNull(dataflow)))
+ return;
- if (dataflow->IsEditing()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTRUNNING"));
- } else if (dataflow->Kill()) {
- myIsKilled = true;
- myThread->stopThread(tr("MSG_GRAPH_KILLED"));
- sync();
- } else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANTKILL_DF"));
- }
+ if (dataflow->IsEditing()) {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_DF_NOTRUNNING"));
+ }
+ else if (dataflow->Kill()) {
+ myThread->stopThread(tr("MSG_GRAPH_KILLED"));
+ sync();
+ }
+ else {
+ QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANTKILL_DF"));
+ }
}
void SUPERVGUI_Main::suspendResume() {
- Trace("SUPERVGUI_Main::suspendResume")
+ Trace("SUPERVGUI_Main::suspendResume");
if ((SUPERV_isNull(dataflow))) return;
if (dataflow->IsEditing()) {
}
}
}
-
+/* asv : 15.12.04 : commented out stopRestart() in Main and CanvasNode because it's not called from anywhere,
+ the comment from kloss below may be explaining it, but it's in French and I do not understand it..
+ It also calls deprecated method of Engine: ReStart().
void SUPERVGUI_Main::stopRestart() { // kloss : a reviser et a connecter dans le popup du dataflow (pas de creation de bouton)
- Trace("SUPERVGUI_Main::stopRestart")
+ Trace("SUPERVGUI_Main::stopRestart");
if ((SUPERV_isNull(dataflow))) return;
if (dataflow->IsEditing()) {
};
};
}
-
+*/
void SUPERVGUI_Main::addNode() {
Trace("SUPERVGUI_Main::addNode");
if (SUPERV_isNull(dataflow)) return;
kill();
}
}
+
+ Editing(); // PAL6170: GUI->Engine: setting "Editing" flag
+
Supervision.getBrowser()->choose();
}
* Add Computation node
*/
void SUPERVGUI_Main::addComputeNode(SUPERV_CNode theNode) {
- //cout<<"### X="<<theNode->X()<<" Y="<<theNode->Y()<<endl;
switch (myCurrentView) {
- case GRAPH:
- {
- SUPERVGUI_Node* aNode = new SUPERVGUI_ComputeNode(graph->viewport(), this, theNode);
- graph->ResizeGraph(aNode, theNode->X(), theNode->Y());
- graph->addChild(aNode, theNode->X(), theNode->Y());
- aNode->sync();
- }
- break;
- case TABLE:
- array->destroy();
- array->create();
- break;
+ case CANVASTABLE:
+ myArray->destroy();
+ myArray->create();
+ break;
case CANVAS:
case CONTROLFLOW:
{
*/
void SUPERVGUI_Main::addGOTONode(SUPERV_CNode theNode) {
switch (myCurrentView) {
- case GRAPH:
- {
- SUPERVGUI_Node* aNode = new SUPERVGUI_GotoNode(graph->viewport(), this, theNode);
- graph->ResizeGraph(aNode, theNode->X(), theNode->Y());
- graph->addChild(aNode, theNode->X(), theNode->Y());
- aNode->sync();
- }
- break;
- case TABLE:
- array->destroy();
- array->create();
+ case CANVASTABLE:
+ myArray->destroy();
+ myArray->create();
break;
case CANVAS:
case CONTROLFLOW:
*/
void SUPERVGUI_Main::addControlNode(SUPERV_CNode theStartNode, SUPERV_CNode theEndNode, bool Update) {
switch (myCurrentView) {
- case GRAPH:
- {
- SUPERVGUI_StartControlNode* aStartPrs =
- new SUPERVGUI_StartControlNode(graph->viewport(), this, theStartNode);
- SUPERVGUI_EndControlNode* aEndPrs =
- new SUPERVGUI_EndControlNode(graph->viewport(), this, theEndNode, aStartPrs);
-
- graph->ResizeGraph(aStartPrs, theStartNode->X(), theStartNode->Y());
- graph->addChild(aStartPrs, theStartNode->X(), theStartNode->Y());
- graph->ResizeGraph(aEndPrs, theEndNode->X(), theEndNode->Y());
- graph->addChild(aEndPrs, theEndNode->X(), theEndNode->Y());
- if (Update) {
- aStartPrs->updateLinksPrs();
- aEndPrs->updateLinksPrs();
- }
- aStartPrs->sync();
- aEndPrs->sync();
- graph->repaintContents();
- }
- break;
- case TABLE:
- array->destroy();
- array->create();
+ case CANVASTABLE:
+ myArray->destroy();
+ myArray->create();
break;
case CANVAS:
case CONTROLFLOW:
* Add Macro node
*/
void SUPERVGUI_Main::addMacroNode(SUPERV_CNode theNode) {
- //cout<<"### X="<<theNode->X()<<" Y="<<theNode->Y()<<endl;
switch (myCurrentView) {
- case GRAPH:
- {
- SUPERVGUI_Node* aNode = new SUPERVGUI_ComputeNode(graph->viewport(), this, theNode);
- graph->ResizeGraph(aNode, theNode->X(), theNode->Y());
- graph->addChild(aNode, theNode->X(), theNode->Y());
- aNode->sync();
- }
- break;
- case TABLE:
- array->destroy();
- array->create();
+ case CANVASTABLE:
+ myArray->destroy();
+ myArray->create();
break;
case CANVAS:
case CONTROLFLOW:
}
}
-
-SUPERVGUI_Graph* SUPERVGUI_Main::getGraph() {
- Trace("SUPERVGUI_Main::getGraph")
- return(graph);
+SUPERVGUI_CanvasArray* SUPERVGUI_Main::getCanvasArray() {
+ Trace("SUPERVGUI_Main::getCanvasArray");
+ return(myArray);
}
-SUPERVGUI_Array* SUPERVGUI_Main::getArray() {
- Trace("SUPERVGUI_Main::getArray")
- return(array);
+SUPERVGUI_ArrayView* SUPERVGUI_Main::getArrayView() {
+ Trace("SUPERVGUI_Main::getArrayView");
+ return(myArrayView);
}
SUPERVGUI_Canvas* SUPERVGUI_Main::getCanvas() {
- Trace("SUPERVGUI_Main::getCanvas")
- return(myCanvas);
+ Trace("SUPERVGUI_Main::getCanvas");
+ return(myCanvas);
}
SUPERVGUI_CanvasView* SUPERVGUI_Main::getCanvasView() {
- Trace("SUPERVGUI_Main::getCanvasView")
- return(myCanvasView);
+ Trace("SUPERVGUI_Main::getCanvasView");
+ return(myCanvasView);
}
SUPERV_Graph SUPERVGUI_Main::getDataflow() {
- Trace("SUPERVGUI_Main::getDataflow")
- return(dataflow);
+ Trace("SUPERVGUI_Main::getDataflow");
+ return(dataflow);
}
QAD_Message* SUPERVGUI_Main::getMessage() {
- Trace("SUPERVGUI_Main::getMessage")
- return(message);
+ Trace("SUPERVGUI_Main::getMessage");
+ return(message);
}
QAD_Study* SUPERVGUI_Main::getStudy() {
- Trace("SUPERVGUI_Main::getStudy")
- return(study);
+ Trace("SUPERVGUI_Main::getStudy");
+ return(study);
}
bool SUPERVGUI_Main::isArrayShown() {
- Trace("SUPERVGUI_Main::isArrayShown")
- return(myCurrentView == TABLE);
+ Trace("SUPERVGUI_Main::isArrayShown");
+ return(myCurrentView == CANVASTABLE);
}
void SUPERVGUI_Main::showPopup(QPopupMenu* p, QMouseEvent* e) {
if (aDlg->exec() )
sync();
delete aDlg;
- /* Trace("SUPERVGUI_Main::changeInformation")
- if (Supervision.information(SUPERV::CNode::_narrow(dataflow), dataflow->IsReadOnly())) {
- sync();
- }*/
}
// returns false, if can't add dataflow into the study
if (aComponent->_is_nil()) { // is supervision component not found, then create it
QAD_Operation* anOperation = new SALOMEGUI_ImportOperation( study );
anOperation->start();
+ //if (aLocked) aStudy->GetProperties()->SetLocked(false);
aComponent = aBuilder->NewComponent(STUDY_SUPERVISION);
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_Supervision" );
aBuilder->DefineComponentInstance(aComponent, Supervision.getEngine());
+ //if (aLocked) aStudy->GetProperties()->SetLocked(true);
anOperation->finish();
}
op->start();
anIORAttr = SALOMEDS::AttributeIOR::_narrow(anAttr);
anIORAttr->SetValue(dataflow->getIOR());
op->finish();
+ //if (aLocked) return false;
}
sync();
void SUPERVGUI_Main::chooseData(QListViewItem* item) {
- Trace("SUPERVGUI_Main::chooseData")
+ Trace("SUPERVGUI_Main::chooseData");
if (choosing) {
QString id = ((QAD_ObjectBrowserItem*)item)->getEntry();
if (!id.isEmpty()) {
if (object->FindAttribute(anAttr, "AttributeIOR")) {
anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
ior = anIOR->Value();
- portIn->setValue(ior);
+
+ // asv : 13.12.04 : commented out use of portIn field, but it seems that it
+ // should be replaced with some analogious code... selection of IOR was done -
+ // put its value into port.
+ //portIn->setValue(ior);
// stop selection
choosing = false;
}
}
-void SUPERVGUI_Main::setData(SUPERVGUI_PortIn* p) {
- Trace("SUPERVGUI_Main::setData")
- portIn = p;
- choosing = true;
- setCursor(forbiddenCursor);
- objectBrowser->setCursor(pointingHandCursor);
- Supervision.putInfo(tr("MSG_CHOOSE_DATA"));
-}
-
SALOMEDS::SObject_var SearchOrCreateSOWithName(const SALOMEDS::Study_var theStudy,
const SALOMEDS::SObject_var theSO,
const char* theName,
SALOMEDS::SComponent_ptr aComponent = aStudy->FindComponent(STUDY_SUPERVISION);
if (aComponent->_is_nil()) { // is supervision component not found, then create it
aBuilder->NewCommand();
+ //if (aLocked) aStudy->GetProperties()->SetLocked(false);
aComponent = aBuilder->NewComponent(STUDY_SUPERVISION);
anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributeName");
aName = SALOMEDS::AttributeName::_narrow(anAttr);
aPixmap = SALOMEDS::AttributePixMap::_narrow(anAttr);
aPixmap->SetPixMap( "ICON_OBJBROWSER_Supervision" );
aBuilder->DefineComponentInstance(aComponent, Supervision.getEngine());
+ //if (aLocked) aStudy->GetProperties()->SetLocked(true);
aBuilder->CommitCommand();
}
aTransaction = true;
aTransaction = true;
aBuilder->NewCommand();
}
- aTmpSO = aDriver->PublishInStudy(aStudy, aTmpSO, anObject, "");
+ aTmpSO = aDriver->PublishInStudy(aStudy, aTmpSO, anObject, /*anObject->Name()*/"");
aBuilder->Addreference(aSO, aTmpSO);
} else { // can't publish object: abort transaction
if (aTransaction) aBuilder->AbortCommand();
void SUPERVGUI_Main::ActivatePanning()
{
- if (graph->isVisible()) {
- graph->ActivatePanning();
- } else if (array->isVisible()) {
- array->ActivatePanning();
- } else if (myCanvasView->isVisible()) {
+ if (myCanvasView->isVisible()) {
myCanvasView->ActivatePanning();
+ } else if (myArrayView->isVisible()) {
+ myArrayView->ActivatePanning();
}
}
void SUPERVGUI_Main::ResetView()
{
- if (graph->isVisible()) {
- graph->ResetView();
- } else if (array->isVisible()) {
- array->ResetView();
- } else if (myCanvasView->isVisible()) {
+ if (myCanvasView->isVisible()) {
myCanvasView->ResetView();
+ } else if (myArrayView->isVisible()) {
+ myArrayView->ResetView();
}
}
void SUPERVGUI_Main::setAsFromStudy(bool theToStudy) {
myIsFromStudy = theToStudy;
- graph->setAsFromStudy(theToStudy);
- array->setAsFromStudy(theToStudy);
myCanvas->setAsFromStudy(theToStudy);
}
Trace("SUPERVGUI_Main::isFiltered");
bool b = false;
if (strcmp(getDataflow()->Name(), graph) == 0) {
- SUPERVGUI_Node* n;
- QObjectList* nodes = queryList("SUPERVGUI_Node");
+ SUPERVGUI_CanvasNode* n;
+ QObjectList* nodes = queryList("SUPERVGUI_CanvasNode");
QObjectListIt i(*nodes);
- while ((n=(SUPERVGUI_Node*)i.current()) != 0) {
+ while ((n=(SUPERVGUI_CanvasNode*)i.current()) != 0) {
++i;
if (strcmp(n->name(), node) == 0) {
if (strcmp(type, NOTIF_WARNING) == 0) {
void SUPERVGUI_Main::setPaletteBackgroundColor(const QColor& color) {
- array->setPaletteBackgroundColor(color);
- graph->setPaletteBackgroundColor(color);
myCanvas->setBackgroundColor(color);
myCanvasView->setPaletteBackgroundColor(color.light());
+ myArray->setBackgroundColor(color);
+ myArrayView->setPaletteBackgroundColor(color.light());
SUPERVGraph_View::setPaletteBackgroundColor(color);
}
void SUPERVGUI_Main::executionFinished() {
getStudy()->updateObjBrowser();
myCanvas->update();
+ myArray->update();
}
void SUPERVGUI_Main::checkExecution() {
}
}
+/**
+ * Editing() is to be called by any operation in GUI before modification of a datamodel
+ * (add/remove ports or nodes, etc.). It is used to resolve inconsistancies between 2 data models
+ * in Engine: Editor and Executor. During and after execution, the values of ports and statuses of nodes
+ * are taken from Executor data model. But when user starts editing the graph - these changes must
+ * be applied to Editor data model. This function destroys Executor data model and moves to Editor.
+ */
+void SUPERVGUI_Main::Editing() {
+ if ( !SUPERV_isNull( dataflow ) )
+ dataflow->Editing();
+
+ // updata GUI, Nodes' statuses and Ports' values could change.
+ sync();
+}
+
+void SUPERVGUI_Main::removeArrayChild(SUPERV::CNode_ptr theNode)
+{
+ // mkr: since the deletion of the node allow only in CANVAS view,
+ // it is necessary to remove the CanvasArray's children, which
+ // have the same CNode engine as deleting node. This CNode is given
+ // as argument
+ if (myArray) {
+ const QObjectList* aChList = myArray->children();
+ QObjectListIt aItChList(*aChList);
+ SUPERVGUI_CanvasNode* anObjNode;
+ while ((anObjNode = (SUPERVGUI_CanvasNode*)aItChList.current()) != 0) {
+ ++aItChList;
+ if ((QString(anObjNode->getEngine()->Name())).compare(QString(theNode->Name())) == 0) {
+ myArray->removeChild(anObjNode);
+ delete anObjNode;
+ }
+ }
+ }
+}
+
/******************************* SUPERVGUI_Thread class ****************************************/
SUPERVGUI_Thread::SUPERVGUI_Thread()
:QThread()
#ifndef SUPERVGUI_Main_H
#define SUPERVGUI_Main_H
-//#include "SUPERVGUI.h"
#include "SUPERVGraph_ViewFrame.h"
-#include "SUPERVGUI_Array.h"
-#include "SUPERVGUI_Graph.h"
#include "QAD_Desktop.h"
-#include "SUPERVGUI_Port.h"
#include "SUPERVGUI_Canvas.h"
#include "SUPERVGUI_CanvasView.h"
+#include "SUPERVGUI_ArrayView.h"
#include <qobject.h>
#include <qapplication.h>
class QAD_Study;
class QAD_ObjectBrowser;
class QAD_Message;
+class QAD_SpinBoxDbl;
+class QLineEdit;
+class QComboBox;
class NOTIFICATION_Consumer;
class SUPERVGUI_Thread;
friend class SUPERVGUI_Thread;
public:
- //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool fromIOR);
- //SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, bool isModify, const char* filename);
SUPERVGUI_Main(SUPERVGraph_ViewFrame*, QAD_Desktop*, SUPERV_Graph);
virtual ~SUPERVGUI_Main();
void startExecute();
void kill();
void suspendResume();
- void stopRestart();
- bool exportDataflow(QString theFile);
+ //void stopRestart();
void openSubGraph(SUPERV_CNode theNode, bool correct = false);
bool putDataStudy(SUPERV_Port port, const char* inout);
- void setData(SUPERVGUI_PortIn* p);
- SUPERVGUI_Graph* getGraph();
- SUPERVGUI_Array* getArray();
+ SUPERVGUI_CanvasArray* getCanvasArray();
+ SUPERVGUI_ArrayView* getArrayView();
SUPERVGUI_Canvas* getCanvas();
SUPERVGUI_CanvasView* getCanvasView();
SUPERV_Graph getDataflow();
void lockedGraph(bool theLock) { myIsLocked = theLock; }
bool isLocked() { return myIsLocked; }
- bool isKilled() { return myIsKilled; }
SUPERV::GraphState getNodeExecState();
void setNodeExecState(SUPERV::GraphState theNodeExecState);
bool IsGUIEventLoopFinished() const { return myGUIEventLoopFinished; }
+ void Editing(); // any Editing operation is to be performed ->
+ // activate Editors data model in Engine
+
+ void removeArrayChild(SUPERV::CNode_ptr theNode);
+
signals:
void KillMyThread(bool theValue);
void addNode();
void changeInformation();
void copy();
- void showTable();
- void showFullGraph();
+
+ void showCanvasTable();
void showContolFlow();
void showCanvas();
+
void filterNotification();
void changeDSGraphParameters();
void onSubGraphClosed(QAD_StudyFrame* );
QAD_Study* study;
QAD_ObjectBrowser* objectBrowser;
QAD_Message* message;
- SUPERVGUI_Graph* graph;
-
+
GraphViewType myCurrentView;
- SUPERVGUI_Array* array;
+ SUPERVGUI_CanvasArray* myArray;
+ SUPERVGUI_ArrayView* myArrayView;
SUPERVGUI_Canvas* myCanvas;
SUPERVGUI_CanvasView* myCanvasView;
bool choosing;
- SUPERVGUI_PortIn* portIn;
QString myHashCode;
bool myStep;
bool myTrace;
bool myVerbose;
- bool myIsKilled;
bool myIsLocked;
SUPERVGUI_Thread* myThread;
};
-//**************************************************************
+/**
+ * A dialog for setting Graph execution parameters
+ */
class SUPERVGUI_DSGraphParameters: public QDialog {
Q_OBJECT
void accept();
private:
-
+
void setData();
-
+
QAD_SpinBoxDbl* myDeltaTime;
QLineEdit* myTimeOut;
QComboBox* myDataStreamTrace;
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : SUPERVGUI_ManagePortsDlg.cxx
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+using namespace std;
+
+#include "SUPERVGUI_ManagePortsDlg.h"
+#include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI_CanvasPort.h"
+#include "SUPERVGUI_CanvasControlNode.h"
+#include "SUPERVGUI.h"
+
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qhbox.h>
+#include <qgroupbox.h>
+
+static const char* gTypes[] =
+ {"string", "boolean", "char", "short", "int", "long", "float", "double", "objref"};
+
+static const char* const add_pix_data[] = {
+"20 20 4 1",
+". c None",
+"b c #084818",
+"a c #186929",
+"# c #208541",
+"....................",
+"....................",
+"....................",
+"....................",
+"........##a.........",
+"........##b.........",
+"........##b.........",
+"........##b.........",
+"........##b.........",
+"...############a....",
+"...############b....",
+"...abbbb##bbbbbb....",
+"........##b.........",
+"........##b.........",
+"........##b.........",
+"........##b.........",
+"........abb.........",
+"....................",
+"....................",
+"...................."};
+
+static const char* const del_pix_data[] = {
+"16 16 3 1",
+". c None",
+"# c #800000",
+"a c #ffffff",
+"................",
+"................",
+".##a........##a.",
+".####a.....##a..",
+"..####a...##a...",
+"....###a.#a.....",
+".....#####a.....",
+"......###a......",
+".....#####a.....",
+"....###a.##a....",
+"...###a...##a...",
+"..###a.....#a...",
+"..###a......#a..",
+"...#a........#a.",
+"................",
+"................"};
+
+static const char* const up_pix_data[] = {
+"16 16 5 1",
+". c None",
+"# c #000000",
+"a c #838183",
+"c c #c5c2c5",
+"b c #ffffff",
+"................",
+"................",
+"........#.......",
+"......a#b#......",
+".....a#bbb#.....",
+"....a#bccbb#....",
+"...a#bccccbb#...",
+"..a####ccb####..",
+".aaaaa#ccb#.....",
+".....a#ccb#.....",
+".....a#ccb#.....",
+".....a#ccb#.....",
+".....a#ccb#.....",
+".....a#ccb#.....",
+".....a#####.....",
+"................"};
+
+static const char* const down_pix_data[] = {
+"16 16 5 1",
+". c None",
+"# c #000000",
+"a c #838183",
+"c c #c5c2c5",
+"b c #ffffff",
+"................",
+".....#####a.....",
+".....#bcc#a.....",
+".....#bcc#a.....",
+".....#bcc#a.....",
+".....#bcc#a.....",
+".....#bcc#a.....",
+".....#bcc#aaaaa.",
+"..####bcc####a..",
+"...#bbccccb#a...",
+"....#bbccb#a....",
+".....#bbb#a.....",
+"......#b#a......",
+".......#........",
+"................",
+"................"};
+
+
+/**
+ * Constructor
+ */
+SUPERVGUI_ManagePortsDlg::SUPERVGUI_ManagePortsDlg( SUPERVGUI_CanvasNode* theNode )
+ : QDialog( QAD_Application::getDesktop(), 0, false, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose )
+{
+ myNode = theNode;
+ myLastItem = 0;
+ init();
+}
+
+void SUPERVGUI_ManagePortsDlg::init()
+{
+ setName( "SUPERVGUI_ManagePortsDlg" );
+
+ SUPERV_CNode aCNode = myNode->getEngine();
+ setCaption( tr( "TIT_MANAGE_PORTS" ) + aCNode->Name() );
+
+ QGridLayout* aBaseLayout = new QGridLayout( this );
+ aBaseLayout->setMargin( 11 );
+ aBaseLayout->setSpacing( 6 );
+
+ // -- name and type upper line widgets --
+ QLabel* aNameLbl = new QLabel( tr( "NAME_LBL") , this );
+ myNameEdt = new QLineEdit( this );
+ QLabel* aTypeLbl = new QLabel( tr( "TYPE_LBL" ), this );
+ myTypeCombo = new QComboBox( false, this ); // input field not editable
+
+ aBaseLayout->addWidget( aNameLbl, 0, 0 );
+ aBaseLayout->addWidget( myNameEdt, 0, 1 );
+ aBaseLayout->addWidget( aTypeLbl, 0, 2 );
+ aBaseLayout->addWidget( myTypeCombo, 0, 3 );
+ aBaseLayout->setColStretch( 1, 1 );
+ aBaseLayout->setColStretch( 3, 1 );
+
+ // -- common Input/Output variables --
+ QPixmap adPix( (const char**) add_pix_data );
+ QPixmap rmPix( (const char**) del_pix_data );
+ QPixmap upPix( (const char**) up_pix_data );
+ QPixmap dnPix( (const char**) down_pix_data );
+
+ // -- Input ports group box --
+ QGroupBox* anInputGr = new QGroupBox( 1, Qt::Vertical, tr( "INPUT" ), this );
+ anInputGr->layout()->setSpacing( 6 );
+ anInputGr->layout()->setMargin( 11 );
+
+ myInList = new QListBox( anInputGr );
+ myInList->setSelectionMode( QListBox::Single );
+
+ QGroupBox* anInputBtnGr = new QGroupBox( 0, Qt::Vertical, anInputGr );
+ anInputBtnGr->setFrameStyle( QFrame::NoFrame );
+ anInputBtnGr->layout()->setSpacing( 0 );
+ anInputBtnGr->layout()->setMargin( 0 );
+
+ QVBoxLayout* anInputBtnLay = new QVBoxLayout( anInputBtnGr->layout() );
+ anInputBtnLay->layout()->setSpacing( 6 );
+ anInputBtnLay->layout()->setMargin( 0 );
+
+ QPushButton* anAddInputBtn = new QPushButton( anInputBtnGr );
+ anAddInputBtn->setPixmap( adPix );
+ QPushButton* aDeleteInputBtn = new QPushButton( anInputBtnGr );
+ aDeleteInputBtn->setPixmap( rmPix );
+ QPushButton* anUpInputBtn = new QPushButton( anInputBtnGr );
+ anUpInputBtn->setPixmap( upPix );
+ QPushButton* aDownInputBtn = new QPushButton( anInputBtnGr );
+ aDownInputBtn->setPixmap( dnPix );
+
+ connect( anAddInputBtn, SIGNAL( clicked() ), this, SLOT( addInput() ) );
+ connect( aDeleteInputBtn, SIGNAL( clicked() ), this, SLOT( removeInput() ) );
+ connect( anUpInputBtn, SIGNAL( clicked() ), this, SLOT( upInput() ) );
+ connect( aDownInputBtn, SIGNAL( clicked() ), this, SLOT( downInput() ) );
+
+ anInputBtnLay->addWidget( anAddInputBtn );
+ anInputBtnLay->addWidget( aDeleteInputBtn );
+ anInputBtnLay->addItem( new QSpacerItem( 1, 16, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ) );
+ anInputBtnLay->addWidget( anUpInputBtn );
+ anInputBtnLay->addWidget( aDownInputBtn );
+ anInputBtnLay->addItem( new QSpacerItem( 1, 16, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ) );
+
+ aBaseLayout->addMultiCellWidget( anInputGr, 1, 1, 0, 1 );
+
+ // -- Output ports group box --
+ QGroupBox* anOutputGr = new QGroupBox( 1, Qt::Vertical, tr( "OUTPUT" ), this );
+ anOutputGr->layout()->setSpacing( 6 );
+ anOutputGr->layout()->setMargin( 11 );
+
+ myOutList = new QListBox( anOutputGr );
+ myOutList->setSelectionMode( QListBox::Single );
+
+ QGroupBox* anOutputBtnGr = new QGroupBox( 0, Qt::Vertical, anOutputGr );
+ anOutputBtnGr->setFrameStyle( QFrame::NoFrame );
+ anOutputBtnGr->layout()->setSpacing( 0 );
+ anOutputBtnGr->layout()->setMargin( 0 );
+
+ QVBoxLayout* anOutputBtnLay = new QVBoxLayout( anOutputBtnGr->layout() );
+ anOutputBtnLay->layout()->setSpacing( 6 );
+ anOutputBtnLay->layout()->setMargin( 0 );
+
+ QPushButton* anAddOutputBtn = new QPushButton( anOutputBtnGr );
+ anAddOutputBtn->setPixmap( adPix );
+ QPushButton* aDeleteOutputBtn = new QPushButton( anOutputBtnGr );
+ aDeleteOutputBtn->setPixmap( rmPix );
+ QPushButton* anUpOutputBtn = new QPushButton( anOutputBtnGr );
+ anUpOutputBtn->setPixmap( upPix );
+ QPushButton* aDownOutputBtn = new QPushButton( anOutputBtnGr );
+ aDownOutputBtn->setPixmap( dnPix );
+
+ connect( anAddOutputBtn, SIGNAL( clicked() ), this, SLOT( addOutput() ) );
+ connect( aDeleteOutputBtn, SIGNAL( clicked() ), this, SLOT( removeOutput() ) );
+ connect( anUpOutputBtn, SIGNAL( clicked() ), this, SLOT( upOutput() ) );
+ connect( aDownOutputBtn, SIGNAL( clicked() ), this, SLOT( downOutput() ) );
+
+ anOutputBtnLay->addWidget( anAddOutputBtn );
+ anOutputBtnLay->addWidget( aDeleteOutputBtn );
+ anOutputBtnLay->addItem( new QSpacerItem( 1, 16, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ) );
+ anOutputBtnLay->addWidget( anUpOutputBtn );
+ anOutputBtnLay->addWidget( aDownOutputBtn );
+ anOutputBtnLay->addItem( new QSpacerItem( 1, 16, QSizePolicy::Maximum, QSizePolicy::MinimumExpanding ) );
+
+ aBaseLayout->addMultiCellWidget( anOutputGr, 1, 1, 2, 3 );
+
+ // -- Ok / Cancel buttons line at the bottom of dialog --
+ QGroupBox* aBtnBox = new QGroupBox( this );
+ aBtnBox->setColumnLayout( 0, Qt::Vertical );
+ aBtnBox->layout()->setSpacing( 0 );
+ aBtnBox->layout()->setMargin( 0 );
+
+ QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
+ aBtnLayout->setAlignment( Qt::AlignTop );
+ aBtnLayout->setSpacing( 6 );
+ aBtnLayout->setMargin( 11 );
+
+ QPushButton* aOkBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
+ QPushButton* aCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), aBtnBox );
+ connect( aOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
+ connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+
+ aBtnLayout->addWidget( aOkBtn );
+ aBtnLayout->addStretch();
+ aBtnLayout->addWidget( aCancelBtn );
+
+ aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 3 );
+ // -----------
+
+ connect( myInList,SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(itemChanged(QListBoxItem*)));
+ connect( myOutList, SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(itemChanged(QListBoxItem*)));
+ connect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+ connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&)));
+
+ myNode->getMain()->lockedGraph( true );
+
+ // asv : 11.01.05 : if a node is a loop node, then only INPUT ports can be added/removed
+ if ( myNode->getNodeType() == SUPERV::LoopNode ) {
+ myOutList->setEnabled( false );
+ anAddOutputBtn->setEnabled( false );
+ aDeleteOutputBtn->setEnabled( false );
+ anUpOutputBtn->setEnabled( false );
+ aDownOutputBtn->setEnabled( false );
+ }
+
+}
+
+/**
+ * Destructor
+ */
+SUPERVGUI_ManagePortsDlg::~SUPERVGUI_ManagePortsDlg() {
+}
+
+/**
+ * Set the ports as entered by user (order, name/type, etc.) and close the dialog
+ */
+void SUPERVGUI_ManagePortsDlg::accept() {
+ // 1. set the ports to Engine's CNode
+ SUPERV_INode aINode = myNode->getInlineNode();
+ if ( !SUPERV_isNull( aINode ) ) {
+ int i;
+ const bool isLoop = ( myNode->getNodeType() == SUPERV::LoopNode );
+
+ // 1.1 delete all ports (delete CanvasPorts, they delete SUPERV_Ports)
+ QObjectList* oldPorts = myNode->queryList("SUPERVGUI_CanvasPort");
+ QObjectListIt it( *oldPorts ); // iterate over the old ports
+ QObject *obj;
+
+ // asv : 11.01.05 : fix for a bug: for Loop node, removal of an Input Port
+ // automatically removes the corresponding Output Port. So for Loops the
+ // oldPorts list should be filtered to include only Input Ports.
+ // But I'll filter Gate-s as well..
+ QObjectList portsToRemove;
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ SUPERV::Port_var aPort = ((SUPERVGUI_CanvasPort*)obj)->getEngine();
+ if ( !aPort->IsGate() && ( !isLoop || aPort->IsInput() ) )
+ portsToRemove.append( obj );
+ }
+ delete oldPorts; // delete the list, not the objects
+
+ // portsToRemove list contains:
+ // for Loop node: all INPUT ports except Gates
+ // for other Inline: all INPUT and OUTPUT ports except Gates
+ it = QObjectListIt( portsToRemove );
+ while ( (obj = it.current()) != 0 ) {
+ ++it;
+ ((SUPERVGUI_CanvasPort*)obj)->remove();
+ }
+
+ // 1.2 create new ports in INode and CanvasPort in myNode
+ PortListItem* item;
+ SUPERV_Port aPort;
+ for ( i = 0; i < myInList->count(); i++ ) {
+ item = (PortListItem*)myInList->item( i );
+ aPort = aINode->InPort( item->PortName.latin1(), item->PortType.latin1() );
+ myNode->createPort( aPort.in() );
+ // asv : 11.01.05 : for Loop nodes do the same as in SUPERVGUI_CanvasStartNode::addInputPort()
+ if ( isLoop ) {
+ SUPERVGUI_CanvasStartNode* aStartLoopNode = (SUPERVGUI_CanvasStartNode*)myNode;
+ aStartLoopNode->merge();
+ aStartLoopNode->getCoupled()->merge();
+ }
+ }
+ // creating Out-ports, except LoopNode-s
+ for ( i = 0; i < myOutList->count() && !isLoop; i++ ) {
+ item = (PortListItem*)myOutList->item( i );
+ aPort = aINode->OutPort( item->PortName.latin1(), item->PortType.latin1() );
+ myNode->createPort( aPort.in() );
+ }
+
+ // 2. update the node's presentation
+ myNode->getMain()->getCanvas()->update();
+ }
+
+ // 3. close the dialog
+ myNode->getMain()->lockedGraph( false );
+ QDialog::accept();
+ close();
+}
+
+/**
+ * Simply close the dialog
+ */
+void SUPERVGUI_ManagePortsDlg::reject() {
+ myNode->getMain()->lockedGraph( false );
+ QDialog::reject();
+ close();
+}
+
+/**
+ * Update current values on show event
+ */
+void SUPERVGUI_ManagePortsDlg::showEvent( QShowEvent* theEvent ) {
+ init( myNode );
+ QDialog::showEvent( theEvent );
+}
+
+/**
+ * Initialize In/Out tables with values from the given node
+ */
+void SUPERVGUI_ManagePortsDlg::init( const SUPERVGUI_CanvasNode* theNode ) {
+ if ( !theNode ) {
+ MESSAGE("ERROR: SUPERVGUI_ManagePortsDlg: the CanvasNode is nil!");
+ return;
+ }
+
+ SUPERV_INode aINode = myNode->getInlineNode();
+ if ( SUPERV_isNull( aINode ) ) {
+ MESSAGE("ERROR: SUPERVGUI_ManagePortsDlg: the node of wrong type is found (not InLine node)!");
+ return;
+ }
+
+ // 1. fill myTypeCombo with all available types
+ myTypeCombo->insertStrList( gTypes );
+
+ // 2. fill Input and Output listboxes with Ports' names/types
+ QStringList aTypes;
+ SUPERV_Ports aPorts = aINode->Ports();
+ for ( int i=0; i < aPorts->length(); i++ ) {
+ if ( aPorts[i]->IsGate() )
+ continue;
+ if ( aPorts[i]->IsInput() )
+ new PortListItem( myInList, aPorts[i]->Name(), aPorts[i]->Type() );
+ else
+ new PortListItem( myOutList, aPorts[i]->Name(), aPorts[i]->Type() );
+ }
+}
+
+void SUPERVGUI_ManagePortsDlg::addPort( QListBox* theLB ) {
+ if ( !theLB )
+ return;
+ QString name = myNameEdt->text();
+ if ( !name.isNull() && name.length() ) {
+ bool found = false; // check if already exists -- and don't allow if yes
+ for ( int i = 0; i < theLB->count(); i++ ) {
+ if ( ((PortListItem*)theLB->item(i))->PortName == name ) {
+ found = true;
+ break;
+ }
+ }
+ if ( found )
+ QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+ else
+ new PortListItem( theLB, name, myTypeCombo->currentText() );
+ }
+}
+
+/**
+ * called on 'X' button press - remove selected port item
+ */
+void SUPERVGUI_ManagePortsDlg::removePort( QListBox* theLB ) {
+ if ( !theLB )
+ return;
+
+ const int i = theLB->currentItem();
+ if ( i >=0 )
+ delete theLB->item( i );
+}
+
+/**
+ * called on up/down key press - move the selected list box item from position 'from' to position 'to'
+ */
+void SUPERVGUI_ManagePortsDlg::moveItem( QListBox* theLB, const int from, const int to ) {
+ if ( !theLB )
+ return;
+
+ // disconnect itemChanged - it leads to crash if there was only 1 item left
+ disconnect( theLB, SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(itemChanged(QListBoxItem*)));
+
+ if ( from >= 0 && from < theLB->count() && to >=0 && to < theLB->count() ) {
+ QListBoxItem* item = theLB->item( from );
+ theLB->takeItem( item );
+ theLB->insertItem( item, to );
+ theLB->setCurrentItem( item );
+ theLB->setSelected( item, true );
+ }
+
+ // connect back..
+ connect( theLB, SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(itemChanged(QListBoxItem*)));
+}
+
+/**
+ * move the selected item UP
+ */
+void SUPERVGUI_ManagePortsDlg::moveUp( QListBox* theLB ) {
+ if ( !theLB )
+ return;
+ const int i = theLB->currentItem();
+ moveItem( theLB, i, i-1 );
+}
+
+/**
+ * move the selected item DOWN
+ */
+void SUPERVGUI_ManagePortsDlg::moveDown( QListBox* theLB ) {
+ if ( !theLB )
+ return;
+ const int i = theLB->currentItem();
+ moveItem( theLB, i, i+1 );
+}
+
+
+/**
+ * returns true if there is a current and selected item in the given listbox and it
+ * equals to the given item.
+ */
+bool isEditingItem( const QListBoxItem* item, const QListBox* theLB ) {
+ return item && item == theLB->item( theLB->currentItem() ) && theLB->isSelected( item );
+}
+
+/**
+ * called when name is changed. Tries to change name of the item, which was
+ * the last selected by user item in myInList or myOutList (myLastItem)
+ */
+void SUPERVGUI_ManagePortsDlg::nameChanged( const QString& name ) {
+ if ( isEditingItem( myLastItem, myInList ) || isEditingItem( myLastItem, myOutList ) ) {
+ ((PortListItem*)myLastItem)->PortName = name;
+ //myLastItem->listBox()->repaint( true );
+ // it would be much better to change the item and repaint it -- but -- repaint()
+ // is done only after a while, which is not good.. so -- "cheating" around
+ const int i = myLastItem->listBox()->index( myLastItem );
+ moveItem( myLastItem->listBox(), i, i );
+ }
+}
+
+/**
+ * called when type item in myTypeCombo is changed. Tries to change type
+ * of the last selected by user item in myInList or myOutList (myLastItem)
+ */
+void SUPERVGUI_ManagePortsDlg::typeChanged( const QString& type ) {
+ if ( isEditingItem( myLastItem, myInList ) || isEditingItem( myLastItem, myOutList ) ) {
+ ((PortListItem*)myLastItem)->PortType = type;
+ //myLastItem->listBox()->repaint( true );
+ // it would be much better to change the item and repaint it -- but -- repaint()
+ // is done only after a while, which is not good.. so -- "cheating" around
+ const int i = myLastItem->listBox()->index( myLastItem );
+ moveItem( myLastItem->listBox(), i, i );
+ }
+}
+
+/**
+ * called when new item became "currentItem" in any myInList or myOutList listboxes.
+ */
+void SUPERVGUI_ManagePortsDlg::itemChanged( QListBoxItem * item ) {
+ if ( !item ) // after remove, etc..
+ return;
+
+ // disable nameChanged, typeChanged callbacks
+ disconnect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+ disconnect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&)));
+
+ myLastItem = item;
+ myNameEdt->setText( ((PortListItem*)item)->PortName );
+ for ( int i = 0; i < myTypeCombo->count(); i++ )
+ if ( myTypeCombo->text( i ) == ((PortListItem*)item)->PortType ) {
+ myTypeCombo->setCurrentItem( i );
+ break;
+ }
+
+ // connect back nameChanged, typeChanged
+ connect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+ connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&)));
+}
+
+
+
+
+/*!
+ * Port parameters dialog definition (taken from SUPERVGUI_Node.cxx without change)
+ */
+SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames)
+ : QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+ myPortsNames( thePortsNames )
+{
+ setSizeGripEnabled( true );
+ setCaption("Port parameters");
+
+ QGridLayout* aBaseLayout = new QGridLayout( this );
+ aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
+
+ QLabel* aNameLbl = new QLabel("Port Name", this );
+ aBaseLayout->addWidget(aNameLbl, 0, 0);
+
+ myNameTxt = new QLineEdit( this );
+ aNameLbl->setBuddy( myNameTxt );
+ aBaseLayout->addWidget(myNameTxt, 0, 1);
+
+ QLabel* aTypeLbl = new QLabel("Value Type", this );
+ aBaseLayout->addWidget(aTypeLbl, 1, 0);
+
+ myTypeTxt = new QComboBox( this );
+ aTypeLbl->setBuddy( myTypeTxt );
+ myTypeTxt->insertStrList( gTypes );
+ aBaseLayout->addWidget(myTypeTxt, 1, 1);
+
+ QGroupBox* aBtnBox = new QGroupBox( this );
+ aBtnBox->setColumnLayout( 0, Qt::Vertical );
+ aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
+ QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
+ aBtnLayout->setAlignment( Qt::AlignTop );
+ aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
+
+ aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 1 );
+
+ QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
+ connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) );
+ aBtnLayout->addWidget( aOKBtn );
+
+ aBtnLayout->addStretch();
+
+ QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
+ connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
+ aBtnLayout->addWidget( aCancelBtn );
+}
+
+void SUPERVGUI_PortParamsDlg::clickOnOk()
+{
+ if (getName().isEmpty() || getType().isEmpty())
+ QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) );
+ else if (myPortsNames.contains(getName()))
+ QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+ else
+ accept();
+}
--- /dev/null
+// SUPERV SUPERVGUI : GUI for Supervisor component
+//
+// Copyright (C) 2003 CEA/DEN, EDF R&D
+//
+//
+//
+// File : SUPERVGUI_ManagePortsDlg.h
+// Author : Alexander SLADKOV
+// Module : SUPERV
+
+#ifndef SUPERVGUI_ManagePortsDlg_H
+#define SUPERVGUI_ManagePortsDlg_H
+
+#include <qdialog.h>
+#include <qlistbox.h>
+#include <qstringlist.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+
+class SUPERVGUI_CanvasNode;
+
+/**
+ * Simple redefinition of ListBoxItem for storing ports name and type without having to parce it
+ */
+class PortListItem : QListBoxText {
+public:
+ PortListItem ( QListBox* lb, const QString& name, const QString& type )
+ : QListBoxText( lb/*, QString( "%1 (%2)" ).arg( name ).arg( type )*/ ),
+ PortName( name ),
+ PortType( type ) {}
+ QString PortName;
+ QString PortType;
+ virtual QString text() const { return QString( "%1 (%2)" ).arg( PortName ).arg( PortType ); }
+};
+
+/**
+ * The dialog class
+ */
+class SUPERVGUI_ManagePortsDlg: public QDialog {
+
+ Q_OBJECT
+
+public:
+ SUPERVGUI_ManagePortsDlg( SUPERVGUI_CanvasNode* theNode );
+ virtual ~SUPERVGUI_ManagePortsDlg();
+
+protected slots:
+ void accept();
+ void reject();
+
+ void addInput() { addPort( myInList ); }
+ void addOutput() { addPort( myOutList );}
+ void removeInput() { removePort( myInList ); }
+ void removeOutput() { removePort( myOutList );}
+ void upInput() { moveUp( myInList ); }
+ void upOutput() { moveUp( myOutList );}
+ void downInput() { moveDown( myInList ); }
+ void downOutput() { moveDown( myOutList );}
+
+ void nameChanged( const QString& name );
+ void typeChanged( const QString& type );
+ void itemChanged( QListBoxItem * item );
+
+protected:
+ virtual void showEvent( QShowEvent* theEvent );
+ void addPort( QListBox* );
+ void removePort( QListBox* );
+ void moveUp( QListBox* );
+ void moveDown( QListBox* );
+ void moveItem( QListBox* theLB, const int from, const int to );
+
+private:
+ void init();
+ void init( const SUPERVGUI_CanvasNode* theNode );
+
+ SUPERVGUI_CanvasNode* myNode;
+
+ QLineEdit* myNameEdt;
+ QComboBox* myTypeCombo;
+ QListBox* myInList;
+ QListBox* myOutList;
+ QListBoxItem* myLastItem;
+};
+
+/*!
+ * Port parameters dialog definition (taken from SUPERVGUI_Node.h without change)
+ */
+class SUPERVGUI_PortParamsDlg: public QDialog {
+ Q_OBJECT
+
+ public:
+ SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames);
+ ~SUPERVGUI_PortParamsDlg() {};
+
+ QString getName() { return myNameTxt->text(); }
+ QString getType() { return myTypeTxt->currentText(); }
+
+ public slots:
+ void clickOnOk();
+
+
+ private:
+ QLineEdit* myNameTxt;
+ QComboBox* myTypeTxt;
+ QStringList myPortsNames;
+};
+
+
+#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Node.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Node.h"
-#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_Python.h"
-#include "SUPERVGUI.h"
-#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "SALOMEGUI_NameDlg.h"
-#include "SUPERVGUI_Information.h"
-#include "SUPERVGUI_ComputeNode.h"
-#include "SUPERVGUI_ControlNode.h"
-
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qhbox.h>
-#include <qgroupbox.h>
-#include <qtooltip.h>
-
-
-
-SUPERVGUI_Node::SUPERVGUI_Node(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- QFrame(theParent, "", WDestructiveClose),
- myMain(theMain),
- myNode(theNode),
- warning(true),
- step(true),
- trace(true),
- verbose(true),
- aBrowseDlg(0)
-{
- Trace("SUPERVGUI_Node::SUPERVGUI_Node");
- QPalette BackColor = QPalette(MAIN_BACK);
- setPalette(BackColor);
-
- setName(myNode->Name());
- //myTitle = new SUPERVGUI_Label(0, LABEL_WIDTH, LABEL_HEIGHT, name(), QLabel::AlignLeft);
- //connect(myTitle, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
- //myTitle->hide();
-
- myStatus = new SUPERVGUI_Label(0, LABEL_WIDTH/2, LABEL_HEIGHT, "", QLabel::AlignHCenter);
- myTime = new SUPERVGUI_Label(0, LABEL_WIDTH/2, LABEL_HEIGHT, "00:00:00", QLabel::AlignHCenter);
- myStatus->hide();
- myTime->hide();
-
- connect(myStatus, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
- connect(myTime, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
-
- //create common popup
- myPopup = new QPopupMenu(this);
- if (myMain->isEditable() && getNodeType() != SUPERV::EndLoopNode
- && getNodeType() != SUPERV::EndSwitchNode) {
- myRenameItem = myPopup->insertItem(tr("MSG_RENAME"), this, SLOT(rename()));
- myDeleteItem = myPopup->insertItem(tr("MSG_DELETE"), this, SLOT(remove()));
- mySeparatorId = myPopup->insertSeparator();
- }
- myPopup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
- if ((getNodeType() != SUPERV::EndLoopNode) && (getNodeType() != SUPERV::EndSwitchNode))
- myPopup->insertItem(tr("MSG_CHANGE_INFO"), this, SLOT(changeInformation()));
- //myPopup->insertItem(tr("MSG_CONFIGURE"), this, SLOT(configure()));
-
- if (myMain->isEditable() && (getNodeType() != SUPERV::FactoryNode)
- && (getNodeType() != SUPERV::ComputingNode)) {
- if ((getNodeType() != SUPERV::EndLoopNode)) {
- QPopupMenu* aAddPortMnu = new QPopupMenu(this);
- aAddPortMnu->insertItem("Input", this, SLOT(addInputPort()));
- if (getNodeType() != SUPERV::LoopNode)
- aAddPortMnu->insertItem("Output", this, SLOT(addOutputPort()));
-
- myPopup->insertSeparator();
- if ((getNodeType() != SUPERV::EndSwitchNode))
- myPopup->insertItem("Edit Function", this, SLOT(editFunction()));
- myPopup->insertItem("Add Port", aAddPortMnu);
- }
- }
-
- // create execution popup
- myRunPopup = new QPopupMenu(this);
- mySuspendItem = myRunPopup->insertItem(tr("MSG_SUSPEND"), this, SLOT(suspendResume()));
- myKillItem = myRunPopup->insertItem(tr("MSG_KILL"), this, SLOT(kill()));
- //myStopItem = myRunPopup->insertItem(tr("MSG_STOP"), this, SLOT(stopRestart()));
-
- setState(myNode->State());
-}
-
-SUPERVGUI_Node::~SUPERVGUI_Node()
-{
- Trace("SUPERVGUI_Node::~SUPERVGUI_Node")
-}
-
-
-void SUPERVGUI_Node::sync() {
- // asv : 18.11.04 : fix for 6170 : after execution is finished, nodes' status must be reset.
- // this code here seems to be executed only in Table View (array).
- SUPERV::GraphState aState = myNode->State();
- if ( !myMain->getDataflow()->IsExecuting() && myMain->IsGUIEventLoopFinished() &&
- (aState == SUPERV::DoneState || aState == SUPERV::KillState || aState == SUPERV::StopState ) )
- aState = SUPERV::EditingState;
-
- setState( aState );
-}
-
-void SUPERVGUI_Node::syncOnEvent(SUPERV::GraphState theStateFromEvent) {
- setState(theStateFromEvent);
-}
-
-void SUPERVGUI_Node::setState(SUPERV::GraphState theState)
-{
- MESSAGE("NodeState="<<theState);
- myRunPopup->changeItem(mySuspendItem, tr("MSG_SUSPEND"));
- myRunPopup->setItemEnabled(mySuspendItem, true);
- myRunPopup->setItemEnabled(myStopItem, false);
-
- switch (theState) {
- case SUPERV_Waiting:
- myStatus->setText("Waiting");
- myStatus->setPaletteBackgroundColor(QColor(35, 192, 255));
- break;
- case SUPERV_Running:
- case SUPERV::ReadyState:
- myStatus->setText("Running");
- myStatus->setPaletteBackgroundColor(QColor(32,210,32));
- myRunPopup->changeItem(myStopItem, tr("MSG_STOP"));
- myRunPopup->setItemEnabled(myStopItem, true);
- break;
- case SUPERV_Suspend:
- case SUPERV::SuspendReadyState:
- myStatus->setText("Suspended");
- myStatus->setPaletteBackgroundColor(QColor(255,180, 0));
- myRunPopup->changeItem(mySuspendItem, tr("MSG_RESUME"));
- break;
- case SUPERV_Done:
- myStatus->setText("Finished");
- myStatus->setPaletteBackgroundColor(QColor(255, 158, 255));
- myRunPopup->setItemEnabled(mySuspendItem, false);
- myRunPopup->changeItem(myStopItem, tr("MSG_RESTART"));
- myRunPopup->setItemEnabled(myStopItem, true);
- break;
- case SUPERV_Error:
- myStatus->setText("Aborted");
- myStatus->setPaletteBackgroundColor(red);
- myRunPopup->setItemEnabled(mySuspendItem, false);
- myRunPopup->changeItem(myStopItem, tr("MSG_RESTART"));
- myRunPopup->setItemEnabled(myStopItem, true);
- break;
- case SUPERV_Kill:
- myStatus->setText("Killed");
- myStatus->setPaletteBackgroundColor(red);
- myRunPopup->setItemEnabled(mySuspendItem, false);
- myRunPopup->changeItem(myStopItem, tr("MSG_RESTART"));
- myRunPopup->setItemEnabled(myStopItem, true);
- break;
- default:
- myStatus->setText("No Status");
- myStatus->setPaletteBackgroundColor(QColor(NODE_RED, NODE_GREEN, NODE_BLUE));
- myRunPopup->setItemEnabled(mySuspendItem, false);
- break;
- }
- myTime->setPaletteBackgroundColor(myStatus->paletteBackgroundColor());
- long sec = myNode->CpuUsed();
- // sec++;
- char hms[9];
- long s = sec/3600;
- hms[0]=(char)(((s/10)%10)+48);
- hms[1]=(char)((s%10)+48);
- hms[2]=':';
- sec = sec%3600;
- s = sec/60;
- hms[3]=(char)((s/10)+48);
- hms[4]=(char)((s%10)+48);
- hms[5]=':';
- sec = sec%60;
- hms[6]=(char)((sec/10)+48);
- hms[7]=(char)((sec%10)+48);
- hms[8]='\0';
- myTime->setText(hms);
-}
-
-void SUPERVGUI_Node::rename()
-{
- QString nm = SALOMEGUI_NameDlg::getName( QAD_Application::getDesktop(), myNode->Name() );
- if ( !nm.isEmpty() ) {
- setNodeName(nm);
- }
-}
-
-
-void SUPERVGUI_Node::remove() {
- Trace("SUPERVGUI_Node::remove");
- deleteLinks();
- myNode->destroy();
- myMain->getGraph()->deleteNode(this);
-}
-
-void SUPERVGUI_Node::suspendResume() {
- Trace("SUPERVGUI_Node::suspendResume");
- int n = queryList("SUPERVGUI_Node")->count();
- if (myNode->IsSuspended()) {
- if (!((n==1)? myMain->getDataflow()->Resume() : myNode->Resume())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_RESUMENODE"));
- }
- else {
- myMain->getMyThread()->startThread(tr("MSG_NODE_RESUMED1")+myNode->Name()+tr("MSG_NODE_RESUMED2"));
- }
- } else {
- if (!((n==1)? myMain->getDataflow()->Suspend() : myNode->Suspend())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_SUSPENDNODE"));
- } else {
- myStatus->setPaletteBackgroundColor(QColor(255,180, 0));
- myTime->setPaletteBackgroundColor(QColor(255,180, 0));
- myMain->getMyThread()->stopThread(tr("MSG_NODE_SUSPENDED1")+myNode->Name()+tr("MSG_NODE_SUSPENDED2"));
- }
- }
-}
-
-void SUPERVGUI_Node::kill() {
- Trace("SUPERVGUI_Node::kill");
- int n = queryList("SUPERVGUI_Node")->count();
- if (!((n==1)? myMain->getDataflow()->Kill() : myNode->Kill())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_KILLNODE"));
- } else {
- myStatus->setPaletteBackgroundColor(Qt::red);
- myTime->setPaletteBackgroundColor(Qt::red);
- myMain->getMyThread()->stopThread(tr("MSG_NODE_KILLED1")+myNode->Name()+tr("MSG_NODE_KILLED2"));
- }
-}
-
-void SUPERVGUI_Node::stopRestart() {
- Trace("SUPERVGUI_Node::stopRestart");
-
- int n = queryList("SUPERVGUI_Node")->count();
- if ((myNode->State() == SUPERV_Stop) || (myNode->State() == SUPERV_Kill)) {
- if (!((n==1)? myMain->getDataflow()->Run() : myNode->ReStart())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_RESTARTNODE"));
- }
- } else {
- if (!((n==1)? myMain->getDataflow()->Stop() : myNode->Stop())) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_STOPNODE"));
- }
- }
-}
-
-void SUPERVGUI_Node::changeInformation() {
- SUPERVGUI_Information* aDlg = new SUPERVGUI_Information(myNode, !myMain->isEditable());
- if (aDlg->exec() )
- sync();
- delete aDlg;
- if (myNode->IsGOTO()) {
- QString nmGT = myNode->Name();
- if ( !nmGT.isEmpty() ) {
- setNodeName(nmGT);
- }
- }
- if (myMain->isEditable()) {
- if (myMain->isArrayShown()) { //Table View
- if (myNode->IsLoop() || myNode->IsSwitch()) { //for synchronic names changing
- QString nmA = myNode->Name();
- if ( !nmA.isEmpty() ) {
- setNodeName(nmA);
- QString aStrA(tr("ENDNODE_PREFIX"));
- aStrA+=nmA;
- (dynamic_cast<SUPERVGUI_Cell*>(this))->getPairCell()->getTitle()->setText(aStrA);
- (dynamic_cast<SUPERVGUI_Cell*>(this))->getPairCell()->setNodeName(aStrA);
- // QToolTip::remove((dynamic_cast<SUPERVGUI_Cell*>(this))->getPairCell()->getTitle());
- QToolTip::add((dynamic_cast<SUPERVGUI_Cell*>(this))->getPairCell()->getTitle(),
- (dynamic_cast<SUPERVGUI_Cell*>(this))->getPairCell()->getTitle()->text());
-
- }
- }
- // QToolTip::remove((dynamic_cast<SUPERVGUI_Cell*>(this))->getTitle());
- QToolTip::add((dynamic_cast<SUPERVGUI_Cell*>(this))->getTitle(),
- (dynamic_cast<SUPERVGUI_Cell*>(this))->getTitle()->text());
- QToolTip::add((dynamic_cast<SUPERVGUI_Cell*>(this))->getComponent(),
- (dynamic_cast<SUPERVGUI_Cell*>(this))->getComponent()->text());
- }
- else { //Graph View
- if (myNode->IsLoop() || myNode->IsSwitch()) { //for synchronic names changing
- QString nm = myNode->Name();
- if ( !nm.isEmpty() ) {
- setNodeName(nm);
- QString aStr(tr("ENDNODE_PREFIX"));
- aStr+=nm;
- (dynamic_cast<SUPERVGUI_StartControlNode*>(this))->getEndNode()->setNodeName(aStr);
- }
- }
- else {
- if (!(myNode->IsGOTO())) {
- // QToolTip::remove((dynamic_cast<SUPERVGUI_ComputeNode*>(this))->getCommLabel());
- QToolTip::add((dynamic_cast<SUPERVGUI_ComputeNode*>(this))->getCommLabel(),
- (dynamic_cast<SUPERVGUI_ComputeNode*>(this))->getCommLabel()->text());
- QToolTip::add((dynamic_cast<SUPERVGUI_ComputeNode*>(this))->getTitleLabel(),
- (dynamic_cast<SUPERVGUI_ComputeNode*>(this))->getTitleLabel()->text());
- }
- }
- }
- }
- /* Trace("SUPERVGUI_Node::changeInformation")
- if (Supervision.information(myNode, !myMain->isEditable())) {
- myMain->syncAsync();
- };*/
-}
-
-void SUPERVGUI_Node::configure() {
- Trace("SUPERVGUI_Node::configure")
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_NOT_IMPLEMENTED")); // kloss : a faire : lancer l'ihm DATA
-}
-
-void SUPERVGUI_Node::showPython() {
- Trace("SUPERVGUI_Node::showPython")
- SUPERVGUI_Python cp(myMain->getStudy()->get_PyInterp(), !myMain->isEditable());
- cp.exec();
-}
-
-void SUPERVGUI_Node::showPopup(QMouseEvent* e) {
- Trace("SUPERVGUI_Node::showPopup");
- if (myMain->getDataflow()->IsExecuting())
- myMain->showPopup(myRunPopup, e);
- else
- myMain->showPopup(myPopup, e);
-}
-
-
-void SUPERVGUI_Node::mousePressEvent(QMouseEvent* e) {
- if (!myMain->getDataflow()->IsExecuting())
- myMain->showPopup(myPopup, e);
-}
-
-
-bool SUPERVGUI_Node::isWarning() {
- Trace("SUPERVGUI_Node::isWarning")
- return(warning);
-}
-
-bool SUPERVGUI_Node::isStep() {
- Trace("SUPERVGUI_Node::isStep")
- return(step);
-}
-
-bool SUPERVGUI_Node::isTrace() {
- Trace("SUPERVGUI_Node::isTrace")
- return(trace);
-}
-
-bool SUPERVGUI_Node::isVerbose() {
- Trace("SUPERVGUI_Node::isVerbose")
- return(verbose);
-}
-
-void SUPERVGUI_Node::setWarning(bool b) {
- Trace("SUPERVGUI_Node::setWarning")
- warning = b;
-}
-
-void SUPERVGUI_Node::setStep(bool b) {
- Trace("SUPERVGUI_Node::setStep")
- step = b;
-}
-
-void SUPERVGUI_Node::setTrace(bool b) {
- Trace("SUPERVGUI_Node::setTrace")
- trace = b;
-}
-
-void SUPERVGUI_Node::setVerbose(bool b) {
- Trace("SUPERVGUI_Node::setVerbose")
- verbose = b;
-}
-
-
-void SUPERVGUI_Node::browse() {
- if ( !aBrowseDlg ) {
- aBrowseDlg = new SUPERVGUI_BrowseNodeDlg(this);
- aBrowseDlg->installEventFilter( this );
- }
- if ( !aBrowseDlg->isVisible() )
- aBrowseDlg->show();
- else {
- aBrowseDlg->raise();
- aBrowseDlg->setActiveWindow();
- aBrowseDlg->setFocus();
- }
-}
-
-bool SUPERVGUI_Node::eventFilter( QObject* o, QEvent* e )
-{
- if ( o == aBrowseDlg && e->type() == QEvent::Close )
- aBrowseDlg = 0;
- return QFrame::eventFilter( o, e );
-}
-
-
-void SUPERVGUI_Node::setNodeName(QString aName) {
- if ( myNode->SetName(aName.latin1())) {
- setName(myNode->Name());
- //myTitle->setText(aName);
- } else
- QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_RENAMENODE" ) );
-}
-
-QStringList SUPERVGUI_Node::getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts)
-{
- QStringList aPNList;
- if (!SUPERV_isNull(theNode)) {
- SUPERV_Ports aPorts = theNode->Ports();
- for (int i=0; i<aPorts->length(); i++) {
- if (theInputPorts) {
- if (aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name()));
- }
- else
- if (!aPorts[i]->IsInput()) aPNList.append(QString(aPorts[i]->Name()));
- }
- }
- return aPNList;
-}
-
-SUPERV_Port SUPERVGUI_Node::createInPort() {
- SUPERV_INode aNode = getInlineNode();
- if (SUPERV_isNull(aNode)) {
- MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type");
- return NULL;
- }
-
- SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,true));
- if (aDlg->exec()) {
- SUPERV_Port aPort = aNode->InPort(aDlg->getName().latin1(),
- aDlg->getType().latin1());
- delete aDlg;
- return aPort;
- }
- delete aDlg;
- return NULL;
-}
-
-
-SUPERV_Port SUPERVGUI_Node::createOutPort() {
- SUPERV_INode aNode = getInlineNode();
- if (SUPERV_isNull(aNode)) {
- MESSAGE("SUPERVGUI_Node::createInPort: Node is wrong type");
- return NULL;
- }
-
- SUPERVGUI_PortParamsDlg* aDlg = new SUPERVGUI_PortParamsDlg(getPortsNamesIN(aNode,false));
- if (aDlg->exec()) {
- SUPERV_Port aPort = aNode->OutPort(aDlg->getName().latin1(),
- aDlg->getType().latin1());
- delete aDlg;
- return aPort;
- }
- delete aDlg;
- return NULL;
-}
-
-
-
-void SUPERVGUI_Node::addInputPort() {
- createInPort();
-}
-
-
-void SUPERVGUI_Node::addOutputPort() {
- createOutPort();
-}
-
-
-void SUPERVGUI_Node::editFunction() {
- if (getNodeType() == SUPERV::LoopNode) {
- SUPERVGUI_EditPythonDlg* aDlg = new SUPERVGUI_EditPythonDlg(true);
- SUPERV_LNode aLNode = getLoopNode();
- aDlg->setInitFunction(aLNode->PyInit());
- aDlg->setMoreFunction(aLNode->PyMore());
- aDlg->setNextFunction(aLNode->PyNext());
- if (aDlg->exec()) {
- aLNode->SetPyInit(aDlg->getInitFuncName().latin1(), (aDlg->getInitFunction()).in());
- aLNode->SetPyMore(aDlg->getMoreFuncName().latin1(), (aDlg->getMoreFunction()).in());
- aLNode->SetPyNext(aDlg->getNextFuncName().latin1(), (aDlg->getNextFunction()).in());
- }
- delete aDlg;
- } else {
- SUPERVGUI_EditPythonDlg* aDlg = new SUPERVGUI_EditPythonDlg();
- SUPERV_INode aINode = getInlineNode();
- aDlg->setFunction(aINode->PyFunction());
- if (aDlg->exec()) {
- aINode->SetPyFunction(aDlg->getFuncName().latin1(), (aDlg->getFunction()).in());
- }
- delete aDlg;
- }
-}
-
-
-
-
-
-
-/*!
- * Port parameters dialog definition
- */
-
-static const char* MyTypeStrings[] =
- {"string", "boolean", "char", "short", "int", "long", "float", "double", "objref"};
-
-SUPERVGUI_PortParamsDlg::SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames)
- : QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- myPortsNames(thePortsNames)
-{
- setSizeGripEnabled( true );
- setCaption("Port parameters");
-
- QGridLayout* aBaseLayout = new QGridLayout( this );
- aBaseLayout->setMargin( 11 ); aBaseLayout->setSpacing( 6 );
-
- QLabel* aNameLbl = new QLabel("Port Name", this );
- aBaseLayout->addWidget(aNameLbl, 0, 0);
-
- myNameTxt = new QLineEdit( this );
- aNameLbl->setBuddy( myNameTxt );
- aBaseLayout->addWidget(myNameTxt, 0, 1);
-
- QLabel* aTypeLbl = new QLabel("Value Type", this );
- aBaseLayout->addWidget(aTypeLbl, 1, 0);
-
- myTypeTxt = new QComboBox( this );
- aTypeLbl->setBuddy( myTypeTxt );
- myTypeTxt->insertStrList( MyTypeStrings );
- aBaseLayout->addWidget(myTypeTxt, 1, 1);
-
- QGroupBox* aBtnBox = new QGroupBox( this );
- aBtnBox->setColumnLayout( 0, Qt::Vertical );
- aBtnBox->layout()->setSpacing( 0 ); aBtnBox->layout()->setMargin( 0 );
- QHBoxLayout* aBtnLayout = new QHBoxLayout( aBtnBox->layout() );
- aBtnLayout->setAlignment( Qt::AlignTop );
- aBtnLayout->setSpacing( 6 ); aBtnLayout->setMargin( 11 );
-
- aBaseLayout->addMultiCellWidget( aBtnBox, 2, 2, 0, 1 );
-
- QPushButton* aOKBtn = new QPushButton( tr( "BUT_OK" ), aBtnBox );
- connect( aOKBtn, SIGNAL( clicked() ), this, SLOT( clickOnOk() ) );
- aBtnLayout->addWidget( aOKBtn );
-
- aBtnLayout->addStretch();
-
- QPushButton* aCancelBtn = new QPushButton( tr("BUT_CANCEL"), aBtnBox );
- connect( aCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
- aBtnLayout->addWidget( aCancelBtn );
-}
-
-void SUPERVGUI_PortParamsDlg::clickOnOk()
-{
- if (getName().isEmpty() || getType().isEmpty())
- QMessageBox::warning( QAD_Application::getDesktop(), tr( "ERROR" ), tr( "MSG_CANT_CREATE_PORT" ) );
- else if (myPortsNames.contains(getName()))
- QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
- else
- accept();
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Node.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Node_H
-#define SUPERVGUI_Node_H
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include "SUPERVGUI_Label.h"
-#include <qvbox.h>
-#include "SUPERVGUI_BrowseNodeDlg.h"
-#include <qcombobox.h>
-#include "SUPERVGUI_Port.h"
-#include <qstringlist.h>
-
-class SUPERVGUI_Main;
-
-class SUPERVGUI_Node: public QFrame {
- Q_OBJECT
-
- public:
- SUPERVGUI_Node(QWidget* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
- virtual ~SUPERVGUI_Node();
-
- bool eventFilter( QObject* o, QEvent* e );
- virtual void sync();
- void syncOnEvent(SUPERV::GraphState theStateFromEvent);
-
- virtual void hideAll()=0;
- virtual void showAll()=0;
- virtual void deleteLinks() {};
- virtual void setNodeName(QString aName);
-
- SUPERV_CNode getEngine()
- { return myNode; };
-
- SUPERVGUI_Main* getMain()
- { return myMain; };
-
- bool isWarning();
- bool isStep();
- bool isTrace();
- bool isVerbose();
-
- SUPERV::KindOfNode getNodeType()
- { return myNode->Kind(); }
-
- SUPERV_CNode getComputingNode()
- { return myNode; }
-
- SUPERV_FNode getFactoryNode()
- { return SUPERV::FNode::_narrow(myNode); }
-
- SUPERV_INode getInlineNode()
- { return SUPERV::INode::_narrow(myNode); }
-
- SUPERV_GNode getGotoNode()
- { return SUPERV::GNode::_narrow(myNode); }
-
- SUPERV_LNode getLoopNode()
- { return SUPERV::LNode::_narrow(myNode); }
-
- SUPERV_ELNode getEndLoopNode()
- { return SUPERV::ELNode::_narrow(myNode); }
-
- SUPERV_SNode getSwitchNode()
- { return SUPERV::SNode::_narrow(myNode); }
-
- SUPERV_ESNode getEndSwitchNode()
- { return SUPERV::ESNode::_narrow(myNode); }
-
-
- SUPERV_Port createInPort();
- SUPERV_Port createOutPort();
- QStringList getPortsNamesIN(SUPERV_INode theNode, bool theInputPorts);
-
- protected:
- void mousePressEvent(QMouseEvent* e);
-
- public slots:
- void suspendResume();
- void kill();
- void stopRestart();
- void configure();
- void showPython();
-
- virtual void rename();
- virtual void remove();
- void changeInformation();
- void browse();
-
- void setWarning(bool b);
- void setStep(bool b);
- void setTrace(bool b);
- void setVerbose(bool b);
- void showPopup(QMouseEvent* e);
-
- virtual void addInputPort();
- virtual void addOutputPort();
- virtual void editFunction();
-
- protected:
- virtual void setState(SUPERV::GraphState theState);
-
- SUPERV_CNode myNode;
- SUPERVGUI_Main* myMain;
-
- //SUPERVGUI_Label* myTitle;
- SUPERVGUI_Label* myTime;
- SUPERVGUI_Label* myStatus;
-
- QPopupMenu* myPopup;
- QPopupMenu* myRunPopup;
- int myKillItem;
- int mySuspendItem;
- int myStopItem;
- int myRenameItem;
- int myDeleteItem;
- int mySeparatorId;
-
- SUPERVGUI_BrowseNodeDlg* aBrowseDlg;
-
- private:
-
- bool warning;
- bool step;
- bool trace;
- bool verbose;
-
-};
-
-
-
-/*!
- * Port parameters dialog definition
- */
-class SUPERVGUI_PortParamsDlg: public QDialog {
- Q_OBJECT
-
- public:
- SUPERVGUI_PortParamsDlg(const QStringList& thePortsNames);
- ~SUPERVGUI_PortParamsDlg() {};
-
- QString getName() { return myNameTxt->text(); }
- QString getType() { return myTypeTxt->currentText(); }
-
- public slots:
- void clickOnOk();
-
-
- private:
- QLineEdit* myNameTxt;
- QComboBox* myTypeTxt;
- QStringList myPortsNames;
-};
-
-
-
-#endif
// Module : SUPERV
using namespace std;
+
#include "SUPERVGUI_Notification.h"
-#include "QAD_Message.h"
-#include "QAD_FileDlg.h"
-#include "SUPERVGUI_Node.h"
#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI_CanvasNode.h"
+
#include "NOTIFICATION.hxx"
+#include "QAD_Message.h"
+#include "QAD_FileDlg.h"
+
#include <qlayout.h>
#include <qlabel.h>
#include <qgroupbox.h>
myMainNotif->setVerbose( false );
/* nodes notification */
- QObjectList* ihmList = myMain->getGraph()->queryList( "SUPERVGUI_Node" );
+ QObjectList* ihmList = myMain->/*getGraph()->*/queryList( "SUPERVGUI_CanvasNode" );
QObjectListIt i( *ihmList );
- SUPERVGUI_Node* theNode;
- while ( ( theNode = ( ( SUPERVGUI_Node* )i.current() ) ) != 0) {
+ SUPERVGUI_CanvasNode* theNode;
+ while ( ( theNode = ( ( SUPERVGUI_CanvasNode* )i.current() ) ) != 0) {
lin = new QFrame( myBox );
lin->setFrameStyle( QFrame::HLine | QFrame::Plain );
/*!
Constructor
*/
-SUPERVGUI_NotifWidget::SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_Node* n )
+SUPERVGUI_NotifWidget::SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_CanvasNode* n )
: QWidget( parent ), myNode ( n )
{
init();
#include <qvbox.h>
class SUPERVGUI_Main;
-class SUPERVGUI_Node;
+class SUPERVGUI_CanvasNode;
class SUPERVGUI_NotifWidget;
class SUPERVGUI_Notification: public QDialog
class SUPERVGUI_NotifWidget : public QWidget
{
public:
- SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_Node* n );
+ SUPERVGUI_NotifWidget( QWidget* parent, SUPERVGUI_CanvasNode* n );
SUPERVGUI_NotifWidget( QWidget* parent, QString title );
~SUPERVGUI_NotifWidget();
- SUPERVGUI_Node* getNode() { return myNode; }
+ SUPERVGUI_CanvasNode* getNode() { return myNode; }
bool getWarning() { return myWarningCheck->isChecked(); }
bool getStep() { return myStepCheck->isChecked(); }
private:
QString myTitle;
- SUPERVGUI_Node* myNode;
+ SUPERVGUI_CanvasNode* myNode;
QCheckBox* myWarningCheck;
QCheckBox* myStepCheck;
QCheckBox* myTraceCheck;
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Port.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Port.h"
-#include "SUPERVGUI_Def.h"
-#include "SUPERVGUI_Main.h"
-#include "SUPERVGUI_Link.h"
-#include "SUPERVGUI.h"
-#include "SUPERVGUI_BrowseNodeDlg.h"
-#include "QAD_LeftFrame.h"
-#include "QAD_ObjectBrowser.h"
-#include <qpoint.h>
-#include "SUPERVGUI_GraphNode.h"
-
-
-// Port en general
-// ---------------
-
-SUPERVGUI_Port::SUPERVGUI_Port(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p):
- SUPERVGUI_Label(parent, PORT_WIDTH, PORT_HEIGHT, "", QLabel::AlignLeft | QLabel::AlignVCenter),
- main(m)
-{
- Trace("SUPERVGUI_Port::SUPERVGUI_Port");
- port = SUPERV::Port::_duplicate(p);
- myName = port->Name();
- QString aName(port->Name());
- aName += (port->IsInput())? "Input":"Output";
- setName(aName);
-
- if (!port->IsInput() && port->IsGate())
- setAlignment(QLabel::AlignRight | QLabel::AlignVCenter);
-
- if (port->IsParam() || port->IsInLine())
- setText(myName + "=" + port->ToString());
- else
- setText(myName);
-
- setLineWidth(1);
- setMidLineWidth(2);
- setFrameShape(QLabel::Box);
- setFrameShadow(QLabel::Plain);
-
- popup = new QPopupMenu(this);
- if (main->isEditable()) {
- mySketchItem = popup->insertItem(tr("MSG_SKETCH_LINK"), this, SLOT(sketchLink()));
- popup->insertSeparator();
- }
- //for Loop Node: enable "Delete" popup item only for the input port
- if ( ( port->IsInLine()
- &&
- ( port->Node()->Kind()!=SUPERV::EndLoopNode )
- &&
- !( port->Node()->Kind()==SUPERV::LoopNode && !port->IsInput() )
- )
- ||
- ( port->IsEndSwitch() && port->IsInput())) {
- myDelItem = popup->insertItem(tr("ITM_DEL_PORT"), this, SLOT(deletePort()));
- }
- browser = popup->insertItem(tr("MSG_BROWSE"),this, SLOT(browse()));
-
- connect(this, SIGNAL(MousePress(QMouseEvent*)), this, SLOT(showPopup(QMouseEvent*)));
- connect(this, SIGNAL(MouseRelease(QMouseEvent*)), this, SLOT(endSketch()));
-}
-
-SUPERVGUI_Port::~SUPERVGUI_Port() {
- Trace("SUPERVGUI_Port::~SUPERVGUI_Port")
-}
-
-SUPERV_Port SUPERVGUI_Port::getPort() {
- Trace("SUPERVGUI_Port::getPort")
- return(port);
-}
-
-void SUPERVGUI_Port::showPopup(QMouseEvent* e) {
- Trace("SUPERVGUI_Port::showPopup");
- if (e->button() != RightButton) return;
- if (main->getDataflow()->IsExecuting())
- popup->setItemEnabled(mySketchItem, false);
- /* else
- if (!port->IsInput() //output port
- ||
- port->IsInput() && (!port->IsLinked() //not linked input port
- ||
- port->Kind() == SUPERV::EndSwitchParameter)) { //input port of EndSwitch node
- popup->setItemEnabled(mySketchItem, true);
- }
- */
- main->showPopup(popup, e);
-}
-
-
-void SUPERVGUI_Port::browse() {
- Trace("SUPERVGUI_Port::browse")
- QString mess = (port->IsInput())? (tr("MSG_IPORT_VAL")) : (tr("MSG_OPORT_VAL"));
- mess += port->ToString();
- QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), mess);
-}
-
-
-QPoint SUPERVGUI_Port::getConnectPnt() {
- return QPoint(0,0);
-}
-
-
-void SUPERVGUI_Port::sync() {
- if (port->IsParam() || port->IsInLine())
- setText(myName + "=" + port->ToString());
- else
- setText(myName);
-
-}
-
-
-void SUPERVGUI_Port::sketchLink() {
- main->getGraph()->sketchBegin(this);
- if (port->IsInput())
- setLineWidth(1);
-}
-
-void SUPERVGUI_Port::endSketch() {
- main->getGraph()->sketchEnd(this);
- if (port->IsInput() && port->IsLinked())
- setLineWidth(1);
-}
-
-
-void SUPERVGUI_Port::deletePort() {
- SUPERVGUI_GraphNode* aNode = (SUPERVGUI_GraphNode* )main->getGraph()->child(port->Node()->Name(), "SUPERVGUI_GraphNode");
- if (aNode) {
- aNode->deletePort(this);
- }
-}
-
-
-
-
-//***********************************************************
-// Port d'entree
-// -------------
-
-SUPERVGUI_PortIn::SUPERVGUI_PortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p)
- : SUPERVGUI_Port(parent, m, p), myDlg( 0 )
-{
- Trace("SUPERVGUI_PortIn::SUPERVGUI_PortIn");
- myLinkPrs = 0;
- // link->move(0, height()/2-POINT_SIZE_HALF);
-
- bool editing = port->IsInput() && ( !port->IsLinked() ); //main->isEditable();
-// bool linked = port->IsLinked();
-// bool b = (!linked) && editing;
- if ((!port->IsGate()) && editing ) {
- psc = popup->insertItem(tr("MSG_SETVALUE"), this, SLOT(setInput()));
- }
- // browser = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
-}
-
-SUPERVGUI_PortIn::~SUPERVGUI_PortIn() {
- Trace("SUPERVGUI_PortIn::~SUPERVGUI_PortIn");
-}
-
-
-bool SUPERVGUI_PortIn::eventFilter( QObject* o, QEvent* e )
-{
- if ( o == myDlg && e->type() == QEvent::Close )
- myDlg = 0;
- return SUPERVGUI_Port::eventFilter( o, e );
-}
-
-void SUPERVGUI_PortIn::showPopup(QMouseEvent* e){
- if (e->button() != RightButton) return;
- if (main->getDataflow()->IsExecuting())
- popup->setItemEnabled(mySketchItem, false);
- else {
- popup->setItemEnabled(mySketchItem, !port->IsLinked());
- popup->setItemEnabled(psc, !port->IsLinked());
- }
- main->showPopup(popup, e);
-}
-
-void SUPERVGUI_PortIn::deleteLinks() {
- if (myLinkPrs) {
- disconnect(myLinkPrs, 0, this, 0);
- main->getGraph()->deleteLink(myLinkPrs);
- myLinkPrs = 0;
- }
-}
-
-
-void SUPERVGUI_PortIn::sync() {
- SUPERVGUI_Port::sync();
- // if (port->IsLinked()) {
- // popup->setItemEnabled(browser, port->State() == SUPERV_Ready);
- //} else {
- if (!port->IsLinked()) {
- if (port->HasInput()) {
- // popup->setItemEnabled(browser, true);
- setLineWidth(2);
- } else {
- //popup->setItemEnabled(browser, false);
- setLineWidth(1);
- }
- }
-}
-
-void SUPERVGUI_PortIn::setValue(const char* d) {
- Trace("SUPERVGUI_PortIn::setValue")
- if (port->Input(Supervision.getEngine()->StringValue(d))) {
- sync();
- } else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_SETVAL"));
- };
-}
-
-void SUPERVGUI_PortIn::setInput() {
- Trace("SUPERVGUI_PortIn::setInput");
- if ( !myDlg ) {
- myDlg = new SUPERVGUI_GetValueDlg(this);
- myDlg->installEventFilter( this );
- }
- if ( !myDlg->isVisible() )
- myDlg->show();
- else {
- myDlg->raise();
- myDlg->setActiveWindow();
- myDlg->setFocus();
- }
-}
-
-/*void SUPERVGUI_PortIn::browse() {
- Trace("SUPERVGUI_PortIn::browse")
- QString mess(tr("MSG_IPORT_VAL"));
- mess += port->ToString();
- QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), mess);
- }*/
-
-
-
-/**
- * Returns coordinates of connection point in content coordinates
- */
-QPoint SUPERVGUI_PortIn::getConnectPnt() {
- // Parent widget is internal node frame
- // parent of parent is node it self
- QWidget* aNode = parentWidget()->parentWidget()->parentWidget();
- QPoint aPnt(aNode->pos()); // position of the node
-
- if (parentWidget()->isVisible()) {
- aPnt += parentWidget()->parentWidget()->pos();
- aPnt += parentWidget()->pos();
- return QPoint(aPnt.x() + pos().x(),
- aPnt.y() + (pos().y() + height()/2));
- }
- return QPoint(aPnt.x(),
- aPnt.y() + (aNode->height()/2));
-}
-
-void SUPERVGUI_PortIn::setLinkPrs(SUPERVGUI_Link* theLink) {
- myLinkPrs = theLink;
- connect(myLinkPrs, SIGNAL(linkDeleted(SUPERVGUI_Link*)),
- this, SLOT(onDeleteLink(SUPERVGUI_Link*)));
- popup->setItemEnabled(mySketchItem, false);
-}
-
-void SUPERVGUI_PortIn::onDeleteLink(SUPERVGUI_Link*) {
- disconnect(myLinkPrs, 0, this, 0);
- myLinkPrs = 0;
- popup->setItemEnabled(psc, true);
- if (port->HasInput())
- setLineWidth(2);
- if (main->isEditable()) {
- popup->setItemEnabled(mySketchItem, true);
- } else {
- popup->setItemEnabled(mySketchItem, false);
- }
-}
-
-
-
-//***********************************************************
-// Port de sortie
-// --------------
-
-SUPERVGUI_PortOut::SUPERVGUI_PortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p):
- SUPERVGUI_Port(parent, m, p),
- study(false)
-{
- Trace("SUPERVGUI_PortOut::SUPERVGUI_PortOut")
- // link->move(width()-POINT_SIZE, height()/2-POINT_SIZE_HALF);
- myLinksList.setAutoDelete(false);
-
- if (!port->IsGate()) {
- pls = popup->insertItem(tr("MSG_PUT_INSTUDY"), this, SLOT(toStudy()));
- }
- //browser = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
-
- if (!main->getDataflow()->IsReadOnly()) {
- popup->setItemEnabled(mySketchItem, true);
- } else {
- popup->setItemEnabled(mySketchItem, false);
- }
-}
-
-SUPERVGUI_PortOut::~SUPERVGUI_PortOut() {
- Trace("SUPERVGUI_PortOut::~SUPERVGUI_PortOut");
-}
-
-void SUPERVGUI_PortOut::sync() {
- Trace("SUPERVGUI_PortOut::sync")
- SUPERVGUI_Port::sync();
-
- bool ok = (port->State() == SUPERV_Ready);
- // popup->setItemEnabled(browser, ok);
- if (study && ok) {
- study = main->putDataStudy(port, STUDY_PORT_OUT);
- }
-
- if (study) {
- setLineWidth(2);
- popup->changeItem(pls, tr("MSG_NOT_INSTUDY"));
- } else {
- setLineWidth(1);
- popup->changeItem(pls, tr("MSG_PUT_INSTUDY"));
- }
-
-}
-
-void SUPERVGUI_PortOut::updateStudy() {
- Trace("SUPERVGUI_PortOut::updateStudy")
- SUPERVGUI_Node* aNode = (SUPERVGUI_Node* )main->getGraph()->child(port->Node()->Name(), "SUPERVGUI_Node");
- if (aNode)
- ((SUPERVGUI_PortOut*)aNode->child(port->Name(), "SUPERVGUI_PortOut"))->study = study;
- else
- {
- aNode = (SUPERVGUI_Node* )main->getArray()->child(port->Node()->Name(), "SUPERVGUI_Node");
- if (aNode)
- ((SUPERVGUI_PortOut*)aNode->child(port->Name(), "SUPERVGUI_PortOut"))->study = study;
- }
-}
-
-void SUPERVGUI_PortOut::toStudy() {
- Trace("SUPERVGUI_PortOut::toStudy")
-
- if (main->getStudy()->getStudyDocument()->GetProperties()->IsLocked()) {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED"));
- return;
- }
-
- if (!main->isFromStudy()) {
- if (main->addStudy()) main->setAsFromStudy(true);
- }
- study = !study;
- sync();
-}
-
-/*void SUPERVGUI_PortOut::browse() {
- Trace("SUPERVGUI_PortOut::browse")
- QString mess(tr("MSG_OPORT_VAL"));
- mess += port->ToString();
- QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), mess);
- }*/
-
-
-/**
- * Returns coordinates of connection point in scroll view content coordinates
- */
-QPoint SUPERVGUI_PortOut::getConnectPnt() {
- // Parent widget is internal node frame
- // parent of parent is node it self
- QWidget* aNode = parentWidget()->parentWidget()->parentWidget();
- QPoint aPnt(aNode->pos()); // position of the node
- if (parentWidget()->isVisible()) {
- aPnt += parentWidget()->parentWidget()->pos();
- aPnt += parentWidget()->pos();
- return QPoint(aPnt.x() + pos().x() + width(),
- aPnt.y() + (pos().y() + height()/2));
- }
- return QPoint(aPnt.x() + aNode-> width(),
- aPnt.y() + (aNode->height()/2));
-}
-
-
-void SUPERVGUI_PortOut::addLinkPrs(SUPERVGUI_Link* theLink) {
- myLinksList.append(theLink);
- connect(theLink, SIGNAL(linkDeleted(SUPERVGUI_Link*)),
- this, SLOT(onDeleteLink(SUPERVGUI_Link*)));
-}
-
-
-void SUPERVGUI_PortOut::onDeleteLink(SUPERVGUI_Link* theLink) {
- disconnect(theLink, 0, this, 0);
- myLinksList.remove(theLink);
-}
-
-
-void SUPERVGUI_PortOut::deleteLinks() {
- if (myLinksList.count() > 0) {
- while (SUPERVGUI_Link* aLink = myLinksList.last()) {
- disconnect(aLink, 0, this, 0);
- myLinksList.remove(aLink);
- main->getGraph()->deleteLink(aLink);
- }
- }
-}
-
-
-
-// ----------------------------
-// Input Port of EndSwitch Node
-// ----------------------------
-SUPERVGUI_PortInESNode::SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p)
- : SUPERVGUI_Port(parent, m, p), myDlg( 0 )
-{
- Trace("SUPERVGUI_PortInESNode::SUPERVGUI_PortInESNode");
- myLinksList.setAutoDelete(false);
-
- bool editing = port->IsInput() && ( !port->IsLinked() ); //main->isEditable();
- if ((!port->IsGate()) && editing ) {
- psc = popup->insertItem(tr("MSG_SETVALUE"),this, SLOT(setInput()));
- }
- // browser = popup->insertItem(tr("MSG_BROWSE"),this, SLOT(browse()));
-}
-
-SUPERVGUI_PortInESNode::~SUPERVGUI_PortInESNode() {
- Trace("SUPERVGUI_PortInESNode::~SUPERVGUI_PortInESNode");
-}
-
-bool SUPERVGUI_PortInESNode::eventFilter( QObject* o, QEvent* e ) {
- if ( o == myDlg && e->type() == QEvent::Close )
- myDlg = 0;
- return SUPERVGUI_Port::eventFilter( o, e );
-}
-
-void SUPERVGUI_PortInESNode::sync() {
- SUPERVGUI_Port::sync();
- /* if (port->IsLinked()) {
- popup->setItemEnabled(browser, port->State() == SUPERV_Ready);
- } else {*/
- if (!port->IsLinked()) {
- if (port->HasInput()) {
- // popup->setItemEnabled(browser, true);
- setLineWidth(2);
- } else {
- // popup->setItemEnabled(browser, false);
- setLineWidth(1);
- }
- }
-}
-
-void SUPERVGUI_PortInESNode::setValue(const char* d) {
- Trace("SUPERVGUI_PortIn::setValue")
- if (port->Input(Supervision.getEngine()->StringValue(d))) {
- sync();
- } else {
- QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_SETVAL"));
- };
-}
-
-/**
- * Returns coordinates of connection point in content coordinates
- */
-QPoint SUPERVGUI_PortInESNode::getConnectPnt() {
- QWidget* aNode = parentWidget()->parentWidget()->parentWidget();
- QPoint aPnt(aNode->pos());
-
- if (parentWidget()->isVisible()) {
- aPnt += parentWidget()->parentWidget()->pos();
- aPnt += parentWidget()->pos();
- return QPoint(aPnt.x() + pos().x(),
- aPnt.y() + (pos().y() + height()/2));
- }
- return QPoint(aPnt.x(),
- aPnt.y() + (aNode->height()/2));
-}
-
-void SUPERVGUI_PortInESNode::setLinkPrs(SUPERVGUI_Link* theLink) {
- myLinksList.append(theLink);
- connect(theLink, SIGNAL(linkDeleted(SUPERVGUI_Link*)),
- this, SLOT(onDeleteLink(SUPERVGUI_Link*)));
-}
-
-void SUPERVGUI_PortInESNode::deleteLinks() {
- if (myLinksList.count() > 0) {
- while (SUPERVGUI_Link* aLink = myLinksList.last()) {
- disconnect(aLink, 0, this, 0);
- myLinksList.remove(aLink);
- main->getGraph()->deleteLink(aLink);
- }
- }
-}
-
-void SUPERVGUI_PortInESNode::setInput() {
- Trace("SUPERVGUI_PortInESNode::setInput");
- if ( !myDlg ) {
- myDlg = new SUPERVGUI_GetValueDlg(this);
- myDlg->installEventFilter( this );
- }
- if ( !myDlg->isVisible() )
- myDlg->show();
- else {
- myDlg->raise();
- myDlg->setActiveWindow();
- myDlg->setFocus();
- }
-}
-
-/*void SUPERVGUI_PortInESNode::browse() {
- Trace("SUPERVGUI_PortInESNode::browse")
- QString mess(tr("MSG_IPORT_VAL"));
- mess += port->ToString();
- QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), mess);
- }*/
-
-
-void SUPERVGUI_PortInESNode::onDeleteLink(SUPERVGUI_Link* theLink) {
- disconnect(theLink, 0, this, 0);
- myLinksList.remove(theLink);
-
- if (myLinksList.count() == 0) {
- popup->setItemEnabled(psc, true);
- } else {
- popup->setItemEnabled(psc, false);
- }
-
- if (port->HasInput())
- setLineWidth(2);
-
- if (main->isEditable()) {
- popup->setItemEnabled(mySketchItem, true);
- } else {
- popup->setItemEnabled(mySketchItem, false);
- }
-}
-
-
-
-// ----------------------------
-// Stream Ports
-// ----------------------------
-
-SUPERVGUI_StreamPortIn::SUPERVGUI_StreamPortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p):
- SUPERVGUI_PortIn(parent, m, p)
-{
- myPort = SUPERV::StreamPort::_duplicate(p);
- myParamItem = popup->insertItem(tr("MSG_STREAM_PARAM"),this, SLOT(setParams()));
-}
-
-SUPERVGUI_StreamPortIn::~SUPERVGUI_StreamPortIn()
-{
-}
-
-
-void SUPERVGUI_StreamPortIn::setParams()
-{
- SUPERVGUI_StreamInDlg* aDlg = new SUPERVGUI_StreamInDlg(this);
- aDlg->exec();
- delete aDlg;
-}
-
-
-void SUPERVGUI_StreamPortIn::sync()
-{
- SUPERVGUI_PortIn::sync();
- setText(myName + "=" + myPort->ToString());
-}
-
-
-//------------------------------------------------------------------------------------------------
-
-SUPERVGUI_StreamPortOut::SUPERVGUI_StreamPortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p):
- SUPERVGUI_PortOut(parent, m, p)
-{
- myPort = SUPERV::StreamPort::_duplicate(p);
- myParamItem = popup->insertItem(tr("MSG_STREAM_PARAM"),this, SLOT(setParams()));
-}
-
-SUPERVGUI_StreamPortOut::~SUPERVGUI_StreamPortOut()
-{
-}
-
-void SUPERVGUI_StreamPortOut::setParams()
-{
- SUPERVGUI_StreamOutDlg* aDlg = new SUPERVGUI_StreamOutDlg(this);
- aDlg->exec();
- delete aDlg;
-}
-
-
-void SUPERVGUI_StreamPortOut::sync()
-{
- SUPERVGUI_PortOut::sync();
- setText(myName + "=" + myPort->ToString());
-}
-
-
-//------------------------------------------------------------------------------------------------
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Port.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Port_H
-#define SUPERVGUI_Port_H
-
-//#include "SUPERVGUI_Point.h"
-#include "SUPERVGUI_Label.h"
-#include "SUPERVGUI_Def.h"
-#include "SALOME_Selection.h"
-
-class SUPERVGUI_Main;
-class SUPERVGUI_Link;
-
-class SUPERVGUI_Port: public SUPERVGUI_Label {
- Q_OBJECT
-
- public:
- SUPERVGUI_Port(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
- virtual ~SUPERVGUI_Port();
-
- SUPERV_Port getPort();
-
- virtual QPoint getConnectPnt();
- virtual void deleteLinks() = 0;
- virtual void sync();
-
- SUPERVGUI_Main* getMain() { return main;}
-
- private slots:
- void sketchLink();
- void endSketch();
-
- protected slots:
- void browse();
- virtual void deletePort();
-
- protected:
- SUPERVGUI_Main* main;
- SUPERV_Port port;
-
- QPopupMenu* popup;
- int mySketchItem;
- int myDelItem;
- int browser;
-
- SALOME_Selection* mySelection;
-
- QString myName;
-
- private slots:
- virtual void showPopup(QMouseEvent* e);
-};
-
-
-
-
-class SUPERVGUI_GetValueDlg;
-class SUPERVGUI_PortIn: public SUPERVGUI_Port {
- Q_OBJECT
-
- public:
- SUPERVGUI_PortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
- virtual ~SUPERVGUI_PortIn();
-
- bool eventFilter( QObject* o, QEvent* e );
-
- void sync();
- void setValue(const char* id);
- virtual QPoint getConnectPnt();
-
- void setLinkPrs(SUPERVGUI_Link* theLink);
-
- SUPERVGUI_Link* getLinkPrs()
- { return myLinkPrs; };
-
- void deleteLinks();
-
- private slots:
- void setInput();
- // void browse();
- void onDeleteLink(SUPERVGUI_Link*);
- virtual void showPopup(QMouseEvent* e);
-
-
- private:
- int psd;
- int psc;
- SUPERVGUI_Link* myLinkPrs;
- SUPERVGUI_GetValueDlg* myDlg;
-};
-
-
-
-
-
-class SUPERVGUI_PortOut: public SUPERVGUI_Port {
- Q_OBJECT
-
- public:
- SUPERVGUI_PortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
- virtual ~SUPERVGUI_PortOut();
-
- void sync();
- void updateStudy();
- bool isInStudy() { return study; };
- void setStudyState(bool theIsInStudy) { study = theIsInStudy; };
- virtual QPoint getConnectPnt();
-
- void addLinkPrs(SUPERVGUI_Link* theLink);
-
- SUPERVGUI_Link* getLinkPrs(int theNum)
- { return myLinksList.at(theNum); };
-
- int getLinkPrsCount()
- { return myLinksList.count(); };
-
- void deleteLinks();
-
- private slots:
- void toStudy();
- // void browse();
-
- void sketch(QMouseEvent* e);
- void onDeleteLink(SUPERVGUI_Link*);
-
-
- private:
- int pls;
- bool study;
- QPtrList<SUPERVGUI_Link> myLinksList;
-};
-
-
-class SUPERVGUI_PortInESNode: public SUPERVGUI_Port {
- Q_OBJECT
-
- public:
- SUPERVGUI_PortInESNode(QWidget* parent, SUPERVGUI_Main* m, SUPERV::Port_ptr p);
- virtual ~SUPERVGUI_PortInESNode();
-
- bool eventFilter( QObject* o, QEvent* e );
-
- void sync();
- void setValue(const char* id);
- virtual QPoint getConnectPnt();
-
- void setLinkPrs(SUPERVGUI_Link* theLink);
-
- SUPERVGUI_Link* getLinkPrs(int theNum)
- { return myLinksList.at(theNum); };
-
- int getLinkPrsCount()
- { return myLinksList.count(); };
-
- void deleteLinks();
-
-
- private slots:
- void setInput();
- // void browse();
- void onDeleteLink(SUPERVGUI_Link*);
-
-
- private:
-// int psd;
- int psc;
- QPtrList<SUPERVGUI_Link> myLinksList;
- SUPERVGUI_GetValueDlg* myDlg;
-
-};
-
-
-
-
-class SUPERVGUI_StreamPortIn: public SUPERVGUI_PortIn
-{
- Q_OBJECT
-public:
- SUPERVGUI_StreamPortIn(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
- virtual ~SUPERVGUI_StreamPortIn();
-
- void sync();
- SUPERV_StreamPort getStreamPort() { return myPort;}
-
-private slots:
- void setParams();
-
-private:
- SUPERV_StreamPort myPort;
-
- int myParamItem;
-};
-
-
-class SUPERVGUI_StreamPortOut: public SUPERVGUI_PortOut
-{
- Q_OBJECT
-public:
- SUPERVGUI_StreamPortOut(QWidget* parent, SUPERVGUI_Main* m, SUPERV::StreamPort_ptr p);
- virtual ~SUPERVGUI_StreamPortOut();
-
- void sync();
- SUPERV_StreamPort getStreamPort() { return myPort;}
-
-private slots:
- void setParams();
-
-private:
- SUPERV_StreamPort myPort;
- int myParamItem;
-};
-
-
-#endif
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Python.cxx
-// Author : Francis KLOSS
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include "QAD_PyEditor.h"
-#include "QAD_PyInterp.h"
-#include "QAD_Application.h"
-#include "SUPERVGUI_Python.h"
-#include <qgroupbox.h>
-#include <qlayout.h>
-#include <qapplication.h>
-
-#define MARGIN_SIZE 11
-#define SPACING_SIZE 6
-#define MIN_PYTHON_WIDTH 300
-#define MIN_PYTHON_HEIGHT 200
-
-/*!
- Constructor
-*/
-SUPERVGUI_Python::SUPERVGUI_Python(QAD_PyInterp* pi, bool isReadOnly)
- : QDialog( 0, "", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
- py_int( pi )
-{
- Trace("SUPERVGUI_Python::SUPERVGUI_Python");
- setCaption("Python Control Code");
- setSizeGripEnabled( TRUE );
-
- QVBoxLayout* topLayout = new QVBoxLayout( this );
- topLayout->setMargin( MARGIN_SIZE ); topLayout->setSpacing( SPACING_SIZE );
-
- edit = new QMultiLineEdit( this );
- edit->setPalette( QAD_Application::getPalette( true ) );
- edit->setReadOnly( isReadOnly );
- edit->setMinimumSize( MIN_PYTHON_WIDTH, MIN_PYTHON_HEIGHT );
-
- QGroupBox* GroupButtons = new QGroupBox( this );
- GroupButtons->setColumnLayout(0, Qt::Vertical );
- GroupButtons->layout()->setSpacing( 0 ); GroupButtons->layout()->setMargin( 0 );
- QHBoxLayout* GroupButtonsLayout = new QHBoxLayout( GroupButtons->layout() );
- GroupButtonsLayout->setAlignment( Qt::AlignTop );
- GroupButtonsLayout->setSpacing( SPACING_SIZE );
- GroupButtonsLayout->setMargin( MARGIN_SIZE );
-
- if ( !isReadOnly ) {
- ok = new QPushButton( tr( "BUT_OK" ), GroupButtons, "buttonOk" );
- ok->setAutoDefault( TRUE ); ok->setDefault( TRUE );
- GroupButtonsLayout->addWidget( ok );
- connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) );
- }
- GroupButtonsLayout->addStretch();
- ko = new QPushButton( isReadOnly ? tr( "BUT_CLOSE" ) : tr( "BUT_CANCEL" ), GroupButtons, "buttonCancel" );
- ko->setAutoDefault( TRUE );
- GroupButtonsLayout->addWidget( ko );
- connect( ko, SIGNAL( clicked() ), this, SLOT( reject() ) );
- if ( isReadOnly ) {
- GroupButtonsLayout->addStretch();
- }
- topLayout->addWidget( edit );
- topLayout->addWidget( GroupButtons );
-}
-
-/*!
- Destructor
-*/
-SUPERVGUI_Python::~SUPERVGUI_Python() {
- Trace("SUPERVGUI_Python::~SUPERVGUI_Python")
-}
-
-/*!
- <OK> button slot
-*/
-void SUPERVGUI_Python::accept() {
- Trace("SUPERVGUI_Python::okButton");
- QDialog::accept();
- qApp->processEvents();
- int n = edit->numLines();
- for ( int li = 0; li < n; li++ ) {
- QString ligne = edit->textLine( li );
- if ( !ligne.isEmpty() ) {
- if ( py_int->run( ligne.latin1() ) ) {
- QMessageBox::warning(0, "Supervision Error", "Can't Reload Python Code");
- }
- }
- }
-}
-
-/*!
- <Cancel> button slot
-*/
-void SUPERVGUI_Python::reject() {
- Trace("SUPERVGUI_Python::koButton");
- QDialog::reject();
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
-//
-//
-//
-// File : SUPERVGUI_Python.h
-// Author : Francis KLOSS
-// Module : SUPERV
-
-#ifndef SUPERVGUI_Python_H
-#define SUPERVGUI_Python_H
-
-using namespace std;
-#include "SUPERVGUI_Def.h"
-#include "QAD_PyInterp.h"
-
-class SUPERVGUI_Python: public QDialog {
- Q_OBJECT
-
- public:
- SUPERVGUI_Python(QAD_PyInterp* pi, bool isReadOnly);
- virtual ~SUPERVGUI_Python();
-
- private slots:
- void accept();
- void reject();
-
- private:
- QAD_PyInterp* py_int;
- QMultiLineEdit* edit;
- QPushButton* ok;
- QPushButton* ko;
-};
-
-#endif
using namespace std;
#include "SUPERVGUI_Service.h"
#include "SUPERVGUI_Main.h"
+#include "SUPERVGUI_Library.h"
#include "SUPERVGUI.h"
#include "QAD_Tools.h"
#include "QAD_FileDlg.h"
#include "SALOME_NamingService.hxx"
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include <qlayout.h>
+#include <qhbox.h>
#include <qtextstream.h>
-
+#include <qregexp.h>
static const char * ComponentIcon[] = {
"20 20 2 1",
/*QLabel* aTypeLbl = */new QLabel(tr("LBL_NODETYPE"), aAddBox2);
myTypeCombo = new QComboBox(aAddBox2);
- myTypeCombo->insertItem("Computation");
- myTypeCombo->insertItem("Switch");
- myTypeCombo->insertItem("Loop");
- myTypeCombo->insertItem("GoTo");
- //myTypeCombo->insertItem("Label");
+ myTypeCombo->insertItem( tr( "INLINE_COMP" ) );
+ myTypeCombo->insertItem( tr( "INLINE_SWTC" ) );
+ myTypeCombo->insertItem( tr( "INLINE_LOOP" ) );
+ myTypeCombo->insertItem( tr( "INLINE_GOTO") );
connect(myTypeCombo, SIGNAL(activated(int)), this, SLOT(typeNodeSelected(int)));
aPythonLayout->addWidget(aAddBox2);
myStackWidget = new QWidgetStack(aPythonPane);
// other pane
- myScriptPane = new SUPERVGUI_PythonEditPane(myStackWidget);
+ myScriptPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
myOtherId = myStackWidget->addWidget(myScriptPane);
// loop pane
QTabWidget* aLoopTabPane = new QTabWidget(myStackWidget);
- myInitPane = new SUPERVGUI_PythonEditPane(myStackWidget);
+ myInitPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
aLoopTabPane->addTab(myInitPane, "Init");
- myMorePane = new SUPERVGUI_PythonEditPane(myStackWidget);
+ myMorePane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
aLoopTabPane->addTab(myMorePane, "More");
- myNextPane = new SUPERVGUI_PythonEditPane(myStackWidget);
+ myNextPane = new SUPERVGUI_PythonEditPane( myStackWidget, true, myX, myY );
aLoopTabPane->addTab(myNextPane, "Next");
myLoopId = myStackWidget->addWidget(aLoopTabPane);
myTabPane->addTab(aPythonPane, tr("INLINE_PANE"));
// Create Tab for Macro node only if environmental variable ENABLE_MACRO_NODE is set
- if ( getenv( "ENABLE_MACRO_NODE" ) != NULL )
- {
- QWidget* aMacroPane = new QWidget(myTabPane);
- QVBoxLayout* aMacroLayout = new QVBoxLayout(aMacroPane, 0, 4);
- aMacroLayout->setMargin(5);
- aMacroLayout->setSpacing(10);
-
- QHBoxLayout* aLoadLayout = new QHBoxLayout(aMacroPane); //!!
- aLoadLayout->addStretch();
-
- QPushButton* aLoadBtn = new QPushButton(tr("BUT_LOAD"), aMacroPane);
- connect(aLoadBtn, SIGNAL(clicked()), this, SLOT(loadGraph()));
+ if ( getenv( "ENABLE_MACRO_NODE" ) != NULL ) {
+ QWidget* aMacroPane = new QWidget(myTabPane);
+ QVBoxLayout* aMacroLayout = new QVBoxLayout(aMacroPane, 0, 4);
+ aMacroLayout->setMargin(5);
+ aMacroLayout->setSpacing(10);
+
+ QHBoxLayout* aLoadLayout = new QHBoxLayout(aMacroPane); //!!
+ aLoadLayout->addStretch();
+
+ QPushButton* aLoadBtn = new QPushButton(tr("BUT_LOAD"), aMacroPane);
+ connect(aLoadBtn, SIGNAL(clicked()), this, SLOT(loadGraph()));
- aLoadLayout->addWidget(aLoadBtn);
+ aLoadLayout->addWidget(aLoadBtn);
- aMacroLayout->addLayout(aLoadLayout);
+ aMacroLayout->addLayout(aLoadLayout);
- myMacroPane = new QListView(aMacroPane);
- myMacroPane->addColumn(tr("COL_COMPONENTS"));
- myMacroPane->addColumn(tr("COL_PORTTYPE"));
- myMacroPane->addColumn(tr("COL_PORTWAY"));
- myMacroPane->setColumnAlignment(1, AlignLeft);
- myMacroPane->setColumnAlignment(2, AlignLeft);
- myMacroPane->setColumnAlignment(3, AlignLeft);
- myMacroPane->setSelectionMode(QListView::Extended);
- myMacroPane->setRootIsDecorated(true);
- aMacroLayout->addWidget(myMacroPane); //!!
-
- QPushButton* aAddBtn = new QPushButton(tr("TIT_ADDFNODE"), aMacroPane);
- connect(aAddBtn, SIGNAL(clicked()), this, SLOT(addMacroNode()));
- aAddBtn->setDefault(true);
-
- aMacroLayout->addWidget(aAddBtn);
-
- myTabPane->addTab(aMacroPane, tr("MACRO_PANE"));
- }
+ myMacroPane = new QListView(aMacroPane);
+ myMacroPane->addColumn(tr("COL_COMPONENTS"));
+ myMacroPane->addColumn(tr("COL_PORTTYPE"));
+ myMacroPane->addColumn(tr("COL_PORTWAY"));
+ myMacroPane->setColumnAlignment(1, AlignLeft);
+ myMacroPane->setColumnAlignment(2, AlignLeft);
+ myMacroPane->setColumnAlignment(3, AlignLeft);
+ myMacroPane->setSelectionMode(QListView::Extended);
+ myMacroPane->setRootIsDecorated(true);
+ aMacroLayout->addWidget(myMacroPane); //!!
+
+ QPushButton* aAddBtn = new QPushButton(tr("TIT_ADDFNODE"), aMacroPane);
+ connect(aAddBtn, SIGNAL(clicked()), this, SLOT(addMacroNode()));
+ aAddBtn->setDefault(true);
+
+ aMacroLayout->addWidget(aAddBtn);
+ myTabPane->addTab(aMacroPane, tr("MACRO_PANE"));
+ }
+
aMainLayout->addWidget(myTabPane);
// Close button
const char* interface = item->parent()->text(0).latin1();
const char* component = item->parent()->parent()->text(0).latin1();
SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(aDesktop->getComponentName(component));
- if (myComponent==NULL) {
+ if ( myComponent == NULL ) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
- } else {
+ }
+ else {
const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
- b = true;
-
- SUPERV_CNode node = aMain->getDataflow()->CNode(*myService);
- if (CORBA::is_nil(node)) {
+ SUPERV_CNode aNode = aMain->getDataflow()->CNode(*myService);
+ if ( CORBA::is_nil( aNode ) ) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- int cx, cy;
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- node->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aNode, aDummyEndNode, myX, myY );
+ b = true; // at least one node was added
}
}
}
- if (!b) {
+ if ( !b ) {
QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
}
}
SALOME_ModuleCatalog::Acomponent_ptr myComponent = (*aModuleCatalog)->GetComponent(component);
if (myComponent==NULL) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CHOOSE_SERVICE"));
- } else {
+ }
+ else {
const SALOME_ModuleCatalog::Service* myService = myComponent->GetService(interface, service);
- b = true;
-
- MESSAGE ( " myService->TypeOfNode == " << myService->TypeOfNode )
-
- int cx, cy;
+ SUPERV_CNode aNode;
if ( myService->TypeOfNode == 0 ) { // ComputeNode
- SUPERV_CNode node = aMain->getDataflow()->CNode(*myService);
- if (CORBA::is_nil(node)) {
+ aNode = aMain->getDataflow()->CNode(*myService);
+ if (CORBA::is_nil( aNode ) ) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- node->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addComputeNode(SUPERV::CNode::_narrow(node));
- } else { // Factory Node
- SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
- if (CORBA::is_nil(node)) {
+ }
+ else { // Factory Node
+ aNode = aMain->getDataflow()->FNode(component, interface, *myService);
+ if ( CORBA::is_nil( aNode ) ) {
QMessageBox::warning(aDesktop, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- node->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addComputeNode(SUPERV::CNode::_narrow(node));
-
}
-
-// SUPERV_FNode node = aMain->getDataflow()->FNode(component, interface, *myService);
-// if (CORBA::is_nil(node)) {
-// QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-// return;
-// }
-// node->Coords(myX, myY);
-// myX += NODE_DX;
-// myY += NODE_DY;
-// aMain->addComputeNode(SUPERV::CNode::_narrow(node));
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aNode, aDummyEndNode, myX, myY );
+ b = true;
}
}
}
- if (!b) {
+ if ( !b ) {
QMessageBox::warning(aDesktop, tr("WARNING"), tr("MSG_NONODE_TOADD"));
}
}
SUPERVGUI_Main* aMain = Supervision.getMain();
if (aMain==0) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
- } else if (!aMain->isEditable()) {
+ }
+ else if (!aMain->isEditable()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
- } else {
+ }
+ else {
int aSel = myTypeCombo->currentItem();
- int cx, cy;
switch (aSel) {
case 0: // Computation
- if (myScriptPane->isDefined()) {
- SUPERV_INode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(),
+ {
+ SUPERV_CNode aNode = aMain->getDataflow()->INode(myScriptPane->getFuncName().latin1(),
(myScriptPane->getFunction()).in());
if (CORBA::is_nil(aNode)) {
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- aNode->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addComputeNode(SUPERV::CNode::_narrow(aNode));
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aNode, aDummyEndNode, myX, myY );
}
break;
case 1: // Switch
- if (myScriptPane->isDefined()) {
+ {
SUPERV_INode aEndNode;
- SUPERV_SNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(),
+ SUPERV_CNode aStartNode = aMain->getDataflow()->SNode(myScriptPane->getFuncName().latin1(),
(myScriptPane->getFunction()).in(),
aEndNode);
if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- aStartNode->Coords(cx, cy);
- aEndNode->Coords(cx + LABEL_WIDTH*2, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true);
+ addNode( aStartNode, aEndNode, myX, myY );
}
break;
case 2: // Loop
{
SUPERV_INode aEndNode;
- SUPERV_LNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(),
+ SUPERV_CNode aStartNode = aMain->getDataflow()->LNode(myInitPane->getFuncName().latin1(), (myInitPane->getFunction()).in(),
myMorePane->getFuncName().latin1(), (myMorePane->getFunction()).in(),
myNextPane->getFuncName().latin1(), (myNextPane->getFunction()).in(),
aEndNode);
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- aStartNode->Coords(cx, cy);
- aEndNode->Coords(cx + LABEL_WIDTH*2, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addControlNode(SUPERV::CNode::_narrow(aStartNode), SUPERV::CNode::_narrow(aEndNode), true);
+ addNode( aStartNode, aEndNode, myX, myY );
}
break;
case 3: // GoTo
{
- SUPERV_GNode aGotoNode;
+ SUPERV_CNode aGotoNode;
if (myScriptPane->isDefined())
aGotoNode = aMain->getDataflow()->GNode(myScriptPane->getFuncName().latin1(),
(myScriptPane->getFunction()).in(), "");
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- aGotoNode->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addGOTONode(SUPERV::GNode::_narrow(aGotoNode));
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aGotoNode, aDummyEndNode, myX, myY );
}
break;
}
SUPERVGUI_Main* aMain = Supervision.getMain();
if (aMain==0) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NO_SUPERVISION_WINDOW"));
- } else if (!aMain->isEditable()) {
+ }
+ else if (!aMain->isEditable()) {
QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
- } else {
- if (myMFile) {
- SUPERV_Graph aNode;
+ }
+ else {
+ if ( myMFile ) {
+ SUPERV_CNode aNode;
if (aMain->getDataflow()->IsStreamGraph()) {
SUPERV_StreamGraph aSGraph = aMain->getDataflow()->ToStreamGraph();
if (!SUPERV_isNull(aSGraph))
QMessageBox::warning(0, tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
return;
}
- //to appear a new node in the top-left corner of the current viewport
- int cx, cy;
- aMain->getCanvasView()->viewportToContents(myX, myY, cx, cy);
- aNode->Coords(cx, cy);
- myX += NODE_DX;
- myY += NODE_DY;
- aMain->addMacroNode(SUPERV::CNode::_narrow(aNode));
+
+ SUPERV::INode_var aDummyEndNode;
+ addNode( aNode, aDummyEndNode, myX, myY );
}
else {
QMessageBox::warning(QAD_Application::getDesktop(), tr("WARNING"), tr("MSG_NONODE_TOADD"));
void SUPERVGUI_Service::showEvent(QShowEvent* theEvent) {
SUPERVGUI_Main* aMain = Supervision.getMain();
if (aMain && (!aMain->isArrayShown())) {
- aMain->getGraph()->viewportToContents(0, 0, myX, myY);
+ aMain->getArrayView()->viewportToContents(0, 0, myX, myY);
+ //aMain->getGraph()->viewportToContents(0, 0, myX, myY);
}
QDialog::showEvent(theEvent);
}
//*****************************************************
// Pane for Python script editing
//*****************************************************
-SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane(QWidget* theParent)
- : QFrame(theParent)
+SUPERVGUI_PythonEditPane::SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY )
+ : myIsWithLibrary( isNodeCreation ),
+ QFrame( theParent ),
+ myX( theX ), myY( theY )
{
- QGridLayout* aEditLayout = new QGridLayout(this, 2, 4);
+ QGridLayout* aEditLayout = new QGridLayout( this, 2, 8, 0, 6 );
// First row
+ if ( myIsWithLibrary ) {
+ QPushButton* aLibBtn = new QPushButton(tr("BUT_LIBRARY"), this);
+ connect(aLibBtn, SIGNAL(clicked()), this, SLOT(library()));
+ aEditLayout->addMultiCellWidget( aLibBtn, 0, 0, 1, 2 );
+ }
+
QPushButton* aLoadBtn = new QPushButton(tr("BUT_LOAD"), this);
connect(aLoadBtn, SIGNAL(clicked()), this, SLOT(loadFile()));
- aEditLayout->addWidget(aLoadBtn, 0, 2);
+ aEditLayout->addMultiCellWidget( aLoadBtn, 0, 0, 3, 4 );
- myNextBtn = new QPushButton(tr("BUT_NEXT"), this);
- myNextBtn->setEnabled(false);
- connect(myNextBtn, SIGNAL(clicked()), this, SLOT(readFunction()));
+ myFunctionsCombo = new QComboBox( this );
+ connect( myFunctionsCombo, SIGNAL( activated( int ) ), this, SLOT( readFunction( int ) ) );
- aEditLayout->addWidget(myNextBtn, 0, 3);
+ aEditLayout->addMultiCellWidget( myFunctionsCombo, 0, 0, 5, 7 );
//Second row
myText = new QTextEdit(this);
- myText->setWordWrap(QTextEdit::FixedColumnWidth);
- myText->setWrapColumnOrWidth(80);
+ myText->setTextFormat( Qt::PlainText ); // NOT rich text, so text() returns plain text
+ myText->setWordWrap( QTextEdit::FixedColumnWidth );
+ myText->setWrapColumnOrWidth( 80 );
+ connect( myText, SIGNAL( returnPressed() ), this, SLOT( autoIndentLine() ) );
- aEditLayout->addMultiCellWidget(myText, 1, 1, 0, 3);
+ aEditLayout->addMultiCellWidget( myText, 1, 1, 0, 7 );
+ //aEditLayout->setColStretch( 3, 1 ); // to allow myFunctionsCombo be larger when needed
+}
+
+/**
+ * Return a text between "def" and "("
+ * "def" must begin with position 0, which means that only global function definitions are possible
+ */
+QString getFunctionName( const QString& aLine ) {
+ int aDefPos = aLine.find("def");
+ if ( aDefPos == 0 ) { // only global function definitions!
+ int aStart = aLine.find(" ", aDefPos);
+ int aEnd = aLine.find("(", aStart);
+ QString aName = aLine.mid(aStart, (aEnd-aStart));
+ return aName.stripWhiteSpace();
+ }
+ return QString();
}
/**
aLine = theStream.readLine();
if ( !aLine.isNull() && aLine.find("def") == 0 ) {
+ myFunctionsCombo->insertItem( getFunctionName( aLine ) ); // aLine now == function name
+
aPyFunction += aLine;
aPyFunction += '\n';
aLine = theStream.readLine();
// asv : 23.11.04 : added "|| aLine.isEmpty()" - fix for PAL6870. readLine() returns an empty
// string for "\n" string, it trails \n caracter. but we accept such lines..
- while ( !aLine.isNull() && ( aLine.isEmpty() || aLine[0].isSpace() ) ) {
+ // asv : 22.12.04 : aLine[0].isSpace() || aLine[0]=='#' -> line must begin with space or tab
+ // (a normal code with indentation) or comment sign.
+ while ( !aLine.isNull() && ( aLine.isEmpty() || aLine[0].isSpace() || aLine[0] == '#' ) ) {
aPyFunction += aLine;
aPyFunction += '\n';
aLine = theStream.readLine();
}
myPyFunctions.clear();
- myPyIndex = -1;
- myNextBtn->setEnabled( false );
+ myFunctionsCombo->clear();
myText->clear();
QTextStream aFileReader(&aFile);
initPyFunctions( aFileReader );
- if ( myPyFunctions.size() ) {
- myNextBtn->setEnabled( true );
- myPyIndex = 0;
- readFunction();
- }
+ if ( myPyFunctions.size() )
+ readFunction( 0 );
}
/**
* asv : Comment above is old! Present model: just take an already read string = PyFunction
* from the list which is filled in loadFile().
*/
-void SUPERVGUI_PythonEditPane::readFunction() {
+void SUPERVGUI_PythonEditPane::readFunction( int i ) {
myText->clear();
- if ( myPyIndex != -1 && myPyFunctions.size() && myPyFunctions.size() > myPyIndex )
- myText->append( myPyFunctions[ myPyIndex++ ] );
- if ( myPyFunctions.size() <= myPyIndex ) // last index was reached
- myNextBtn->setEnabled( false );
+ if ( i != -1 && myPyFunctions.size() && myPyFunctions.size() > i )
+ myText->append( myPyFunctions[ i ] );
+
+ // asv : 30.11.04 : 2.7 - Inline node function editor improvement
+ // 2.7.1 - set focus to editor widget on editor window opening
+ // 2.7.2 - scroll to the beginning of function on editor window opening
+ myText->setFocus();
+ myText->ensureVisible( 0,0 );
}
/**
* Returns the text after "def" and before "(" -- first defined function name
*/
QString SUPERVGUI_PythonEditPane::getFuncName() {
- QString aName("");
for (int i=0; i < myText->paragraphs(); i++) {
- QString aLine = myText->text(i);
- int aDefPos = aLine.find("def");
- if (aDefPos == 0) {
- int aStart = aLine.find(" ", aDefPos);
- int aEnd = aLine.find("(", aStart);
- QString aName = aLine.mid(aStart, (aEnd-aStart));
- return aName.stripWhiteSpace();
- }
+ QString aName = getFunctionName( myText->text(i) );
+ if ( !aName.isEmpty() )
+ return aName;
}
- return aName;
+ return QString();
}
/**
void SUPERVGUI_PythonEditPane::setFunction(SUPERV_Strings theStr) {
- int aLen = theStr->length();
- for (int i=0; i < aLen; i++)
+ myText->clear();
+ for ( int i=0, aLen = theStr->length(); i < aLen; i++ )
myText->append(QString(theStr[i]));
// asv : 30.11.04 : 2.7 - Inline node function editor improvement
myText->ensureVisible( 0,0 );
}
+/**
+ * Automatic indentation rule: if a previous line ended with
+ * ':', then add N additional spaces in the current line. If no ':' found, then
+ * the same amount of spaces as in the previous line is added. Connected to
+ * "returnPressed" signal of myText text edit.
+*/
+void SUPERVGUI_PythonEditPane::autoIndentLine() {
+ const int N = 4; // width of indentation "tab"
+ if ( myText && myText->paragraphs() ) {
+
+ // get current cursor position and previous line (the one to be analized)
+ int pos, para, i;
+ myText->getCursorPosition( ¶, &pos ); // pos==0, beginning of line
+ QString line = myText->text( para-1 ); // previous paragraph line
+
+ // construct a string containing all leading space characters of previous line (tabs, etc.)
+ QString spacesStr;
+ i = -1;
+ while ( line[++i].isSpace() ) // append all isSpace() characters at beginning of line to spacesStr
+ spacesStr += line[i];
+
+ // if ':' was found -- add more spaces to spacesStr
+ line = line.stripWhiteSpace();
+ if ( line[ line.length()-1 ] == ':' ) {
+ i = 0;
+ while ( i++ < N )
+ spacesStr += ' ';
+ }
+
+ // ok, append spacesStr at the beginning of the current line = make indentation
+ myText->insertAt( spacesStr, para, pos );
+ myText->setCursorPosition( para, pos+spacesStr.length() );
+ }
+}
+/**
+ * Create a node by loading it from an external XML library file
+ * This slot opens a dialog box which then "lives" by itself..
+ */
+void SUPERVGUI_PythonEditPane::library() {
+ // if CanImport() returns false, it displays an error message box, so there is no need to
+ // display such message here ("library file not found", etc.).
+ if ( SUPERVGUI_Library::getLibrary()->CanImport() ) {
+ SUPERVGUI_LibDlg* aDlg = new SUPERVGUI_LibDlg( this, myX, myY );
+ aDlg->exec();
+ }
+}
/*!
* Edit Python dialog
*/
-SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg(bool isLoop)
- :QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+SUPERVGUI_EditPythonDlg::SUPERVGUI_EditPythonDlg( bool isLoop )
+ :QDialog(QAD_Application::getDesktop(), 0, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
{
setSizeGripEnabled( true );
setCaption(tr("TIT_FUNC_PYTHON"));
resize( 500, 250 );
QVBoxLayout* aMainLayout = new QVBoxLayout(this, 7, 4);
+ int a,b; // dummies for PythonEditPane, not used, since library = false and myX, myY are not used in PythonEditPane
if (isLoop) {
QTabWidget* aLoopTabPane = new QTabWidget(this);
- myInitPane = new SUPERVGUI_PythonEditPane(this);
+ myInitPane = new SUPERVGUI_PythonEditPane( this, false, a, b ); // library == false, since no creation of a node is needed here
aLoopTabPane->addTab(myInitPane, "Init");
- myMorePane = new SUPERVGUI_PythonEditPane(this);
+ myMorePane = new SUPERVGUI_PythonEditPane( this, false, a, b );
aLoopTabPane->addTab(myMorePane, "More");
- myNextPane = new SUPERVGUI_PythonEditPane(this);
+ myNextPane = new SUPERVGUI_PythonEditPane( this, false, a, b );
aLoopTabPane->addTab(myNextPane, "Next");
aMainLayout->addWidget(aLoopTabPane);
} else {
- myEditPane = new SUPERVGUI_PythonEditPane(this);
+ myEditPane = new SUPERVGUI_PythonEditPane( this, false, a, b );
aMainLayout->addWidget(myEditPane);
}
QGroupBox* aBtnBox = new QGroupBox( this );
aMainLayout->addWidget(aBtnBox);
}
+
+/**
+ * Do the following actions for newly created Engine's CNode:
+ * 1. Create a presentation for it (CanvasNode)
+ * 2. Place the CanvasNode to the current top-left corner or the current viewport
+ * 3. Increment the coordinates of the next CanvasNode (new nodes are "cascaded" when several of them are created at once)
+ * PS theEndNode is passed only for Loop and Switch nodes (EndLoop and EndSwitch)
+ */
+void SUPERVGUI_Service::addNode( SUPERV::CNode_var theNode, SUPERV::INode_var theEndNode, int& theX, int& theY ) {
+ if ( !CORBA::is_nil( theNode ) ) {
+ int cx, cy; //to appear a new node in the top-left corner of the current viewport
+ SUPERVGUI_Main* aMain = Supervision.getMain();
+
+ //2.8 point of improvements: Adding node to graph window with taking into account zoom factor
+ QWMatrix aWM = aMain->getCanvasView()->worldMatrix();
+ aMain->getCanvasView()->viewportToContents(theX, theY, cx, cy);
+
+ //2.8 point of improvements:
+ cx = (int)((double)cx/aWM.m11());
+ cy = (int)((double)cy/aWM.m22());
+ theNode->Coords(cx, cy);
+ if ( !CORBA::is_nil( theEndNode ) )
+ theEndNode->Coords(cx + LABEL_WIDTH*2, cy);
+ theX += (int)(NODE_DX*aWM.m11());
+ theY += (int)(NODE_DY*aWM.m22());
+
+ if ( theNode->IsGOTO() )
+ aMain->addGOTONode( theNode );
+ else if ( theNode->IsMacro() )
+ aMain->addMacroNode( theNode );
+ else if ( theNode->IsLoop() || theNode->IsSwitch() )
+ aMain->addControlNode( theNode, SUPERV::CNode::_narrow( theEndNode ), true );
+ else
+ aMain->addComputeNode( theNode );
+ }
+}
+
#include <qhgroupbox.h>
#include <qwidgetstack.h>
+class QListBox;
-//*****************************************************
-// Pane for Python script editing
-//*****************************************************
+/*!
+ * Pane for Python script editing
+ */
class SUPERVGUI_PythonEditPane: public QFrame {
+
Q_OBJECT
- public:
- SUPERVGUI_PythonEditPane(QWidget* theParent);
+public:
+ SUPERVGUI_PythonEditPane( QWidget* theParent, const bool isNodeCreation, int& theX, int& theY );
~SUPERVGUI_PythonEditPane() {};
QString getFuncName();
SUPERV_Strings getFunction();
void setFunction(SUPERV_Strings theStr);
- public slots:
+public slots:
+ // load all functions from an XML file into internal structures
void loadFile();
- void readFunction();
- private:
+ // when user presses "Enter" - automatically set indentation of next line
+ void autoIndentLine();
+
+ // when user select another function name in combo box - fill myText with its body
+ void readFunction( int i );
+
+ // when user presses "Library" button - open a "Create node from Library" dialog
+ void library();
+
+private:
+ bool myIsWithLibrary;
QTextEdit* myText;
- QPushButton* myNextBtn;
+ QComboBox* myFunctionsCombo;
// fills myPyFunctions list. called from loadFile() after user selects a file.
void initPyFunctions( QTextStream& );
// in readFunction()
QStringList myPyFunctions;
- // index of currently displayed Python function
- int myPyIndex;
-};
-
+ int& myX; // comes from SUPERVGUI_Service
+ int& myY; // comes from SUPERVGUI_Service
-//*****************************************************
-// Dialog box for node creation
-//*****************************************************
+};
+/*!
+ * Dialog box for node creation
+ */
class SUPERVGUI_Service: public QDialog {
+
Q_OBJECT
- public:
+public:
SUPERVGUI_Service(SALOME_NamingService* ns);
~SUPERVGUI_Service();
void choose();
- protected:
+ /*!
+ * Do the following actions for newly created Engine's CNode:
+ * 1. Create a presentation for it (CanvasNode)
+ * 2. Place the CanvasNode to the current top-left corner or the current viewport
+ * 3. Increment the coordinates of the next CanvasNode (new nodes are "cascaded" when several of them are created at once)
+ * PS theEndNode is passed only for Loop and Switch nodes (EndLoop and EndSwitch)
+ */
+ static void addNode( SUPERV::CNode_var theNode, SUPERV::INode_var theEndNode, int& theX, int& theY );
+
+protected:
void showEvent(QShowEvent* theEvent);
- private:
+private:
void initialise();
- private slots:
+private slots:
void tabChanged(QWidget *);
void addComputeNode();
void addFactoryNode();
void typeNodeSelected(int theRow);
void loadGraph();
- private:
- QListView* components;
+private:
+ QListView* components;
SALOME_NamingService* naming;
int myX, myY;
QWidgetStack* myStackWidget;
* Edit Python dialog
*/
class SUPERVGUI_EditPythonDlg: public QDialog {
+
Q_OBJECT
- public:
+public:
SUPERVGUI_EditPythonDlg(bool isLoop = false);
~SUPERVGUI_EditPythonDlg() {};
void setNextFunction(SUPERV_Strings theStr)
{ myNextPane->setFunction(theStr); }
- private:
+private:
SUPERVGUI_PythonEditPane* myEditPane;
SUPERVGUI_PythonEditPane* myInitPane;
SUPERVGUI_PythonEditPane* myMorePane;
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_View.cxx
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-using namespace std;
-#include "SUPERVGUI_View.h"
-#include "SUPERVGUI_Main.h"
-#include "QAD_Config.h"
-#include <qcolordialog.h>
-
-
-#if QT_VERSION >= 0x030005
-QCursor panCursor(Qt::SizeAllCursor);
-#else
-QCursor panCursor(SizeAllCursor);
-#endif
-
-SUPERVGUI_View::SUPERVGUI_View(SUPERVGUI_Main* theMain):
- QScrollView(theMain, 0, Qt::WRepaintNoErase),
- main(theMain)
-{
- myIsPanActivated = false;
- myAddStudyItem = 0;
- myDx = 0;
- myDx = 0;
- myLastX = 0;
- myLastY = 0;
- myIsDragging = false;
- myCursor = cursor();
- myDSItemID = -1;
-
-// myLastMinVisX = horizontalScrollBar()->value(); //viewport()->x();
-// myLastMinVisY = verticalScrollBar()->value(); //viewport()->y();
-
- myPopup = new QPopupMenu(viewport());
-
- if (main->isEditable()) {
- myPopup->insertItem(tr("MSG_ADD_NODE"), main, SLOT(addNode()));
- myPopup->insertItem(tr("MSG_INS_FILE"), main, SLOT(insertFile()));
- myPopup->insertSeparator();
- }
-
- myViewPopup = new QPopupMenu(viewport());
- // myViewPopup->insertItem(tr("POP_FULLVIEW"), main, SLOT(showFullGraph()));
- myViewPopup->insertItem(tr("POP_FULLVIEW"), main, SLOT(showCanvas()));
- myViewPopup->insertItem(tr("POP_CONTROLVIEW"), main, SLOT(showContolFlow()));
- myViewPopup->insertItem(tr("POP_TABLEVIEW"), main, SLOT(showTable()));
- // myViewPopup->insertItem("Previous Full View", main, SLOT(showFullGraph()));
- // myViewPopup->insertItem(tr("POP_CANVASVIEW"), main, SLOT(showCanvas()));
-
- myPopup->insertItem(tr("POP_VIEW"), myViewPopup);
- myPopup->insertSeparator();
-
- myAddStudyItem = myPopup->insertItem(tr("MSG_ADD_STUDY"), this, SLOT(addToStudy()));
- myPopup->insertItem(tr("MSG_CHANGE_INFO"), main, SLOT(changeInformation()));
- myPopup->insertSeparator();
-
- myPopup->insertItem(tr("MSG_COPY_DATAFLOW"), main, SLOT(copy()));
- myPopup->insertItem(tr("MSG_FILTER_NOTIFY"), main, SLOT(filterNotification()));
-
- myPopup->insertSeparator();
- myPopup->insertItem(tr("MSG_CHANGE_BACKGROUND"), this, SLOT(changeBackground()));
-
- QString aRed = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorRed");
- QString aGreen = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen");
- QString aBlue = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue");
-
- if( (!aRed.isEmpty()) && (!aGreen.isEmpty()) && (!aBlue.isEmpty()) ) {
- QColor aColor(aRed.toInt(), aGreen.toInt(), aBlue.toInt());
- setPaletteBackgroundColor(QColor(aRed.toInt(), aGreen.toInt(), aBlue.toInt()));
- } else
- setPaletteBackgroundColor(MAIN_COLOR);
-}
-
-
-SUPERVGUI_View::~SUPERVGUI_View()
-{
-}
-
-bool SUPERVGUI_View::isHavingStreamPort()
-{
- SUPERV::ListOfNodes* aNodesList = main->getDataflow()->Nodes();
-
- //Computing Nodes
- for ( int i = 0 ; i < (int) aNodesList->CNodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->CNodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- //FactoryNodes
- for ( int i = 0 ; i < (int) aNodesList->FNodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->FNodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- //InLineNodes
- for ( int i = 0 ; i < (int) aNodesList->INodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->INodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- //GOTONodes
- for ( int i = 0 ; i < (int) aNodesList->GNodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->GNodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- //LoopNodes
- for ( int i = 0 ; i < (int) aNodesList->LNodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->LNodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- //SwitchNodes
- for ( int i = 0 ; i < (int) aNodesList->SNodes.length() ; i++ ) {
- SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->SNodes)[i]->StreamPorts() );
- if ((int) aStrPortsList.length() > 0) {
- return true;
- }
- }
-
- return false;
-}
-
-void SUPERVGUI_View::addDSPopupItem()
-{
- if (myDSItemID == -1) {
- //Popupmenu items for user specification of parameters, if there are any DataStream ports in the graph
- if (isHavingStreamPort()) {
- myPopup->insertSeparator();
- myDSItemID = myPopup->insertItem(tr("MSG_SET_GRAPHPARAMS"), main, SLOT(changeDSGraphParameters()));
- }
- }
-}
-
-void SUPERVGUI_View::viewportMousePressEvent(QMouseEvent* theEvent)
-{
- myIsDragging = true;
- myLastX = theEvent->globalX();
- myLastY = theEvent->globalY();
-
- if (((theEvent->button() == Qt::MidButton)&&(theEvent->state() == Qt::ControlButton)) || myIsPanActivated) {
- myCursor = cursor();
- setCursor(panCursor);
- return;
- }
- QScrollView::viewportMousePressEvent(theEvent);
-}
-
-void SUPERVGUI_View::viewportMouseMoveEvent(QMouseEvent* theEvent)
-{
- if (myIsDragging && ((theEvent->state() == (Qt::ControlButton|Qt::MidButton)) || myIsPanActivated)) {
- myDx = theEvent->globalX() - myLastX;
- myDy = theEvent->globalY() - myLastY;
-
- myLastX = theEvent->globalX();
- myLastY = theEvent->globalY();
-
- scrollBy(-myDx, -myDy);
- return;
- }
- QScrollView::viewportMouseMoveEvent(theEvent);
-}
-
-
-
-void SUPERVGUI_View::viewportMouseReleaseEvent(QMouseEvent* theEvent)
-{
- myDx = 0;
- myDx = 0;
- myIsDragging = false;
- myIsPanActivated = false;
- setCursor(myCursor);
- QScrollView::viewportMouseReleaseEvent(theEvent);
-}
-
-
-void SUPERVGUI_View::ActivatePanning()
-{
- myIsPanActivated = true;
-}
-
-
-void SUPERVGUI_View::ResetView()
-{
- setContentsPos(0,0);
-}
-
-
-void SUPERVGUI_View::setAsFromStudy(bool theToStudy) {
- if (myAddStudyItem != 0) {
- myPopup->setItemEnabled(myAddStudyItem, !theToStudy);
- }
-}
-
-void SUPERVGUI_View::addToStudy() {
- if (main->addStudy()) main->setAsFromStudy(true);
-}
-
-void SUPERVGUI_View::setPaletteBackgroundColor(const QColor& color) {
- viewport()->setPaletteBackgroundColor(color);
- QScrollView::setPaletteBackgroundColor(color.light());
- repaintContents();
-}
-
-void SUPERVGUI_View::ResizeGraph ( QWidget * theChild, int theX, int theY ) {
-
- int aGraphWidth = contentsWidth();
- int aGraphHeight = contentsHeight();
- if (theX > (contentsWidth() - theChild->width())) {
- myLastX = theX;
- myDx = theChild->width();
- aGraphWidth = theX + theChild->width();
- }
- if (theY > (contentsHeight() - theChild->height())) {
- myLastY = theY;
- myDy = theChild->height();
- aGraphHeight = theY + theChild->height();
- }
-
- setMaximumWidth(aGraphWidth);
- setMaximumHeight(aGraphHeight);
-
- resizeContents(aGraphWidth, aGraphHeight);
-}
-
-int SUPERVGUI_View::getLastX() {
- return myLastX;
-}
-
-int SUPERVGUI_View::getLastY() {
- return myLastY;
-}
-void SUPERVGUI_View::changeBackground()
-{
- QColor selColor = QColorDialog::getColor(viewport()->paletteBackgroundColor(), this );
- if ( selColor.isValid() ) {
- setPaletteBackgroundColor( selColor );
- }
-}
+++ /dev/null
-// SUPERV SUPERVGUI : GUI for Supervisor component
-//
-// Copyright (C) 2003 CEA/DEN, EDF R&D
-//
-//
-//
-// File : SUPERVGUI_View.h
-// Author : Vitaly SMETANNIKOV
-// Module : SUPERV
-
-#ifndef SUPERVGUI_View_H
-#define SUPERVGUI_View_H
-
-//#include "SUPERVGUI.h"
-#include <qpopupmenu.h>
-#include <qscrollview.h>
-
-//VRV: porting on Qt 3.0.5
-#if QT_VERSION >= 0x030005
-#include <qcursor.h>
-#endif
-//VRV: porting on Qt 3.0.5
-
-class SUPERVGUI_Main;
-
-class SUPERVGUI_View: public QScrollView {
- Q_OBJECT
-
- public:
- SUPERVGUI_View(SUPERVGUI_Main* theMain);
- virtual ~SUPERVGUI_View();
-
- SUPERVGUI_Main* getMain() { return main; };
-
- virtual void ActivatePanning();
- virtual void ResetView();
- virtual void setAsFromStudy(bool theToStudy);
-
- void setPaletteBackgroundColor(const QColor& color);
-
- void ResizeGraph( QWidget * theChild, int theX, int theY );
-
- int getLastX();
- int getLastY();
-
- void addDSPopupItem();
-
- public slots:
- void addToStudy();
- void changeBackground();
-
- protected:
- void viewportMouseMoveEvent(QMouseEvent* theEvent);
- void viewportMouseReleaseEvent(QMouseEvent* theEvent);
- void viewportMousePressEvent(QMouseEvent* theEvent);
- bool isHavingStreamPort();
-
- SUPERVGUI_Main* main;
- QPopupMenu* myPopup;
- QPopupMenu* myViewPopup;
- bool myIsPanActivated;
- int myAddStudyItem;
-
- private:
- int myDSItemID;
- int myDx;
- int myDy;
- int myLastX;
- int myLastY;
- bool myIsDragging;
- QCursor myCursor;
-
-
-};
-
-#endif
#
#
#
-# File : SupervisorGUI_msg_en.po
+# File : SUPERV_msg_en.po
# Module : SUPERV
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2001-09-11 12:08:44 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
+"PO-Revision-Date: 2005-01-20 19:47+0300\n"
"Last-Translator: FULLNAME <EMAIL@ADRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
#:SUPERVGUI_Main.cxx:252
msgid "MSG_BAD_WRITING"
-msgstr "Bad Writing File"
+msgstr "Export failed. Backup copy of overwritten file is stored in '%1'"
#:SUPERVGUI_Main.cxx:242
msgid "TTL_EXPORT_DATAFLOW"
msgid "MSG_ORTHO_LINE"
msgstr "Ortho Mode"
-#warnings - all of them must be Supervisor Warning..
+#:SUPERVGUI_Main.cxx:146
msgid "WARNING"
msgstr "Supervisor Warning"
msgid "POP_TABLEVIEW"
msgstr "Table"
+msgid "POP_TABLEVIEWCANVAS"
+msgstr "Canvas Table"
+
msgid "POP_CANVASVIEW"
msgstr "Canvas"
+msgid "POP_FITALL"
+msgstr "Fit All"
+
+msgid "POP_FITWITHINRECT"
+msgstr "Fit Within Rectangle"
+
+msgid "POP_ZOOM"
+msgstr "Zoom"
+
msgid "POP_SHOW"
msgstr "Show"
msgid "BUT_LOAD"
msgstr "Load from file..."
+msgid "BUT_LIBRARY"
+msgstr "Library..."
+
msgid "BUT_NEXT"
msgstr "Next Function"
msgid "ITM_DEL_PORT"
msgstr "Delete"
+msgid "ITM_COPY_PORT"
+msgstr "Copy"
+
+msgid "ITM_PASTE_PORT"
+msgstr "Paste Port"
+
+msgid "ITM_COPY_NODE"
+msgstr "Copy Node"
+
+msgid "ITM_PASTE_NODE"
+msgstr "Paste Node"
+
msgid "MSG_CANT_CREATE_NODE"
msgstr "Can't create node"
msgid "MSG_CANT_CREATE_PORT"
msgstr "Port with empty Name and empty Type can not be created"
+
+msgid "TIT_MANAGE_PORTS"
+msgstr "Edit Ports : "
+
+msgid "INPUT"
+msgstr "Input"
+
+msgid "OUTPUT"
+msgstr "Output"
+
+msgid "TYPE_LBL"
+msgstr "Type:"
+
+msgid "MNU_INPUT"
+msgstr "Input"
+
+msgid "MNU_OUTPUT"
+msgstr "Output"
+
+msgid "MNU_EDIT_FUNC"
+msgstr "Edit Function"
+
+msgid "MNU_ADD_PORT"
+msgstr "Add Port"
+
+msgid "MNU_MANAGE_PORTS"
+msgstr "Edit Ports"
+
+msgid "INLINE_COMP"
+msgstr "Computation"
+
+msgid "INLINE_SWTC"
+msgstr "Switch"
+
+msgid "INLINE_LOOP"
+msgstr "Loop"
+
+msgid "INLINE_GOTO"
+msgstr "GoTo"
+
+msgid "TLT_INVALID_LINK"
+msgstr "Incompatible types"
+
+msgid "MSG_INVALID_LINK"
+msgstr "Warning: the link connect ports of incompatible types.\nYou may keep it and edit types of ports before execution\nor you may remove it now."
+
+msgid "BUT_REMOVE"
+msgstr "Remove"
+
+msgid "MNU_EXPORT"
+msgstr "Export to Library"
+
+msgid "MSG_BAD_INODE"
+msgstr "InLine node export error:\nThe selected node does not seem to be a valid InLine node."
+
+msgid "MSG_ERROR_LIB1"
+msgstr "Error creating a library file and opening for writing."
+
+msgid "MSG_ERROR_LIB_IS_RECREATE"
+msgstr "Library file is corrupt (bad XML structure). Remove it and create a new one?"
+
+msgid "MSG_ERROR_LIB_IO"
+msgstr "Unknown I/O error occured creating new library file."
+
+msgid "MSG_ERROR_LIB_WRITE"
+msgstr "Error writing library file!"
+
+msgid "MSG_ERROR_LIB_NIL_NODE"
+msgstr "Error: the node to be exported is NULL"
+
+msgid "MSG_ERROR_LIB_NIL_COUPLED"
+msgstr "Error: the coupled node of the exported node is NULL"
+
+msgid "MSG_ERROR_LIB_BAD_LOOP"
+msgstr "Error: the Loop/EndLoop nodes pair is incorrect."
+
+msgid "MSG_ERROR_LIB_BAD_SWITCH"
+msgstr "Error: the Switch/EndSwitch nodes pair is incorrect."
+
+msgid "MSG_ERROR_IMPORT_LIB_BAD_XML"
+msgstr "Library file is corrupt (bad XML structure)."
+
+msgid "MSG_ERROR_IMPORT_LIB_NO_XML"
+msgstr "Library file is not found. Export an InLine node to library to create the library file."
+
+msgid "MSG_ERROR_IMPORT_BAD_INDEX"
+msgstr "Index of library node to be imported is out of bounds."
+
+msgid "MSG_ERROR_IMPORT_BAD_KIND_OF_NODE"
+msgstr "Kind of node in the library is incorrect."
+
+msgid "MSG_ERROR_IMPORT_EXCEPTION"
+msgstr "Unknown error occured during import operation."
+
+msgid "MSG_ERROR_EXPORT_EXCEPTION"
+msgstr "Unknown error occured during export operation."
+
+msgid "TIT_LIB_DLG"
+msgstr "Inline Library"
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2001-09-11 12:08:44 PM CEST\n"
-"PO-Revision-Date: YYYY-MM-DD\n"
+"PO-Revision-Date: 2004-12-02 16:17+0300\n"
"Last-Translator: FULLNAME <EMAIL@ADRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
#:SUPERVGUI_Main.cxx:252
msgid "MSG_BAD_WRITING"
-msgstr "Bad Writing File"
+msgstr "Export failed. Backup copy of overwritten file is stored in '%1'"
#:SUPERVGUI_Main.cxx:242
msgid "TTL_EXPORT_DATAFLOW"
msgid "POP_SHOWPORTS"
msgstr "Ports"
+
+msgid "TIT_MANAGE_PORTS"
+msgstr "Edit Ports : "
+
+msgid "INPUT"
+msgstr "Input"
+
+msgid "OUTPUT"
+msgstr "Output"
+
+msgid "TYPE_LBL"
+msgstr "Type:"
+
+msgid "MNU_INPUT"
+msgstr "Input"
+
+msgid "MNU_OUTPUT"
+msgstr "Output"
+
+msgid "MNU_EDIT_FUNC"
+msgstr "Edit Function"
+
+msgid "MNU_ADD_PORT"
+msgstr "Add Port"
+
+msgid "MNU_MANAGE_PORTS"
+msgstr "Edit Ports"
+
+msgid "INLINE_COMP"
+msgstr "Computation"
+
+msgid "INLINE_SWTC"
+msgstr "Switch"
+
+msgid "INLINE_LOOP"
+msgstr "Loop"
+
+msgid "INLINE_GOTO"
+msgstr "GoTo"
+
+msgid "TLT_INVALID_LINK"
+msgstr "Incompatible types"
+
+msgid "MSG_INVALID_LINK"
+msgstr "Warning: the link connect ports of incompatible types.\nYou may keep it and edit types of ports before execution\nor you may remove it now."
+
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("CNode_Impl::destroy ERROR ") ;
+ }
}
// endService( "CNode_Impl::Destroy" );
}
return RetVal ;
}
-// Old method used in the past for initial study about GOTO and Loop
-// Should not be used
-bool CNode_Impl::Run() {
- beginService( "CNode_Impl::Run" );
- bool RetVal = false ;
- GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
- MESSAGE( "CNode_Impl::Run DataFlowExecutor " << aDataFlowExecutor << Name() << " _IsNode " << _IsNode ) ;
- if ( aDataFlowExecutor ) {
- DataFlowEditor()->EditedAfterExecution( false ) ;
- if ( _IsNode ) {
- RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ;
- }
- else {
- RetVal = aDataFlowExecutor->Run( false ) ;
- }
- }
- endService( "CNode_Impl::Run" );
- return RetVal ;
-}
-
-bool CNode_Impl::ReRun() {
- beginService( "CNode_Impl::ReRun" );
- bool RetVal = false ;
- GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
- if ( aDataFlowExecutor ) {
- DataFlowEditor()->EditedAfterExecution( false ) ;
- if ( _IsNode ) {
- RetVal = aDataFlowExecutor->Run( Name() , Name() , false ) ;
- }
-// The GUI calls directly that method instead of calling Graph_Impl::Run() :
-// I redirect the call to Graph_Impl::Run()
- else if ( DataFlowEditor()->IsEditing() ) {
- RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Run() ;
- }
- else {
- RetVal = aDataFlowExecutor->Run( false ) ;
- }
- }
- endService( "CNode_Impl::ReRun" );
- return RetVal ;
-}
-
-// Old method used in the past for initial study about GOTO and Loop
-// Should not be used
-bool CNode_Impl::ReRunAt( const char * aNodeName ) {
- beginService( "CNode_Impl::ReRunAt" );
- bool RetVal = false ;
- GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
- if ( aDataFlowExecutor ) {
- DataFlowEditor()->EditedAfterExecution( false ) ;
- if ( _IsNode ) {
- RetVal = aDataFlowExecutor->Run( Name() , aNodeName , false ) ;
- }
- }
- endService( "CNode_Impl::ReRunAt" );
- return RetVal ;
-}
-
-bool CNode_Impl::ReStart() {
- beginService( "CNode_Impl::ReStart" );
- bool RetVal = false ;
- GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
- if ( aDataFlowExecutor ) {
- if ( _IsNode ) {
- RetVal = aDataFlowExecutor->Run( Name() , Name() , true ) ;
- }
-// The GUI calls directly that method instead of calling Graph_Impl::Start() :
-// I redirect the call to Graph_Impl::Start()
- else if ( DataFlowEditor()->IsEditing() ) {
- RetVal = ((Graph_Impl::Graph_Impl *) this)->Graph_Impl::Start() ;
- }
- else {
- RetVal = aDataFlowExecutor->Run( true ) ;
- }
- }
- endService( "CNode_Impl::ReStart" );
- return RetVal ;
-}
-
-// Old method used in the past for initial study about GOTO and Loop
-// Should not be used
-bool CNode_Impl::ReStartAt( const char * aNodeName ) {
- beginService( "CNode_Impl::ReStartAt" );
- bool RetVal = false ;
- GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
- if ( aDataFlowExecutor ) {
- if ( _IsNode ) {
- RetVal = aDataFlowExecutor->Run( Name() , aNodeName , true ) ;
- }
- }
- endService( "CNode_Impl::ReStartAt" );
- return RetVal ;
-}
-
long CNode_Impl::CpuUsed() {
long RetVal = 0 ;
GraphExecutor::DataFlow * aDataFlowExecutor = DataFlowEditor()->Executor() ;
bool CNode_Impl::IsExecuting() {
bool RetVal = false;
if ( !IsMacro() && DataFlowEditor() && DataFlowEditor()->Executor() ) {
- // asv : the statement below normally does not return true, Executor_OutNode
+ // asv : the statement below normally does not return true, Executor_OutNode
// sets Editor->Editing() after finishing of execution (see Executor_OutNode.cxx)
if ( DataFlowEditor()->IsExecuting() && DataFlowEditor()->Executor()->IsDone() ) {
DataFlowEditor()->Editing();
}
+
RetVal = DataFlowEditor()->IsExecuting();
}
return RetVal;
virtual bool SuspendDone() ;
virtual bool Resume() ;
- virtual bool Run() ;
- virtual bool ReRun() ;
- virtual bool ReRunAt( const char * aNodeName ) ;
- virtual bool ReStart() ;
- virtual bool ReStartAt( const char * aNodeName ) ;
-
virtual long CpuUsed() ;
virtual bool IsExecuting();
void ELNode_Impl::destroy() {
beginService( "ELNode_Impl::Destroy" );
if ( DataFlowEditor()->IsEditing() ) {
- SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
+// SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
if ( Delete() ) {
_poa->deactivate_object(*_id) ;
CORBA::release(_poa) ;
delete(_id) ;
_thisObj->_remove_ref();
}
- if ( !CORBA::is_nil( aCoupled ) ) {
- aCoupled->SetCoupled( "" ) ;
- aCoupled->destroy() ;
+ else {
+ MESSAGE("ELNode_Impl::destroy ERROR ") ;
}
+// destroy have to be used for the LoopNode ==> destroy of the EndLoopNode
+// if ( !CORBA::is_nil( aCoupled ) ) {
+// aCoupled->SetCoupled( "" ) ;
+// aCoupled->destroy() ;
+// }
}
endService( "ELNode_Impl::Destroy" );
}
if ( DataFlowEditor()->IsEditing() ) {
DeletePorts() ;
RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
- if ( RetVal ) {
- RetVal = DataFlowEditor()->IsValid() ;
- }
+// IsValid is done in LNode_Impl::Delete
+// if ( RetVal ) {
+// RetVal = DataFlowEditor()->IsValid() ;
+// }
}
endService( "ELNode_Impl::Delete" );
return RetVal ;
void ESNode_Impl::destroy() {
beginService( "ESNode_Impl::Destroy" );
if ( DataFlowEditor()->IsEditing() ) {
- SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
+// SUPERV::GNode_ptr aCoupled = SUPERV::GNode::_narrow( Coupled() ) ;
if ( Delete() ) {
_poa->deactivate_object(*_id) ;
CORBA::release(_poa) ;
delete(_id) ;
_thisObj->_remove_ref();
}
- if ( !CORBA::is_nil( aCoupled ) ) {
- aCoupled->SetCoupled( "" ) ;
- aCoupled->destroy() ;
+ else {
+ MESSAGE("ESNode_Impl::destroy ERROR ") ;
}
+// destroy have to be used for the SwitchNode ==> destroy of the EndSwitchNode
+// if ( !CORBA::is_nil( aCoupled ) ) {
+// aCoupled->SetCoupled( "" ) ;
+// aCoupled->destroy() ;
+// }
}
-// endService( "ESNode_Impl::Destroy" );
+ endService( "ESNode_Impl::Destroy" );
}
bool ESNode_Impl::Delete() {
-// beginService( "ESNode_Impl::Delete" );
+ beginService( "ESNode_Impl::Delete" );
bool RetVal = false ;
if ( DataFlowEditor()->IsEditing() ) {
DeletePorts() ;
RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
- if ( RetVal )
- RetVal = DataFlowEditor()->IsValid() ;
+// IsValid is done in SNode_Impl::Delete
+// if ( RetVal ) {
+// RetVal = DataFlowEditor()->IsValid() ;
+// }
}
-// endService( "ESNode_Impl::Delete" );
+ endService( "ESNode_Impl::Delete" );
return RetVal ;
}
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("FNode_Impl::destroy ERROR ") ;
+ }
}
// endService( "FNode_Impl::Destroy" );
}
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("GNode_Impl::destroy ERROR ") ;
+ }
}
// endService( "GNode_Impl::Destroy" );
}
//#include "utilities.h"
+#include "SALOME_Container_i.hxx"
+
#include "StreamGraph_Impl.hxx"
#include "DataFlowEditor_DataFlow.hxx"
*aDataFlowExecutor = new GraphExecutor::DataFlow( orb , NamingService ,
theDataFlowInstanceName.c_str() , dbgfile.c_str() ,
aKindOfNode ) ;
+
MESSAGE( "CreateExecutor " << theDataFlowName << " " << theDataFlowInstanceName << " created with "
<< dbgfile.c_str() ) ;
myNode->SetCoupled( myEndNode->BaseNode()->Name() ) ;
myEndNode->SetCoupled( myNode->BaseNode()->Name() ) ;
Link( myNode->Port( "DoLoop" ) , myEndNode->Port( "DoLoop" ) ) ;
- Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "InitLoop" ) ) ;
+// Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "InitLoop" ) ) ;
+ Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "DoLoop" ) ) ;
}
}
anEndOfLoop = SUPERV::ELNode::_duplicate( iendobject ) ;
}
if ( DataFlowExecutor() ) {
MESSAGE( "Graph_Impl::Begin " << DataFlowExecutor()->Threads() << " threads" )
-// if ( DataFlowExecutor()->Threads() ) {
-// DataFlowExecutor()->JoinedWait() ;
-// }
- delete DataFlowExecutor() ;
- DataFlowEditor()->Executor( NULL ) ;
+ Editing(); // just in case it was not called before by GUI..
}
if ( DataFlowEditor()->IsExecutable() ) {
DataFlowEditor()->EditedAfterExecution( false ) ;
}
return RetVal ;
}
-bool Graph_Impl::Run() {
- beginService( "Graph_Impl::Run" );
+
+/**
+ * run() : was created in order to reduce code dublication, Run() and Start() do the same thing
+ * except for final call to Executor->Run( bool ) - Run() calls with AndSuspend=false
+ * and Start() calls with AndSuspend=true flag. The rest of the actions are the same:
+ * 1. if a MacroNode's coupled graph (MacroLevel>0) -> simply Run() it.
+ * 2. if a Supergraph -> create executor, load dataflow in it (done in Begin()), then - Run() it.
+ */
+bool Graph_Impl::run( const bool andSuspend ) {
bool RetVal = false ;
+
+ // if Editing or Finished state, and, naturally, 'this' is not a MacroNode.
if ( ( DataFlowEditor()->IsEditing() || IsDone() ) && !IsMacro() ) {
- MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() << " IsEditing" );
+
if ( DataFlowEditor()->Graph()->GraphMacroLevel() ) {
- MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel "
- << DataFlowEditor()->Graph()->GraphMacroLevel() ) ;
- RetVal = true ;
+ // MacroGraph's Executor was created in recursive function LoadDataflows(Executor), called from
+ // Begin() of Supergraph. See Begin() and LoadDataflows(Executor) for details.
+ RetVal = true ;
}
else {
- MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel "
- << DataFlowEditor()->Graph()->GraphMacroLevel() << " --> Begin()" ) ;
+ // Create Executor instance and its datamodel
RetVal = Begin() ;
}
if ( RetVal ) {
- MESSAGE( "Graph_Impl::Run " );
+ // Set Executing flag to avoid edition operations during execution, EditedAfterExecution=false
DataFlowEditor()->Executing() ;
- RetVal = CNode_Impl::Run() ;
+ DataFlowEditor()->EditedAfterExecution( false );
+
+ // THE MAIN RUN METHOD
+ RetVal = DataFlowExecutor()->Run( andSuspend );
}
}
-// It is necessary to reload the dataflow because of ports with input initial values changed
-// during execution to values of outport of EndLoopNode or GOTONode
-// else if ( !IsMacro() && IsDone() ) {
-// MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor()
-// << " IsNOTEditing --> CNode_Impl::ReRun" );
-// DataFlowEditor()->Executing() ;
-// RetVal = CNode_Impl::ReRun() ;
-// }
+ return RetVal ;
+
+}
+
+/**
+ * Run() - called on "Execute" command
+ */
+bool Graph_Impl::Run() {
+ beginService( "Graph_Impl::Run" );
+ bool RetVal = run( /*andSuspend=*/false ) ;
MESSAGE( "Graph_Impl::Run " << DataFlowEditor()->Graph()->Name() << " RetVal " << RetVal ) ;
endService( "Graph_Impl::Run" );
return RetVal ;
}
+
+/**
+ * Run() - called on "Execute step-by-step" command
+ */
bool Graph_Impl::Start() {
beginService( "Graph_Impl::Start" );
- bool RetVal = false ;
- if ( ( DataFlowEditor()->IsEditing() || IsDone() ) && !IsMacro() ) {
- MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor() << " IsEditing" );
- if ( DataFlowEditor()->Graph()->GraphMacroLevel() ) {
- MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel "
- << DataFlowEditor()->Graph()->GraphMacroLevel() ) ;
- RetVal = true ;
- }
- else {
- MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " GraphMacroLevel "
- << DataFlowEditor()->Graph()->GraphMacroLevel() << " --> Begin()" ) ;
- RetVal = Begin() ;
- }
- if ( RetVal ) {
- // Added by NKV to fix PAL6222 --> to be confirm by JR ; JR confirmed
- DataFlowEditor()->Executing() ;
- // End of NKV's correction
- MESSAGE( "Graph_Impl::(Re)Start " );
- RetVal = ReStart() ;
- }
- }
-// It is necessary to reload the dataflow because of ports with input initial values changed
-// during execution to values of outport of EndLoopNode or GOTONode
-// else if ( !IsMacro() && IsDone() ) {
-// MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " " << DataFlowEditor()
-// << " IsNOTEditing --> CNode_Impl::ReStart" );
-// DataFlowEditor()->Executing() ;
-// RetVal = CNode_Impl::ReStart() ;
-// }
+ bool RetVal = run( /*andSuspend=*/true ) ;
MESSAGE( "Graph_Impl::Start " << DataFlowEditor()->Graph()->Name() << " RetVal " << RetVal ) ;
endService( "Graph_Impl::Start" );
return RetVal ;
}
anEvent = theEvent ;
aState = theState ;
+
return RetVal ;
}
return SUPERV::StreamGraph::_duplicate( iobject ) ;
}
-
+/**
+ * Destroy Executor and use only Editor and its data model
+ */
+void Graph_Impl::Editing() {
+ if ( DataFlowEditor() && DataFlowExecutor() ) {
+ delete DataFlowExecutor() ;
+ DataFlowEditor()->Executor( NULL );
+ }
+}
virtual long Threads() ;
virtual long SuspendedThreads() ;
+ virtual bool Run() ; // called on "Execute Graph" command
+ virtual bool Start() ; // called on "Execute Graph Step-by-Step" command
+
virtual bool Begin() ;
- virtual bool Run() ;
- virtual bool Start() ;
virtual long LastLevelDone() ;
virtual bool EventNoW( SUPERV::CNode_out aNode ,
virtual SUPERV::StreamGraph_ptr ToStreamGraph() ;
+ virtual void Editing(); // Destroy Executor and use only Editor and its data model
+
+private:
+ bool run( const bool andSuspend = false ); // Run() calls run( false ), Start() calls run( true );
+
};
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("INode_Impl::destroy ERROR ") ;
+ }
}
endService( "INode_Impl::Destroy" );
}
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("LNode_Impl::destroy ERROR ") ;
+ }
if ( !CORBA::is_nil( aCoupled ) ) {
- aCoupled->SetCoupled( "" ) ;
+// aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndLoopNode ) :
aCoupled->destroy() ;
}
+// Valid() only after deletion of the corresponding EndLoopNode :
+ DataFlowEditor()->IsValid() ;
}
endService( "LNode_Impl::Destroy" );
}
if ( DataFlowEditor()->IsEditing() ) {
DeletePorts() ;
RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
- if ( RetVal ) {
- RetVal = DataFlowEditor()->IsValid() ;
- }
+// Valid() only after deletion of the corresponding EndLoopNode :
+// if ( RetVal ) {
+// RetVal = DataFlowEditor()->IsValid() ;
+// }
}
endService( "LNode_Impl::Delete" );
return RetVal ;
return RetVal ;
}
+/**
+ * Return true if InPort's and OutPort's types are compatible
+ * {"string", "boolean", "char", "short", "int", "long", "float", "double", "objref"};
+ * Currently considered compatible ALL types except for objref - they must match exactly
+ * To make sure no other rule of compatibility is used - see Editor::OutNode::IsCompatible().
+ */
+bool Link_Impl::IsValid() {
+ if ( InPort() && OutPort() ) {
+ return DataFlowEditor()->IsCompatible( OutPort()->Type(), InPort()->Type() );
+ }
+ return false;
+}
+
+/**
+ * Return true the ports of this link and theLink are equal. If you do on the GUI side - it does not
+ * return the correct value..
+ */
+bool Link_Impl::IsEqual( SUPERV::Link_ptr theLink ) {
+ if ( InPort() && OutPort() && !CORBA::is_nil(theLink) ) {
+ return ( InPort() == theLink->InPort() && OutPort() == theLink->OutPort() );
+ }
+ return false;
+}
virtual bool RemoveCoord( const long index ) ;
virtual bool Coords( const long index , long & X , long & Y ) ;
+ virtual bool IsValid(); // returns true if inPort() and outPort() are type-compatible
+
+ virtual bool IsEqual( SUPERV::Link_ptr theLink ); // returns true if GraphBase::InPort-s and OutPort-s of
+ // this Link and theLink are equal
} ;
delete(_id) ;
_thisObj->_remove_ref();
}
+ else {
+ MESSAGE("SNode_Impl::destroy ERROR ") ;
+ }
if ( !CORBA::is_nil( aCoupled ) ) {
- aCoupled->SetCoupled( "" ) ;
+// aCoupled->SetCoupled( "" ) ; : Used in GraphBase::Graph::RemoveNode( EndSwitchNode ) :
aCoupled->destroy() ;
}
+// Valid() only after deletion of the corresponding EndSwitchNode :
+ DataFlowEditor()->IsValid() ;
}
-// endService( "SNode_Impl::Destroy" );
+ endService( "SNode_Impl::Destroy" );
}
bool SNode_Impl::Delete() {
-// beginService( "SNode_Impl::Delete" );
+ beginService( "SNode_Impl::Delete" );
bool RetVal = false ;
if ( DataFlowEditor()->IsEditing() ) {
DeletePorts() ;
RetVal = DataFlowEditor()->RemoveNode( Name() ) ;
- if ( RetVal )
- RetVal = DataFlowEditor()->IsValid() ;
+// Valid() only after deletion of the corresponding EndLoopNode :
+// if ( RetVal ) {
+// RetVal = DataFlowEditor()->IsValid() ;
+// }
}
-// endService( "SNode_Impl::Delete" );
+ endService( "SNode_Impl::Delete" );
return RetVal ;
}
return self.N.DoneW()
def SuspendedW( self ):
return self.N.SuspendedW()
- def ReRun( self ):
- return self.N.ReRun()
- def ReStart( self ):
- return self.N.ReStart()
- def ReRunAt( self , aNodeName ):
- return self.N.ReRunAt( aNodeName )
- def ReStartAt( self , aNodeName ):
- return self.N.ReStartAt( aNodeName )
+ #def ReRun( self ):
+ # return self.N.ReRun()
+ #def ReStart( self ):
+ # return self.N.ReStart()
+ #def ReRunAt( self , aNodeName ):
+ # return self.N.ReRunAt( aNodeName )
+ #def ReStartAt( self , aNodeName ):
+ # return self.N.ReStartAt( aNodeName )
def Ping( self ):
return self.N.ping()
def Kill( self ):
else {
_InputValue = _DataFlowEditor->HasInput( _ParameterName ) ;
}
- if ( _InputValue && _DataFlowEditor->IsEditing() ) {
+ GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+ if ( _DataFlowExecutor ) {
+ anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name ,
+ _ParameterName ) ) ;
+ }
+ else if ( _InputValue ) {
anAny = new CORBA::Any( * _DataFlowEditor->GetInData( name ,
_ParameterName ) ) ;
}
else {
- GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
- if ( _DataFlowExecutor ) {
- anAny = new CORBA::Any( * _DataFlowExecutor->GetInData( name ,
- _ParameterName ) ) ;
- }
- else {
- anAny = new CORBA::Any( *_Any ) ;
- }
+ anAny = new CORBA::Any( *_Any ) ;
}
}
else {
- if ( _InputValue && _DataFlowEditor->IsEditing() ) {
- anAny = new CORBA::Any( * _DataFlowEditor->GetOutData( name ,
- _ParameterName ) ) ;
+ GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+ if ( _DataFlowExecutor ) {
+ anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name ,
+ _ParameterName ) ) ;
}
else {
- GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
- if ( _DataFlowExecutor ) {
- anAny = new CORBA::Any( * _DataFlowExecutor->GetOutData( name ,
- _ParameterName ) ) ;
- }
- else {
- anAny = new CORBA::Any( *_Any ) ;
- }
+ anAny = new CORBA::Any( *_Any ) ;
}
}
}
char * Value_Impl::ToString() {
// beginService( "Value_Impl::ToString" );
CORBA::Any anAny = *ToAny() ;
-// cout << "Value_Impl::ToString " << _DataFlowNode->Name() << " "
-// << _ParameterName << " " ;
if ( _DataFlowEditor ) {
char * name ;
if ( _DataFlowNode ) {
else {
name = _DataFlowEditor->Graph()->Name() ;
}
+// cout << "Value_Impl::ToString " << name << " " << _ParameterName << " " ;
if ( _InputPort ) {
if ( _DataFlowNode ) {
_InputValue = _DataFlowNode->HasInput( _ParameterName ) ;
else {
_InputValue = _DataFlowEditor->HasInput( _ParameterName ) ;
}
- if ( _InputValue && _DataFlowEditor->IsEditing() ) {
+ GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+ if ( _DataFlowExecutor ) {
+// cout << "_DataFlowExecutor->GetInData" << endl ;
+ anAny = * _DataFlowExecutor->GetInData( name ,
+ _ParameterName ) ;
+ }
+ else if ( _InputValue ) {
+// cout << "_DataFlowEditor->GetInData _DataFlowNode " << _DataFlowNode
+// << " _InputValue " << _InputValue << endl ;
anAny = * _DataFlowEditor->GetInData( name ,
_ParameterName ) ;
}
else {
- GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
- if ( _DataFlowExecutor ) {
- anAny = * _DataFlowExecutor->GetInData( name ,
- _ParameterName ) ;
- }
+ anAny = *_Any ;
}
}
else {
- if ( _InputValue && _DataFlowEditor->IsEditing() ) {
- anAny = * _DataFlowEditor->GetOutData( name ,
- _ParameterName ) ;
+ GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
+ if ( _DataFlowExecutor ) {
+ anAny = * _DataFlowExecutor->GetOutData( name ,
+ _ParameterName ) ;
}
else {
- GraphExecutor::DataFlow * _DataFlowExecutor = _DataFlowEditor->Executor() ;
- if ( _DataFlowExecutor ) {
- anAny = * _DataFlowExecutor->GetOutData( name ,
- _ParameterName ) ;
- }
+ anAny = *_Any ;
}
}
}
return self.N.DoneW()
def SuspendedW( self ):
return self.N.SuspendedW()
- def ReRun( self ):
- return self.N.ReRun()
- def ReStart( self ):
- return self.N.ReStart()
- def ReRunAt( self , aNodeName ):
- return self.N.ReRunAt( aNodeName )
- def ReStartAt( self , aNodeName ):
- return self.N.ReStartAt( aNodeName )
+ #def ReRun( self ):
+ # return self.N.ReRun()
+ #def ReStart( self ):
+ # return self.N.ReStart()
+ #def ReRunAt( self , aNodeName ):
+ # return self.N.ReRunAt( aNodeName )
+ #def ReStartAt( self , aNodeName ):
+ # return self.N.ReStartAt( aNodeName )
def Ping( self ):
return self.N.ping()
def Kill( self ):
class GraphE(Graph):
##########################################################
def __init__( self , aName ):
- graph = SuperVision.GraphE( aName )
- self.G = graph
- self.G.Verbose = 1
- self.N = graph
- self.N.Verbose = 1
+ try:
+ graph = SuperVision.GraphE( aName )
+ except:
+ try:
+ graph = aName.G.Copy()
+ except:
+ graph = aName
+ if graph != None :
+ if graph.IsStreamGraph() :
+ aGraph = graph.ToStreamGraph()
+ if aGraph != None :
+ graph = StreamGraphE( aGraph )
+ else :
+ print "Graph creation failed"
+ self.G = graph
+ self.G.Verbose = 1
+ self.N = graph
+ self.N.Verbose = 1
+ else :
+ print "Graph creation failed"
def ToStreamGraph( self ):
aGraph = self.G.ToStreamGraph()
if aGraph != None :