Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/datafiles.git] / Yacs / Schemas / forwhile1.xml
diff --git a/Yacs/Schemas/forwhile1.xml b/Yacs/Schemas/forwhile1.xml
new file mode 100644 (file)
index 0000000..a04cd18
--- /dev/null
@@ -0,0 +1,75 @@
+<!--
+  Copyright (C) 2006-2011  CEA/DEN, EDF R&D
+
+  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<proc>
+    <!--a Python node in a while loop in a for loop (3 steps) in a bloc 
+        The while ends when p1 < 40
+        condition is not reinitialized so we get 2 steps in the while
+        and 2 more steps in the for loop
+    -->
+    <!--types -->
+    <!--nodes -->
+    <inline name="n" >
+        <script>
+            <code>nstep=3</code>
+        </script>
+        <outport name="nstep" type="int"/>
+    </inline>
+    <bloc name="b">
+      <forloop name="b1" >
+            <while name="l" >
+              <inline name="node2" >
+                <function name="f">
+                  <code>a=0</code>
+                  <code>def f(p1):</code>
+                  <code>  global a</code>
+                  <code>  p1= p1+10.</code>
+                  <code>  print "a:",a</code>
+                  <code>  a=a+p1</code>
+                  <code>  print "p1:",p1</code>
+                  <code><![CDATA[  condition=(p1 < 40.)]]> </code>
+                  <code>  return p1,condition</code>
+                </function>
+                <inport name="p1" type="double"/>
+                <outport name="p1" type="double"/>
+                <outport name="condition" type="bool"/>
+              </inline>
+    <datalink> <fromnode>node2</fromnode><fromport>condition</fromport>
+              <tonode>b.b1.l</tonode> <toport>condition</toport> </datalink>
+    <datalink> <fromnode>node2</fromnode><fromport>p1</fromport>
+              <tonode>node2</tonode> <toport>p1</toport> </datalink>
+            </while>
+      </forloop>
+    </bloc>
+    <!--control links -->
+    <!--data links -->
+    <datalink> <fromnode>n</fromnode><fromport>nstep</fromport>
+               <tonode>b.b1</tonode> <toport>nsteps</toport> </datalink>
+    <!--parameters -->
+    <parameter>
+        <tonode>b.b1.l.node2</tonode> <toport>p1</toport>
+        <value><double>23</double> </value>
+    </parameter>
+    <parameter>
+        <tonode>b.b1.l</tonode> <toport>condition</toport>
+        <value><boolean>true</boolean></value>
+    </parameter>
+
+</proc>