[Companion] Horus analog input names fixed

This commit is contained in:
Bertrand Songis
2016-12-02 20:27:28 +01:00
parent c23ac292b7
commit 440ca771df
11 changed files with 67 additions and 28 deletions
@@ -789,6 +789,58 @@ int OpenTxFirmware::getCapability(Capability capability)
}
}
QString OpenTxFirmware::getAnalogInputName(unsigned int index)
{
if (index < 4) {
const QString sticks[] = { QObject::tr("Rud"),
QObject::tr("Ele"),
QObject::tr("Thr"),
QObject::tr("Ail") };
return sticks[index];
}
index -= 4;
if (IS_9X(board) || IS_2560(board) || IS_SKY9X(board)) {
const QString pots[] = { QObject::tr("P1"),
QObject::tr("P2"),
QObject::tr("P3") };
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_TARANIS_X9E(board)) {
const QString pots[] = { QObject::tr("F1"),
QObject::tr("F2"),
QObject::tr("F3"),
QObject::tr("F4"),
QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("LS"),
QObject::tr("RS") };
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_TARANIS(board)) {
const QString pots[] = {QObject::tr("S1"),
QObject::tr("S2"),
QObject::tr("S3"),
QObject::tr("LS"),
QObject::tr("RS")};
return CHECK_IN_ARRAY(pots, index);
}
else if (IS_HORUS(board)) {
const QString pots[] = {QObject::tr("S1"),
QObject::tr("6P"),
QObject::tr("S2"),
QObject::tr("L1"),
QObject::tr("L2"),
QObject::tr("LS"),
QObject::tr("RS")};
return CHECK_IN_ARRAY(pots, index);
}
else {
return "???";
}
}
Firmware::Switch OpenTxFirmware::getSwitch(unsigned int index)
{
if (board == BOARD_X7D) {