10 - 12 - 2024

Block Layers Conception

Layers conception

Layers are a very good way to avoid complicated and crowded diagrams by distributing controls and blocks by different layers. To do this, we first need to describe the layers. This happens with the interface that opens by pressing the button Layers from the group Design/Process at the top bar with buttons of the application AltonaLab.

By clicking on the Add button a new layer is added to the grid, then by double-clicking the mouse button in the Name column, we can enter a layer name. Attributes (the grid columns) of every Layer are:

  • Name - Name of the layer;
  • Layer - index of the layer;
  • Curr layer - only one of the layers can be set as Current layer. Only controls and blocks from the current layer are shown on the diagram. All other controls and blocks are invisible at this moment;
  • Always visible - the controls and blocks from this layer are always visible, no matter which layer is currently selected;
  • Visible blocks in run mode - when the diagram is run, and this layer is selected, if this attribute is checked, the blocks from this layer will be visible, in other case the blocks from this layer will be invisible. Controls from this layer is it is selected, are always visible;
  • Run if layer is not active - if the attribute is checked, when the diagram is working, all the blocks from this layer will work too, in other case they will not work;

 

Copying graphic objects from another diagram into selected layer:
The interface has a button Load diagram to selected layer. When we press it, a new File Open dialog opens and we can choose an AltonaLab diagram. All the elements from choosen diagram - controls and blocks will be added to the existing diagram into the selected layer.

 

Change the current visible layer at the diagram:
From the top bar of the application with buttons, click the Layers button. In the interface grid, select the layer row which has to be current and check the checkbox from column Curr layer.

 

Select a layer of a graphic object (control/block):


When all the needful layers are added, we can choose the layer of every control or block. When the property editor of the control or block is open, at the parameter Layers we will see the list of existing layers of the diagram. We just have to choose one of them.


Description of functional block Layers


With this block, we can change the current layer at run time of the diagram.

Block's parameters:

  • HideAlwaysVisible - if the parameter is checked, at the DataSet output of the block Layers, the layers with checked column Always visible will be not added;

Block's inputs:

  • InCurrLayer - at this integer input we have to set the index of needful layer;
  • SetCurrentLayer - when this input becomes to a high level, the current layer of the diagram will be set to the layer with index gotten from the input InCurrLayer;

Block's output:

  • Layers - the output is with DataSet data type. It has two columns: Layer (integer), Name (String). The dataset contains the layers of the diagram, so if this output is connected to ComboBox, LisBox or Table control, we can easy change the current layer at run time of the diagram, when we change the selection of the ComboBox, LisBox or Table control;
  • CurrLayer - currently selected Layer;
  • CurrIndex - the index of a currently selected Layer;
  • OnFirstLayerChanged - when the diagram is started, after a short time this output will becomes to a high level for a while, which indicates the current layer is selected for first time;