1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-15 23:13:07 +01:00

allow to set a read only mode for config items, output compiler messages for overwritten configs, add m5 gps unit defs

This commit is contained in:
andreas
2023-10-05 18:52:30 +02:00
parent 9572b1e95e
commit 4fa40b98b3
7 changed files with 114 additions and 45 deletions

View File

@@ -5,19 +5,25 @@
class GwConfigHandler;
class GwConfigInterface{
public:
typedef enum {
NORMAL=0,
HIDDEN=1,
READONLY=2
} ConfigType;
private:
String name;
const char * initialValue;
String value;
bool secret=false;
bool hidden=false;
ConfigType type=NORMAL;
public:
GwConfigInterface(const String &name, const char * initialValue, bool secret=false, bool hidden=false){
GwConfigInterface(const String &name, const char * initialValue, bool secret=false,ConfigType type=NORMAL){
this->name=name;
this->initialValue=initialValue;
this->value=initialValue;
this->secret=secret;
this->hidden=hidden;
this->type=type;
}
virtual String asString() const{
return value;
@@ -43,8 +49,8 @@ class GwConfigInterface{
String getDefault() const {
return initialValue;
}
bool isHidden() const {
return hidden;
ConfigType getType() const {
return type;
}
friend class GwConfigHandler;
};
@@ -67,5 +73,7 @@ class GwNmeaFilter{
String toString();
};
#define __XSTR(x) __STR(x)
#define __STR(x) #x
#define __MSG(x) _Pragma (__STR(message (x)))
#endif