code:open-source:hse-framework:navigation
Table of Contents
13 Navigation
The Navigation module provides a vertical list of buttons for navigating the application. The number, text and assigned action of those buttons can be defined from a configuration file.
To use the navigation sidebar module, it must be started from the startup.vi
. For this, add it to the list of dynamically started modules in the config.ini
.
Example snippet:
[modules] ; paths are noted from the application base path ; (ie the path the startup.vi sits in) list = "Framework\Navigation;Modules\Dummy;Modules\ActorModule;Modules\StateMachine;Modules\DBModule" start = "Modules\Dummy"
Configuration
The configuration is read from /<%appname%>_Config/UNIT_<%unit%>/Navigation.ini
.
[global] ; The descriptor is used for the VI's Front Panel Window titlebar ; and for the entries in the UI Manager's Run-Time Menu. descriptor = "Navigation" buttons_def = "Sidebar-Def_Template.json"
The value in buttons_def
points towards a file in the same directory as the configuration file containing the button definitions.
Example Button Definition
The first object top
contains an array of button definitions. Every button has the following properties:
-
name: internal name of the button.
-
caption: the text shown on the button.
-
tooltip: a tooltip text for the button.
-
enabled_state: [Enabled|Disabled] state of the button.
-
action: module name to show when clicking on the button (like in the
config.ini
). -
display_scenario: [Managed|Stand-Alone|None] Select how to display the module.
-
sub: an array of optional subsections under the button.
-
content: array of elements in this subsection.
-
retain_value: (boolean) [true|false] highlight the sub-item when clicked.
{ "top": [ { "name": "btn_Dummy", "caption": "Dummy Module", "tooltip": "Show the Dummy module", "enabled_state": "Enabled", "action": "Modules\\Dummy", "display_scenario": "Stand-Alone", "sub": [] }, { "name": "btn_Actor", "caption": "Actor Module", "tooltip": "Show the Actor module", "enabled_state": "Enabled", "action": "Modules\\ActorModule", "display_scenario": "Managed", "sub": [ { "name": "lb_actorstate", "tooltip": "Actor State", "enabled_state": "Disabled", "content": [ "Display Value 1/3", "Display Value 2/3", "Display Value 3/3" ], "retain value": true } ] }, { "name": "btn_Action", "caption": "Actor Module Actions", "tooltip": "Trigger actions in Actor Module", "enabled_state": "Enabled", "action": "triggerAction", "_display_scenario_comment": "do not request the module to display itself", "display_scenario": "None", "_sub_comment": "define sub items of the button" "sub": [ { "name": "lb_actoractions", "tooltip": "Available Actions", "enabled_state": "Enabled", "content": [ "Reset Timer", "Enable Timeout Event", "Disable Timeout Event", "Register for Broadcasts", "Unregister from Broadcasts" ], "retain value":false } ] } ] }
Removing the Navigation Panel
-
code/open-source/hse-framework/navigation.txt · Last modified: 2024/07/17 07:36 by joerg.hampel