Loading...
Searching...
No Matches
BindHeadingIndicator.hpp
1#ifndef __BINDHEADINGINDICATOR_HPP
2#define __BINDHEADINGINDICATOR_HPP
3#include "BindView.hpp"
4#include "BindUtils.hpp"
5
24 class BindHeadingIndicator : public BindView
25{
26
27 public:
28 BindHeadingIndicator();
29 int16_t x = 0;
30 int16_t y = 0;
31 uint8_t cmdId = 0;
32 int16_t dimSize = 200;
33 float heading = 0.0f;
34
44 uint16_t getBytes(uint8_t *out) override
45 {
46 offset = 0;
47 copyAndOffset(out, &offset, &objID, sizeof(objID));
48 copyAndOffset(out, &offset, &x, sizeof(x));
49 copyAndOffset(out, &offset, &y, sizeof(y));
50 copyAndOffset(out, &offset, &tag, sizeof(tag));
51 copyAndOffset(out, &offset, &cmdId, sizeof(cmdId));
52 copyAndOffset(out, &offset, &dimSize, sizeof(dimSize));
53 copyAndOffset(out, &offset, &heading, sizeof(heading));
54 return offset;
55 }
56
57 private:
58 uint8_t objID = BIND_ID_HEADING_INDICATOR;
59 uint16_t offset = 0;
60 static int16_t tagIndex;
61};
62
63#endif /* __BINDHEADINGINDICATOR_HPP */
BindHeadingIndicator
Represents a heading indicator for BindCanvas.
Definition BindHeadingIndicator.hpp:25
BindHeadingIndicator::dimSize
int16_t dimSize
Size dimension of the heading indicator (Width = Height).
Definition BindHeadingIndicator.hpp:32
BindHeadingIndicator::cmdId
uint8_t cmdId
Command ID for the heading indicator. See the notes for possible cmdId values.
Definition BindHeadingIndicator.hpp:31
BindHeadingIndicator::y
int16_t y
Y-coordinate position of the heading indicator.
Definition BindHeadingIndicator.hpp:30
BindHeadingIndicator::x
int16_t x
X-coordinate position of the heading indicator.
Definition BindHeadingIndicator.hpp:29
BindHeadingIndicator::heading
float heading
Current heading value.
Definition BindHeadingIndicator.hpp:33
BindHeadingIndicator::getBytes
uint16_t getBytes(uint8_t *out) override
Generates and returns the byte data representing the heading indicator configuration.
Definition BindHeadingIndicator.hpp:44
BindView
Definition BindView.hpp:22