Gauge
The Gauge () form object displays some value as a gauge with a needle and an optional scale. You can use the gauge to indicate some value graphically in an app. Specify a name for the gauge object in the Name field. The value that the gauge can display varies from the value in the Minimum value field (default: 0) to the value in the Maximum value field (default: 1). You can specify the number of steps from the minimum value to the maximum value in the Number of steps field (default: 5). In the Tooltip field, enter text that will appear as a tooltip when the user hovers the pointer over the gauge.
In addition, the Settings window contains the following sections.
Source
In this section, you specify the source for the data to display with a gauge. The section contains a tree with a filtered view of the trees in the Application Builder and Model Builder windows. The nodes either represent some sort of data or have children that do. For a gauge, the data source can be parameters and variables in the COMSOL Multiphysics model and numerical (double and integer), Boolean, and string variables that you define under Declarations. The data display can show arrays or matrices with LaTeX syntax. You can extend the list of available data nodes by clicking the Switch to Model Builder and Activate Data Access button () in the Source section header, which takes you to the Model Builder window, and then selecting a node in the Model Builder branch whose data you want to access. With this button active, the Settings window of the selected node displays a Select Data Source check box (a green square) next to the settings that you can include. Click to select the check box to include that data as an available source node for data display objects.
When you select a node that represents data, the Use as Source toolbar button () below the tree becomes enabled. You can click it or, alternatively, press Enter, double-click, or right-click the node and choose Use as Source to add it as the selected source. You can also click the Create New Declaration and Use It as Source button () or the Create New Form Declaration and Use It as Source button () in the Source section header to create a new global or local (in the form) variable declaration for the data display and use it as the source. A Create and Use Variable dialog box opens, so that you can select the data type of the source (if applicable), its name, and its initial value (if applicable). The name cannot be in conflict with any existing variable declaration. Click the Edit Node toolbar button () below the tree to move to the corresponding node. If necessary, the program switches to the Model Builder.
After selecting a node as the source, the node appears as the selected source under Selected source.
From the Initial value list, choose From data source to take the initial value of the gauge from the data source, or choose Custom value to enter a custom initial value in the Value field underneath.
Unit
From the Method list, select one of the following methods to specify the unit for the gauge:
No unit, the default option.
Append unit to number: The unit that you type in the Unit expression field is appended to the number corresponding to the position of the gauge.
Append unit from unit set: The gauge appends a unit from a Unit Set node added under Declarations (see The Unit Set Node). You specify the unit set to use from the Unit set list and the unit to use from Unit list, which lists all defined properties and their units from the select unit tests. There is also a No unit option.
Number Format
Select the Custom label formatting check box to access the number format settings below.
In the Precision field, enter the number of significant digits to display in the label (default: 4). Choose the notation to use for the data from the Notation list. The options are Automatic (the default), Scientific, and Decimal. If you use Automatic, the program switches to scientific notation when the output is about 3 orders of magnitude larger than or smaller than 1. For the Automatic and Scientific options, you can also choose the format of the exponent for scientific notation from the Exponent list. The choices are Power of 10 (the default) and E-notation.
Position and Size
This section contains all layout settings for a gauge in the grid of the parent form.
In the grid mode, you can control the horizontal and vertical alignment of the gauge using the following lists:
From the Horizontal alignment list, choose Left, Center (the default), Right, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
From the Vertical alignment list, choose Middle (the default), Top, Bottom, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
The need to specify the alignment is most obvious when working in the grid mode, as it controls how the form object is aligned in its grid cell. Aligning the form object can be useful in the sketch mode too, and you can then use the alignment tools on the Arrange menu in the Form toolbar’s Sketch section. When running the application in any client other than the Windows client, the form objects may not be positioned exactly as seen in the Application Builder. This is because the form objects may have a different size in other clients, giving them a slightly different positioning. Specifying the alignment ensures that the form objects are aligned as you want them to be in all clients.
You can change the size of the gauge using the Width field. The Height field is unavailable because the gauge object is always a square enclosing a circular disk (that is, the gauge). The radius of the gauge is set automatically by default. From the Radius list, choose Manual instead of Automatic to specify a manual gauge radius in the text field that appears below the Radius list.
Additionally, in the sketch mode, you can specify the absolute position of the gauge using the Position x and Position y fields. In the grid mode, you can position the object in the grid and see the grid position as the Row, Column, Row span, and Column span values.
Cell Margin
Under Cell margin (in grid mode only), you can control the margins around the form object. By default, the margins are taken from the parent form. From the Cell margin list, choose:
None, for no margin around the form object. This setting can be useful when displaying dynamical data inside a sentence to avoid excessive whitespace margins.
From parent form (the default), to use the margins set for the parent form.
Custom, to specify the margins for the form object in the Horizontal and Vertical text fields.
Appearance
In this section, you can control the appearance of the gauge and the background in the gauge object.
From the Scale list, select an option for the appearance of the scale for the gauge:
Choose None for no scale indication.
Choose Tick marks (the default) to indicate the scale using tick marks.
Choose Tick marks and labels to indicate the scale using tick marks and with labels for the minimum and maximum values.
Choose Tick marks and all labels to indicate the scale using tick marks and with labels for the minimum and maximum values as well as some other values between the minimum and maximum.
From the Needle color list, select a color to use as the color for the needle in the gauge: Default (the default), any of the predefined basic colors, or Custom, which makes it possible to select a custom color from a color palette.
You can specify the sweep angle for the needle as an angle between 30 and 330 degrees (default: 270 degrees) in the Sweep angle field.
Under Color ranges, you can add color to the scale for the gauge. You can use one or more ranges for the colors. You define each range by specifying values for Start value, End value, Start color, and End color in one or more rows of the table. The start and end values should be within the minimum and maximum values for the displayed quantity. When you click the Add button () to add a color range, the Color Range dialog box opens where you specify values in the Start value and End value field and select a color from the Start color and End color list. The color can be any basic color, Transparent, or Custom, which makes it possible to specify a custom color of your choice.
From the Text color list, select a color to use for the text on the gauge: Inherit (the default; the form object then uses the setting from the Form object it is located in), any of the predefined basic colors, or Custom, which makes it possible to select a custom color from a color palette.
From the Background color list, select a color to use as the background for the gauge: Transparent (the default), any of the predefined basic colors, or Custom, which makes it possible to select a custom color from a color palette.
The font and the font size for the gauge use the font settings from the Forms node by default. Select a font from the Font list: Default font or any of the available fonts. If needed, choose or enter a font size (in points) in the Font size list. The default is to use the Default size for the font.
You can also select the Bold check box to use a boldface font or the Italic check box to use italics (an italic font).
Under State, you can control the initial state of the gauge when users run the application. By default, the gauge is visible and enabled. Clear the Visible or Enabled check box if you want to make the initial state so that the gauge is hidden or unavailable. You can then make it visible or enable it using a method. In the Form Editor, the state of the form object is indicated by a change in its appearance. Objects that are hidden become visible when selected in the Form Editor.