4#include "BindUtils.hpp"
88 strLength = strlen(str);
89 if (strLength > MAX_STRING_LENGTH_TERMINAL)
91 strLength = MAX_STRING_LENGTH_TERMINAL;
93 copyAndOffset(out, &offset, &objID, 1);
94 copyAndOffset(out, &offset, &
x,
sizeof(
x));
95 copyAndOffset(out, &offset, &
y,
sizeof(
y));
96 copyAndOffset(out, &offset, &tag,
sizeof(tag));
97 copyAndOffset(out, &offset, &
cmdId,
sizeof(
cmdId));
99 copyAndOffset(out, &offset, &
value,
sizeof(
value));
105 copyAndOffset(out, &offset, str, strLength);
110 uint8_t objID = BIND_ID_GAUGE1;
114 static int16_t tagIndex;
The BindGauge class represents a gauge UI element for use with BindCanvas.
Definition BindGauge.hpp:31
void setlabel(const char *cstr)
Sets the label text for the gauge.
Definition BindGauge.hpp:70
uint16_t getBytes(uint8_t *out) override
Serializes gauge properties into a byte array for synchronization.
Definition BindGauge.hpp:85
float maxValue
Maximum value of the gauge.
Definition BindGauge.hpp:56
uint8_t cmdId
Command ID for the gauge. See the notes for possible cmdId values.
Definition BindGauge.hpp:53
int16_t dimSize
Size of the gauge (Width = height)
Definition BindGauge.hpp:54
float arcRedMaxVal
Maximum value for the red arc section.
Definition BindGauge.hpp:60
float value
Current value of the gauge.
Definition BindGauge.hpp:55
BindGauge()
Constructs a BindGauge with a default label.
Definition BindGauge.hpp:49
uint8_t drawArc
Indicates whether to draw the gauge arc.
Definition BindGauge.hpp:57
float arcYellowMaxVal
Maximum value for the yellow arc section.
Definition BindGauge.hpp:59
int16_t y
Y-coordinate position of the gauge.
Definition BindGauge.hpp:52
float arcGreenMaxVal
Maximum value for the green arc section.
Definition BindGauge.hpp:58
int16_t x
X-coordinate position of the gauge.
Definition BindGauge.hpp:51
Definition BindView.hpp:22