Use definitions in Boards for switches

This commit is contained in:
elecpower
2021-12-31 10:53:10 +01:00
committed by Raphael Coeffic
parent 56997f4d3c
commit 703bc20c6e
5 changed files with 68 additions and 18 deletions
+10 -1
View File
@@ -291,7 +291,8 @@ class Firmware
variantBase(0),
base(base),
eepromInterface(nullptr),
analogInputNamesLookupTable(Boards::getAnalogNamesLookupTable(board))
analogInputNamesLookupTable(Boards::getAnalogNamesLookupTable(board)),
switchesLookupTable(Boards::getSwitchesLookupTable(board))
{
}
@@ -405,8 +406,15 @@ class Firmware
return &analogInputNamesLookupTable;
}
const StringTagMappingTable* getSwitchesLookupTable()
{
return &switchesLookupTable;
}
int getAnalogInputIndex(const char * tag);
std::string getAnalogInputTag(unsigned int index);
int getSwitchesIndex(const char * tag);
std::string getSwitchesTag(unsigned int index);
protected:
QString id;
@@ -416,6 +424,7 @@ class Firmware
Firmware * base;
EEPROMInterface * eepromInterface;
const StringTagMappingTable analogInputNamesLookupTable;
const StringTagMappingTable switchesLookupTable;
QList<const char *> languages;
//QList<const char *> ttslanguages;
OptionsList opts;