4 Modification of a schema
5 ========================
9 YACS GUI uses the following approach for creation of all kinds of YACS objects:
11 #. Optionally, the user selects some item (or items) in the Tree View or in the 2D Viewer that acts as input parameter(s) for creation.
12 #. Then the user activates corresponding GUI command to create an object of required type.
13 #. The new object appears in the Tree View and 2D Viewer of a schema. In order to show Input Panel with the property page of a new
14 created object the user should select a new created object in the Tree View or 2D Viewer of a schema. After that the user can modify
15 properties of a new created object via the corresponding property page on the Input Panel.
17 More detailed information about the creation of certain objects types is given in sections below.
19 .. _create_new_schema:
23 The YACS module provides the user with capabilities not only for modification, but also for creation of the graphs. The user can
24 create a new schema by calling **YACS -> New Schema** command from :ref:`file` or from the corresponding toolbar button on the :ref:`schema`.
26 .. image:: images/functionality_list_9.jpg
29 As a result of this operation, YACS module creates an empty instance of a schema object, new schema object is shown in the Object
30 Browser and the Tree View is created for a new empty schema. The schema object is shown as a root of Tree View structure. Schema root
31 object of the Tree View will be used as a parent for the schema sub-trees and all new objects added to the schema will appear under
34 .. image:: images/functionality_list_10.jpg
38 **New created schema**
40 New schema object becomes the active one. In order to display Input Panel with schemas' property page containing properties of the
41 schema the user should select schema root object in the Tree View. The property page of a schema allows the user to modify
42 schemas' properties (see :ref:`pp_for_schema` section).
44 .. _create_container_definition:
46 Create a container definition
47 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 To create a container use the command **Create container** from the context menu of the folder **Containers** in the Tree View.
50 .. image:: images/functionality_list_11.jpg
53 On this command call a SALOME container with a default name and default machine parameters is created.
55 As a result of container creation, YACS module creates a new container definition object and shows it in the Tree View under 'Containers' folder.
56 It is used as a parent item for all component instances created in this container.
58 .. image:: images/functionality_list_12.jpg
61 As soon as user selects a container object in the Tree View, Input Panel containing property page of the selected container is shown
62 (for the sample of the property page see :ref:`pp_for_container` section) and allows the user to modify its properties. In the container
63 property page the user can specify parameters of a created container object, such as the name of the container and machine parameters.
65 .. _create_component_instance_definition:
67 Create a component instance definition
68 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69 At the current moment YACS module does not provide a functionality to create directly component instance.
70 The component instances are created indirectly when nodes are created (see :ref:`create_node`).
72 When a component instance is created (following the creation of a node), a new SALOME component instance definition is shown in
73 the Tree View under its container object.
75 .. image:: images/functionality_list_16.jpg
78 As soon as user selects a component instance definition in the Tree View, Input Panel containing property page of the component instance
79 definition object is shown (for the sample of the property page see :ref:`pp_for_component_instance_definition` section).
85 YACS module provides the user with a specific GUI command for creation of each type of node.
87 At the current moment in the frames of the YACS module the user can create nodes of the following types:
94 The node object can be created with help of **Create Node --> Inline Function Node** command from the Tree View context menu
96 .. image:: images/functionality_list_19a.jpg
99 or from the 2D Viewer context menu. The context menu must be activated on the chosen parent node.
101 .. image:: images/functionality_list_19.jpg
106 .. image:: images/functionality_list_18.jpg
110 **Example of inline function node with ports**
112 Now, if you want to modify the settings of this node, use the associated panel :ref:`pp_for_inline_node`.
119 The node object can be created with help of **Create Node --> Inline Script Node** command from the Tree View context menu or
120 from the 2D Viewer context menu. The context menu must be activated on the chosen parent node.
122 .. image:: images/functionality_list_21.jpg
127 .. image:: images/functionality_list_20.jpg
131 **Example of inline script node with ports**
133 Now, if you want to modify the settings of this node, use the associated panel :ref:`pp_for_inline_node`.
140 This type of node can be created with help of **Create Node -> Node from Catalog** command from the Tree View context menu
141 or from the 2D Viewer context menu.
143 The type of service node is chosen from the catalog of services available in the list of imported catalog, in the :ref:`catalogs_tree_view`.
145 .. image:: images/functionality_list_23.jpg
148 As a result of this command call the Input Panel with catalogs' properties is displayed. The displayed property page provides a user
149 with the possibility to choose firstly a catalog type: **Current Session**, **Built In** or other imported catalog (i.e. to fill catalog
150 with types of nodes belonging to a predefined schema), and secondly - the type of node from the catalog to add it into the active schema. The
151 **Current Session** catalog contains all SALOME components with its services.
155 To add a node from catalog to the schema, drag and drop it. Multiple selection is possible in the Catalog, so you can add several
156 nodes to the schema with one drag and drop.
158 .. image:: images/functionality_list_24.jpg
162 **Create a node from current session catalog**
164 .. image:: images/functionality_list_25.jpg
168 **Create a node from a user catalog**
171 .. image:: images/functionality_list_22.jpg
175 **Example of service node**
177 As a result of SALOME service node creation from **Current Session** catalog, the content of schema Tree View is enlarged with data types
178 used by the new node, a new node object under **newSchema_1** folder, the corresponding SALOME component instance definition and a
179 reference to a new created service node under it.
181 .. image:: images/functionality_list_27.jpg
185 **Tree View after SALOME service node creation**
187 Now, if you want to modify the settings of this node, use the associated panel :ref:`pp_for_salome_node`.
194 The node object can be created with help of **Create Node --> bloc Node** command from the Tree View context menu or from
195 the 2D Viewer context menu.
197 .. image:: images/functionality_list_31.jpg
202 .. image:: images/functionality_list_30.jpg
208 Child nodes of a block node can be created with help of sub-items of **Create Node** command from block node context popup menu in the
209 Tree View or in the 2D Viewer.
211 .. image:: images/functionality_list_32.jpg
216 .. image:: images/functionality_list_33.jpg
220 **Example of Block node with inline function node as a child node**
227 The node object can be created with help of **Create Node --> For Loop Node** command from the Tree View context menu or from the 2D Viewer context menu.
229 .. image:: images/functionality_list_35.jpg
234 .. image:: images/functionality_list_34.jpg
238 **For Loop node without a body (i.e. newly created)**
240 Body node of a For Loop node can be created with help of sub-items of **Create Node** command from For Loop node context popup menu in the
241 Tree View or in the 2D Viewer.
243 .. image:: images/functionality_list_36.jpg
248 .. image:: images/functionality_list_37.jpg
252 **For Loop node with inline script node as a body**
254 .. _foreachloop_node:
259 The node object can be created with help of sub-items of **Create Node --> ForEachLoop** command from the Tree View context menu
260 or from the 2D Viewer context menu. There is one sub-item for each data type known in the schema object. If you need another data type,
261 you'll have to import it in the schema. In this case we use a double data type as the main type of the loop.
263 .. image:: images/functionality_list_39.jpg
268 .. image:: images/functionality_list_38.jpg
272 **ForEachLoop (double) node without a body (i.e. new created)**
274 Body node of a ForEachLoop node can be created with help of sub-items of **Create Node** command from ForEachLoop node context popup menu in the
275 Tree View or in the 2D Viewer.
277 .. image:: images/functionality_list_40.jpg
282 .. image:: images/functionality_list_41.jpg
287 **ForEachLoop node with SALOME service node as a body**
294 The node object can be created with help of **Create Node --> While Loop Node** command from the Tree View context menu
295 or from the 2D Viewer context menu.
297 .. image:: images/functionality_list_43.jpg
301 .. image:: images/functionality_list_42.jpg
305 **While loop node without a body (i.e. new created)**
307 Body node of a While Loop node can be created with help of sub-items of **Create Node** command from While Loop node context popup menu in the
308 Tree View or in the 2D Viewer.
310 .. image:: images/functionality_list_44.jpg
314 .. image:: images/functionality_list_45.jpg
319 **While Loop node with Block node as a body**
326 The node object can be created with help of **Create Node --> Switch Node** command from the Tree View context menu
327 or from the 2D Viewer context menu.
329 .. image:: images/functionality_list_47.jpg
332 .. image:: images/functionality_list_46.jpg
336 **Switch node without any cases (i.e. new created)**
338 Body node of a Switch node can be created with help of sub-items of **Create Node** command from Switch node context popup menu in the
339 Tree View or in the 2D Viewer.
341 .. image:: images/functionality_list_48.jpg
345 .. image:: images/functionality_list_49.jpg
349 **Switch node with three cases**
351 The number of Switch node cases can be changed with help of functionality provided by the property page of Switch node (for the sample
352 of the property page see :ref:`Property page for Switch node <pp_for_switch_node>` section).
354 .. _optimizerloop_node:
359 The node object can be created with help of **Create Node --> Optimizer Loop** command from the Tree View context menu
360 or from the 2D Viewer context menu.
362 .. image:: images/functionality_list_47a.jpg
365 Body node of an Optimizer Loop node can be created with help of sub-items of **Create Node** command from Optimizer Loop node context popup menu in the
366 Tree View or in the 2D Viewer.
368 .. image:: images/functionality_list_47b.jpg
371 .. image:: images/functionality_list_47c.jpg
375 **Optimizer Loop with one internal python node**
377 The parameters of the Optimizer Loop can then be modified with help of the functionality provided by the property page of Optimizer Loop node
378 (see :ref:`Property page for Optimizer Loop <pp_for_optimizer_node>` section).
384 The node object can be created with help of **Create Node --> Input Data Node** command from the Tree View context menu
385 or from the 2D Viewer context menu.
387 .. image:: images/functionality_list_51.jpg
391 .. image:: images/functionality_list_50.jpg
395 **Input data node with sample ports**
402 The node object can be created with help of **Create Node --> Output Data Node** command from the Tree View context menu
403 or from the 2D Viewer context menu.
405 .. image:: images/functionality_list_53.jpg
409 .. image:: images/functionality_list_52.jpg
413 **Output data node with sample ports**
420 The node object can be created with help of **Create Node --> Input Study Node** command from the Tree View context menu
421 or from the 2D Viewer context menu.
423 .. image:: images/functionality_list_55.jpg
427 .. image:: images/functionality_list_54.jpg
431 **Input study node with sample ports**
438 The node object can be created with help of **Create Node --> Output Study Node** command from the Tree View context menu
439 or from the 2D Viewer context menu.
441 .. image:: images/functionality_list_57.jpg
444 .. image:: images/functionality_list_56.jpg
448 **Output study node with sample ports**
450 As a result of node creation, YACS module creates a new node object with a default name and shows it in the Tree View (under the proper
451 parent item) and in 2D Viewer. For service nodes the reference to the created service node is also published under the corresponding
452 component instance definition in the Tree View. For any node object type, the default name has a form of "node_subtypeNNN", where
453 NNN is the smallest integer that produces a unique node name not yet in use.
455 The user can delete the created node by choosing **Delete** command from node context popup menu in the Tree View or in the 2D Viewer
456 (see :ref:`delete_object` section).
458 .. image:: images/functionality_list_58.jpg
463 Connecting nodes ports by links means transferring data from output port to input port of a next node. So, in general, only output and input
464 ports of different nodes can be connected by a link.
466 There are three types of links to connect nodes with each other in YACS GUI:
468 + data flow link (between data ports),
470 + data stream link (between stream ports),
472 + control link (between gate ports).
474 The color code of data links differs from the same one of stream links and is taken from the user preferences (see :ref:`set_user_preferences` section).
476 The link creation can be performed only between nodes included into the same schema object. Therefore, in such a case the schema should
477 contain at least two nodes.
479 The user can create a link by dragging the output port to connect and dropping it onto the input port. The action is the same
480 for data flow, data stream and control link. The action of drag-and-drop can be done in the Tree View or in the 2D Viewer.
482 The input port is considered as the end of the newly created link. The output port is the beginning of the newly created link.
484 .. image:: images/functionality_list_59.jpg
488 **Drag-and-drop between Add16.z output port and Add17.x input port**
490 It's worth mentioning that there are two possibilities for the user to create data links with Drag-and-Drop:
492 #. **Add dataflow link** : standard Drag-and-Drop creates a data link and adds a control link between concerned nodes simultaneously
494 #. **Add data link** Drag-and-Drop with control key pressed creates a data link **without adding a control link**. This functionality is
495 needed inside loop nodes. An example of such a data link is shown on the figure below.
497 .. image:: images/functionality_list_60.jpg
501 **Trying to create a dataflow link between Add21.z and Add20.x with a loop**
503 In such a case it is needed to separate the flow of data from the flow of control.
505 .. image:: images/functionality_list_60a.jpg
509 **Create a simple data link with control key pressed**
513 To create a control link the user should use Drag-and-Drop between output gate port and input gate port. The output gate port is considered
514 as the beginning of the newly created control link, and the input gate port as the end of the link.
516 As a result of link creation, a valid link between ports is created. The link object is published in the Tree View in the **Links** folder
517 under the corresponding schema object. The presentation of a new link is shown in the 2D Viewer and colored with the color code according
520 A new link object has a default name, which contains names of "from" and "to" nodes and ports and cannot be changed by the user
521 (see :ref:`description of link objects in the Tree View <description_of_link_objects>`).
523 Each link has an associated property page that, in most cases, shows the link name. For datastream links (CALCIUM links), a properties
524 editor allows to set and modify link properties (see :ref:`datastreamlinks`).
526 .. image:: images/functionality_list_60b.jpg
530 datastream link properties editor
532 The user can delete a link by choosing **Delete** command from link context popup menu in the Tree View or in the
533 2D Viewer (see :ref:`delete_object` section).
539 The edition of an object is one of basic points of modification operations as the creation or deletion. The YACS GUI proposes the edition
540 of an object with help of the :ref:`input_panel`. For this purpose the user should select the object, which properties he wants to edit, in
541 the Tree View or in the 2D Viewer.
543 As a result of this operation, Input Panel is updated and the property page of the selected object (and objects dependable from this one)
544 is opened. Within the property page(s) the user can modify objects' parameters by typing in corresponding input fields or selecting an item
545 in combo box input fields.
547 The user confirm the modifications by pressing **Apply** button on the Input Panel.
548 The **Cancel Edition** button can be used to cancel modifications that have not been already applied.
550 If the user finishes the edition process, YACS module updates (if it is necessary) Tree View and/or 2D representation of the modified object.
552 It's worth mentioning that if the user selects something in the Tree View or 2D Viewer before applying the changes in the Input Panel,
553 the object background color is changed to yellow to remind applying the changes.
555 .. _pp_for_container:
557 Property page for container
558 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
559 The property page for container definition is shown on the figure below.
561 .. image:: images/functionality_list_61.jpg
565 **Container property page**
567 .. image:: images/functionality_list_61a.jpg
571 **Container property page with advanced parameters shown**
573 The property page for container allows to modify the name and a set of machine parameters of the selected container object.
574 At the beginning, machine parameters are initialized with the default values.
575 For most parameters, the default values can be used. The user can select a resource from a list obtained with help of SALOME resource manager
576 or use the **automatic** option to let SALOME selects computers. The user can only modify resource parameters (Resource tab)
577 when the **automatic** option has been choosen. In that case, resource parameters are constraints used by the resource manager
578 to select the best resource for the container. In the other case (specific resource selected), the resource parameters come
579 from the resource manager, are the effective ones and are only displayed.
581 The user can apply modifications to the selected container object by pressing **Apply** button. In such a case YACS module changes
582 properties of the selected container definition according to new values from the Input Panel and updates the Tree View if it is needed.
583 The **Cancel Edition** button can be used to cancel modifications that have not been already applied.
585 .. _pp_for_component_instance_definition:
587 Property page for component instance definition
588 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
589 The property page for SALOME components is shown on the figure below.
591 .. image:: images/functionality_list_62.jpg
595 **Property page for SALOME component instance definition**
597 In the Input Panel for SALOME component instances the user can see the name of the selected component object.
598 This field is not editable and use only to provide information about component name.
599 It is also possible to change the associated container (container: combobox) and to add properties to the component instance.
600 These properties are converted to environment variables when the schema is executed.
604 Property page for schema
605 ~~~~~~~~~~~~~~~~~~~~~~~~
606 The schema property page allows the user to specify the name of the schema.
608 The property page for schema is shown on the figure below.
610 .. image:: images/functionality_list_64.jpg
614 **Property page for schema**
616 It is possible to add properties to the schema.
617 These are properties for all the nodes defined in the schema.
621 Property page for node
622 ~~~~~~~~~~~~~~~~~~~~~~
623 The content of the property page for node depends on the type of the node. Here are property page configurations for the different types of nodes.
625 .. _pp_for_inline_node:
627 Property page for inline nodes
628 '''''''''''''''''''''''''''''''''
630 The property pages for **inline function** and **inline script** nodes are shown on the figures below.
632 .. image:: images/functionality_list_65.jpg
636 **Property page for inline script nodes**
638 .. image:: images/functionality_list_65a.jpg
642 **Property page for inline function nodes**
644 The pages allow the user to:
646 + specify the name of the node,
648 + read the full name of the node (this field is read only and updated if the user changes the node name),
650 + change the list of input and output ports (it is possible to set port name, choose port type and value type from the corresponding
651 combo boxes, set input values for input port, if it is not linked),
653 + change the name of the Python function ("Function Name" entry) to execute for Python function node only,
655 + enter or modify a source code of Python function or script in the built-in Python code editor (syntax highlighting, text selection,
656 cut/copy/paste mechanism).
658 + generate a template of the python function with the **Template** button when all ports are defined and the function name is set.
660 + edit the python code with an external editor (**External Editor** button, if set in :ref:`user preferences <set_user_preferences>`).
662 An inline node can be executed in a remote container by setting its execution mode to **Remote** and selecting a container
663 in the containers list.
665 .. image:: images/functionality_list_65b.jpg
668 .. _pp_for_salome_node:
670 Property page for SALOME service
671 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
672 The property page for **SALOME service** nodes is shown on the figure below.
674 .. image:: images/functionality_list_66.jpg
678 **Property page for SALOME service nodes**
680 The page allows the user to:
682 + change the name of the node,
684 + read the full name of the node (this field is read only and updated if the user changes the node name) and its type,
686 + read the name of the associated component instance,
688 + change the associated component instance by selecting it in the list of available component instance definitions in the
691 + change the associated container with help of built-in property page for component instance definition. The user selects it in
692 the list of available container definitions in the current schema,
694 + change properties of the associated container (e.g. host name) with help of built-in property page for container,
696 + read the name of the method from the associated component, which will be executed by the node,
698 + change values of input ports, if it is not linked,
700 + change or add properties
702 Property page for Block node
703 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
704 The property page for **Block** node is shown on the figure below.
706 .. image:: images/functionality_list_71.jpg
710 **Property page for Block node**
712 The page allows the user to :
714 + change the name of the node,
716 + read the full name of the node (this field is read only and updated if the user changes the node name),
718 + change or add properties. These are properties for all the nodes defined in the Block.
720 Property page for For Loop node
721 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
722 The property page for **For Loop** node is shown on the figure below.
724 .. image:: images/functionality_list_68.jpg
728 **Property page for For Loop node**
730 The page allows the user to:
732 + change the name of the node,
734 + read the full name of the node (this field is read only and updated if the user changes the node name),
736 + specify the value of the "nsteps" input port if it is not connected with a link,
738 Property page for ForEachLoop node
739 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
740 The property page for **ForEachLoop** node is shown on the figure below.
742 .. image:: images/functionality_list_69.jpg
746 **Property page for ForEachLoop node**
748 The page allows the user to:
750 + change the name of the node,
752 + read the full name of the node (this field is read only and updated if the user changes the node name),
754 + read the input type of the loop (read only field),
756 + specify the value of the "nbBranches" input port if it is not connected with a link,
758 + specify the Sequence value of the "SmplsCollection" input port if it is not connected with a link,
760 Property page for While Loop node
761 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
762 The property page for **While Loop** node is shown on the figure below.
764 .. image:: images/functionality_list_67.jpg
768 **Property page for While Loop node**
770 The page allows the user to:
772 + change the name of the node,
774 + read the full name of the node (this field is read only and updated if the user changes the node name),
776 + specify the Boolean value of the "condition" input port if it is not connected with a link,
778 Property page for Switch node
779 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
780 The property page for **Switch** node is shown on the figure below.
782 .. _pp_for_switch_node:
784 .. image:: images/functionality_list_70.jpg
788 **Property page for Switch node**
790 The page allows the user to:
792 + change the name of the node,
794 + read the full name of the node (this field is read only and updated if the user changes the node name),
796 + specify the value of the "select" input port if it is not connected with a link,
798 + change the case value (integer or "default") associated with child nodes.
800 .. _pp_for_optimizer_node:
802 Property page for Optimizer Loop node
803 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
804 The property page for **Optimizer Loop** node is shown on the figure below.
806 .. image:: images/functionality_list_47d.jpg
810 **Property page for Optimizer Loop**
812 The page allows the user to:
814 - change the name of the node,
815 - read the full name of the node (this field is read only and updated if the user changes the node name),
816 - read the input data type (this field is read only and updated if the user changes the plugin),
817 - change the number of branches
818 - change the plugin : parameters lib and entry
819 - change the initialization file : parameter FileNameInitAlg
821 Property page for Input Data node
822 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
823 The property page for **Input Data** node is shown on the figure below.
825 .. image:: images/functionality_list_72.jpg
829 **Property page for Input Data node**
831 The page allows the user to:
833 + change the name of the node,
835 + read the full name of the node (this field is read only and updated if the user changes the node name) and its type,
837 + change the list of output ports (it is possible to set port name, choose port data type from the corresponding
838 combo boxes, set values for output ports).
840 Property page for Output Data node
841 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
842 The property page for **Output Data** node is shown on the figure below.
844 .. image:: images/functionality_list_73.jpg
848 **Property page for Output Data node**
850 The page allows the user to:
852 + change the name of the node,
854 + read the full name of the node (this field is read only and updated if the user changes the node name) and its type,
856 + change the list of input ports (it is possible to set port name, choose port data type from the corresponding combo boxes).
858 Property page for Input Study node
859 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
860 The property page for **Input Study** node is shown on the figure below.
862 .. image:: images/functionality_list_74.jpg
866 **Property page for Input Study node**
868 The page allows the user to:
870 + change the name of the node,
872 + read the full name of the node (this field is read only and updated if the user changes the node name) and its type,
874 + change the list of output ports. It is possible to set port name, choose port data type from the corresponding combo boxes, set
875 values for output ports. The values must be SALOME study paths.
877 Property page for Output Study node
878 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''
879 The property page for **Output Study** node is shown on the figure below.
881 .. image:: images/functionality_list_75.jpg
885 **Property page for Output Study node**
887 The page allows the user to:
889 + change the name of the node,
891 + read the full name of the node (this field is read only and updated if the user changes the node name) and its type,
893 + change the list of input ports. It is possible to set port name, choose port data type from the corresponding combo boxes and
894 set values that must be SALOME study paths.
901 The user can remove one or several objects from the current study.
903 To perform this operation the user should select object to be deleted in the Tree View or in the 2D Viewer and activates **Delete** item
904 from its context popup menu.
906 With help of context popup menu the user can delete the following objects:
912 .. image:: images/functionality_list_76.jpg
916 **An example of link deletion using link context popup menu in the 2D Viewer**
918 YACS module deletes the selected object with all sub-objects.
920 As the result of delete operation, the tree structure of the active schema in the Tree View and its representation in 2D Viewer
921 are updated to reflect deletion of objects.
923 Input/output ports of inline nodes can also be deleted by the user with help of the Input Panel for this type of
924 nodes (see the corresponding paragraph from :ref:`pp_for_node` section).