feat(radio): refactor of switch handling to better support customisable switches (#6095)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: 3djc <3djc@gh.com> Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
co-authored by
philmoz
3djc
elecpower
parent
28833f42e6
commit
0c8c39b134
@@ -61,13 +61,15 @@ class BoardJson
|
||||
};
|
||||
|
||||
struct SwitchDefn {
|
||||
Board::SwitchType type = Board::SWITCH_NOT_AVAILABLE;
|
||||
std::string tag = "";
|
||||
Board::SwitchType type = Board::SWITCH_NOT_AVAILABLE;
|
||||
std::string name = "";
|
||||
int flags = 0;
|
||||
bool inverted = false;
|
||||
Board::SwitchType dflt = Board::SWITCH_NOT_AVAILABLE;
|
||||
Display display;
|
||||
bool isCustomSwitch = false;
|
||||
int customSwitchIdx = -1;
|
||||
Board::LookupValueType cfgYaml = Board::LVT_TAG;
|
||||
Board::LookupValueType refYaml = Board::LVT_NAME;
|
||||
|
||||
@@ -137,6 +139,8 @@ class BoardJson
|
||||
const int getKeyIndex(const QString key) const;
|
||||
|
||||
const int getSwitchIndex(const QString val, Board::LookupValueType lvt) const;
|
||||
const int getCFSIndexForSwitch(int sw) const;
|
||||
const int getSwitchIndexForCFS(int customSwitchIdx) const;
|
||||
const Board::SwitchInfo getSwitchInfo(int index) const;
|
||||
const QString getSwitchName(int index) const;
|
||||
const QString getSwitchTag(int index) const;
|
||||
|
||||
Reference in New Issue
Block a user