Add "Act" switch to companion (fix #6851) (#6854)

This commit is contained in:
Andre Bernet
2019-09-30 17:56:12 +02:00
committed by Bertrand Songis
parent af5f3586f2
commit 4f614850c4
4 changed files with 10 additions and 0 deletions
@@ -217,6 +217,10 @@ class SwitchesConversionTable: public ConversionTable {
addConversion(RawSwitch(SWITCH_TYPE_SENSOR, i), val++);
}
}
if (version >= 219) {
addConversion(RawSwitch(SWITCH_TYPE_ACT, -1), -val+offset);
addConversion(RawSwitch(SWITCH_TYPE_ACT, 1), val++);
}
}
+3
View File
@@ -115,6 +115,9 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen
case SWITCH_TYPE_ONE:
return tr("One");
case SWITCH_TYPE_ACT:
return tr("Act");
case SWITCH_TYPE_FLIGHT_MODE:
if (modelData)
return modelData->flightModeData[index-1].nameToString(index - 1);
+1
View File
@@ -45,6 +45,7 @@ enum RawSwitchType {
SWITCH_TYPE_TIMER_MODE,
SWITCH_TYPE_TELEMETRY,
SWITCH_TYPE_SENSOR,
SWITCH_TYPE_ACT,
MAX_SWITCH_TYPE
};