Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / doc / scratch.rst
index 2028c06682dde3da375c5d63766fc5bbc37ef167..6df29d9279474973f2c48383e2b33dc926670e12 100644 (file)
@@ -7,8 +7,8 @@ Creation of a schema from scratch
 ---------------------------------
 In order to describe each main action let's describe step by step the creation of a simple schema from scratch.
 
-After launching of Salome 4.1 activate YACS module with help of :ref:`modules`. In order to create a new schema it is needed to choose **New Schema** command from :ref:`file` or from the corresponding toolbar button on the :ref:`schema`. Having these operations done the state of the Salome
-4.1 application would be like the following:
+After launching of SALOME activate YACS module with help of :ref:`modules`. In order to create a new schema it is needed to choose **New Schema** command from :ref:`file` or from the corresponding toolbar button on the :ref:`schema`. Having these operations done the state of the SALOME
+application would be like the following:
 
 
 
@@ -20,9 +20,13 @@ After launching of Salome 4.1 activate YACS module with help of :ref:`modules`.
   **A new empty schema is created**
 
 
-Create an inline script node by calling **Inline script** command from :ref:`creation`. As a result a new inline script node ( **PyScript0** in our example) without ports will be displayed in the 2D Viewer and the corresponding node object will be published in **Nodes** folder in the edition Tree View under the schema object.
+Create an inline script node by using the context menu on the **newSchema_1** node. 
 
+.. image:: images/scratch1.jpg
+  :align: center
 
+As a result a new inline script node ( **PyScript0** in our example) without ports will be displayed in the 2D Viewer 
+and the corresponding node object will be published in the edition Tree View under the schema object **newSchema_1**.
 
 .. image:: images/functionality_list_84.jpg
   :align: center
