okGauge (Wire Out)

The okGauge component is used to display a bar-type indicator horizontally or vertically on the panel.  It connects to a Wire Out endpoint and allows a maximum range of 65535 (all 16-bits of a Wire Out).  It appropriately selects the proper number of bits for smaller ranges.

positionPOSITIONPosition of the top-left corner.
sizeSIZESize in pixels.
tooltipTEXTTooltip text.
endpointHEX BYTEEndpoint address for the corresponding Wire Out.
bitNUMBERThis bit on the endpoint is the LSB for the display.
rangeNUMBERThe maximum allowed value in the display in base 10.

XML Example

<object class="okGauge">
</object>Code language: HTML, XML (xml)

Lua Scripting

This component supports executing a script function when the value of the specified bit of the given endpoint changes. By default, the value displayed by the control will also be updated, however this can be prevented by calling event:PreventDefault() as described in the “Default Behaviour” section of FrontPanel Scripting.

Notice that this component can also be used as a standalone indicator, not bound to any input wire. In this case it must have a name, so that it can be used by the other script functions, as otherwise it would be perfectly unusable.

The event parameter of the script function provides GetValue() method returning the numeric value corresponding to the new wire in value.

The gauge object, provided to the script function, or returned by FindGauge() method of the panel object, provides the following additional methods:

  • GetValue() returns the value currently displayed by the control.
  • SetValue(value) allows to change this value.
  • GetRange() returns the current maximum range of the control.
  • SetRange(range) allows to change the range.

All XML components that support Lua scripting also inherit from the Control class. Please refer to the FrontPanel Scripting documentation for more information on this class.

Example Screenshot