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