]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Loop with negative values
authorrahuel <rahuel@opencascade.com>
Wed, 12 Jan 2005 13:51:03 +0000 (13:51 +0000)
committerrahuel <rahuel@opencascade.com>
Wed, 12 Jan 2005 13:51:03 +0000 (13:51 +0000)
examples/GraphSwitch2.py
examples/GraphSwitch2.xml

index 62f3d755b9ea2f732f03078ee797f2b9b9bac5a3..3bdae8d84bf55820cc546051a794908b76ef7615 100644 (file)
@@ -1,15 +1,15 @@
 
-# Generated python file of Graph GraphSwitch_1
+# Generated python file of Graph GraphSwitch_1_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 )
+# 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
     
@@ -20,7 +20,7 @@ def DefGraphSwitch_1() :
     PyIsOdd.append( '    print a,"IsOdd (GraphSwitch)"      ' )
     PyIsOdd.append( '    sleep( 1 )   ' )
     PyIsOdd.append( '    return a     ' )
-    IsOdd = GraphSwitch_1.INode( 'IsOdd' , PyIsOdd )
+    IsOdd = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd )
     IsOdd.SetName( 'IsOdd' )
     IsOdd.SetAuthor( '' )
     IsOdd.SetComment( 'Python function' )
@@ -36,7 +36,7 @@ def DefGraphSwitch_1() :
     PyIsEven.append( '    print a,"IsEven (GraphSwitch)"       ' )
     PyIsEven.append( '    sleep( 1 )    ' )
     PyIsEven.append( '    return a      ' )
-    IsEven = GraphSwitch_1.INode( 'IsEven' , PyIsEven )
+    IsEven = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven )
     IsEven.SetName( 'IsEven' )
     IsEven.SetAuthor( '' )
     IsEven.SetComment( 'Compute Node' )
@@ -62,7 +62,7 @@ def DefGraphSwitch_1() :
     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 )
+    InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
     EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
     EndOfInitLoopSwitch.SetAuthor( '' )
     EndOfInitLoopSwitch.SetComment( 'Compute Node' )
@@ -95,14 +95,14 @@ def DefGraphSwitch_1() :
     
     # 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.SNode( 'Switch' , 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' )
@@ -125,38 +125,38 @@ def DefGraphSwitch_1() :
     OSwitchDefault = Switch.GetOutPort( 'Default' )
     
     # Creation of Links
-    LIsOddaEndOfSwitcha = GraphSwitch_1.Link( OIsOdda , IEndOfSwitcha )
+    LIsOddaEndOfSwitcha = GraphSwitch_1_1.Link( OIsOdda , IEndOfSwitcha )
     
-    LInitLoopSwitchIndexSwitcha = GraphSwitch_1.Link( OInitLoopSwitchIndex , ISwitcha )
+    LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha )
     
-    LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+    LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
     
-    LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+    LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
     
-    LIsEvenaEndOfSwitcha = GraphSwitch_1.Link( OIsEvena , IEndOfSwitcha )
+    LIsEvenaEndOfSwitcha = GraphSwitch_1_1.Link( OIsEvena , IEndOfSwitcha )
     
-    LSwitchOddIsOddGate = GraphSwitch_1.Link( OSwitchOdd , IIsOddGate )
+    LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate )
     
-    LSwitchEvenIsEvenGate = GraphSwitch_1.Link( OSwitchEven , IIsEvenGate )
+    LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate )
     
-    LSwitchaIsOdda = GraphSwitch_1.Link( OSwitcha , IIsOdda )
+    LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda )
     
-    LSwitchaIsEvena = GraphSwitch_1.Link( OSwitcha , IIsEvena )
+    LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena )
     
-    LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1.Link( OSwitchDefault , IEndOfSwitchDefault )
+    LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault )
     
-    LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+    LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
     
     # Input datas
     IInitLoopSwitchIndex.Input( 0 )
-    IInitLoopSwitchMin.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
+    return GraphSwitch_1_1
 
 
-GraphSwitch_1 = DefGraphSwitch_1()
+GraphSwitch_1_1 = DefGraphSwitch_1_1()
index bb2c0f299ac2981efc447a20324344b76b885fa7..98d34c18a4dad1204b070718485cd26fe0510e0c 100644 (file)
@@ -5,11 +5,11 @@
 <node>
 <component-name>?</component-name>
     <interface-name>?</interface-name>
-    <node-name>GraphSwitch_1</node-name>
+    <node-name>GraphSwitch_1_1</node-name>
     <kind>1</kind>
     <coupled-node>?</coupled-node>
     <service>
-<service-name>GraphSwitch_1</service-name>
+<service-name>GraphSwitch_1_1</service-name>
      <inParameter-list>
 <inParameter>
 <inParameter-type>long</inParameter-type>
@@ -33,7 +33,7 @@
     <DataStream-list/>
     <PyFunction-list/>
     <creation-date>1/10/2003 - 17:23:54</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <lastmodification-date>12/1/2005 - 17:7:20</lastmodification-date>
     <editor-release>1.05</editor-release>
     <author>?</author>
     <container>?</container>
@@ -66,8 +66,8 @@
       <PyFunc><![CDATA[    print a,"IsOdd (GraphSwitch)"      ]]></PyFunc>
       <PyFunc><![CDATA[    sleep( 1 )   ]]></PyFunc>
       <PyFunc><![CDATA[    return a     ]]></PyFunc>     </PyFunction>    </PyFunction-list>
-    <creation-date>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <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>
       <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>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <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>
 <PyFunction>
 <FuncName>?</FuncName>
       <PyFunc><![CDATA[?]]></PyFunc>     </PyFunction>    </PyFunction-list>
-    <creation-date>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <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>
       <PyFunc><![CDATA[    print a,"IsEven (GraphSwitch)"       ]]></PyFunc>
       <PyFunc><![CDATA[    sleep( 1 )    ]]></PyFunc>
       <PyFunc><![CDATA[    return a      ]]></PyFunc>     </PyFunction>    </PyFunction-list>
-    <creation-date>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <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>
     <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>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+      <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>
 <PyFunction>
 <FuncName>EndSwitch_1</FuncName>
       <PyFunc><![CDATA[?]]></PyFunc>     </PyFunction>    </PyFunction-list>
-    <creation-date>11/1/2005 - 18:44:50</creation-date>
-    <lastmodification-date>11/1/2005 - 18:44:50</lastmodification-date>
+    <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>
     <coord-list/>   </link>  </link-list>
   <data-list>
 <data>
-<fromnode-name>GraphSwitch_1</fromnode-name>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
     <fromserviceparameter-name>InitLoopSwitch__Index</fromserviceparameter-name>
     <tonode-name>InitLoopSwitch</tonode-name>
     <toserviceparameter-name>Index</toserviceparameter-name>
      <value>0</value>    </data-value>
     <coord-list/>   </data>
    <data>
-<fromnode-name>GraphSwitch_1</fromnode-name>
+<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>0</value>    </data-value>
+     <value>-5</value>    </data-value>
     <coord-list/>   </data>
    <data>
-<fromnode-name>GraphSwitch_1</fromnode-name>
+<fromnode-name>GraphSwitch_1_1</fromnode-name>
     <fromserviceparameter-name>InitLoopSwitch__Max</fromserviceparameter-name>
     <tonode-name>InitLoopSwitch</tonode-name>
     <toserviceparameter-name>Max</toserviceparameter-name>