Skip to main content

Gauge Class

Package: GHIElectronics.Endpoint.UI
Namespace: GHIElectronics.Endpoint.UI

Radial dial with a needle. Not a standard .NET widget: the API mirrors TinyCLR's Gauge. SweepAngle is 180/270/360 degrees.

public class Gauge : Widget

Constructors​

Gauge(Widget parent, int width, int height)​

public Gauge(Widget parent, int width, int height)

Create a gauge inside parent.

ParameterTypeDescription
parentWidgetContaining widget.
widthintWidth in pixels.
heightintHeight in pixels.

Properties​

EnableScale​

public bool EnableScale { get; set; }

Whether tick marks and labels are drawn around the dial. Getter returns the last value set.

Returns bool

SweepAngle​

public int SweepAngle { get; set; }

Total sweep in degrees (typically 180, 270, or 360). Getter returns the last value set.

Returns int

Value​

public int Value { get; set; }

Current needle value. Getter returns the last value set (LVGL has no read-back).

Returns int

Methods​

SetNeedleShape(double centerY, double length)​

public void SetNeedleShape(double centerY, double length)

Needle center-Y (0..1 of height) and length (0..1 of half min dimension).

SetRange(int min, int max)​

public void SetRange(int min, int max)

Set the value range mapped onto the dial.

ParameterTypeDescription
minintValue shown at the start of the sweep.
maxintValue shown at the end of the sweep.