Loading...
Searching...
No Matches
BindGaugeSimple.hpp
1#ifndef __BINDGAUGESIMPLE_HPP
2#define __BINDGAUGESIMPLE_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
5
50 class BindGaugeSimple : public BindView
51{
52
53 public:
61 BindGaugeSimple(const char *cstr);
62
68 BindGaugeSimple():BindGaugeSimple("Gauge"){}
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
109 private:
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
BindGaugeSimple Class.
Definition BindGaugeSimple.hpp:51
BindGaugeSimple::style
uint8_t style
The style of the gauge (e.g., radial or linear).
Definition BindGaugeSimple.hpp:77
BindGaugeSimple::minValue
int16_t minValue
The minimum value for the gauge's value range.
Definition BindGaugeSimple.hpp:74
BindGaugeSimple::setLabel
void setLabel(const char *cstr)
Set the label text.
Definition BindGaugeSimple.hpp:88
BindGaugeSimple::maxValue
int16_t maxValue
The maximum value for the gauge's value range.
Definition BindGaugeSimple.hpp:75
BindGaugeSimple::x
int16_t x
The x-coordinate position of the gauge on the screen.
Definition BindGaugeSimple.hpp:70
BindGaugeSimple::y
int16_t y
The y-coordinate position of the gauge on the screen.
Definition BindGaugeSimple.hpp:71
BindGaugeSimple::dimSize
int16_t dimSize
The dimensions (size) of the gauge.
Definition BindGaugeSimple.hpp:73
BindGaugeSimple::cmdId
uint8_t cmdId
Command identifier to add or refresh the gauge. See the notes for possible cmdId values.
Definition BindGaugeSimple.hpp:72
BindGaugeSimple::BindGaugeSimple
BindGaugeSimple()
Default constructor.
Definition BindGaugeSimple.hpp:68
BindGaugeSimple::getBytes
uint16_t getBytes(uint8_t *out)
Serialize the gauge object into bytes.
Definition BindGaugeSimple.cpp:11
BindGaugeSimple::isSymmetrical
bool isSymmetrical
Indicates whether the gauge is symmetrical or not.
Definition BindGaugeSimple.hpp:78
BindGaugeSimple::color
int32_t color
The color of the gauge.
Definition BindGaugeSimple.hpp:79
BindGaugeSimple::value
int16_t value
The current value of the gauge.
Definition BindGaugeSimple.hpp:76
BindView
Definition BindView.hpp:26