feat: use any source for expo/weight/offset (#5220)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2024-07-26 20:51:21 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 326c58a7fd
commit 4b917b762c
87 changed files with 2751 additions and 1671 deletions
+7 -6
View File
@@ -26,6 +26,7 @@
#include "appdata.h"
#include "adjustmentreference.h"
#include "curveimage.h"
#include "sourcenumref.h"
#include <QApplication>
#include <QPainter>
@@ -366,9 +367,9 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
str += " " + tr("Scale(%1)").arg(input.scale * range.step).toHtmlEscaped();
}
str += " " + tr("Weight(%1)").arg(AdjustmentReference(input.weight).toString(&model, true)).toHtmlEscaped();
str += " " + tr("Weight(%1)").arg(SourceNumRef(input.weight).toString(&model, &generalSettings)).toHtmlEscaped();
if (input.curve.value)
str += " " + input.curve.toString(&model).toHtmlEscaped();
str += " " + input.curve.toString(&model, true, &generalSettings).toHtmlEscaped();
QString flightModesStr = printFlightModes(input.flightModes);
if (!flightModesStr.isEmpty())
@@ -386,7 +387,7 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
}
if (input.offset)
str += " " + tr("Offset(%1)").arg(AdjustmentReference(input.offset).toString(&model)).toHtmlEscaped();
str += " " + tr("Offset(%1)").arg(SourceNumRef(input.offset).toString(&model, &generalSettings)).toHtmlEscaped();
if (firmware->getCapability(HasExpoNames) && input.name[0])
str += QString(" [%1]").arg(input.name).toHtmlEscaped();
@@ -417,7 +418,7 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
if (mix.mltpx == MLTPX_MUL && !showMultiplex)
str += " " + tr("MULT!").toHtmlEscaped();
else
str += " " + tr("Weight(%1)").arg(AdjustmentReference(mix.weight).toString(&model, true)).toHtmlEscaped();
str += " " + tr("Weight(%1)").arg(SourceNumRef(mix.weight).toString(&model, &generalSettings)).toHtmlEscaped();
QString flightModesStr = printFlightModes(mix.flightModes);
if (!flightModesStr.isEmpty())
@@ -434,9 +435,9 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
if (firmware->getCapability(HasNoExpo) && mix.noExpo)
str += " " + tr("No DR/Expo").toHtmlEscaped();
if (mix.sOffset)
str += " " + tr("Offset(%1)").arg(AdjustmentReference(mix.sOffset).toString(&model)).toHtmlEscaped();
str += " " + tr("Offset(%1)").arg(SourceNumRef(mix.sOffset).toString(&model, &generalSettings)).toHtmlEscaped();
if (mix.curve.value)
str += " " + mix.curve.toString(&model).toHtmlEscaped();
str += " " + mix.curve.toString(&model, true, &generalSettings).toHtmlEscaped();
int scale = firmware->getCapability(SlowScale);
if (scale == 0)
scale = 1;