Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / doc / dataflow.rst
1
2 :tocdepth: 3
3
4 A standard dataflow
5 -------------------
6 Let's consider a YACS schema containing Block, FOR loop and inline script nodes with data ports.
7
8 The first step is to import the schema from YACS XML file. One of the ways for the user to do it is to click on the **Import schema** button on the :ref:`schema` and choose **YACS XML** item from the pull-down list. Let's open legendre7.xml from YACS_SRC/src/gui directory.
9
10 After import operation, arrangement of the schema nodes and **Fit All** operation we have the following state of Salome 4.1 application.
11
12
13
14 .. image:: images/functionality_list_98.jpg
15   :align: center
16
17
18 .. centered::
19   **The result of legendre7.xml import**
20
21
22 For more convenient view of a schema representation in 2D Viewer the user can rebuild schemas' links with help of **Rebuild links** command from :ref:`visualization`. The result will be the following.
23
24
25
26 .. image:: images/functionality_list_99.jpg
27   :align: center
28
29
30 .. centered::
31   **Representation of a schema after rebuild links operation**
32
33
34 To change input value of the schemas' node it is needed to select this node either in schema 2D Viewer or in the Tree View of a schema. And after that change input ports values with help of corresponding controls on the property page of the selected node. But in our case, if we want to execute a body of the **loopiter** node 5 times we have to change the **nsteps** output port value of **init**
35 node from 3 to 5 with help of its property page, and press "Apply" button on the Input Panel schema 2D Viewer.
36
37
38 .. image:: images/functionality_list_100.jpg
39   :align: center
40   :width: 38ex
41
42
43 .. centered::
44   **Property page of init node**
45
46
47 In order to execute this schema the user should to create a run of the schema with help of **New execution** button on the :ref:`execution_toolbar`. After a new schema run has been created, schema run Tree View is constructed and schema run object is published in the Object Browser.
48
49
50 .. image:: images/functionality_list_101.jpg
51   :align: center
52   :width: 40ex
53
54
55 .. centered::
56   **Object Browser content and schema run Tree View**
57
58
59 If the user selects schema object in the Tree View, Input Panel with schema property page will occur. Errors raised during create execution process is shown in the 'Error Log' list box of schema property page in the run mode. In our case there are no errors occured during creation of execution.
60
61
62 .. image:: images/functionality_list_102.jpg
63   :align: center
64   :width: 38ex
65
66
67 .. centered::
68   **Schema property page in the run mode**
69
70
71 To use :ref:`breakpoints run mode <breakpoints_mode>` it is sufficient for the user to set breakpoints on nodes using check boxes in the run Tree View. Let's set one breakpoint - on **iter2** node inside **deuxIter** block.
72
73
74 .. image:: images/functionality_list_103.jpg
75   :align: center
76   :width: 40ex
77
78
79 .. centered::
80   **Set breakpoint in run Tree View**
81
82
83 Start execution with help of **Start/Resume** button on :ref:`execution_toolbar` in run mode. Execution is paused on the **iter2** node inside **deuxIter** block. The run Tree View displays states of nodes.
84
85
86 .. image:: images/functionality_list_104.jpg
87   :align: center
88   :width: 41ex
89
90
91 .. centered::
92   **Run Tree View of paused schema**
93
94
95 Now try to save execution state of the schema by clicking :ref:`save_restore_execution_state` button on :ref:`execution_toolbar`. Save the current state of execution into /tmp/legendre7_exec_state.xml file.
96
97
98
99 .. image:: images/functionality_list_105.jpg
100   :align: center
101   :width: 60ex
102
103 .. centered::
104   **Save the current execution state of legendre7.xml schema**
105
106
107 Now execute the schema using **Start/Resume** button until the execution of the schema is finished, making sure that **loopiter** node had been executed 5 times.
108
109
110 .. image:: images/functionality_list_106.jpg
111   :align: center
112   :width: 40ex
113
114
115 .. centered::
116   **Execution of legendre7.xml schema is finished**
117
118
119 The user can check values of output ports with help of 'Output ports' table on the propertty page of a node.
120
121
122 .. image:: images/functionality_list_107.jpg
123   :align: center
124   :width: 64ex
125
126
127 .. centered::
128   **Output port values of iter_1 node**
129
130
131 Let's try to load saved execution state of legendre7.xml schema. After this operation run Tree View should be in the same state as at the moment of saving execution state.
132
133
134 .. image:: images/functionality_list_108.jpg
135   :align: center
136   :width: 40ex
137
138
139 .. centered::
140   **Run Tree View after load execution state**
141
142
143 Continue execution of the schema from the saved state and check values of output ports when execution is finished. They should be the same as obtained earlier during the first execution.
144
145