feat: Add facilty for custom throttle warning position (#1395)

* replace magic number for throttle idle with correct define

* settings for custom throttle warning position

* settings fixed not to break byte-aligment of bit-fields

* evaluate custom throttle warning position

* add requested throttle value to warning text

* comment about field alignment in ModelData struct

* Menu for editing custom throttle warning for 128x64 radios
Tested on RM TX12

* Improoved menu display

* move displayed strings to translation

* translation template added for each language

* support for 212x64 B&W radios

* menu for colorlcd
not tested

* corrected translation entry for TW

* corrected handling of padding bits in ModelData structure

* Companion support for custom throttle warning position

* Rebase catchup

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
piotrva
2022-01-30 15:04:40 +10:00
committed by GitHub
co-authored by Peter Feerick
parent a052ba63c2
commit bf931a5097
42 changed files with 249 additions and 40 deletions
+14
View File
@@ -1496,6 +1496,18 @@ void SetupPanel::on_throttleWarning_toggled(bool checked)
emit modified();
}
void SetupPanel::on_enableCustomThrottleWarning_toggled(bool checked)
{
model->enableCustomThrottleWarning = checked;
emit modified();
}
void SetupPanel::on_customThrottleWarningPosition_valueChanged(int value)
{
model->customThrottleWarningPosition = value;
emit modified();
}
void SetupPanel::on_throttleReverse_toggled(bool checked)
{
model->throttleReversed = checked;
@@ -1589,6 +1601,8 @@ void SetupPanel::update()
ui->throttleSource->updateValue();
populateThrottleTrimSwitchCB();
ui->throttleWarning->setChecked(!model->disableThrottleWarning);
ui->enableCustomThrottleWarning->setChecked(model->enableCustomThrottleWarning);
ui->customThrottleWarningPosition->setValue(model->customThrottleWarningPosition);
ui->trimIncrement->setCurrentIndex(model->trimInc+2);
ui->throttleTrim->setChecked(model->thrTrim);
ui->extendedLimits->setChecked(model->extendedLimits);