Dynamically Disabling and Hiding Dashboard Controls

In some models, some inputs (or outputs) may not be applicable based on the values of other inputs (or outputs) in the model. For these situations, GoldSim allows you to disable or hide Dashboard controls based on various model attributes. 

Disabling a control grays it out on the Dashboard (so it cannot be edited).  When a control is hidden, it cannot be seen at all on the Dashboard (hiding a control also disables it).

Examples of what you can do with this feature include the following:

   Show a control only if a different check box control on the Dashboard is checked.

   Enable an input control only if another input control’s current value is greater than 10.

   Show an output control only if a specific model output is True.

   Enable a control only if a specific model output’s current value is between 0 and 100.

   Enable a control only if a specific model output’s current value is one of several specified values.

This feature is provided in the Attributes tab of each control:

All controls have an Attributes tab, but it differs slightly between the various types of controls.  In particular,

   You cannot disable Output controls; you can only hide them. As a result the first check box in the dialog is disabled for Output controls.

   The Apply “Default Value”… check box is only available for Input controls. It is not available for Output controls or Button controls.

By default, controls are visible and enabled. To disable or hide a control, click on the appropriate check box.  When you do this, a dialog will be displayed explaining what to do next (select OK), followed by a browser which shows all of the outputs in the model that are scalars (values or conditions). Once you have selected an output, it will be displayed in the dialog:

   Note: You can change the selected output by clicking on it in the dialog.  Doing so will open a browser for selecting a new output.

Once the output is selected, you must then select the type of condition that is to be tested from the drop-list.  If the output is a value, the following options are available:

Most of these condition types require a single value entered immediately to the right.  For example, the dialog below would hide (and disable) the control if the value of Volume was greater than 10m3:

Note that this value cannot be entered as a link or expression, and no units can be specified.  The units that are used are automatically displayed to the right of the field (and are the Display Units for the output).

The following condition types require or accept multiple values in the field to the right:

   “value is in range” requires two values, which must be separated by a semicolon. The evaluation is inclusive with regard the ends of the range (e.g., if the range is 5 to 10, then values of 5 or 10 are considered inside the range).

   “value is outside range” requires two values, which must be separated by a semicolon. The evaluation is inclusive with regard to the ends of the range (e.g., if the range is 5 to 10, then values of 5 or 10 are considered inside the range).

   “value is = =” (value is equal) supports (but does not require) multiple values (which must be separated by semicolons). If multiple values are provided, the test is considered to be true if any of the conditions are met (i.e., the conditions are ORed).

   “value is =!” (value is not equal) supports (but does not require) multiple values (which must be separated by semicolons). If multiple values are provided, the test is considered to be true if all of the conditions are met (i.e., the conditions are ANDed).

If the output selected for the attribute is a condition, only two condition types are available in the drop list:

The field to the right is “hardwired” to True (i.e., it cannot be edited).  These two choices, therefore, allow you to apply the attribute when the specified output is either True or False.

Input controls all have Default values that are defined by the Dashboard author.  The Attributes tab of Input controls has a special option that can be selected to Apply ”Default Value” when control is hidden or disabled. If this check box is checked, when the control transitions from a visible state to a disabled or hidden state, the default value is automatically assigned to the element linked to the control.

   Note: If the model is Paused or running, this will only occur if the “Allow changes while paused” box is checked for the control.

Note that if an element is referenced by a control in order to hide and/or disable it, this is indicated in the context menu for the element:

Similarly, if a Dashboard control references an output for hiding and/or disabling the control, the element associated with this output is displayed in the context menu for the control::

Related Topics…