Bind
C++ UI framework for Arduino
 
Loading...
Searching...
No Matches
BindGaugeSimple.hpp
1#ifndef __BINDGAUGESIMPLE_HPP
2#define __BINDGAUGESIMPLE_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
5
51{
52
53public:
61 BindGaugeSimple(const char *cstr);
62
69
70 int16_t x = 0;
71 int16_t y = 0;
72 uint8_t cmdId = 0;
73 int16_t dimSize = 200;
74 int16_t minValue = 0;
75 int16_t maxValue = 100;
76 int16_t value = 0;
77 uint8_t style = 0;
78 bool isSymmetrical = false;
79 int32_t color;
80
88 void setLabel(const char *cstr)
89 {
90 str = cstr;
91 }
92
93 [[deprecated("Use setLabel instead")]]
94 void setlabel(const char *cstr)
95 {
96 setLabel(cstr);
97 }
98
107 uint16_t getBytes(uint8_t *out);
108
109private:
110 uint8_t objID = BIND_ID_GAUGE_SIMPLE;
111 uint16_t offset = 0;
112 int strLength = 0;
113 const char *str;
114 static int16_t tagIndex;
115};
116
117#endif /* __BINDGAUGESIMPLE_HPP */
BindGaugeSimple Class.
Definition BindGaugeSimple.hpp:51
uint8_t style
The style of the gauge (e.g., radial or linear).
Definition BindGaugeSimple.hpp:77
int16_t minValue
The minimum value for the gauge's value range.
Definition BindGaugeSimple.hpp:74
void setLabel(const char *cstr)
Set the label text.
Definition BindGaugeSimple.hpp:88
int16_t maxValue
The maximum value for the gauge's value range.
Definition BindGaugeSimple.hpp:75
int16_t x
The x-coordinate position of the gauge on the screen.
Definition BindGaugeSimple.hpp:70
int16_t y
The y-coordinate position of the gauge on the screen.
Definition BindGaugeSimple.hpp:71
int16_t dimSize
The dimensions (size) of the gauge.
Definition BindGaugeSimple.hpp:73
uint8_t cmdId
Command identifier to add or refresh the gauge. See the notes for possible cmdId values.
Definition BindGaugeSimple.hpp:72
BindGaugeSimple()
Default constructor.
Definition BindGaugeSimple.hpp:68
uint16_t getBytes(uint8_t *out)
Serialize the gauge object into bytes.
Definition BindGaugeSimple.cpp:11
bool isSymmetrical
Indicates whether the gauge is symmetrical or not.
Definition BindGaugeSimple.hpp:78
int32_t color
The color of the gauge.
Definition BindGaugeSimple.hpp:79
int16_t value
The current value of the gauge.
Definition BindGaugeSimple.hpp:76
Definition BindView.hpp:26