Use Boards for trim switches
This commit is contained in:
committed by
Raphael Coeffic
parent
609604d141
commit
1c7bece090
@@ -230,3 +230,29 @@ std::string Firmware::getSwitchesTag(unsigned int index)
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
int Firmware::getTrimSwitchesIndex(const char * tag)
|
||||
{
|
||||
const StringTagMappingTable& lut = trimSwitchesLookupTable;
|
||||
|
||||
auto it =
|
||||
find_if(lut.begin(), lut.end(), [=](const StringTagMapping& elmt) {
|
||||
if (elmt.tag == tag) return true;
|
||||
return false;
|
||||
});
|
||||
|
||||
if (it != lut.end()) {
|
||||
return it - lut.begin();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::string Firmware::getTrimSwitchesTag(unsigned int index)
|
||||
{
|
||||
const StringTagMappingTable& lut = trimSwitchesLookupTable;
|
||||
if (index < lut.size())
|
||||
return lut[index].tag;
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user