Lesson 6 - Dashboard Input Controls
Now that we have learned the basics of creating Dashboards, adding controls to the Dashboard and creating and viewing a Player file, in the next several Lessons we are going to examine the various Dashboard controls in a bit more detail.
To do this, instead of building models and adding the controls, we are going to utilize some pre-built example models. This will allow you to more efficiently explore and understand these controls. These models will provide examples of the use of each of the controls. We won’t discuss all of the details of each control (as you can readily consult the Help file for that). Rather, we will simply illustrate what they look like and how they can be used.
Before we look at an example model, however, let’s take a closer look at the Controls toolbar. Open GoldSim now (with a new model) and insert a Dashboard element so we can do so. Then enter the Dashboard.
In a previous Lesson, we moved the Controls toolbar to the bottom of the window. By default, however, it is docked on the right side of the window. Drag it back there now. The various tools in the Controls toolbar are identified below:
In this Lesson, we are going to focus on the input controls, which are those in the middle section of the toolbar.
Let’s start by opening the file Example31_Input_Controls.gsm. You will find it in the “Examples” subfolder of the “Basic GoldSim Course” folder you should have downloaded and unzipped to your Desktop.
You will see that the file simply consists of a number of Data elements, each of which is linked to a different type of input control:
Note: Recall that input controls can only be linked to Data elements.
Place your cursor over any of the Data elements (e.g., Data1):
You will note that the tool-tip indicates that the element is linked to a Dashboard control (and, as pointed out in the previous Lesson, therefore cannot be edited here).
If you right-click on the element, you can choose Go to referencing control, which will jump directly to the control in the Dashboard to which the element is linked:
Let’s do that now. You will see that the Dashboard looks like this:
Let’s briefly explore each of the controls.
The control in the top left-hand corner with the “Volume” label is an Input Edit Box. Double-click on it now:
The Input Edit Box control is the most basic of the input controls. It simply provides a mechanism for typing values directly into an input field. Like the Slider that we saw in previous Lessons, it allows you to enter Default, Minimum and Maximum values, along with the Smallest allowed increment. And like all controls, there are some options for controlling the Appearance (experiment with these if you wish) and specifying a Tool Tip.
Close the dialog, and place the Dashboard in Active view (recall you toggle between Design view and Active view using this button):
You will see that you can simply type a value into this field. The field does not accept units or links; just numbers. Because the input, however, requires a particular set of units (as defined by the Display Units of the Data element to which it is linked), you need a way allow the Dashboard user to see this. Unlike the Slider control, there is no built-in label. As a result, when you use this control, you will typically add a Text object (as has been done here) to specify what the input represents. (Of course, you can also specify this information in the Tool Tip.)
Learn More in GoldSim Help: Input Edit Box Control
Toggle back to Design view so we can look at the next control (labeled “Mass”). This is a Combo Box. Double-click on it now:
The Combo Box control allows you to associate text strings with specified values for an input, and then allows the user to choose among the options in a Dashboard from a combo (drop list) box. In this example, we have assigned the label “High” to a value of 10 kg, “Medium” to a value of 5 kg, and “Low” to a value of 2 kg. You also select which of the values is the default.
Close the dialog, and place the Dashboard in Active view again. You will see that the user can simply choose among the options from a drop-list:
Like the Input Edit Box, there is no built-in label. As a result, when you use this control, you will typically add a Text object to specify what the input represents. (Of course, you would also typically specify what the various options represent in the Tool Tip, as we did above).
Toggle back to Design view so we can look at the next control (labeled “Option”). This is a List Box. If you double-click on it you will notice that it looks just like a Combo Box. In fact, it is identical to a Combo Box except for its appearance. Close the dialog, and place the Dashboard in Active view again. You will see that rather than selecting from among the options using a drop-list, all of the options are shown simultaneously, and you simply click on one to select it:
It should be pointed out that Combo Boxes and List Boxes are one of the ways in which you can use a Dashboard to control any part of your model (e.g., logic, not just data). For example, imagine that you wanted to select between three different Time Series using the option selected in a Combo or List Box. You could do so by simply referencing the element linked to that control in the appropriate place. In this example, the element (Data3) controls which time series is used:
We discussed the basic properties of Time Series elements in Unit 10. One of the advanced properties of Time Series elements (that we briefly mentioned in Unit 14, Lesson 8) is that you can define multiple series inside the element, and then select which one you want to use. That is what is being done here.
Alternatively, we could use a Selector to choose between three different Time Series elements (or Lookup Tables, or any other type of element) based on the value of the Data element linked to the control:
This allows you to define different logic based on the “flag” controlled by the Combo or List Box. For example, in the example above, rather than referencing a Time Series, the various Rainfalls could be the output of three different complex calculations (each representing a different conceptual model for Rainfall).
The next control (labeled “Velocity”) is a Slider. Since we have already discussed this in a previous Lesson, we won’t do so now.
The control in the top right-hand corner with the “Model Storms?” label is a Check Box. Double-click on it now:
The Check Box control allows you to add a binary selection (e.g., true/false, on/off, 1/0, 100/300, etc.) to a Dashboard. In this way, it is similar to a Combo or List Box (with only two options). However, rather than selecting the option from a list, you select it via a check box. That is, you specify the value that is assumed for the linked Data element if it is checked, and the value if it is cleared. Typically, the Data element will be a Condition (True/False), but it does not have to be. It could be a Value, in which case you would need to specify the numeric values to be used for checked and cleared.
You can add a built-in Label for the checkbox (and you may also want to add a Tool Tip to clarify the meaning of checking the box if it is not obvious from the Label).
Close the dialog, and place the Dashboard in Active view again to see what the Check Box control looks like (check and clear the box to experiment with it):
Similar to a Combo and a List Box, a Check Box is often used to modify the logic in a model (e.g., by turning some processes on and off).
Toggle back to Design view so we can look at the next control (labeled “Facility Start Date”). This is a Date-Time control. Double-click on it now:
GoldSim allows you to enter dates in Data elements (and expressions in other input fields) by enclosing the date in quotation marks. The format for referencing a date is determined by the Regional and Language time/date settings specified by the operating system. For example, for a computer in the US, the following formats would all be valid ways for referencing 1 October 2009:
- “October 1, 2009”
- “1 October 2009”
You would typically reference a date in conjunction with DateTime, as shown below:
DateTime is a Run Property (recall that we discussed Run Properties, such as ETime, in previous Units). It represents the simulated calendar date/time.
Obviously, if the date is something you might want to edit, you would create a Data element to represent it, so your equation would look like this:
The Date-Time control allows you to easily edit Data elements that represent dates (such as Facility_Opens in the example directly above) via a Dashboard.
There is no built-in label. As a result, when you use this control, you will typically add a Text object to specify what the date represents. (Of course, you could also specify a Tool Tip, as we did above).
Close the dialog, and place the Dashboard in Active view again. Then experiment with the control. You will see that it provides a very nice interface (a calendar) for specifying dates.
Toggle back to Design view so we can look at the next (and final) control (the grid with the five rows). This is an Input Grid. Double-click on it now:
The Input Grid control is the most complex of all of the input controls. As a result, we will not discuss it in detail here (as you can learn all about it via GoldSim Help). Basically, the Input Grid provides an alternative to creating numerous individuals controls and positioning them in a Dashboard by allowing you to create a grid of controls. Each item in the grid can be defined to act either like an Input Edit Box, a Check Box, or a Combo Box. In this example, the first three items act like Input Edit Boxes, the fourth acts like a Check Box, and the final one acts like a Combo Box.
The various properties for each item (e.g., how it behaves, defaults, etc.) are defined by clicking in the row under Value Properties. For example, the properties for the fourth row (which acts as a Check Box) look like this:
Explore the other rows in the grid to see how they are defined.
This Lesson should have provided you with an overview of what all of the input controls can do, and how you can use them. You are encouraged to take some more time to experiment with the various options in each of the controls (e.g., changing their appearance). Note that all of the controls have a separate tab (Attributes). Don’t worry about that yet. We will discuss that tab in a later Lesson.
When you are done experimenting, you can close this file, as we won’t be using it again.