feat: special function to push customisable switches (#5497)
Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
co-authored by
philmoz
elecpower
parent
40449bf730
commit
d417228677
@@ -468,6 +468,22 @@ int BoardJson::getSwitchTagNum(const SwitchesTable * switches, int index)
|
||||
return -1;
|
||||
}
|
||||
|
||||
const int BoardJson::getSwitchTypeOffset(Board::SwitchType type)
|
||||
{
|
||||
return getSwitchTypeOffset(m_switches, type);
|
||||
}
|
||||
|
||||
// static
|
||||
int BoardJson::getSwitchTypeOffset(const SwitchesTable * switches, Board::SwitchType type)
|
||||
{
|
||||
for (int i = 0; i < (int)switches->size(); i++) {
|
||||
if (type == switches->at(i).type)
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const int BoardJson::getSwitchYamlIndex(const QString val, YamlLookupType ylt) const
|
||||
{
|
||||
for (int i = 0; i < (int)m_switches->size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user