chore: Companion - port of OpenTX function switches management (#1694)
* TPro - Port of OpenTX function switches management (https://github.com/opentx/opentx/pull/8847) * cleanup * Corrections * Fix YAML generation and adjusted switches to match TPRO firmware Co-authored-by: Batam <batam@macbook-pro.home>
This commit is contained in:
@@ -369,7 +369,7 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
||||
str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (input.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + tr("Switch(%1)").arg(input.swtch.toString(getCurrentBoard(), &generalSettings)).toHtmlEscaped();
|
||||
str += " " + tr("Switch(%1)").arg(input.swtch.toString(getCurrentBoard(), &generalSettings, &model)).toHtmlEscaped();
|
||||
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
@@ -418,7 +418,7 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (mix.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + tr("Switch(%1)").arg(mix.swtch.toString(getCurrentBoard(), &generalSettings)).toHtmlEscaped();
|
||||
str += " " + tr("Switch(%1)").arg(mix.swtch.toString(getCurrentBoard(), &generalSettings, &model)).toHtmlEscaped();
|
||||
|
||||
if (mix.carryTrim > 0)
|
||||
str += " " + tr("NoTrim");
|
||||
@@ -650,7 +650,7 @@ QString ModelPrinter::printCurveName(int idx)
|
||||
|
||||
QString ModelPrinter::printCurve(int idx)
|
||||
{
|
||||
const CurveData & curve = model.curves[idx];
|
||||
const CurveData & curve = model.curves[idx];
|
||||
return QString("%1 %2").arg(curve.typeToString()).arg(curve.pointsToString());
|
||||
}
|
||||
|
||||
@@ -759,7 +759,7 @@ QString ModelPrinter::printSwitchWarnings()
|
||||
uint64_t switchStates = model.switchWarningStates;
|
||||
uint64_t value;
|
||||
|
||||
for (int idx=0; idx<board.getCapability(Board::Switches); idx++) {
|
||||
for (int idx=0; idx<board.getCapability(Board::Switches) + board.getCapability(Board::FunctionSwitches); idx++) {
|
||||
Board::SwitchInfo switchInfo = Boards::getSwitchInfo(board.getBoardType(), idx);
|
||||
switchInfo.config = Board::SwitchType(generalSettings.switchConfig[idx]);
|
||||
if (switchInfo.config == Board::SWITCH_NOT_AVAILABLE || switchInfo.config == Board::SWITCH_TOGGLE) {
|
||||
|
||||
Reference in New Issue
Block a user