Move analogInputNamesLookupTable to Firmware

This commit is contained in:
elecpower
2021-12-31 10:53:09 +01:00
committed by Raphael Coeffic
parent d636487663
commit df4a4a6960
5 changed files with 86 additions and 70 deletions
+17 -2
View File
@@ -26,6 +26,7 @@
#include "radiodata.h"
#include "../../radio/src/definitions.h"
#include "simulatorinterface.h"
#include "datahelpers.h"
#include <QtCore>
#include <QStringList>
@@ -287,8 +288,15 @@ class Firmware
board(board),
variantBase(0),
base(base),
eepromInterface(nullptr)
{ }
eepromInterface(nullptr),
analogInputNamesLookupTable(Boards::getAnalogNamesLookupTable(board))
{
/* qDebug() << "board:" << Boards::getBoardName(board);
* for_each(analogInputNamesLookupTable.begin(), analogInputNamesLookupTable.end(), [=](const Int2StringMapping& row) {
* qDebug() << "index:" << row.first << "value:" << row.second.c_str();
* });
*/
}
virtual ~Firmware() { }
@@ -395,6 +403,11 @@ class Firmware
currentVariant = value;
}
const Int2StringMappingTable * getAnalogIndexNamesLookupTable()
{
return &analogInputNamesLookupTable;
}
protected:
QString id;
QString name;
@@ -402,6 +415,7 @@ class Firmware
unsigned int variantBase;
Firmware * base;
EEPROMInterface * eepromInterface;
const Int2StringMappingTable analogInputNamesLookupTable;
QList<const char *> languages;
//QList<const char *> ttslanguages;
OptionsList opts;
@@ -409,6 +423,7 @@ class Firmware
static QVector<Firmware *> registeredFirmwares;
static Firmware * defaultVariant;
static Firmware * currentVariant;
};
inline Firmware * getCurrentFirmware()