semilimes mcu sdk 1.1.4 semilimes Software Development Kit for microcontrollers

Loading...
Searching...
No Matches
fc_gauge.h
1#ifndef _fc_gauge_
2#define _fc_gauge_
3
4#include "../defines.h"
5
6 class FcGauge
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: ~FcGauge
23
24// distructor of the class, frees up the memory occupied by the array/s
25
26// Prototype:
27// ~FcGauge()
28
29// Parameters:
30
31// Returns:
33 ~FcGauge()
34 {
35 delete[] json;
36 delete[] jsonArray;
37 json = nullptr;
38 jsonArray = nullptr;
39 }
40
41// Function: FcGauge.set
42
43// A gauge to show numerical data with a configurable ranges and colors
44
45// Prototype:
46// void FcGauge::set(const char* refname,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:
61
62// Returns:
64 void set(const char* refname,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);
65
66// Function: FcGauge.addSegment
67
68// is an array of the graphical segments composing the gauge.
69
70// Prototype:
71// void FcGauge::addSegment(int from,int to,const char* color);
72
73// Parameters:
77
78// Returns:
80
81 void addSegment(int from,int to,const char* color);
82
83// Function: FcGauge.appendSegments
84
85// Append the selected Segments
86
87// Prototype:
88// void FcGauge::appendSegments();
89
90// Parameters:
91
92// Returns:
94 void appendSegments();
95
96// Function: FcGauge.get
97
98// return the json script
99
100// Prototype:
101// void FcGauge::get();
102
103// Parameters:
104
105// Returns:
107 char* get();
108};
109
110#endif
FcGauge
Definition fc_gauge.h:7
FcGauge::set
void set(const char *refname, 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 fc_gauge.cpp:27
FcGauge::addSegment
void addSegment(int from, int to, const char *color)
Definition fc_gauge.cpp:63
FcGauge::progressBar
char progressBar[3][8]
Definition fc_gauge.h:20
FcGauge::pointer
char pointer[4][9]
Definition fc_gauge.h:16
FcGauge::appendSegments
void appendSegments()
Definition fc_gauge.cpp:97
FcGauge::~FcGauge
~FcGauge()
Definition fc_gauge.h:33
FcGauge::get
char * get()
Definition fc_gauge.cpp:119