From 21760a3960310fe25b94972ad332bc5fb03d1162 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 10 Oct 2015 16:38:04 +0200 Subject: [PATCH] Fixes #2936: 3POS type removed from SH and SF switches (hw only supports 2POS type) --- companion/src/generaledit/calibration.cpp | 8 ++++---- companion/src/generaledit/calibration.h | 2 +- radio/releasenotes.txt | 7 ++++++- radio/src/gui/Taranis/menu_general_hardware.cpp | 5 ++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/companion/src/generaledit/calibration.cpp b/companion/src/generaledit/calibration.cpp index 978a48910..1cc155b21 100644 --- a/companion/src/generaledit/calibration.cpp +++ b/companion/src/generaledit/calibration.cpp @@ -1,7 +1,7 @@ #include "calibration.h" #include "ui_calibration.h" -void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type) +void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true) { bool enabled = false; @@ -18,7 +18,7 @@ void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit if (enabled) { type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE); type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS); - type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS); + if (threePos) type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS); name->setField(generalSettings.switchName[index], 3, this); type->setField(generalSettings.switchConfig[index], this); } @@ -130,9 +130,9 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType); setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType); setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType); - setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType); + setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType); - setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType); + setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType); setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType); setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType); diff --git a/companion/src/generaledit/calibration.h b/companion/src/generaledit/calibration.h index ffb1524b7..731423472 100644 --- a/companion/src/generaledit/calibration.h +++ b/companion/src/generaledit/calibration.h @@ -63,7 +63,7 @@ class CalibrationPanel : public GeneralPanel protected: void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type); void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type); - void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type); + void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos); private: Ui::Calibration *ui; diff --git a/radio/releasenotes.txt b/radio/releasenotes.txt index d48230088..703b7bf6d 100644 --- a/radio/releasenotes.txt +++ b/radio/releasenotes.txt @@ -1,6 +1,11 @@

Version 2.1.4 /

-[AVR boards] +[Taranis] + + +[ARM boards]