1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 21:30:19 +00:00

IDs are uint16_t, removed not used member ESPUIClass::cIndex

This commit is contained in:
Christian Riggenbach
2019-03-03 21:53:59 +01:00
parent 6c8f113861
commit acce17b82c
2 changed files with 22 additions and 20 deletions

View File

@ -103,11 +103,14 @@ enum ControlColor : uint8_t {
class Control {
public:
ControlType type;
unsigned int id; // just mirroring the id here for practical reasons
uint16_t id; // just mirroring the id here for practical reasons
const char* label;
void ( *callback )( Control, int );
String value;
ControlColor color;
Control* next;
Control(
@ -201,43 +204,42 @@ class ESPUIClass {
// Update Elements
Control* getControl( int id );
Control* getControl( uint16_t id );
Control* getControl( String label );
// Update Elements
void updateControl( int id, String value, int clientId = -1 );
void updateControl( uint16_t id, String value, int clientId = -1 );
void updateControl( String label, String value, int clientId = -1 );
void updateControl( Control* control, String value, int clientId = -1 );
void print( int id, String value );
void print( uint16_t id, String value );
void print( String label, String value );
void updateLabel( int id, String value );
void updateLabel( uint16_t id, String value );
void updateLabel( String label, String value );
void updateSwitcher( int id, bool nValue, int clientId = -1 );
void updateSwitcher( uint16_t id, bool nValue, int clientId = -1 );
void updateSwitcher( String label, bool nValue, int clientId = -1 );
void updateSlider( int id, int nValue, int clientId = -1 );
void updateSlider( uint16_t id, int nValue, int clientId = -1 );
void updateSlider( String label, int nValue, int clientId = -1 );
void updateNumber( int id, int nValue, int clientId = -1 );
void updateNumber( uint16_t id, int nValue, int clientId = -1 );
void updateNumber( String label, int nValue, int clientId = -1 );
void updateText( int id, String nValue, int clientId = -1 );
void updateText( uint16_t id, String nValue, int clientId = -1 );
void updateText( String label, String nValue, int clientId = -1 );
void clearGraph( int id, int clientId = -1 );
void clearGraph( uint16_t id, int clientId = -1 );
void clearGraph( String label, int clientId = -1 );
void addGraphPoint( int id, int nValue, int clientId = -1 );
void addGraphPoint( uint16_t id, int nValue, int clientId = -1 );
void addGraphPoint( String label, int nValue, int clientId = -1 );
// void textThem( String text, int clientId = -1 );
// Variables ---
const char* ui_title = "ESPUI"; // Store UI Title and Header Name
int cIndex = 0; // Control index
Control* controls = nullptr;
void jsonDom( AsyncWebSocketClient* client );