8 To work with YACS module the user can activate it in two ways:
13 #. by activating YACS item in :ref:`modules`,
16 #. by click YACS toolbar button on :ref:`modules`.
22 For the correct activation of YACS module it is necessary to install YACS GUI libraries and set YACS_ROOT_DIR environment variable pointed to the directory with installed binaries.
24 If there is no any study opened/created, during the YACS module activation the user has possibility to choose between opening an existing study and creating a new one. When YACS module has been activated, YACS GUI :ref:`main_menu` and :ref:`toolbars` corresponding to the state when no calculation schema is being edited or run are shown:
28 .. image:: images/functionality_list_0.jpg
34 In such a case there are only possibilities for the user to create or import (YACS or SUPERV XML) a schema.
36 :ref:`object_browser` shows tree representation of YACS objects in the current study.
39 Import/Export a schema
40 ----------------------
41 To display either in :ref:`viewer` or in the :ref:`object_browser` and :ref:`tree_view` and edit a schema the user can import the schemas' XML file. The modified schema object can be saved into the specified XML file with help of :ref:`export_schema` YACS GUI command.
43 .. _import_yacs_schema:
45 Import YACS calculation schema
46 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 The command **Import Schema --> YACS XML** is accessible from :ref:`file` or from the corresponding toolbar button on the :ref:`schema`. On this command call a standard open file dialog box appears and lets user to select desirable YACS XML file.
51 .. image:: images/functionality_list_1.jpg
56 **Import YACS XML schema dialog**
59 Imported schema is shown as an entry in :ref:`object_browser`.
61 If a selected YACS XML file has incorrect structure, a part of a schema that has been imported successfully (before an error occurred) will be represented in :ref:`object_browser` and :ref:`viewer` and the user will be able to work with it. YACS GUI shows an error message with error description in such a
64 Dimensions of drawing area occupied by a graph, positions and dimensions of node presentations, positions of internal link points and type of :ref:`change_2d_representation_schema` is retrieved from YACS XML file in order to correct 2D representation of the schema in the 2D Viewer.
66 .. _import_supervisor_graph:
68 Import SALOME Supervisor graph
69 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 This operation is intended for importing an XML files containing description of calculation schema and having logical structure adopted by existing SALOME 4 Supervisor module. The command **Import Schema --> SUPERV XML** is available from :ref:`file` or from the corresponding toolbar button on the :ref:`schema`. On this command
71 call a standard open file dialog box appears and lets user to select desirable SUPERV XML file.
75 .. image:: images/functionality_list_2.jpg
80 **Import SUPERV XML schema dialog**
83 Imported schema is shown as an entry in Object Browser.
85 If a selected SUPERV XML file has incorrect structure, a part of a schema that has been imported successfully (before an error occurred) will be represented in Object Browser and 2D Viewer and the user will be able to work with it. YACS GUI shows an error message with error description in such a case.
87 After importing of the SUPERV XML file has been completed a 2D representation of the schema (nodes and links) is displayed in the 2D Viewer.
91 Export a schema to a file
92 ~~~~~~~~~~~~~~~~~~~~~~~~~
93 If user wants to store modifications done in the existing schema or save a new created graph into the YACS XML file, it is needed to make the schema active and choose the **Export schema** command from :ref:`file` or the corresponding toolbar button on the :ref:`schema`. As a result a standard save file dialog appears and lets
94 user to input or select desirable YACS XML file name to export the active schema in it.
98 .. image:: images/functionality_list_3.jpg
103 **Export schema dialog**
106 YACS module writes description of a schema and its child objects into an XML file. Additionally, schema 2D presentation data is saved in new created XML file.
111 The user can start his work with the saved earlier study document. To open a saved study, the user has to activate common SALOME 4 GUI operation with help of **Open** command from :ref:`file` or **Open document** toolbar button on the :ref:`standard`. SALOME unpacks YACS XML files from the study. YACS module reads them and re-
112 creates the study structure. If XML files in a study have incorrect structure, YACS GUI says that the loaded study is incomplete by showing an error message.
116 .. image:: images/functionality_list_4.jpg
121 **Open a study dialog**
124 If the user finished his work, he can save a study for the future by calling **Save** command from :ref:`file` or **Save document** toolbar button on the :ref:`standard`. YACS module stores all schemas from the current study to XML files, which are then packed into a single HDF5 study file by SALOME.
128 .. image:: images/functionality_list_5.jpg
133 **Save a study dialog**
136 .. _set_user_preferences:
140 In the frames of the YACS module the user has a possibility to set his own preferences. There are the following preferences in the YACS GUI for SALOME 4.1:
148 + Stream link draw color
154 + Link highlight color
160 These preferences can be set by the user with help of standard SALOME 4 GUI operation of editing preferences: **Preferences ...** command from :ref:`file`. But in versions after YASC GUI for SALOME 4.1 the set of preferences can be extended by colors for various node types and states during execution, by preferences for external Python code editor and probably some
163 After the user changed the preferences in the Preferences dialog box for YACS module
167 .. image:: images/functionality_list_6.jpg
172 **Preferences dialog for YACS module**
175 the system applies the new values of preferences to relevant objects immediately.
180 Object Browser, Tree View and 2D Viewer provides user with the possibility to select an object. The user can select objects in 2D Viewer or Tree View. There is the mechanism to synchronize selection between 2D Viewer and Tree View in YACS module.
184 .. image:: images/functionality_list_7.jpg
192 In 2D Viewer the user can select/hilight nodes, ports and links. In the Tree View the user can select containers definitions, component instances definitions, nodes, ports, data types and links.
194 At the current moment YACS module supports only single selection, i.e. the user clicks on a single object with the mouse. However, the following kinds of interactive selection will be implemented in further versions:
199 + **Multiple** - the user clicks on different objects while holding SHIFT key pressed. This type of selection is needed, for example, for creation of link between two ports selected in the Object Browser.
202 + **With rectangle** - the user selects one or several objects by clicking first corner of a rectangle in 2D Viewer and dragging the mouse pointer to the opposite corner with the left mouse button pressed. All objects inside the rectangle become selected.
205 + **SHIFT mode** - the user clicks on the same object or select object(s) with a rectangle holding SHIFT key pressed, and the system deselects objects that were selected and select objects that were not selected before.
211 The 2D Viewer displays selected/hilighted objects in a distinctive way that allows the user to identify the selected/hilighted objects easily.
213 The system state after interactive selection depends on the type of selected object(s):
218 + **A single editable object is selected:** Input Panel is shown and contains property pages for the selected object and in some cases for its parent objects in a schema hierarchy. For instance, if an inline script node is selected either in 2D Viewer or in the Tree View, the property page for the selected node will be displayed in the Input Panel.
220 .. image:: images/functionality_list_8.jpg
227 If the user selects SALOME service node, property pages for node, its component and container will be shown in the Input Panel.
230 + **Several objects or a single object that has no editable properties is selected:** Input Panel is hidden.
233 + **Nothing is selected:** Input Panel is hidden.
238 .. _activate_context_popup_menu:
240 Activate context popup menu
241 ---------------------------
242 In the YACS module the user can perform a set of operations on the different types of objects shown in the Object Browser and Tree View of the schema with help of context popup menu. For this purpose, the user has to click the right mouse button in the Object Browser or in the Tree View of the schema to select the object and choose needed menu item from context popup menu, which contains commands
243 applicable to the current selection. For empty selection, only commands applicable to the window (Object Browser, schema Tree View or 2D Viewer) in general are shown in context menu:
248 + Object Browser: **Refresh** and **Find** operations are available.
251 + Schema Tree View: nothing.
254 + 2D Viewer: **Change background color** operation is available.
260 When a single object is selected in the Object Browser, its context popup menu contains all operations applicable to objects of the given type. Additionally, it contains **Expand all** command for expanding all collapsed items in the selected objects' sub-tree.
262 Specific operations available for each type of objects selected in the Object Browser are given in the Table 1 below.
264 .. |schema| image:: images/schema.png
265 .. |yacs| image:: images/yacs.png
266 .. |run| image:: images/run.png
268 +---------------------------+-----------+---------------------------------------------------------------------------------+
269 | **Selected object type** | **Icon** | **Available context menu commands** |
270 +===========================+===========+=================================================================================+
271 | YACS root item | |yacs| | Standard Salome **Refresh** and **Find** popup menu items. |
272 +---------------------------+-----------+---------------------------------------------------------------------------------+
273 | Schema | |schema| | **New execution** - create a run schema object. |
275 | | | **Load execution state** - restore execution state for the |
276 | | | selected schema from an XML file. It is useful if the user |
277 | | | wants to continue the execution from a state saved |
278 | | | previously. For more detailed information see |
279 | | | :ref:`save_restore_execution_state` section. |
281 | | | Standard Salome **Refresh** and **Find** popup menu items. |
282 +---------------------------+-----------+---------------------------------------------------------------------------------+
283 |Execution (run) of a schema| |run| | **New edition** - create a run schema copy for edition. |
284 | | | For more detailed information see :ref:`create_new_edition` |
287 | | | Standard Salome **Refresh** and **Find** popup menu items. |
288 +---------------------------+-----------+---------------------------------------------------------------------------------+
291 **Table 1. Context popup menus in the Object Browser**
293 When a single object is selected in the Tree View of a schema, its context popup menu contains all operations applicable to objects of the given type.
295 Specific operations available in the **edition mode** for each type of objects selected in the Tree View are given in the Table 2 below.
297 .. |container| image:: images/container.png
298 .. |component| image:: images/component.png
299 .. |block| image:: images/block_node.png
300 .. |switch| image:: images/switch_node.png
301 .. |loop| image:: images/loop_node.png
302 .. |node| image:: images/node.png
303 .. |inport| image:: images/in_port.png
304 .. |outport| image:: images/out_port.png
305 .. |control| image:: images/control_link.png
306 .. |data| image:: images/data_link.png
307 .. |stream| image:: images/stream_link.png
311 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
312 | **Selected object type** | **Icon** | **Available context menu commands** |
313 +================================+=============+=====================================================================================+
314 |Schema | |schema| | |
315 | | |**Export** - export the selected schema into the |
316 | | |YACS XML file. |
318 | | |**Create a Data Type** (further version) - create a user |
319 | | |defined data type inside the schema. |
321 | | |**Create a Container definition** - create an empty container |
322 | | |with the default name **containerN** (where N = 0,1,2,...) |
323 | | |inside the current schema. |
325 | | |**Create a node** - menu which contains submenu for creation |
326 | | |different types of nodes inside the current schema. |
328 | | |**Execute** - execute the selected schema, i.e. create a run |
329 | | |schema object. |
331 | | |**Copy** (further version) - copy a schema with all its |
332 | | |components to the buffer. |
334 | | |**Paste** (further version) - paste items (if any) from the |
335 | | |buffer into the current schema. |
337 | | |**Display** (further version) - display the content of the |
338 | | |selected schema in the 2D Viewer. |
340 | | |**Erase** (further version) - close the 2D Viewer of the |
341 | | |selected schema. |
342 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
343 |Data Types | |**Edit** (further version) - gives the possibility to edit |
344 | | |data types inside the current schema. |
346 | | |**Import a Data Type** - add a data type from the session |
347 | | |catalog or data types catalog of another schema into the |
348 | | |current schema. |
349 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
350 |Containers | |**Create a Container definition** - create an empty container |
351 | | |with the default name **containerN** (where N = 0,1,2,...) |
352 | | |inside the current schema. |
353 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
354 |SALOME container definition | |container| | |
355 | | |**Create a component instance definition --> SALOME** - create a new SALOME component|
356 | | |and publish it in the Tree View. |
358 | | |**Create a component instance definition --> SALOME Python** (further version) - |
359 | | |create a new SALOME Python component and publish it in the Tree View. |
361 | | |**Copy** (further version) - copy a container object. |
363 | | |**Paste** (further version) - insert copied objects (if any SALOME components have |
364 | | |been copied) under the selected container. |
366 | | |**Delete** - delete a container object with all its content. |
367 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
368 |SALOME component instance | |component| | |
369 | | |**Create a node --> From catalog** - create a SALOME service node within the active |
370 | | |schema and publish it in the Tree View. In such a case the type of service node is |
371 | | |chosen from the catalog of services available inside the selected component. |
372 |SALOME Python component instance| |component| | |
373 | | |**Create a node --> Service inline** (further version) - create a service inline |
374 | | |node within the active schema and publish it in the Tree View. |
376 | | |**Copy** (further version) - copy a component object. |
378 | | |**Delete** - delete a component object with all its content. |
379 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
380 |CORBA component instance | |component| |**Copy** (further version) - copy a component object. |
382 | | |**Delete** - delete a component object with all its content. |
383 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
387 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
388 | **Selected object type** | **Icon** | **Available context menu commands** |
389 +================================+=============+=====================================================================================+
390 |Block node | |block| |**Create a node** - menu which contains submenu for creation different types of |
391 | | |nodes inside the selected composed node. |
392 |SWITCH node | |switch| | |
393 | | |**Create a loop** - menu which contains submenu for creation FOR, FOREACH or WHILE |
394 | | |loop nodes inside the corresponding level of the current schema hierarchy. |
395 | | |Such new created loop node has the selected node as a body. |
397 | | |**Add to library** (further version) - save selected node to the selected directory |
400 | | |**Add control link to other node** - connect the selected node and the next selected |
401 | | |node with the control flow link. The first selected node is the output node and the |
402 | | |second selected node is the input node for the new created control link. |
404 | | |**Copy** (further version) - copy the selected composed node object. |
406 | | |**Delete** - delete the selected composed node object with all its content. |
408 | | |**Display** (further version) - display the composed node in the 2D Viewer. |
410 | | |**Erase** (further version) - erase the composed node from the 2D Viewer |
411 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
412 |FOR loop node | |loop| |**Create a body** - menu which contains submenu for creation different types of |
413 | | |nodes inside the selected loop node. Such new created node becomes a body of the |
414 | | |selected loop node. |
415 |FOREACH loop node | |loop| | |
416 | | |**Create a loop** - menu which contains submenu for creation FOR, FOREACH or WHILE |
417 | | |loop nodes inside the corresponding level of the current schema hierarchy. |
418 | | |Such new created loop node has the selected node as a body. |
419 |WHILE loop node | |loop| | |
420 | | |**Add to library** (further version) - save selected node to the selected |
421 | | |directory as XML file. |
423 | | |**Add control link to other node** - connect the selected node and the next selected |
424 | | |node with the control flow link. The first selected node is the output node and |
425 | | |the second selected node is the input node for the new created control link. |
427 | | |**Copy** (further version) - copy the selected loop node object. |
429 | | |**Delete** - delete the selected loop node object with all its content. |
431 | | |**Display** (further version) - display the loop node in the 2D Viewer. |
433 | | |**Erase** (further version) - erase the loop node from the 2D Viewer. |
434 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
435 |Node of any other type | |node| |**Create a loop** - menu which contains submenu for creation FOR, FOREACH or WHILE |
436 | | |loop nodes inside the corresponding level of the current schema hierarchy. Such new |
437 | | |created loop node has the selected node as a body. |
439 | | |**Add to library** (further version) - save selected node to the selected directory |
442 | | |**Add control link to other node** - connect the selected node and the next selected |
443 | | |node with the control flow link. The first selected node is the output node and the |
444 | | |second selected node is the input node for the new created control link. |
446 | | |**Copy** (further version) - copy the selected node object. |
448 | | |**Delete** - delete the selected node object. |
450 | | |**Display** (further version) - display the selected node in the 2D Viewer. |
452 | | |**Erase** (further version) - erase the selected node from the 2D Viewer. |
453 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
455 Port and link objects.
457 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
458 | **Selected object type** | **Icon** | **Available context menu commands** |
459 +================================+=============+=====================================================================================+
460 |Input port | |inport| |**Delete** - delete the selected input port object. This menu item is available only |
461 | | |for input ports of non-service nodes. |
462 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
463 |Output port | |outport| |**Add dataflow link** - add the data (flow or stream) / control link from the |
464 | | |selected port to the other (selected later). |
466 | | |**Add data link** - add a simple data link from the selected port to the other |
467 | | |(selected later) without control link automatically added. This functionality is |
468 | | |needed inside loop nodes. |
470 | | |**Delete** - delete the selected output port object. This menu item is available |
471 | | |only for output ports of non-service nodes. |
472 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
473 |Control link | |control| |**Delete** - delete the selected link object, update Tree View and 2D Viewer content |
474 | | |according to this operation. |
475 |Data link | |data| | |
477 |Datastream link | |stream| | |
479 +--------------------------------+-------------+-------------------------------------------------------------------------------------+
482 **Table 2. Context popup menus in the Tree View of a schema, edition mode**
484 There are no any popup menus available on the objects selected in the Tree View of a schema in the **run mode** .
486 .. _set_active_schema_or_run:
488 Set active schema or run of a schema
489 ------------------------------------
490 Active schema is a YACS schema from the current study that is used implicitly in all YACS GUI operations working with a schema. Typically, a study can contain several YACS schemas and several executions (run) for a schema. For some YACS GUI operations such as creation of a node, it is convenient to add a new object (node) to the currently active schema.
492 YACS GUI allows the user to set a schema/run as active by double click on the schema/run object in the Object Browser or by switching between 2D Viewers showing different schemas/runs.
494 The active schema is used in creation/execution operations.