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:
26
src/ESPUI.h
26
src/ESPUI.h
@ -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 );
|
||||
|
||||
|
Reference in New Issue
Block a user