Skip to content

Gauge

The gauge shows a tag value with a needle: a pressure gauge, a thermometer, a tachometer. The scale is set up with angles (“Scale start” and “Scale length”: 240° is a classic gauge, 180° a half circle), the number of major and minor ticks and the label format. “Scale zones” color the arc: for example, a yellow zone from 80 and a red one from 90. Below the needle is the value with the tag’s units.

Besides the properties of every element — name, position, size, tooltip, rotation, transparency and the operate right:

Property Values Default Description
Tag tag name Tag
Minimum number 0 Minimum
Maximum number 100 Maximum
Zones text Scale zones. Colour zones: “threshold:colour” pairs separated by “;”, for example 0:#F2F3F4; 50:#F9C800; 80:#D32F2F. The colour of the highest threshold not above the value is used; below all thresholds the normal colour applies
Label text Label
Format text 0.0 Format. How to show the value under the needle
StartAngle number 150 Scale start, °. Minimum angle: 0 — right, 90 — bottom, 150 — bottom left
SweepAngle number 240 Scale sweep, °. 240 — classic gauge, 180 — half circle, 270 — three quarters
MajorTicks integer 5 Major ticks
MinorTicks integer 1 Minor ticks. Between major ticks
ScaleFormat text 0.## Scale format
ShowValue true / false true Show value
Unit text Units. Empty — tag units
NeedleColor #RRGGBB #1E2328 Needle color
ScaleColor #RRGGBB #5C646C Scale color
LabelColor #RRGGBB Labels color
ValueColor #RRGGBB Value color
DialColor #RRGGBB Dial. Circle background; empty — transparent
RimColor #RRGGBB Rim. Ring around the dial; empty — none
NeedleWidth number 3 Needle width

Item.Type = Gauge. Any property is read and changed by name: Item.NeedleColor = "#D32F2F". The common element members (Visible, Enabled, Value, Raise, Apply…) are described in Elements from scripts.

Mouse, hover, focus and keyboard — as for any element (see Events and functions).

Zones from the alarm setpoints — the Screen opened event script.

var g = Screen.Items("Pressure");
g.Zones = "0:#3C9A5F; " + Tags("PNet.HighWarn").Value + ":#F9C800; " + Tags("PNet.HighAlarm").Value + ":#D32F2F";

One gauge for several points — clicking a marker switches the gauge to its tag.

var g = Screen.Items("Gauge");
g.Tag = Item.Name.replace("Mark_", "") + ".Value";
g.Label = Item.Name.replace("Mark_", "");