From bdfb94ae832e08a5b5e24da27ec6fb689ecb3963 Mon Sep 17 00:00:00 2001 From: philmoz Date: Mon, 29 Jul 2024 20:07:58 +1000 Subject: [PATCH] feat: add precision setting for mix delay up & down (#5314) --- .../src/firmwares/edgetx/yaml_mixdata.cpp | 2 + companion/src/firmwares/mixdata.h | 1 + companion/src/modeledit/mixerdialog.cpp | 31 ++- companion/src/modeledit/mixerdialog.ui | 211 ++++++++++-------- companion/src/modelprinter.cpp | 9 +- radio/src/datastructs_private.h | 3 +- radio/src/gui/128x64/model_mix_edit.cpp | 9 +- radio/src/gui/212x64/model_mix_edit.cpp | 9 +- radio/src/gui/colorlcd/mixer_edit_adv.cpp | 38 +++- radio/src/gui/colorlcd/mixer_edit_adv.h | 2 + radio/src/mixer.cpp | 3 +- .../storage/yaml/yaml_datastructs_128x64.cpp | 3 +- .../storage/yaml/yaml_datastructs_nv14.cpp | 3 +- .../storage/yaml/yaml_datastructs_pl18.cpp | 3 +- .../src/storage/yaml/yaml_datastructs_t15.cpp | 3 +- .../src/storage/yaml/yaml_datastructs_t20.cpp | 3 +- .../storage/yaml/yaml_datastructs_tpro.cpp | 3 +- .../src/storage/yaml/yaml_datastructs_x10.cpp | 3 +- .../storage/yaml/yaml_datastructs_x12s.cpp | 3 +- .../src/storage/yaml/yaml_datastructs_x9d.cpp | 3 +- .../src/storage/yaml/yaml_datastructs_x9e.cpp | 3 +- .../storage/yaml/yaml_datastructs_xlites.cpp | 3 +- radio/src/translations.cpp | 1 + radio/src/translations.h | 1 + radio/src/translations/cn.h | 1 + radio/src/translations/cz.h | 1 + radio/src/translations/da.h | 1 + radio/src/translations/de.h | 1 + radio/src/translations/en.h | 1 + radio/src/translations/es.h | 1 + radio/src/translations/fi.h | 1 + radio/src/translations/fr.h | 1 + radio/src/translations/he.h | 1 + radio/src/translations/it.h | 1 + radio/src/translations/jp.h | 1 + radio/src/translations/nl.h | 1 + radio/src/translations/pl.h | 1 + radio/src/translations/pt.h | 1 + radio/src/translations/ru.h | 1 + radio/src/translations/se.h | 1 + radio/src/translations/tw.h | 1 + radio/src/translations/ua.h | 1 + 42 files changed, 242 insertions(+), 129 deletions(-) diff --git a/companion/src/firmwares/edgetx/yaml_mixdata.cpp b/companion/src/firmwares/edgetx/yaml_mixdata.cpp index e3d48eb3d..0e09b0f25 100644 --- a/companion/src/firmwares/edgetx/yaml_mixdata.cpp +++ b/companion/src/firmwares/edgetx/yaml_mixdata.cpp @@ -143,6 +143,7 @@ Node convert::encode(const MixData& rhs) node["weight"] = YamlSourceNumRefEncode(rhs.weight); node["swtch"] = rhs.swtch; node["curve"] = rhs.curve; + node["delayPrec"] = rhs.delayPrec; node["delayUp"] = rhs.delayUp; node["delayDown"] = rhs.delayDown; node["speedPrec"] = rhs.speedPrec; @@ -166,6 +167,7 @@ bool convert::decode(const Node& node, MixData& rhs) } node["swtch"] >> rhs.swtch; node["curve"] >> rhs.curve; + node["delayPrec"] >> rhs.delayPrec; node["delayUp"] >> rhs.delayUp; node["delayDown"] >> rhs.delayDown; node["speedPrec"] >> rhs.speedPrec; diff --git a/companion/src/firmwares/mixdata.h b/companion/src/firmwares/mixdata.h index f226b07ff..1d6eb654a 100644 --- a/companion/src/firmwares/mixdata.h +++ b/companion/src/firmwares/mixdata.h @@ -48,6 +48,7 @@ class MixData { int weight; RawSwitch swtch; CurveReference curve; + unsigned int delayPrec; unsigned int delayUp; unsigned int delayDown; unsigned int speedPrec; diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index ae156619b..2e0514758 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -145,20 +145,23 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(md->swtch.toValue())); ui->warningCB->setCurrentIndex(md->mixWarn); ui->mltpxCB->setCurrentIndex(md->mltpx); + ui->delayPrecCB->setCurrentIndex(md->delayPrec); ui->speedPrecCB->setCurrentIndex(md->speedPrec); - int scale=firmware->getCapability(SlowScale); - float range=firmware->getCapability(SlowRange); + float range = firmware->getCapability(SlowRange); + int scale = firmware->getCapability(SlowScale); + if (md->delayPrec) scale = scale * 10; ui->delayDownSB->setMaximum(range / scale); ui->delayDownSB->setSingleStep(1.0 / scale); - ui->delayDownSB->setDecimals((scale == 1 ? 0 : 1)); + ui->delayDownSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2)); ui->delayDownSB->setValue((float)md->delayDown / scale); ui->delayUpSB->setMaximum(range / scale); ui->delayUpSB->setSingleStep(1.0 / scale); - ui->delayUpSB->setDecimals((scale == 1 ? 0 : 1)); + ui->delayUpSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2)); ui->delayUpSB->setValue((float)md->delayUp / scale); + scale = firmware->getCapability(SlowScale); if (md->speedPrec) scale = scale * 10; ui->slowDownSB->setMaximum(range / scale); ui->slowDownSB->setSingleStep(1.0 / scale); @@ -178,6 +181,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->warningCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->mltpxCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); + connect(ui->delayPrecCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->delayDownSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged())); connect(ui->delayUpSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged())); connect(ui->speedPrecCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); @@ -229,18 +233,35 @@ void MixerDialog::valuesChanged() md->mixWarn = ui->warningCB->currentIndex(); md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex(); + float range = firmware->getCapability(SlowRange); + + // Update values based on old precision (in case it changed) int scale = firmware->getCapability(SlowScale); + if (md->delayPrec) scale = scale * 10; md->delayDown = round(ui->delayDownSB->value() * scale); md->delayUp = round(ui->delayUpSB->value() * scale); + // Get new precion and update controls + md->delayPrec = ui->delayPrecCB->currentIndex(); + scale = firmware->getCapability(SlowScale); + if (md->delayPrec) scale = scale * 10; + ui->delayDownSB->setMaximum(range / scale); + ui->delayDownSB->setSingleStep(1.0 / scale); + ui->delayDownSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2)); + ui->delayDownSB->setValue((float)md->delayDown / scale); + ui->delayUpSB->setMaximum(range / scale); + ui->delayUpSB->setSingleStep(1.0 / scale); + ui->delayUpSB->setDecimals((scale == 1 ? 0 : scale == 10 ? 1 : 2)); + ui->delayUpSB->setValue((float)md->delayUp / scale); + // Update values based on old precision (in case it changed) + scale = firmware->getCapability(SlowScale); if (md->speedPrec) scale = scale * 10; md->speedDown = round(ui->slowDownSB->value() * scale); md->speedUp = round(ui->slowUpSB->value() * scale); // Get new precion and update controls md->speedPrec = ui->speedPrecCB->currentIndex(); - float range = firmware->getCapability(SlowRange); scale = firmware->getCapability(SlowScale); if (md->speedPrec) scale = scale * 10; ui->slowDownSB->setMaximum(range / scale); diff --git a/companion/src/modeledit/mixerdialog.ui b/companion/src/modeledit/mixerdialog.ui index 1e6620e6c..e7eb67913 100644 --- a/companion/src/modeledit/mixerdialog.ui +++ b/companion/src/modeledit/mixerdialog.ui @@ -6,8 +6,8 @@ 0 0 - 752 - 623 + 763 + 655 @@ -63,13 +63,6 @@ - - - - Slow up/dn prec - - - @@ -80,20 +73,6 @@ - - - - - 0.0 - - - - - 0.00 - - - - @@ -521,37 +500,8 @@ - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1 - - - 7.500000000000000 - - - 0.500000000000000 - - - - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -573,7 +523,48 @@ p, li { white-space: pre-wrap; } - + + + + Slow + + + + + + + Delay + + + + + + + Up + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Down + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -602,49 +593,8 @@ p, li { white-space: pre-wrap; } - - - - - - - - - - - Down - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Up - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Delay - - - - - - - Slow - - - - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -666,6 +616,73 @@ p, li { white-space: pre-wrap; } + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Delay is not zero the actuation of the mix will be delayed by the specified amount of seconds.</p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 7.500000000000000 + + + 0.500000000000000 + + + + + + + Precision + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0.0 + + + + + 0.00 + + + + + + + + + 0.0 + + + + + 0.00 + + + + diff --git a/companion/src/modelprinter.cpp b/companion/src/modelprinter.cpp index 1866f79f2..bf0835323 100644 --- a/companion/src/modelprinter.cpp +++ b/companion/src/modelprinter.cpp @@ -440,10 +440,15 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in if (mix.curve.value) str += " " + mix.curve.toString(&model, true, &generalSettings).toHtmlEscaped(); int scale = firmware->getCapability(SlowScale); - if (scale == 0) - scale = 1; + if (scale == 0) scale = 1; + if (mix.delayPrec) { + scale = scale * 10; + str += " " + tr("Delay precision(0.00)").toHtmlEscaped(); + } if (mix.delayDown || mix.delayUp) str += " " + tr("Delay(u%1:d%2)").arg((double)mix.delayUp / scale).arg((double)mix.delayDown / scale).toHtmlEscaped(); + scale = firmware->getCapability(SlowScale); + if (scale == 0) scale = 1; if (mix.speedPrec) { scale = scale * 10; str += " " + tr("Slow precision(0.00)").toHtmlEscaped(); diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index e2d317b7b..3386f156c 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -93,9 +93,10 @@ PACK(struct MixData { uint16_t carryTrim:1; uint16_t mixWarn:2; // mixer warning uint16_t mltpx:2 ENUM(MixerMultiplex); + uint16_t delayPrec:1; uint16_t speedPrec:1; uint16_t flightModes:9 CUST(r_flightModes, w_flightModes); - uint16_t spare:2 SKIP; + uint16_t spare:1 SKIP; uint32_t weight:11 CUST(r_sourceNumVal,w_sourceNumVal); uint32_t offset:11 CUST(r_sourceNumVal,w_sourceNumVal); int32_t swtch:10 CUST(r_swtchSrc,w_swtchSrc); diff --git a/radio/src/gui/128x64/model_mix_edit.cpp b/radio/src/gui/128x64/model_mix_edit.cpp index 56048a90e..296918722 100644 --- a/radio/src/gui/128x64/model_mix_edit.cpp +++ b/radio/src/gui/128x64/model_mix_edit.cpp @@ -33,6 +33,7 @@ enum MixFields { MIX_FIELD_SWITCH, MIX_FIELD_WARNING, MIX_FIELD_MLTPX, + MIX_FIELD_DELAY_PREC, MIX_FIELD_DELAY_UP, MIX_FIELD_DELAY_DOWN, MIX_FIELD_SLOW_PREC, @@ -185,12 +186,16 @@ void menuModelMixOne(event_t event) md2->mltpx = editChoice(MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event); break; + case MIX_FIELD_DELAY_PREC: + md2->delayPrec = editChoice(MIXES_2ND_COLUMN, y, STR_MIX_DELAY_PREC, &STR_VPREC[1], md2->delayPrec, 0, 1, attr, event); + break; + case MIX_FIELD_DELAY_UP: - md2->delayUp = EDIT_DELAY(0, y, event, attr, STR_DELAYUP, md2->delayUp, PREC1); + md2->delayUp = EDIT_DELAY(0, y, event, attr, STR_DELAYUP, md2->delayUp, (md2->delayPrec ? PREC2 : PREC1)); break; case MIX_FIELD_DELAY_DOWN: - md2->delayDown = EDIT_DELAY(0, y, event, attr, STR_DELAYDOWN, md2->delayDown, PREC1); + md2->delayDown = EDIT_DELAY(0, y, event, attr, STR_DELAYDOWN, md2->delayDown, (md2->delayPrec ? PREC2 : PREC1)); break; case MIX_FIELD_SLOW_PREC: diff --git a/radio/src/gui/212x64/model_mix_edit.cpp b/radio/src/gui/212x64/model_mix_edit.cpp index 43a0eb6f3..13b7bf438 100644 --- a/radio/src/gui/212x64/model_mix_edit.cpp +++ b/radio/src/gui/212x64/model_mix_edit.cpp @@ -33,6 +33,7 @@ enum MixFields { MIX_FIELD_SWITCH, MIX_FIELD_WARNING, MIX_FIELD_MLTPX, + MIX_FIELD_DELAY_PREC, MIX_FIELD_DELAY_UP, MIX_FIELD_DELAY_DOWN, MIX_FIELD_SLOW_PREC, @@ -181,12 +182,16 @@ void menuModelMixOne(event_t event) md2->mltpx = editChoice(MIXES_2ND_COLUMN, y, STR_MULTPX, STR_VMLTPX, md2->mltpx, 0, 2, attr, event); break; + case MIX_FIELD_DELAY_PREC: + md2->delayPrec = editChoice(MIXES_2ND_COLUMN, y, STR_MIX_DELAY_PREC, &STR_VPREC[1], md2->delayPrec, 0, 1, attr, event); + break; + case MIX_FIELD_DELAY_UP: - md2->delayUp = EDIT_DELAY(y, event, attr, STR_DELAYUP, md2->delayUp, PREC1); + md2->delayUp = EDIT_DELAY(y, event, attr, STR_DELAYUP, md2->delayUp, (md2->delayPrec ? PREC2 : PREC1)); break; case MIX_FIELD_DELAY_DOWN: - md2->delayDown = EDIT_DELAY(y, event, attr, STR_DELAYDOWN, md2->delayDown, PREC1); + md2->delayDown = EDIT_DELAY(y, event, attr, STR_DELAYDOWN, md2->delayDown, (md2->delayPrec ? PREC2 : PREC1)); break; case MIX_FIELD_SLOW_PREC: diff --git a/radio/src/gui/colorlcd/mixer_edit_adv.cpp b/radio/src/gui/colorlcd/mixer_edit_adv.cpp index 0972d84b8..a8f73c090 100644 --- a/radio/src/gui/colorlcd/mixer_edit_adv.cpp +++ b/radio/src/gui/colorlcd/mixer_edit_adv.cpp @@ -84,20 +84,42 @@ void MixEditAdvanced::buildBody(Window* form) GET_SET_DEFAULT(mix->mixWarn)); edit->setZeroText(STR_OFF); + // Delay up/down precision +#if !PORTRAIT_LCD + grid.setColSpan(2); +#endif + line = form->newLine(grid); + new StaticText(line, rect_t{}, STR_MIX_DELAY_PREC); + new Choice(line, rect_t{}, &STR_VPREC[1], 0, 1, + GET_DEFAULT(mix->delayPrec), + [=](int newValue) { + mix->delayPrec = newValue; + delayUp->clearTextFlag(PREC2); + delayUp->setTextFlag(mix->delayPrec ? PREC2 : PREC1); + delayUp->update(); + delayDn->clearTextFlag(PREC2); + delayDn->setTextFlag(mix->delayPrec ? PREC2 : PREC1); + delayDn->update(); + SET_DIRTY(); + }); +#if !PORTRAIT_LCD + grid.setColSpan(1); +#endif + // Delay up line = form->newLine(grid); new StaticText(line, rect_t{}, STR_DELAYUP); - edit = new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, 0, DELAY_MAX, - GET_DEFAULT(mix->delayUp), - SET_VALUE(mix->delayUp, newValue), PREC1); - edit->setSuffix("s"); + delayUp = new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, 0, DELAY_MAX, + GET_DEFAULT(mix->delayUp), + SET_VALUE(mix->delayUp, newValue), mix->delayPrec ? PREC2 : PREC1); + delayUp->setSuffix("s"); // Delay down new StaticText(line, rect_t{}, STR_DELAYDOWN); - edit = new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, 0, DELAY_MAX, - GET_DEFAULT(mix->delayDown), - SET_VALUE(mix->delayDown, newValue), PREC1); - edit->setSuffix("s"); + delayDn = new NumberEdit(line, rect_t{0, 0, NUM_EDIT_W, 0}, 0, DELAY_MAX, + GET_DEFAULT(mix->delayDown), + SET_VALUE(mix->delayDown, newValue), mix->delayPrec ? PREC2 : PREC1); + delayDn->setSuffix("s"); // Slow up/down precision #if !PORTRAIT_LCD diff --git a/radio/src/gui/colorlcd/mixer_edit_adv.h b/radio/src/gui/colorlcd/mixer_edit_adv.h index e77231c24..d6945fb71 100644 --- a/radio/src/gui/colorlcd/mixer_edit_adv.h +++ b/radio/src/gui/colorlcd/mixer_edit_adv.h @@ -38,6 +38,8 @@ class MixEditAdvanced : public Page protected: uint8_t channel; uint8_t index; + NumberEdit* delayUp; + NumberEdit* delayDn; NumberEdit* slowUp; NumberEdit* slowDn; diff --git a/radio/src/mixer.cpp b/radio/src/mixer.cpp index 92c4dc54e..16922c6d7 100644 --- a/radio/src/mixer.cpp +++ b/radio/src/mixer.cpp @@ -924,7 +924,8 @@ void evalFlightModeMixes(uint8_t mode, uint8_t tick10ms) if (mode == e_perout_mode_normal && swTog) { if (!mixState[i].delay) _swPrev = _swOn; - mixState[i].delay = (mixEnabled > _swOn ? md->delayUp : md->delayDown) * 10; + int32_t precMult = md->delayPrec ? 1 : 10; + mixState[i].delay = (mixEnabled > _swOn ? md->delayUp : md->delayDown) * precMult; mixState[i].now = mixEnabled; mixState[i].prev = _swPrev; } diff --git a/radio/src/storage/yaml/yaml_datastructs_128x64.cpp b/radio/src/storage/yaml/yaml_datastructs_128x64.cpp index 0d02200dc..007a4b2c2 100644 --- a/radio/src/storage/yaml/yaml_datastructs_128x64.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_128x64.cpp @@ -401,9 +401,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp index 633214913..24d2f7fbb 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp @@ -427,9 +427,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_pl18.cpp b/radio/src/storage/yaml/yaml_datastructs_pl18.cpp index 955fbfe23..6254af2ba 100644 --- a/radio/src/storage/yaml/yaml_datastructs_pl18.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_pl18.cpp @@ -427,9 +427,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_t15.cpp b/radio/src/storage/yaml/yaml_datastructs_t15.cpp index f85faec89..c55657130 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t15.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t15.cpp @@ -429,9 +429,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_t20.cpp b/radio/src/storage/yaml/yaml_datastructs_t20.cpp index 0e7e982cd..c39a02703 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t20.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t20.cpp @@ -401,9 +401,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp index a8397a8bf..da473f472 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp @@ -401,9 +401,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/yaml/yaml_datastructs_x10.cpp index a214c3048..29942bf93 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x10.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x10.cpp @@ -429,9 +429,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp index a214c3048..29942bf93 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp @@ -429,9 +429,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp index 81a77893d..5b1c439b7 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp @@ -400,9 +400,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp index 2c8e9a7e5..c1a49413c 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp @@ -401,9 +401,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp index 4f53ac926..239e008d6 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp @@ -404,9 +404,10 @@ static const struct YamlNode struct_MixData[] = { YAML_UNSIGNED( "carryTrim", 1 ), YAML_UNSIGNED( "mixWarn", 2 ), YAML_ENUM("mltpx", 2, enum_MixerMultiplex), + YAML_UNSIGNED( "delayPrec", 1 ), YAML_UNSIGNED( "speedPrec", 1 ), YAML_UNSIGNED_CUST( "flightModes", 9, r_flightModes, w_flightModes ), - YAML_PADDING( 2 ), + YAML_PADDING( 1 ), YAML_UNSIGNED_CUST( "weight", 11, r_sourceNumVal, w_sourceNumVal ), YAML_UNSIGNED_CUST( "offset", 11, r_sourceNumVal, w_sourceNumVal ), YAML_SIGNED_CUST( "swtch", 10, r_swtchSrc, w_swtchSrc ), diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index a7abfd650..b3e7e7b72 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -1111,3 +1111,4 @@ const char STR_WIDGET_SIZE[] = TR_WIDGET_SIZE; #endif const char STR_MIX_SLOW_PREC[] = TR_MIX_SLOW_PREC; +const char STR_MIX_DELAY_PREC[] = TR_MIX_DELAY_PREC; diff --git a/radio/src/translations.h b/radio/src/translations.h index a37d5fdd7..775c62478 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -1276,3 +1276,4 @@ extern const char STR_WIDGET_SIZE[]; #endif extern const char STR_MIX_SLOW_PREC[]; +extern const char STR_MIX_DELAY_PREC[]; diff --git a/radio/src/translations/cn.h b/radio/src/translations/cn.h index 1c208210a..4b359121c 100644 --- a/radio/src/translations/cn.h +++ b/radio/src/translations/cn.h @@ -1294,6 +1294,7 @@ #define TR_CREATE_NEW "新建" #define TR_MIX_SLOW_PREC TR("慢放精度", "慢放精度 上行/下行") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "已存在同名主题目录 !" diff --git a/radio/src/translations/cz.h b/radio/src/translations/cz.h index 3ca3b9c44..843f7977f 100644 --- a/radio/src/translations/cz.h +++ b/radio/src/translations/cz.h @@ -1309,6 +1309,7 @@ #define TR_CREATE_NEW "Vytvořit" #define TR_MIX_SLOW_PREC TR("Přesnost zpomal", "Přesnost zpomalení") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Adresář vzhledu s tímto názvem již existuje." diff --git a/radio/src/translations/da.h b/radio/src/translations/da.h index 8f50a1a76..416b3f810 100644 --- a/radio/src/translations/da.h +++ b/radio/src/translations/da.h @@ -1308,6 +1308,7 @@ #define TR_CREATE_NEW "Opret" #define TR_MIX_SLOW_PREC TR("Træg præc", "Træg op/ned præcision") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Der findes allerede et katalog med samme navn." diff --git a/radio/src/translations/de.h b/radio/src/translations/de.h index 9b54be288..72a677df9 100644 --- a/radio/src/translations/de.h +++ b/radio/src/translations/de.h @@ -1299,6 +1299,7 @@ #define TR_CREATE_NEW "Erstelle" #define TR_MIX_SLOW_PREC TR("Langs. Vorlauf", "Langs. Vor-/Rücklauf") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Ein Theme-Verzeichnis mit demselben Namen existiert bereits" diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index e03dda3fd..fb62e9537 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -1294,6 +1294,7 @@ #define TR_CREATE_NEW "Create" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "A theme directory with the same name already exists." diff --git a/radio/src/translations/es.h b/radio/src/translations/es.h index 4faf222b8..47010bba3 100644 --- a/radio/src/translations/es.h +++ b/radio/src/translations/es.h @@ -1296,6 +1296,7 @@ #define TR_CREATE_NEW "Create" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "A theme directory with the same name already exists." diff --git a/radio/src/translations/fi.h b/radio/src/translations/fi.h index 59a40c254..7bd9014ad 100644 --- a/radio/src/translations/fi.h +++ b/radio/src/translations/fi.h @@ -1312,6 +1312,7 @@ #define TR_CREATE_NEW "Create" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "A theme directory with the same name already exists." diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index 41425b264..d550f26df 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -1311,6 +1311,7 @@ #define TR_CREATE_NEW "Créer" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Un thème avec le même nom existe déjà." diff --git a/radio/src/translations/he.h b/radio/src/translations/he.h index 38fc65307..58c02b3d8 100644 --- a/radio/src/translations/he.h +++ b/radio/src/translations/he.h @@ -1295,6 +1295,7 @@ #define TR_CREATE_NEW "יצירה חדשה" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "כבר קיימת ערכת נושא עם אותו שם" diff --git a/radio/src/translations/it.h b/radio/src/translations/it.h index 3e48c4413..6a8d5d2e0 100644 --- a/radio/src/translations/it.h +++ b/radio/src/translations/it.h @@ -1290,6 +1290,7 @@ #define TR_CREATE_NEW "Crea" #define TR_MIX_SLOW_PREC TR("Prec. lenta", "Prec. su/giù lenta") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Esiste già una cartella di temi con lo stesso nome." diff --git a/radio/src/translations/jp.h b/radio/src/translations/jp.h index ef16e724b..9882da7b3 100644 --- a/radio/src/translations/jp.h +++ b/radio/src/translations/jp.h @@ -1295,6 +1295,7 @@ #define TR_CREATE_NEW "作成" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "同じ名前のテーマディレクトリが既に存在します。" diff --git a/radio/src/translations/nl.h b/radio/src/translations/nl.h index c658e806a..3700f4ead 100644 --- a/radio/src/translations/nl.h +++ b/radio/src/translations/nl.h @@ -1302,6 +1302,7 @@ #define TR_CREATE_NEW "Create" #define TR_MIX_SLOW_PREC TR("Slow prec", "Slow up/dn prec") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "A theme directory with the same name already exists." diff --git a/radio/src/translations/pl.h b/radio/src/translations/pl.h index ea140047d..ec5ba651b 100644 --- a/radio/src/translations/pl.h +++ b/radio/src/translations/pl.h @@ -1295,6 +1295,7 @@ #define TR_CREATE_NEW "Utwórz" #define TR_MIX_SLOW_PREC TR("Wolna prec.", "Wolna prec. góra/dół") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Folder szablonów o takiej samej nazwie już istnieje." diff --git a/radio/src/translations/pt.h b/radio/src/translations/pt.h index 6e541df5e..ee5799d51 100644 --- a/radio/src/translations/pt.h +++ b/radio/src/translations/pt.h @@ -1299,6 +1299,7 @@ #define TR_CREATE_NEW "Criar" #define TR_MIX_SLOW_PREC TR("Prec. Lento", "Prec. mais/menos lento") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Já existe um diretório de tema com o mesmo nome." diff --git a/radio/src/translations/ru.h b/radio/src/translations/ru.h index 3c521f5e9..712cc6d49 100644 --- a/radio/src/translations/ru.h +++ b/radio/src/translations/ru.h @@ -1298,6 +1298,7 @@ #define TR_CREATE_NEW "Создать" #define TR_MIX_SLOW_PREC TR("Точн замедл", "Точность замедления") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Уже есть каталог с таким названием" diff --git a/radio/src/translations/se.h b/radio/src/translations/se.h index 1a31b1a67..fe187192f 100644 --- a/radio/src/translations/se.h +++ b/radio/src/translations/se.h @@ -1330,6 +1330,7 @@ #define TR_CREATE_NEW "Skapa" #define TR_MIX_SLOW_PREC TR("Dröj preci.", "Fördröj upp/ner precision") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "Det finns redan ett tema med samma namn" diff --git a/radio/src/translations/tw.h b/radio/src/translations/tw.h index 9e61186c0..6e5898abf 100644 --- a/radio/src/translations/tw.h +++ b/radio/src/translations/tw.h @@ -1299,6 +1299,7 @@ #define TR_CREATE_NEW "新建" #define TR_MIX_SLOW_PREC TR("慢放精度", "慢放精度 上行/下行") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "已存在同名主題目錄 !" diff --git a/radio/src/translations/ua.h b/radio/src/translations/ua.h index 80b4f8a43..f308a0bd4 100644 --- a/radio/src/translations/ua.h +++ b/radio/src/translations/ua.h @@ -1294,6 +1294,7 @@ #define TR_CREATE_NEW "Створити" #define TR_MIX_SLOW_PREC TR("Точн. уповільн.", "Точність уповільнення") +#define TR_MIX_DELAY_PREC TR("Delay prec", "Delay up/dn prec") #define TR_THEME_EXISTS "A theme directory with the same name already exists."