semilimes mcu sdk 1.1.3 semilimes Software Development Kit for microcontrollers

Loading...
Searching...
No Matches
dc_gauge.h
1#ifndef _dc_gauge_
2#define _dc_gauge_
3
4#include "../defines.h"
5
6 class DcGauge
7{
8 private:
9 SmeJson json_data;
10 char* json = nullptr;
11 char* jsonArray = nullptr;
12
13 public:
14// shows a moving indicator on the gauge, depending on the value
16 char pointer[4][9] = {"none", "triangle", "circle", "needle"};
17
18// shows a progress bar moving on the arch of the gauge, depending on the value
20 char progressBar[3][8] = {"none", "basic", "rounded"};
21
22// Function: ~DcGauge
23
24// distructor of the class, frees up the memory occupied by the array/s
25
26// Prototype:
27// ~DcGauge()
28
29// Parameters:
30
31// Returns:
33 ~DcGauge()
34 {
35 delete[] json;
36 delete[] jsonArray;
37 json = nullptr;
38 jsonArray = nullptr;
39 }
40
41// Function: DcGauge.set
42
43// A gauge to show numerical data with a configurable ranges and colors
44
45// Prototype:
46// void DcGauge::set(const char* title,int thickness,int degrees,int spacing,int fontSize,int value,const char* displayValue,const char* pointer,const char* pointerColor,const char* progressBar,const char* progressBarColor);
47
48// Parameters:
60
61// Returns:
63 void set(const char* title,int thickness,int degrees,int spacing,int fontSize,int value,const char* displayValue,const char* pointer,const char* pointerColor,const char* progressBar,const char* progressBarColor);
64
65// Function: DcGauge.addSegment
66
67// is an array of the graphical segments composing the gauge.
68
69// Prototype:
70// void DcGauge::addSegment(int from,int to,const char* color);
71
72// Parameters:
76
77// Returns:
79
80 void addSegment(int from,int to,const char* color);
81
82// Function: DcGauge.appendSegments
83
84// Append the selected Segments
85
86// Prototype:
87// void DcGauge::appendSegments();
88
89// Parameters:
90
91// Returns:
93 void appendSegments();
94
95// Function: DcGauge.get
96
97// return the json script
98
99// Prototype:
100// void DcGauge::get();
101
102// Parameters:
103
104// Returns:
106 char* get();
107};
108
109#endif
DcGauge
Definition dc_gauge.h:7
DcGauge::appendSegments
void appendSegments()
Definition dc_gauge.cpp:96
DcGauge::~DcGauge
~DcGauge()
Definition dc_gauge.h:33
DcGauge::set
void set(const char *title, int thickness, int degrees, int spacing, int fontSize, int value, const char *displayValue, const char *pointer, const char *pointerColor, const char *progressBar, const char *progressBarColor)
Definition dc_gauge.cpp:27
DcGauge::get
char * get()
Definition dc_gauge.cpp:118
DcGauge::pointer
char pointer[4][9]
Definition dc_gauge.h:16
DcGauge::addSegment
void addSegment(int from, int to, const char *color)
Definition dc_gauge.cpp:62
DcGauge::progressBar
char progressBar[3][8]
Definition dc_gauge.h:20