@@ -32,19 +36,23 @@ Create an inline script node by calling **Inline script** command from :ref:`cre
   **Schema with a new created inline script node**
 
 
-Further by the same way it is easy to create, for example, FOR loop node by choosing **FOR loop** command from :ref:`creation`. To simplify schema presentation in the 2D Viewer and makes it easier for the user perception it is recommended to use auto-arrange graph nodes operation which is accessible from :ref:`visualization`.
-
-
+Further by the same way it is easy to create, for example, a FOR loop node by choosing **For Loop Node** entry 
+in the context menu. To simplify schema presentation in the 2D Viewer and makes it easier for the user perception 
+it is recommended to use auto-arrange graph nodes operation which is accessible from the context menu : entry **arrange local nodes**
+for an automatic placement on one level of nodes or entry **arrange nodes recursion** for an automatic placement
+on all levels.
 
 .. image:: images/functionality_list_85.jpg
   :align: center
 
 
 .. centered::
-  **FOR loop node has been added into the schema and 'Arrange nodes' operation has been applied**
+  **FOR loop node has been added into the schema**
 
 
-Let's create a block node as a body of a new FOR loop node. For this purpose it is needed to select this node object ( **ForLoop0** in our example) in the Tree View and call **Create a body --> Block** item from its context popup menu.
+Let's create a block node as a body of the new FOR loop node. For this purpose it is needed to select this node object ( **ForLoop1** 
+in our example) in the Tree View and call **Create Node --> bloc Node** item from its context popup menu. This operation is also possible
+from the node context menu in the 2D Viewer.
 
 
 
@@ -56,7 +64,9 @@ Let's create a block node as a body of a new FOR loop node. For this purpose it
   **Creation of a body node**
 
 
-As a result of this operation a block node with empty content will be added inside FOR loop node as its body node. The presentation of the schema in the 2D Viewer will be changed and block node item ( **Bloc0** in our example) will appear in the Tree View structure under its father FOR loop node.
+As a result of this operation a block node with empty content will be added inside FOR loop node as its body node. The presentation of 
+the schema in the 2D Viewer will be changed and block node item ( **Bloc2** in our example) will appear in the Tree View structure 
+under its father FOR loop node.
 
 
 
@@ -68,7 +78,8 @@ As a result of this operation a block node with empty content will be added insi
   **Tree View structure and presentation in the 2D Viewer after body block node creation**
 
 
-Now it's time to fill in created block node with a child nodes. Select block node item in the Tree View and call **Create a node --> From catalog** item from context popup menu.
+Now it's time to fill in created block node with a child nodes. Select block node item in the Tree View and call
+**Create Node --> Node from Catalog** item from context popup menu.
 
 
 
@@ -80,7 +91,8 @@ Now it's time to fill in created block node with a child nodes. Select block nod
   **Fill in block node content**
 
 
-Input Panel with catalogs' content is displayed on the right side of the applications' desktop. Choose **Add** method from **AddComponent** component and press "Apply" button.
+Input Panel with catalogs' content is displayed on the right side of the applications' desktop. Choose **Add** service 
+from **AddComponent** component and drag and drop it onto the bloc node.
 
 
 
@@ -92,7 +104,7 @@ Input Panel with catalogs' content is displayed on the right side of the applica
   **Choose a SALOME service node from the session catalog**
 
 
-After closing the Input Panel we can see the following representation of a schema in the 2D Viewer.
+After the drag and drop, we can see the following representation of a schema in the 2D Viewer.
 
 
 
@@ -104,31 +116,23 @@ After closing the Input Panel we can see the following representation of a schem
   **SALOME service node is created inside the block**
 
 
-Tree View structure is changed and now block node contains one SALOME service node ( **SalomeNode0** in our case), which executes the method named **Add** from **AddComponent** component of Salome.
+Tree View structure is changed and now block node contains one SALOME service node ( **Add3** in our case), which executes 
+the service named **Add** from **AddComponent** component of SALOME.
 
-So, the structure of the schema is defined and now it is the time to create input/output ports of schemas' nodes.
+So, the structure of the schema is defined and now it is time to create input/output ports of schemas' nodes.
 
-Firstly, let's consider inline script node **PyScript0** . To show Input Panel with node properties select **PyScript0** object either in the Tree View or in the 2D Viewer. Then activate "Output Ports" tab in the "Edit Ports" group of the Input Panel and click **+** button above the table of output ports. A new line corresponding to a new output port is added to the table. By default a new port is
-a dataflow port and has a type of double. Let's input **stepNum** in the "Name" column as a name of a new port, change the type of port to **int** with help of pull-down list of the "Type" column and type
+Firstly, let's consider inline script node **PyScript0**. To show Input Panel with node properties select **PyScript0** node 
+either in the Tree View or in the 2D Viewer. Then activate "Output Ports" tab in the "Edit Ports" group of the Input Panel
+and choose a data type (**int**) in the drop down menu. A new line corresponding to a new output port is added to the table. 
+This new port is a dataflow port and has a type of int. Let's input **stepNum** in the "Name" column as the name of the 
+new port and type
 
 .. sourcecode:: python
 
     stepNum=3
 
-in the built-in python code editor as an inline python script of the node.
-
-
-
-.. image:: images/functionality_list_91.jpg
-  :align: center
-
-
-.. centered::
-  **Addition of output port and fill in python script for the PyScript0 node**
-
-
-After pressing "Apply" button on the Input Panel a new output port **stepNum** is added to the **PyScript0** node and the structure of the Tree View and nodes' presentation in the 2D Viewer are changed in order to reflect these modifications.
-
+in the built-in python code editor as an inline python script of the node. Finally, click on the **Apply** button to validate all
+the changes. The structure of the Tree View and nodes’ presentation in the 2D Viewer are changed in order to reflect these modifications.
 
 
 .. image:: images/functionality_list_92.jpg
@@ -139,19 +143,9 @@ After pressing "Apply" button on the Input Panel a new output port **stepNum** i
   **2D Viewer and Tree View updates after port addition**
 
 
-Further, link **stepNum** output port of the **PyScript0** node with **nsteps** input port of the **ForLoop0** node. For this purpose the user should to select **stepNum** output port object in the Tree View and call **Add dataflow link** command from its context popup menu.
-
-
-
-.. image:: images/functionality_list_93.jpg
-  :align: center
-
-
-.. centered::
-  **Activate command for dataflow link addition**
-
-
-After that select the **nsteps** input port of the **ForLoop0** node either in the Tree View or in the 2D Viewer. This port is considered as the end port of a new created link. Now the state of the Salome 4.1 application should be as the following:
+Further, link **stepNum** output port of the **PyScript0** node with **nsteps** input port of the **ForLoop1** node. For this purpose 
+the user should select **stepNum** output port object in the 2D Viewer and drag and drop it onto input port **nsteps** of the **ForLoop1** node.
+This port is considered as the end port of the newly created link. Now the state of the SALOME application should be as the following:
 
 
 
@@ -163,7 +157,8 @@ After that select the **nsteps** input port of the **ForLoop0** node either in t
   **A dataflow link is added**
 
 
-In order to make the presentation of the schema more convenient from the user point of view the links can be rebuilt with help of **Rebuild links** command from :ref:`visualization`.
+In order to make the presentation of the schema more convenient from the user point of view the links and nodes can be 
+automatically placed with help of **arrange nodes recursion** command from the context menu of **newShema_1** node.
 
 
 
@@ -172,10 +167,12 @@ In order to make the presentation of the schema more convenient from the user po
 
 
 .. centered::
-  **A schema 2D Viewer representation after links rebuilding**
+  **A schema 2D Viewer representation after nodes placement**
 
 
-To create a valid schema it is needed also to set the values for input ports of the **SalomeNode0** node. For this purpose the user should to activate the Input Panel with SALOME service node properties by selecting **SalomeNode0** node either in the Tree View or in the 2D Viewer and change the content of "Value" column to, for example, **4.4** and **-3.1** double values for **x** and **y** input
+To create a valid schema it is needed also to set the values for input ports of the **Add3** node. For this purpose the user should 
+activate the Input Panel with SALOME service node properties by selecting **Add3** node either in the Tree View or in the 2D Viewer 
+and change the content of "Value" column to, for example, **4.4** and **-3.1** double values for **x** and **y** input
 port correspondingly.
 
 
@@ -187,18 +184,6 @@ port correspondingly.
 .. centered::
   **Set input ports values for SALOME service node**
 
-
-On the figure below the presentation of the schema after applying these changes is represented.
-
-
-
-.. image:: images/functionality_list_97.jpg
-  :align: center
-
-
-.. centered::
-  **Completely created schema**
-
-
-Now the schema is completely created. The user, for example, can export the schema into XML file (see :ref:`export_schema` section) for future import or execute this schema immediately (see :ref:`execute_schema` section).
+Now the schema is completely created. The user, for example, can export the schema into XML file (see :ref:`export_schema` section) 
+for future import or execute this schema immediately (see :ref:`execute_schema` section).