diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h
index cf5e7a2dd..ed33f9380 100644
--- a/companion/src/eeprominterface.h
+++ b/companion/src/eeprominterface.h
@@ -424,7 +424,6 @@ class GeneralSettings {
int timezone;
bool optrexDisplay;
unsigned int inactivityTimer;
- bool throttleReversed;
bool minuteBeep;
bool preBeep;
bool flashBeep;
@@ -871,7 +870,6 @@ enum Capability {
Mixes,
MixesWithoutExpo,
Timers,
- TimerTriggerB,
TimeDivisions,
minuteBeep,
countdownBeep,
@@ -881,7 +879,6 @@ enum Capability {
ModelVoice,
MultiLangVoice,
ModelImage,
- InstantTrimSW,
Pots,
Switches,
SwitchesPositions,
@@ -925,7 +922,6 @@ enum Capability {
TrainerSwitch,
ModelTrainerEnable,
Timer2ThrTrig,
- HasTTrace,
HasExpoNames,
HasMixerNames,
HasChNames,
@@ -935,14 +931,11 @@ enum Capability {
HasPPMStart,
HasGeneralUnits,
HasFAIMode,
- NoTimerDirs,
- NoThrExpo,
OptrexDisplay,
PPMExtCtrl,
PPMFrameLength,
MixFmTrim,
gsSwitchMask,
- pmSwitchMask,
BLonStickMove,
DSM2Indexes,
Telemetry,
@@ -986,8 +979,6 @@ enum Capability {
HasBrightness,
HasContrast,
PerModelTimers,
- PerModelThrottleWarning,
- PerModelThrottleInvert,
SlowScale,
SlowRange,
PermTimers,
diff --git a/companion/src/firmwares/er9x/er9xeeprom.cpp b/companion/src/firmwares/er9x/er9xeeprom.cpp
index 335121706..aca4ca460 100644
--- a/companion/src/firmwares/er9x/er9xeeprom.cpp
+++ b/companion/src/firmwares/er9x/er9xeeprom.cpp
@@ -133,7 +133,6 @@ t_Er9xGeneral::t_Er9xGeneral(GeneralSettings &c9x)
disableAlarmWarning = c9x.disableAlarmWarning;
stickMode = c9x.stickMode;
inactivityTimer = c9x.inactivityTimer - 10;
- throttleReversed = c9x.throttleReversed;
minuteBeep = c9x.minuteBeep;
preBeep = c9x.preBeep;
flashBeep = c9x.flashBeep;
@@ -207,7 +206,6 @@ Er9xGeneral::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
result.inactivityTimer = inactivityTimer + 10;
- result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
diff --git a/companion/src/firmwares/er9x/er9xinterface.cpp b/companion/src/firmwares/er9x/er9xinterface.cpp
index f7e6762a8..4040bae05 100644
--- a/companion/src/firmwares/er9x/er9xinterface.cpp
+++ b/companion/src/firmwares/er9x/er9xinterface.cpp
@@ -304,8 +304,6 @@ int Er9xInterface::getCapability(const Capability capability)
return TM_HASTELEMETRY|TM_HASWSHH;
case TelemetryUnits:
return 1;
- case TimerTriggerB:
- return 1;
case TelemetryMaxMultiplier:
return 2;
case MaxVolume:
@@ -323,7 +321,6 @@ int Er9xInterface::getCapability(const Capability capability)
case HasStickScroll:
case HasAltitudeSel:
case HasContrast:
- case InstantTrimSW:
case HasVolume:
case HasBlInvert:
case ModelVoice:
diff --git a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp
index f21688f20..231e06af7 100644
--- a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp
+++ b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp
@@ -164,7 +164,6 @@ t_Ersky9xGeneral::t_Ersky9xGeneral(GeneralSettings &c9x)
disableAlarmWarning = c9x.disableAlarmWarning;
stickMode = c9x.stickMode;
inactivityTimer = c9x.inactivityTimer - 10;
- throttleReversed = c9x.throttleReversed;
minuteBeep = c9x.minuteBeep;
preBeep = c9x.preBeep;
flashBeep = c9x.flashBeep;
@@ -237,7 +236,6 @@ Ersky9xGeneral::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = std::max((uint8_t)0, std::min(stickMode, (uint8_t)3));
result.inactivityTimer = inactivityTimer + 10;
- result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
diff --git a/companion/src/firmwares/ersky9x/ersky9xinterface.cpp b/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
index 5190ce0e8..b90e9e130 100644
--- a/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
+++ b/companion/src/firmwares/ersky9x/ersky9xinterface.cpp
@@ -338,8 +338,6 @@ int Ersky9xInterface::getCapability(const Capability capability)
return 1;
case OptrexDisplay:
return 1;
- case TimerTriggerB:
- return 2;
case HasAltitudeSel:
case HasCurrentCalibration:
case HasVolume:
@@ -354,8 +352,6 @@ int Ersky9xInterface::getCapability(const Capability capability)
case GvarsAsSources:
case GvarsAsWeight:
return 1;
- case InstantTrimSW:
- return 1;
case TelemetryMaxMultiplier:
return 2;
case LCDWidth:
diff --git a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp
index c1c740efb..8f9860d9a 100644
--- a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp
+++ b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp
@@ -134,7 +134,6 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
- result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
@@ -188,7 +187,6 @@ t_Gruvin9xGeneral_v104::t_Gruvin9xGeneral_v104(GeneralSettings &c9x)
disableAlarmWarning = c9x.disableAlarmWarning;
stickMode = c9x.stickMode;
inactivityTimer = c9x.inactivityTimer;
- throttleReversed = c9x.throttleReversed;
minuteBeep = c9x.minuteBeep;
preBeep = c9x.preBeep;
flashBeep = c9x.flashBeep;
@@ -234,7 +232,6 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
result.disableAlarmWarning = disableAlarmWarning;
result.stickMode = stickMode;
result.inactivityTimer = inactivityTimer;
- result.throttleReversed = throttleReversed;
result.minuteBeep = minuteBeep;
result.preBeep = preBeep;
result.flashBeep = flashBeep;
diff --git a/companion/src/firmwares/opentx/open9xeeprom.cpp b/companion/src/firmwares/opentx/open9xeeprom.cpp
index 9601cb35a..1fc5db454 100644
--- a/companion/src/firmwares/opentx/open9xeeprom.cpp
+++ b/companion/src/firmwares/opentx/open9xeeprom.cpp
@@ -1866,8 +1866,9 @@ Open9xGeneralDataNew::Open9xGeneralDataNew(GeneralSettings & generalData, BoardE
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
if (IS_STOCK(board) && version >= 215) {
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
- } else {
- internalField.Append(new BoolField<1>(generalData.throttleReversed));
+ }
+ else {
+ internalField.Append(new SpareBitsField<1>());
internalField.Append(new BoolField<1>(generalData.minuteBeep));
internalField.Append(new BoolField<1>(generalData.preBeep));
}
diff --git a/companion/src/firmwares/opentx/open9xinterface.cpp b/companion/src/firmwares/opentx/open9xinterface.cpp
index 0ffe6b85e..2e8b00565 100644
--- a/companion/src/firmwares/opentx/open9xinterface.cpp
+++ b/companion/src/firmwares/opentx/open9xinterface.cpp
@@ -684,8 +684,6 @@ int Open9xInterface::getCapability(const Capability capability)
return 1;
case FSSwitch:
return 1;
- case HasTTrace:
- return 1;
case CustomCurves:
return 1;
case MixesWithoutExpo:
@@ -700,10 +698,6 @@ int Open9xInterface::getCapability(const Capability capability)
return (IS_TARANIS(board) ? 6 : 0);
case HasCvNames:
return (IS_TARANIS(board) ? 1 : 0);
- case NoTimerDirs:
- return 1;
- case NoThrExpo:
- return 1;
case Telemetry:
return TM_HASTELEMETRY|TM_HASOFFSET|TM_HASWSHH;
case TelemetryBars:
@@ -770,10 +764,6 @@ int Open9xInterface::getCapability(const Capability capability)
case HasBrightness:
return (IS_ARM(board) ? true : false);
case PerModelTimers:
- case PerModelThrottleWarning:
- case PerModelThrottleInvert:
- return 1;
- case pmSwitchMask:
return 1;
case SlowScale:
return (IS_ARM(board) ? 10 : 2);
@@ -817,12 +807,15 @@ int Open9xInterface::isAvailable(Protocol proto, int port)
case PXX_XJT_D8:
case PXX_XJT_LR12:
case PXX_DJT:
+ case LP45:
+ case DSM2:
+ case DSMX:
return 1;
default:
return 0;
}
break;
- case 2:
+ case -1:
switch (proto) {
case PPM:
return 1;
diff --git a/companion/src/firmwares/th9x/th9xeeprom.cpp b/companion/src/firmwares/th9x/th9xeeprom.cpp
index d09eb979b..2e5ad8a2f 100644
--- a/companion/src/firmwares/th9x/th9xeeprom.cpp
+++ b/companion/src/firmwares/th9x/th9xeeprom.cpp
@@ -101,7 +101,6 @@ t_Th9xGeneral::t_Th9xGeneral(GeneralSettings &c9x)
trainer = c9x.trainer;
adcFilt = c9x.filterInput;
// keySpeed
- thr0pos = c9x.throttleReversed;
disableThrottleWarning = c9x.disableThrottleWarning;
disableSwitchWarning = (c9x.switchWarning != -1);
disableMemoryWarning = c9x.disableMemoryWarning;
@@ -158,7 +157,6 @@ Th9xGeneral::operator GeneralSettings ()
}
result.stickMode = stickMode;
result.inactivityTimer = inactivityMin;
- result.throttleReversed = thr0pos;
result.filterInput = adcFilt;
return result;
}
diff --git a/companion/src/generaledit.cpp b/companion/src/generaledit.cpp
index 1f5b179bb..59cb25ca3 100644
--- a/companion/src/generaledit.cpp
+++ b/companion/src/generaledit.cpp
@@ -170,22 +170,10 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->crosstrimChkB->hide();
ui->crosstrimLB->hide();
}
- if (!GetEepromInterface()->getCapability(HasPPMSim)) {
+ if (!GetEepromInterface()->getCapability(HasPPMSim)) {
ui->PPMSimLB->hide();
ui->PPMSimChkB->hide();
}
-
- if (GetEepromInterface()->getCapability(PerModelThrottleWarning)) {
- ui->thrwarnChkB->setDisabled(true);
- ui->thrwarnChkB->hide();
- ui->thrwarnLabel->hide();
- }
- if (GetEepromInterface()->getCapability(pmSwitchMask)) {
- ui->swwarn_label->hide();
- ui->swtchWarnCB->hide();
- ui->swtchWarnChkB->hide();
- layout()->removeItem(ui->swwarn_layout);
- }
if (!GetEepromInterface()->getCapability( HasPxxCountry)) {
ui->countrycode_label->hide();
ui->countrycode_CB->hide();
@@ -322,11 +310,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->swID0ChkB->hide();
ui->swID1ChkB->hide();
ui->swID2ChkB->hide();
- ui->swtchWarnChkB->hide();
this->layout()->removeItem(ui->switchMaskLayout);
} else {
- ui->swtchWarnCB->setDisabled(true);
- ui->swtchWarnCB->hide();
setSwitchDefPos();
}
if (!GetEepromInterface()->getCapability(TelemetryAlarm)) {
@@ -340,12 +325,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
} else {
populateRotEncCB(ui->re_CB, g_eeGeneral.reNavigation, renumber);
}
- if (GetEepromInterface()->getCapability(PerModelThrottleInvert)) {
- ui->label_thrrev->hide();
- ui->thrrevChkB->hide();
- } else {
- ui->thrrevChkB->setChecked(g_eeGeneral.throttleReversed);
- }
ui->telalarmsChkB->setChecked(g_eeGeneral.enableTelemetryAlarm);
ui->PotScrollEnableChkB->setChecked(!g_eeGeneral.disablePotScroll);
ui->BandGapEnableChkB->setChecked(!g_eeGeneral.disableBG);
@@ -359,9 +338,6 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
ui->StickScrollChkB->setChecked(g_eeGeneral.stickScroll);
ui->PPMSimChkB->setChecked(g_eeGeneral.enablePpmsim);
ui->inputfilterCB->setCurrentIndex(g_eeGeneral.filterInput);
- ui->thrwarnChkB->setChecked(!g_eeGeneral.disableThrottleWarning); //Default is zero=checked
- ui->swtchWarnChkB->setChecked(g_eeGeneral.switchWarning == -1);
- ui->swtchWarnCB->setCurrentIndex(g_eeGeneral.switchWarning == -1 ? 2 : g_eeGeneral.switchWarning);
ui->memwarnChkB->setChecked(!g_eeGeneral.disableMemoryWarning); //Default is zero=checked
ui->alarmwarnChkB->setChecked(!g_eeGeneral.disableAlarmWarning);//Default is zero=checked
ui->enableTelemetryAlarmChkB->setChecked(g_eeGeneral.enableTelemetryAlarm);
@@ -622,36 +598,12 @@ void GeneralEdit::on_inactimerSB_editingFinished()
updateSettings();
}
-void GeneralEdit::on_thrrevChkB_stateChanged(int )
-{
- g_eeGeneral.throttleReversed = ui->thrrevChkB->isChecked() ? 1 : 0;
- updateSettings();
-}
-
void GeneralEdit::on_inputfilterCB_currentIndexChanged(int index)
{
g_eeGeneral.filterInput = index;
updateSettings();
}
-void GeneralEdit::on_thrwarnChkB_stateChanged(int )
-{
- g_eeGeneral.disableThrottleWarning = ui->thrwarnChkB->isChecked() ? 0 : 1;
- updateSettings();
-}
-
-void GeneralEdit::on_swtchWarnCB_currentIndexChanged(int index)
-{
- g_eeGeneral.switchWarning = (index == 2 ? -1 : index);
- updateSettings();
-}
-
-void GeneralEdit::on_swtchWarnChkB_stateChanged(int )
-{
- g_eeGeneral.switchWarning = ui->swtchWarnChkB->isChecked() ? -1 : 0;
- updateSettings();
-}
-
void GeneralEdit::on_memwarnChkB_stateChanged(int )
{
g_eeGeneral.disableMemoryWarning = ui->memwarnChkB->isChecked() ? 0 : 1;
diff --git a/companion/src/generaledit.h b/companion/src/generaledit.h
index ac6b12cbc..eb6895d13 100644
--- a/companion/src/generaledit.h
+++ b/companion/src/generaledit.h
@@ -123,12 +123,8 @@ private slots:
void on_channelorderCB_currentIndexChanged(int index);
void on_beeperCB_currentIndexChanged(int index);
void on_memwarnChkB_stateChanged(int );
- void on_swtchWarnCB_currentIndexChanged(int index);
- void on_swtchWarnChkB_stateChanged(int );
void on_telalarmsChkB_stateChanged(int );
- void on_thrwarnChkB_stateChanged(int );
void on_inputfilterCB_currentIndexChanged(int index);
- void on_thrrevChkB_stateChanged(int );
void on_inactimerSB_editingFinished();
void on_backlightautoSB_editingFinished();
void on_backlightswCB_currentIndexChanged(int index);
diff --git a/companion/src/generaledit.ui b/companion/src/generaledit.ui
index 8ac09986a..d47781a69 100644
--- a/companion/src/generaledit.ui
+++ b/companion/src/generaledit.ui
@@ -117,6 +117,13 @@ These will be relevant for all models in the same EEPROM.
Setup
+ -
+
+
+
+
+
+
-
@@ -130,7 +137,7 @@ These will be relevant for all models in the same EEPROM.
- -
+
-
-
@@ -160,13 +167,6 @@ These will be relevant for all models in the same EEPROM.
- -
-
-
-
-
-
-
-
@@ -174,7 +174,7 @@ These will be relevant for all models in the same EEPROM.
- -
+
-
-
@@ -188,49 +188,7 @@ These will be relevant for all models in the same EEPROM.
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 100
- 16777215
-
-
-
-
-
- Off
-
-
- -
-
- Switches Up
-
-
- -
-
- Switches Down
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
+
-
Measurement Units
@@ -476,13 +434,6 @@ p, li { white-space: pre-wrap; }
- -
-
-
- Reverse Throttle Operation
-
-
-
-
@@ -490,7 +441,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
@@ -551,26 +502,40 @@ Mode 4:
- -
-
+
-
+
- Beeper Mode
+
- -
-
-
- sec
+
-
+
+
+ LCD Display Type
+
+
+
+ -
+
+
+
+ 0
+ 0
+
- 600
-
-
5
+ -
+
+
+ BackLight On Stick Move
+
+
+
-
@@ -598,23 +563,37 @@ p, li { white-space: pre-wrap; }
- -
-
-
- Reverse throttle operation.
-If this is checked the throttle will be reversed. Idle will be forward, trim will also be reversed and the throttle warning will be reversed as well.
-
-
+
-
+
+
+ sec
-
-
+
+ 600
+
+
+ 5
- -
-
+
-
+
- BackLight On Stick Move
+ Beeper Mode
+
+
+
+ -
+
+
+ Timeshift from UTC
+
+
+
+ -
+
+
+ RotEnc Navigation
@@ -637,47 +616,6 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
- -
-
-
- RotEnc Navigation
-
-
-
- -
-
-
- Timeshift from UTC
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- 5
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- LCD Display Type
-
-
-
-
@@ -685,14 +623,7 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
- -
-
-
- Throttle Startup Warning
-
-
-
- -
+
-
-
@@ -775,7 +706,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
-
@@ -800,7 +731,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.
@@ -810,7 +741,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
@@ -948,48 +879,6 @@ This is used by the templated to determine which channel goes to what number out
- -
-
-
- Alarm Warning
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- <!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=" text-decoration: underline;">Warnings</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;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html>
-
-
-
-
-
- true
-
-
-
-
@@ -1046,7 +935,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
FAI Mode
@@ -1163,7 +1052,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
-14
@@ -1176,7 +1065,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
-
@@ -1190,7 +1079,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
@@ -1203,7 +1092,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
Stick Mode
@@ -1247,41 +1136,6 @@ p, li { white-space: pre-wrap; }
- -
-
-
-
- 0
- 0
-
-
-
-
- 16777215
- 16777215
-
-
-
- <!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=" text-decoration: underline;">Warnings</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;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html>
-
-
-
-
-
- true
-
-
-
-
-
@@ -1345,13 +1199,6 @@ p, li { white-space: pre-wrap; }
- -
-
-
- Memory Startup Warning
-
-
-
-
@@ -1532,32 +1379,6 @@ 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=" text-decoration: underline;">Warnings</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;"></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html>
-
-
-
-
-
- true
-
-
- false
-
-
-
-
@@ -1565,7 +1386,7 @@ p, li { white-space: pre-wrap; }
- -
+
-
Qt::Vertical
@@ -1684,7 +1505,7 @@ Acceptable values are 5v..10v
- -
+
-
Readonly Unlock
@@ -1726,13 +1547,6 @@ Acceptable values are 5v..10v
- -
-
-
- Switch Startup Warning
-
-
-
-
@@ -1740,7 +1554,7 @@ Acceptable values are 5v..10v
- -
+
-
QLayout::SetMinimumSize
@@ -2268,6 +2082,90 @@ Acceptable values are 5v..10v
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+ <!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=" text-decoration: underline;">Warnings</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;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html>
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+ Alarm Warning
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+ <!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=" text-decoration: underline;">Warnings</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;"></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These will define startup warnings.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Throttle warning - will alert if the throttle is not at idle during startup</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Switch warning - will alert if switches are not in their defaul position</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Memory warning - will alert if there's not a lot of memory left</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Silent mode warning - will alert you if the beeper is set to quiet (0)</p></body></html>
+
+
+
+
+
+ true
+
+
+
+ -
+
+
+ Memory Startup Warning
+
+
+
@@ -3607,8 +3505,6 @@ p, li { white-space: pre-wrap; }
beepMinuteChkB
beepCountDownChkB
beepFlashChkB
- swtchWarnCB
- swtchWarnChkB
swTHRChkB
swRUDChkB
swELEChkB
diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp
index 3639b7027..445e8013d 100644
--- a/companion/src/helpers.cpp
+++ b/companion/src/helpers.cpp
@@ -567,63 +567,22 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase)
}
}
-void populateTimerSwitchCB(QComboBox *b, int value, int extrafields)
+void populateTimerSwitchCB(QComboBox *b, int value)
{
b->clear();
- uint8_t endvalue=128;
uint8_t count=0;
- if (extrafields==2)
- endvalue=192;
- for (int i=-128; iaddItem(getTimerMode(i), i);
if (i==value)
b->setCurrentIndex(b->count()-1);
- if (extrafields==2 && (i<0 || (i>3 && i model()->index(count, 0);
- // This is the effective 'disable' flag
- QVariant v(0);
- //the magic
- b->model()->setData(index, v, Qt::UserRole - 1);
- }
count++;
}
}
b->setMaxVisibleItems(10);
}
-void populateTimerSwitchBCB(QComboBox *b, int value, int extrafields)
-{
- b->clear();
- if (extrafields!=2) {
- int startvalue=-128;
- int endvalue=128;
- if (extrafields==1) {
- startvalue=-25;
- endvalue=26;
- }
- for (int i=startvalue; iaddItem(getTimerMode(i), i);
- if (i==value)
- b->setCurrentIndex(b->count()-1);
- }
- }
- } else {
- for (int i=-33; i<66; i++) {
- QString timerMode = getTimerModeB(i);
- if (!timerMode.isEmpty()) {
- b->addItem(timerMode, i);
- if (i==value)
- b->setCurrentIndex(b->count()-1);
- }
- }
- }
- b->setMaxVisibleItems(10);
-}
-
QString getTimerMode(int tm) {
QString stt = "OFFABSTHsTH%THt";
diff --git a/companion/src/helpers.h b/companion/src/helpers.h
index b018162e4..4a3b9ee6c 100644
--- a/companion/src/helpers.h
+++ b/companion/src/helpers.h
@@ -45,8 +45,7 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
void populateCurvesCB(QComboBox *b, int value);
void populateCustomScreenFieldCB(QComboBox *b, unsigned int value, bool last, int hubproto);
void populateExpoCurvesCB(QComboBox *b, int value);
-void populateTimerSwitchCB(QComboBox *b, int value, int extrafields=0);
-void populateTimerSwitchBCB(QComboBox *b, int value, int extrafields=0);
+void populateTimerSwitchCB(QComboBox *b, int value);
QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model);
QString getProtocolStr(const int proto);
diff --git a/companion/src/modeledit/CMakeLists.txt b/companion/src/modeledit/CMakeLists.txt
index aa00bc7dc..28c752d64 100644
--- a/companion/src/modeledit/CMakeLists.txt
+++ b/companion/src/modeledit/CMakeLists.txt
@@ -38,6 +38,8 @@ set(modeledit_HDRS
)
set(modeledit_UIS
+ setup_timer.ui
+ setup_module.ui
flightmode.ui
telemetry_analog.ui
)
diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp
index 4475aaebc..67b59d60d 100644
--- a/companion/src/modeledit/flightmodes.cpp
+++ b/companion/src/modeledit/flightmodes.cpp
@@ -191,7 +191,7 @@ void FlightMode::update()
trimsSlider[i]->setRange(-trimsMax, +trimsMax);
trimsValue[i]->setRange(-trimsMax, +trimsMax);
int chn = CONVERT_MODE(i+1)-1;
- if (chn == 2/*TODO constant*/ && generalSettings.throttleReversed)
+ if (chn == 2/*TODO constant*/ && model.throttleReversed)
trimsSlider[i]->setInvertedAppearance(true);
trimUpdate(i);
diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp
index 1c9edb8c3..d71be9cc6 100644
--- a/companion/src/modeledit/setup.cpp
+++ b/companion/src/modeledit/setup.cpp
@@ -1,92 +1,336 @@
#include "setup.h"
#include "ui_setup.h"
+#include "ui_setup_timer.h"
+#include "ui_setup_module.h"
#include "helpers.h"
+TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer):
+ ModelPanel(parent, model),
+ timer(timer),
+ ui(new Ui::Timer)
+{
+ ui->setupUi(this);
+
+ // Mode
+ populateTimerSwitchCB(ui->mode, timer.mode);
+
+ if (!GetEepromInterface()->getCapability(PermTimers)) {
+ ui->persistent->hide();
+ ui->persistentValue->hide();
+ }
+
+ if (!GetEepromInterface()->getCapability(minuteBeep)) {
+ ui->minuteBeep->hide();
+ }
+
+ if (!GetEepromInterface()->getCapability(countdownBeep)) {
+ ui->countdownBeep->hide();
+ }
+}
+
+TimerPanel::~TimerPanel()
+{
+ delete ui;
+}
+
+void TimerPanel::update()
+{
+ int min = timer.val / 60;
+ int sec = timer.val % 60;
+ ui->value->setTime(QTime(0, min, sec));
+
+ if (GetEepromInterface()->getCapability(PermTimers)) {
+ int sign = 1;
+ int pvalue = timer.pvalue;
+ if (pvalue < 0) {
+ pvalue = -pvalue;
+ sign = -1;
+ }
+ int hours = pvalue / 3600;
+ pvalue -= hours * 3600;
+ int minutes = pvalue / 60;
+ int seconds = pvalue % 60;
+ ui->persistent->setChecked(timer.persistent);
+ ui->persistentValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(seconds, 2, 10, QLatin1Char('0')));
+ }
+
+ if (GetEepromInterface()->getCapability(minuteBeep)) {
+ ui->minuteBeep->setChecked(timer.minuteBeep);
+ }
+
+ if (GetEepromInterface()->getCapability(countdownBeep)) {
+ ui->countdownBeep->setChecked(timer.countdownBeep);
+ }
+}
+
+void TimerPanel::on_value_editingFinished()
+{
+ timer.val = ui->value->time().minute()*60 + ui->value->time().second();
+ emit modified();
+}
+
+void TimerPanel::on_mode_currentIndexChanged(int index)
+{
+ timer.mode = TimerMode(ui->mode->itemData(index).toInt());
+ emit modified();
+}
+
+void TimerPanel::on_persistent_toggled(bool checked)
+{
+ timer.persistent = checked;
+ emit modified();
+}
+
+void TimerPanel::on_minuteBeep_toggled(bool checked)
+{
+ timer.minuteBeep = checked;
+ emit modified();
+}
+
+void TimerPanel::on_countdownBeep_toggled(bool checked)
+{
+ timer.countdownBeep = checked;
+ emit modified();
+}
+
+/******************************************************************************/
+
+ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, int moduleIdx):
+ ModelPanel(parent, model),
+ module(module),
+ moduleIdx(moduleIdx),
+ ui(new Ui::Module)
+{
+ ui->setupUi(this);
+
+ QString label;
+ if (moduleIdx < 0) {
+ label = tr("Trainer Module");
+ }
+ else {
+ ui->label_trainerMode->hide();
+ ui->trainerMode->hide();
+ if (moduleIdx == 0)
+ label = tr("Internal Module");
+ else
+ label = tr("External Module");
+
+ }
+ ui->label_module->setText(label);
+
+ // The protocols available on this board
+ for (int i=0; iisAvailable((Protocol)i, moduleIdx)) {
+ ui->protocol->addItem(getProtocolStr(i), (QVariant)i);
+ }
+ }
+
+ if (GetEepromInterface()->getCapability(HasFailsafe)) {
+ for (int i=0; i<16; i++) {
+ QSlider * slider = new QSlider(this);
+ slider->setMinimumSize(QSize(30, 50));
+ slider->setRange(-100, 100);
+ QSpinBox * spinbox = new QSpinBox(this);
+ spinbox->setMinimumSize(QSize(20, 0));
+ spinbox->setRange(-100, 100);
+ slider->setProperty("index", i);
+ spinbox->setProperty("index", i);
+ failsafeSliders << slider;
+ failsafeSpins << spinbox;
+ ui->failsafesLayout->addWidget(slider, 2*(i/8), i%8, Qt::AlignHCenter);
+ ui->failsafesLayout->addWidget(spinbox, 1+2*(i/8), i%8, Qt::AlignHCenter);
+ connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onFailsafeChannelChanged(int)));
+ connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onFailsafeChannelChanged(int)));
+ }
+ }
+}
+
+ModulePanel::~ModulePanel()
+{
+ delete ui;
+}
+
+#define MASK_CHANNELS_COUNT 1
+#define MASK_RX_NUMBER 2
+#define MASK_CHANNELS_RANGE 4
+#define MASK_PPM_FIELDS 8
+#define MASK_FAILSAFES 16
+
+void ModulePanel::update()
+{
+ unsigned int mask = 0;
+ Protocol protocol = (Protocol)module.protocol;
+
+ switch (protocol) {
+ case OFF:
+ break;
+ case PXX_XJT_X16:
+ case PXX_XJT_D8:
+ case PXX_XJT_LR12:
+ case PXX_DJT:
+ mask |= MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT | MASK_RX_NUMBER;
+ if (protocol==PXX_XJT_X16) mask |= MASK_FAILSAFES;
+ break;
+ case LP45:
+ case DSM2:
+ case DSMX:
+ mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
+ module.channelsCount = 8;
+ break;
+ default:
+ mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
+ break;
+ }
+
+ ui->rxNumber->setEnabled(mask & MASK_RX_NUMBER);
+ ui->rxNumber->setValue(model.modelId);
+ ui->label_channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
+ ui->channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
+ ui->channelsStart->setValue(module.channelsStart+1);
+ ui->label_channelsCount->setVisible(mask & MASK_CHANNELS_RANGE);
+ ui->channelsCount->setVisible(mask & MASK_CHANNELS_RANGE);
+ ui->channelsCount->setEnabled(mask & MASK_CHANNELS_COUNT);
+ ui->channelsCount->setValue(module.channelsCount);
+ ui->channelsCount->setSingleStep(GetEepromInterface()->getCapability(HasPPMStart) ? 1 : 2);
+
+ // PPM settings fields
+ ui->label_ppmPolarity->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmPolarity->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmPolarity->setCurrentIndex(module.ppmPulsePol);
+ ui->label_ppmDelay->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmDelay->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmDelay->setValue(module.ppmDelay);
+ ui->label_ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
+ ui->ppmFrameLength->setMinimum(module.channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
+ ui->ppmFrameLength->setMaximum(GetEepromInterface()->getCapability(PPMFrameLength));
+ ui->ppmFrameLength->setValue(22.5+((double)module.ppmFrameLength)*0.5);
+
+ if (GetEepromInterface()->getCapability(HasFailsafe)) {
+ ui->label_failsafeMode->setVisible(mask & MASK_FAILSAFES);
+ ui->failsafeMode->setVisible(mask & MASK_FAILSAFES);
+ ui->failsafeMode->setCurrentIndex(module.failsafeMode);
+ ui->label_failsafeFrame->setVisible(mask & MASK_FAILSAFES);
+ ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
+ ui->failsafesFrame->setEnabled(module.failsafeMode == 1);
+ for (int i=0; isetValue(module.failsafeChannels[i]);
+ failsafeSpins[i]->setValue(module.failsafeChannels[i]);
+ }
+ }
+}
+
+void ModulePanel::on_protocol_currentIndexChanged(int index)
+{
+ if (!lock) {
+ module.protocol = ui->protocol->itemData(index).toInt();
+ update();
+ emit modified();
+ }
+}
+
+void ModulePanel::on_ppmPolarity_currentIndexChanged(int index)
+{
+ module.ppmPulsePol = index;
+ emit modified();
+}
+
+void ModulePanel::on_channelsCount_editingFinished()
+{
+ if (!lock) {
+ module.channelsCount = ui->channelsCount->value();
+ update();
+ emit modified();
+ }
+}
+
+void ModulePanel::on_channelsStart_editingFinished()
+{
+ if (!lock) {
+ module.channelsStart = ui->channelsStart->value() - 1;
+ update();
+ emit modified();
+ }
+}
+
+void ModulePanel::on_ppmDelay_editingFinished()
+{
+ if (!lock) {
+ // TODO only accept valid values
+ module.ppmDelay = ui->ppmDelay->value();
+ emit modified();
+ }
+}
+
+void ModulePanel::on_rxNumber_editingFinished()
+{
+ model.modelId = ui->rxNumber->value();
+ emit modified();
+}
+
+void ModulePanel::on_ppmFrameLength_editingFinished()
+{
+ module.ppmFrameLength = (ui->ppmFrameLength->value()-22.5) / 0.5;
+ emit modified();
+}
+
+void ModulePanel::on_failsafeMode_currentIndexChanged(int value)
+{
+ if (!lock) {
+ module.failsafeMode = value;
+ update();
+ emit modified();
+ }
+}
+
+void ModulePanel::onFailsafeChannelChanged(int value)
+{
+ if (!lock) {
+ lock = true;
+ int index = sender()->property("index").toInt();
+ module.failsafeChannels[index] = value;
+ failsafeSpins[index]->setValue(value);
+ failsafeSliders[index]->setValue(value);
+ emit modified();
+ lock = false;
+ }
+}
+
+/******************************************************************************/
+
Setup::Setup(QWidget *parent, ModelData & model):
ModelPanel(parent, model),
ui(new Ui::Setup)
{
+ memset(modules, 0, sizeof(modules));
+
ui->setupUi(this);
- tabModelEditSetup();
-}
-Setup::~Setup()
-{
- delete ui;
-}
+ ui->name->setMaxLength(IS_TARANIS(GetEepromInterface()->getBoard()) ? 12 : 10);
-void Setup::tabModelEditSetup()
-{
- lock = true;
+ for (int i=0; igridLayout->addWidget(timers[i], 1+i, 1);
+ connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
+ }
- QSlider * fssld1[] = { ui->fsm1SL_1, ui->fsm1SL_2,ui->fsm1SL_3,ui->fsm1SL_4,ui->fsm1SL_5,ui->fsm1SL_6,ui->fsm1SL_7,ui->fsm1SL_8,
- ui->fsm1SL_9, ui->fsm1SL_10,ui->fsm1SL_11,ui->fsm1SL_12,ui->fsm1SL_13,ui->fsm1SL_14,ui->fsm1SL_15,ui->fsm1SL_16, NULL };
- QSlider * fssld2[] = { ui->fsm2SL_1, ui->fsm2SL_2,ui->fsm2SL_3,ui->fsm2SL_4,ui->fsm2SL_5,ui->fsm2SL_6,ui->fsm2SL_7,ui->fsm2SL_8,
- ui->fsm2SL_9, ui->fsm2SL_10,ui->fsm2SL_11,ui->fsm2SL_12,ui->fsm2SL_13,ui->fsm2SL_14,ui->fsm2SL_15,ui->fsm2SL_16, NULL };
- QSpinBox * fssb1[] = { ui->fsm1SB_1, ui->fsm1SB_2,ui->fsm1SB_3,ui->fsm1SB_4,ui->fsm1SB_5,ui->fsm1SB_6,ui->fsm1SB_7,ui->fsm1SB_8,
- ui->fsm1SB_9, ui->fsm1SB_10,ui->fsm1SB_11,ui->fsm1SB_12,ui->fsm1SB_13,ui->fsm1SB_14,ui->fsm1SB_15,ui->fsm1SB_16, NULL };
- QSpinBox * fssb2[] = { ui->fsm2SB_1, ui->fsm2SB_2,ui->fsm2SB_3,ui->fsm2SB_4,ui->fsm2SB_5,ui->fsm2SB_6,ui->fsm2SB_7,ui->fsm2SB_8,
- ui->fsm2SB_9, ui->fsm2SB_10,ui->fsm2SB_11,ui->fsm2SB_12,ui->fsm2SB_13,ui->fsm2SB_14,ui->fsm2SB_15,ui->fsm2SB_16, NULL };
- if (IS_TARANIS(GetEepromInterface()->getBoard())) {
- ui->modelNameLE->setMaxLength(12);
- } else {
- ui->modelNameLE->setMaxLength(10);
- }
- ui->modelNameLE->setText(model.name);
+ for (int i=0; igetCapability(NumModules); i++) {
+ modules[i] = new ModulePanel(this, model, model.moduleData[i], i);
+ ui->modulesLayout->addWidget(modules[i]);
+ connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
+ }
- if (GetEepromInterface()->getCapability(NumModules)<2) {
- ui->rf2_GB->hide();
- }
+ if (GetEepromInterface()->getCapability(ModelTrainerEnable)) {
+ modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], -1);
+ ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
+ }
- if (!GetEepromInterface()->getCapability(HasFailsafe)) {
- ui->FSGB_1->hide();
- ui->FSGB_2->hide();
- ui->ModelSetupTab->setTabEnabled(1,0);
- } else {
- if (GetEepromInterface()->getCapability(HasFailsafe)<32) {
- ui->FSGB_2->hide();
- }
-
- for (int i=0; fssld1[i]; i++) {
- fssld1[i]->setValue(model.moduleData[0].failsafeChannels[i]);
- fssld2[i]->setValue(model.moduleData[1].failsafeChannels[i]);
- fssb1[i]->setValue(model.moduleData[0].failsafeChannels[i]);
- fssb2[i]->setValue(model.moduleData[1].failsafeChannels[i]);
- connect(fssld1[i],SIGNAL(valueChanged(int)),this,SLOT(fssldValueChanged()));
- connect(fssld2[i],SIGNAL(valueChanged(int)),this,SLOT(fssldValueChanged()));
- connect(fssb1[i],SIGNAL(valueChanged(int)),this,SLOT(fssbValueChanged()));
- connect(fssb2[i],SIGNAL(valueChanged(int)),this,SLOT(fssbValueChanged()));
- connect(fssld1[i],SIGNAL(sliderReleased()),this,SLOT(fssldEdited()));
- connect(fssld2[i],SIGNAL(sliderReleased()),this,SLOT(fssldEdited()));
- connect(fssb1[i],SIGNAL(editingFinished()),this,SLOT(fssbEdited()));
- connect(fssb2[i],SIGNAL(editingFinished()),this,SLOT(fssbEdited()));
- }
- }
-
- //timer1 mode direction value
- populateTimerSwitchCB(ui->timer1ModeCB,model.timers[0].mode,GetEepromInterface()->getCapability(TimerTriggerB));
- int min = model.timers[0].val/60;
- int sec = model.timers[0].val%60;
- ui->timer1ValTE->setTime(QTime(0,min,sec));
- ui->timer1DirCB->setCurrentIndex(model.timers[0].dir);
- if (!GetEepromInterface()->getCapability(ModelVoice)) {
- ui->modelVoice_SB->hide();
- ui->modelVoice_label->hide();
- } else {
- ui->modelVoice_SB->setValue(model.modelVoice+260);
- }
- if (!GetEepromInterface()->getCapability(PerModelThrottleInvert)) {
- ui->label_thrrev->hide();
- ui->thrrevChkB->hide();
+ if (!GetEepromInterface()->getCapability(ModelImage)) {
+ ui->image->hide();
+ ui->modelImage_label->hide();
+ ui->imagePreview->hide();
}
else {
- ui->thrrevChkB->setChecked(model.throttleReversed);
- }
- if (!GetEepromInterface()->getCapability(ModelImage)) {
- ui->modelImage_CB->hide();
- ui->modelImage_label->hide();
- ui->modelImage_image->hide();
- } else {
QStringList items;
items.append("");
@@ -110,11 +354,11 @@ void Setup::tabModelEditSetup()
items.append(model.bitmap);
}
items.sort();
- ui->modelImage_CB->clear();
+ ui->image->clear();
foreach ( QString file, items ) {
- ui->modelImage_CB->addItem(file);
+ ui->image->addItem(file);
if (file==model.bitmap) {
- ui->modelImage_CB->setCurrentIndex(ui->modelImage_CB->count()-1);
+ ui->image->setCurrentIndex(ui->image->count()-1);
QString fileName=path;
fileName.append(model.bitmap);
fileName.append(".bmp");
@@ -126,7 +370,7 @@ void Setup::tabModelEditSetup()
image.load(fileName);
}
if (!image.isNull()) {
- ui->modelImage_image->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
+ ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
}
}
}
@@ -145,8 +389,8 @@ void Setup::tabModelEditSetup()
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, analogs+GetEepromInterface()->getCapability(RotaryEncoders));
// Startup switches warnings
- ui->switchesStartupWarning_CB->setProperty("index", 0);
- connect(ui->switchesStartupWarning_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(startupSwitchEdited(int)));
+ ui->switchesStartupWarning->setProperty("index", 0);
+ connect(ui->switchesStartupWarning, SIGNAL(currentIndexChanged(int)), this, SLOT(startupSwitchEdited(int)));
for (int i=0; igetCapability(Switches)-1; i++) {
QLabel * label = new QLabel();
QSlider * slider = new QSlider();
@@ -154,6 +398,7 @@ void Setup::tabModelEditSetup()
slider->setOrientation(Qt::Vertical);
slider->setMinimum(0);
slider->setSingleStep(1);
+ slider->setPageStep(1);
slider->setInvertedAppearance(true);
slider->setTickPosition(QSlider::TicksBothSides);
slider->setTickInterval(1);
@@ -174,1032 +419,61 @@ void Setup::tabModelEditSetup()
}
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, GetEepromInterface()->getCapability(Switches));
- int ppmmax=GetEepromInterface()->getCapability(PPMFrameLength);
- if (ppmmax>0) {
- ui->ppmFrameLengthDSB->setMaximum(ppmmax);
- }
- if (!GetEepromInterface()->getCapability(InstantTrimSW)) {
- ui->instantTrim_label->hide();
- ui->instantTrim_CB->setDisabled(true);
- ui->instantTrim_CB->hide();
- }
- else {
- int found=false;
- for (int i=0; i< C9X_MAX_CUSTOM_FUNCTIONS; i++) {
- if (model.funcSw[i].func==FuncInstantTrim) {
- populateSwitchCB(ui->instantTrim_CB,model.funcSw[i].swtch,POPULATE_MSWITCHES & POPULATE_ONOFF);
- found=true;
- break;
- }
- }
- if (found==false) {
- populateSwitchCB(ui->instantTrim_CB,RawSwitch(),POPULATE_MSWITCHES & POPULATE_ONOFF);
- }
- }
- if (GetEepromInterface()->getCapability(NoTimerDirs)) {
- ui->timer1DirCB->hide();
- ui->timer2DirCB->hide();
- }
- if (GetEepromInterface()->getCapability(NoThrExpo)) {
- ui->label_thrExpo->hide();
- ui->thrExpoChkB->hide();
- }
- if (!(GetEepromInterface()->getCapability(ExtendedTrims)>0)) {
- ui->extendedTrimsChkB->hide();
- ui->extendedTrims_label->hide();
- } else {
- ui->extendedTrimsChkB->setChecked(model.extendedTrims);
- }
- if (!GetEepromInterface()->getCapability(HasTTrace)) {
- ui->label_ttrace->hide();
- ui->ttraceCB->hide();
- } else {
- populateTTraceCB(ui->ttraceCB,model.thrTraceSrc);
- }
-
- if (!GetEepromInterface()->getCapability(PerModelThrottleWarning)) {
- ui->thrwarnChkB->setDisabled(true);
- ui->thrwarnChkB->hide();
- ui->thrwarnLabel->hide();
- }
- else {
- ui->thrwarnChkB->setChecked(model.disableThrottleWarning);
- }
- if (!GetEepromInterface()->getCapability(TimerTriggerB)) {
- ui->timer1ModeBCB->hide();
- ui->timer1ModeB_label->hide();
- ui->timer2ModeBCB->hide();
- ui->timer2ModeB_label->hide();
- } else {
- populateTimerSwitchBCB(ui->timer1ModeBCB,model.timers[0].modeB,GetEepromInterface()->getCapability(TimerTriggerB));
- populateTimerSwitchBCB(ui->timer2ModeBCB,model.timers[1].modeB,GetEepromInterface()->getCapability(TimerTriggerB));
- }
-
- int index=0;
- int selindex;
- int selindex2;
- ui->protocolCB->clear();
- for (int i=0; iisAvailable((Protocol)i)) {
- ui->protocolCB->addItem(getProtocolStr(i), (QVariant)i);
- if (model.moduleData[0].protocol == i) {
- selindex = index;
- }
- index++;
- }
- }
- if (GetEepromInterface()->getCapability(NumModules)>1) {
- index=0;
- ui->protocolCB_2->clear();
- for (int i=0; iisAvailable((Protocol)i, 1)) {
- ui->protocolCB_2->addItem(getProtocolStr(i), (QVariant)i);
- if (model.moduleData[1].protocol == i) {
- selindex2 = index;
- }
- index++;
- }
- }
- }
- if (GetEepromInterface()->getCapability(ModelTrainerEnable)) {
- if (!(model.trainerMode||model.traineron)) {
- ui->protocolCB_3->setCurrentIndex(0);
- ui->label_PPM_3->hide();
- ui->ppmDelaySB_3->hide();
- ui->label_PPMCH_3->hide();
- ui->label_pulsePol_3->hide();
- ui->pulsePolCB_3->hide();
- ui->numChannelsSB_3->hide();
- ui->label_ppmFrameLength_3->hide();
- ui->ppmFrameLengthDSB_3->hide();
- ui->label_numChannelsStart_3->hide();
- ui->numChannelsStart_3->hide();
- } else {
- ui->protocolCB_3->setCurrentIndex(1);
- ui->label_PPM_3->show();
- ui->ppmDelaySB_3->show();
- ui->label_PPMCH_3->show();
- ui->label_pulsePol_3->show();
- ui->pulsePolCB_3->show();
- ui->numChannelsSB_3->show();
- ui->label_ppmFrameLength_3->show();
- ui->ppmFrameLengthDSB_3->show();
- ui->label_numChannelsStart_3->show();
- ui->numChannelsStart_3->show();
- }
- on_protocolCB_3_currentIndexChanged(model.traineron||model.trainerMode);
- } else {
- ui->rf3_GB->hide();
- }
-
- ui->label_PPM->hide();
- ui->ppmDelaySB->hide();
- ui->label_PPMCH->hide();
- ui->label_pulsePol->hide();
- ui->pulsePolCB->hide();
- ui->numChannelsSB->hide();
- ui->label_ppmFrameLength->hide();
- ui->ppmFrameLengthDSB->hide();
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- ui->label_PXX->hide();
- ui->pxxRxNum->hide();
- ui->label_numChannelsStart->hide();
- ui->numChannelsStart->hide();
- ui->pxxRxNum->setEnabled(false);
- ui->protocolCB->setCurrentIndex(selindex);
- on_protocolCB_currentIndexChanged(selindex);
- if (GetEepromInterface()->getCapability(NumModules)>1) {
- ui->label_PPM_2->hide();
- ui->ppmDelaySB_2->hide();
- ui->label_PPMCH_2->hide();
- ui->label_pulsePol_2->hide();
- ui->pulsePolCB_2->hide();
- ui->numChannelsSB_2->hide();
- ui->label_ppmFrameLength_2->hide();
- ui->ppmFrameLengthDSB_2->hide();
- ui->label_DSM_2->hide();
- ui->DSM_Type_2->hide();
- ui->label_PXX_2->hide();
- ui->pxxRxNum_2->hide();
- ui->label_numChannelsStart_2->hide();
- ui->numChannelsStart_2->hide();
- ui->pxxRxNum_2->setEnabled(false);
- ui->protocolCB_2->setCurrentIndex(selindex2);
- on_protocolCB_2_currentIndexChanged(selindex2);
- }
-
- //timer2 mode direction value
- if (GetEepromInterface()->getCapability(Timers)<2) {
- ui->timer2DirCB->hide();
- ui->timer2ValTE->hide();
- ui->timer2DirCB->hide();
- ui->timer2ModeCB->hide();
- ui->timer2ModeBCB->hide();
- ui->timer2ModeB_label->hide();
- ui->label_timer2->hide();
- } else {
- populateTimerSwitchCB(ui->timer2ModeCB,model.timers[1].mode,GetEepromInterface()->getCapability(TimerTriggerB));
- min = model.timers[1].val/60;
- sec = model.timers[1].val%60;
- ui->timer2ValTE->setTime(QTime(0,min,sec));
- ui->timer2DirCB->setCurrentIndex(model.timers[1].dir);
- }
- if (!GetEepromInterface()->getCapability(PermTimers)) {
- ui->timer1Perm->hide();
- ui->timer2Perm->hide();
- ui->timer1PermValue->hide();
- ui->timer2PermValue->hide();
- } else {
- int sign=1;
- int pvalue=model.timers[0].pvalue;
- if (pvalue<0) {
- pvalue=-pvalue;
- sign=-1;
- }
- int hours=pvalue/3600;
- pvalue-=hours*3600;
- int minutes = pvalue/60;
- int seconds = pvalue%60;
- ui->timer1PermValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours,2,10,QLatin1Char('0')).arg(minutes,2,10,QLatin1Char('0')).arg(seconds,2,10,QLatin1Char('0')));
- // QString QString::arg ( int a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) ) const
- sign=1;
- pvalue=model.timers[1].pvalue;
- if (pvalue<0) {
- pvalue=-pvalue;
- sign=-1;
- }
- hours=pvalue/3600;
- pvalue-=hours*3600;
- minutes = pvalue/60;
- seconds = pvalue%60;
- ui->timer2PermValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours,2,10,QLatin1Char('0')).arg(minutes,2,10,QLatin1Char('0')).arg(seconds,2,10,QLatin1Char('0')));
- ui->timer1Perm->setChecked(model.timers[0].persistent);
- ui->timer2Perm->setChecked(model.timers[1].persistent);
- }
- if (!GetEepromInterface()->getCapability(minuteBeep)) {
- ui->timer1Minute->hide();
- ui->timer2Minute->hide();
- } else {
- ui->timer1Minute->setChecked(model.timers[0].minuteBeep);
- ui->timer2Minute->setChecked(model.timers[1].minuteBeep);
- }
-
- if (!GetEepromInterface()->getCapability(countdownBeep)) {
- ui->timer1CountDownBeep->hide();
- ui->timer2CountDownBeep->hide();
- } else {
- ui->timer1CountDownBeep->setChecked(model.timers[0].countdownBeep);
- ui->timer2CountDownBeep->setChecked(model.timers[1].countdownBeep);
- }
-
- //trim inc, thro trim, thro expo, instatrim
- ui->trimIncCB->setCurrentIndex(model.trimInc);
- ui->thrExpoChkB->setChecked(model.thrExpo);
- ui->thrTrimChkB->setChecked(model.thrTrim);
-
- // PPM settings fields
- ui->ppmDelaySB->setEnabled(model.moduleData[0].protocol == PPM);
- ui->pulsePolCB->setCurrentIndex(model.moduleData[0].ppmPulsePol);
- ui->ppmDelaySB->setEnabled(model.moduleData[0].protocol == PPM);
- ui->ppmDelaySB->setValue(model.moduleData[0].ppmDelay);
- // TODO? ui->numChannelsSB->setEnabled(model.moduleData[0].protocol == PPM);
-
- ui->extendedLimitsChkB->setChecked(model.extendedLimits);
- ui->T2ThrTrgChkB->setChecked(model.t2throttle);
- if (!GetEepromInterface()->getCapability(Timer2ThrTrig)) {
- ui->T2ThrTrg->hide();
- ui->T2ThrTrgChkB->hide();
- }
- ui->ppmFrameLengthDSB->setValue(22.5+((double)model.moduleData[0].ppmFrameLength)*0.5);
- if (!GetEepromInterface()->getCapability(PPMExtCtrl)) {
- ui->ppmFrameLengthDSB->hide();
- ui->label_ppmFrameLength->hide();
- }
- switch (model.moduleData[0].protocol) {
- case PXX_DJT:
- case PXX_XJT_X16:
- case PXX_XJT_D8:
- case PXX_XJT_LR12:
- ui->pxxRxNum->setMinimum(0);
- ui->pxxRxNum->setValue((model.modelId));
- break;
- case DSM2:
- if (!GetEepromInterface()->getCapability(DSM2Indexes)) {
- ui->pxxRxNum->setValue(1);
- }
- else {
- ui->pxxRxNum->setMinimum(0);
- ui->pxxRxNum->setValue((model.modelId));
- }
- ui->numChannelsSB->setValue(8);
- break;
- default:
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- ui->DSM_Type->setEnabled(false);
- ui->label_PXX->hide();
- ui->pxxRxNum->hide();
- ui->pxxRxNum->setEnabled(false);
- ui->numChannelsSB->setValue(model.moduleData[0].channelsCount);
- break;
- }
lock = false;
}
-void Setup::on_protocolCB_currentIndexChanged(int index)
+Setup::~Setup()
{
- Protocol protocol = (Protocol)ui->protocolCB->itemData(index).toInt();
-
- if (!lock) {
- model.moduleData[0].protocol = protocol;
- emit modified();
- }
-
- if (protocol==PXX_XJT_D8 || protocol==OFF) {
- ui->FSGB_1->hide();
- } else {
- ui->fsm1CB->setCurrentIndex(model.moduleData[0].failsafeMode);
- on_fsm1CB_currentIndexChanged(model.moduleData[0].failsafeMode);
- ui->FSGB_1->show();
- }
-
- ui->ppmDelaySB->setEnabled(!protocol);
- ui->numChannelsSB->setEnabled(!protocol);
-
- if (GetEepromInterface()->getCapability(HasPPMStart)) {
- ui->numChannelsSB->setSingleStep(1);
- } else {
- ui->numChannelsSB->setSingleStep(2);
- }
-
- switch (protocol) {
- case OFF:
- ui->label_PPM->hide();
- ui->ppmDelaySB->hide();
- ui->label_PPMCH->hide();
- ui->label_pulsePol->hide();
- ui->pulsePolCB->hide();
- ui->numChannelsSB->hide();
- ui->label_ppmFrameLength->hide();
- ui->ppmFrameLengthDSB->hide();
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- ui->label_PXX->hide();
- ui->pxxRxNum->hide();
- ui->label_numChannelsStart->hide();
- ui->numChannelsStart->hide();
- break;
- case PXX_XJT_X16:
- case PXX_XJT_D8:
- case PXX_XJT_LR12:
- case PXX_DJT:
- ui->label_PPM->hide();
- ui->ppmDelaySB->hide();
- ui->ppmDelaySB->setEnabled(false);
- ui->label_PPMCH->show();
- ui->label_pulsePol->hide();
- ui->pulsePolCB->hide();
- ui->numChannelsSB->show();
- ui->numChannelsSB->setEnabled(true);
- ui->label_ppmFrameLength->hide();
- ui->ppmFrameLengthDSB->hide();
- ui->ppmFrameLengthDSB->setEnabled(false);
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- ui->DSM_Type->setEnabled(false);
- ui->label_PXX->show();
- ui->pxxRxNum->setMinimum(0);
- ui->pxxRxNum->show();
- ui->pxxRxNum->setEnabled(true);
- ui->pxxRxNum->setValue((model.moduleData[0].channelsCount-8)/2+1);
- ui->label_numChannelsStart->show();
- ui->numChannelsStart->show();
- ui->numChannelsStart->setValue(model.moduleData[0].channelsStart+1);
- ui->numChannelsSB->setMinimum(model.moduleData[0].channelsStart+4);
- ui->numChannelsSB->setValue(model.moduleData[0].channelsStart+model.moduleData[0].channelsCount);
- break;
- case LP45:
- case DSM2:
- case DSMX:
- ui->label_pulsePol->hide();
- ui->pulsePolCB->hide();
- ui->label_PPM->hide();
- ui->ppmDelaySB->hide();
- ui->ppmDelaySB->setEnabled(false);
- ui->label_PPMCH->hide();
- ui->label_numChannelsStart->hide();
- ui->numChannelsStart->hide();
- ui->numChannelsSB->hide();
- ui->numChannelsSB->setEnabled(false);
- ui->label_ppmFrameLength->hide();
- ui->ppmFrameLengthDSB->hide();
- ui->ppmFrameLengthDSB->setEnabled(false);
- if (!GetEepromInterface()->getCapability(DSM2Indexes)) {
- ui->label_PXX->hide();
- ui->pxxRxNum->hide();
- ui->pxxRxNum->setEnabled(false);
- }
- else {
- ui->pxxRxNum->setMinimum(0);
- ui->pxxRxNum->setValue(model.modelId);
- ui->label_PXX->show();
- ui->pxxRxNum->show();
- ui->pxxRxNum->setEnabled(true);
- }
- ui->DSM_Type->setEnabled(false);
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- break;
- default:
- if (GetEepromInterface()->getCapability(HasPPMStart)) {
- ui->label_numChannelsStart->show();
- ui->numChannelsStart->show();
- }
- else {
- ui->label_numChannelsStart->hide();
- ui->numChannelsStart->hide();
- }
- ui->numChannelsStart->setValue(model.moduleData[0].channelsStart+1);
- ui->numChannelsSB->setMinimum(model.moduleData[0].channelsStart+4);
- ui->numChannelsSB->setValue(model.moduleData[0].channelsStart + model.moduleData[0].channelsCount);
- ui->label_pulsePol->show();
- ui->pulsePolCB->show();
- ui->label_DSM->hide();
- ui->DSM_Type->hide();
- ui->DSM_Type->setEnabled(false);
- ui->label_PXX->hide();
- ui->pxxRxNum->hide();
- ui->pxxRxNum->setEnabled(false);
- ui->label_PPM->show();
- ui->ppmDelaySB->show();
- ui->ppmDelaySB->setEnabled(true);
- ui->label_PPMCH->show();
- ui->numChannelsSB->show();
- ui->numChannelsSB->setEnabled(true);
- ui->ppmFrameLengthDSB->setEnabled(true);
- ui->ppmFrameLengthDSB->setMinimum(model.moduleData[0].channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
- if (GetEepromInterface()->getCapability(PPMExtCtrl)) {
- ui->ppmFrameLengthDSB->show();
- ui->label_ppmFrameLength->show();
- }
-
- break;
- }
+ delete ui;
}
-void Setup::on_protocolCB_2_currentIndexChanged(int index)
-{
- Protocol protocol = (Protocol)ui->protocolCB_2->itemData(index).toInt();
-
- if (!lock) {
- model.moduleData[1].protocol = protocol;
- emit modified();
- }
-
- if (protocol==PXX_XJT_X16 || protocol==PXX_XJT_LR12) {
- ui->FSGB_2->show();
- ui->fsm2CB->setCurrentIndex(model.moduleData[1].failsafeMode);
- on_fsm2CB_currentIndexChanged(model.moduleData[1].failsafeMode);
- }
- else {
- ui->FSGB_2->hide();
- }
-
- ui->ppmDelaySB_2->setEnabled(!protocol);
- ui->numChannelsSB_2->setEnabled(!protocol);
-
- if (GetEepromInterface()->getCapability(HasPPMStart)) {
- ui->numChannelsSB_2->setSingleStep(1);
- } else {
- ui->numChannelsSB_2->setSingleStep(2);
- }
-
- switch (protocol) {
- case OFF:
- ui->label_PPM_2->hide();
- ui->ppmDelaySB_2->hide();
- ui->label_PPMCH_2->hide();
- ui->label_pulsePol_2->hide();
- ui->pulsePolCB_2->hide();
- ui->numChannelsSB_2->hide();
- ui->label_ppmFrameLength_2->hide();
- ui->ppmFrameLengthDSB_2->hide();
- ui->label_DSM_2->hide();
- ui->DSM_Type_2->hide();
- ui->label_PXX_2->hide();
- ui->pxxRxNum_2->hide();
- ui->label_numChannelsStart_2->hide();
- ui->numChannelsStart_2->hide();
- break;
- case PXX_XJT_X16:
- case PXX_XJT_D8:
- case PXX_XJT_LR12:
- case PXX_DJT:
- ui->label_PPM_2->hide();
- ui->ppmDelaySB_2->hide();
- ui->ppmDelaySB_2->setEnabled(false);
- ui->label_PPMCH_2->show();
- ui->label_pulsePol_2->hide();
- ui->pulsePolCB_2->hide();
- ui->numChannelsSB_2->show();
- ui->numChannelsSB_2->setEnabled(true);
- ui->label_ppmFrameLength_2->hide();
- ui->ppmFrameLengthDSB_2->hide();
- ui->ppmFrameLengthDSB_2->setEnabled(false);
- ui->label_DSM_2->hide();
- ui->DSM_Type_2->hide();
- ui->DSM_Type_2->setEnabled(false);
- ui->label_PXX_2->show();
- ui->pxxRxNum_2->setMinimum(0);
- ui->pxxRxNum_2->show();
- ui->pxxRxNum_2->setEnabled(true);
- ui->pxxRxNum_2->setValue(model.modelId);
- ui->label_numChannelsStart_2->show();
- ui->numChannelsStart_2->show();
- ui->numChannelsStart_2->setValue(model.moduleData[1].channelsStart+1);
- ui->numChannelsSB_2->setMinimum(model.moduleData[1].channelsStart+4);
- ui->numChannelsSB_2->setValue(model.moduleData[1].channelsStart+model.moduleData[1].channelsCount);
- break;
- case LP45:
- case DSM2:
- case DSMX:
- ui->label_pulsePol_2->hide();
- ui->pulsePolCB_2->hide();
- ui->label_PPM_2->hide();
- ui->ppmDelaySB_2->hide();
- ui->ppmDelaySB_2->setEnabled(false);
- ui->label_PPMCH_2->hide();
- ui->numChannelsSB_2->hide();
- ui->numChannelsSB_2->setEnabled(false);
- ui->label_ppmFrameLength_2->hide();
- ui->ppmFrameLengthDSB_2->hide();
- ui->ppmFrameLengthDSB_2->setEnabled(false);
- if (!GetEepromInterface()->getCapability(DSM2Indexes)) {
- ui->label_PXX_2->hide();
- ui->pxxRxNum_2->hide();
- ui->pxxRxNum_2->setEnabled(false);
- } else {
- ui->pxxRxNum_2->setMinimum(0);
- ui->pxxRxNum_2->setValue(model.modelId);
- ui->label_PXX_2->show();
- ui->pxxRxNum_2->show();
- ui->pxxRxNum_2->setEnabled(true);
- }
- ui->DSM_Type_2->setEnabled(false);
- ui->label_DSM_2->hide();
- ui->DSM_Type_2->hide();
- break;
- default:
- if (GetEepromInterface()->getCapability(HasPPMStart)) {
- ui->label_numChannelsStart_2->show();
- ui->numChannelsStart_2->show();
- } else {
- ui->label_numChannelsStart_2->hide();
- ui->numChannelsStart_2->hide();
- }
- ui->numChannelsStart_2->setValue(model.moduleData[1].channelsStart+1);
- ui->numChannelsSB_2->setMinimum(model.moduleData[1].channelsStart+4);
- ui->numChannelsSB_2->setValue(model.moduleData[1].channelsStart+model.moduleData[1].channelsCount);
- ui->label_pulsePol_2->show();
- ui->pulsePolCB_2->show();
- ui->pulsePolCB_2->setCurrentIndex(model.moduleData[1].ppmPulsePol);
- ui->label_DSM_2->hide();
- ui->DSM_Type_2->hide();
- ui->DSM_Type_2->setEnabled(false);
- ui->label_PXX_2->hide();
- ui->pxxRxNum_2->hide();
- ui->pxxRxNum_2->setEnabled(false);
- ui->label_PPM_2->show();
- ui->ppmDelaySB_2->show();
- ui->ppmDelaySB_2->setEnabled(true);
- ui->ppmDelaySB_2->setValue(model.moduleData[1].ppmDelay);
- ui->label_PPMCH_2->show();
- ui->numChannelsSB_2->show();
- ui->numChannelsSB_2->setEnabled(true);
- ui->ppmFrameLengthDSB_2->setEnabled(true);
- ui->ppmFrameLengthDSB_2->setMinimum(model.moduleData[1].channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
- if (GetEepromInterface()->getCapability(PPMExtCtrl)) {
- ui->ppmFrameLengthDSB_2->show();
- ui->label_ppmFrameLength_2->show();
- ui->ppmFrameLengthDSB_2->setValue(model.moduleData[1].ppmFrameLength/2.0+22.5);
- }
- break;
- }
-}
-
-void Setup::on_protocolCB_3_currentIndexChanged(int index)
-{
- Protocol protocol = (Protocol)ui->protocolCB_3->currentIndex();
-
- if (!lock) {
- model.moduleData[2].protocol = protocol;
- model.trainerMode = ui->protocolCB_3->currentIndex();
- emit modified();
- }
-
- switch (index) {
- case 0:
- ui->label_PPM_3->hide();
- ui->ppmDelaySB_3->hide();
- ui->label_PPMCH_3->hide();
- ui->label_pulsePol_3->hide();
- ui->pulsePolCB_3->hide();
- ui->numChannelsSB_3->hide();
- ui->label_ppmFrameLength_3->hide();
- ui->ppmFrameLengthDSB_3->hide();
- ui->label_numChannelsStart_3->hide();
- ui->numChannelsStart_3->hide();
- break;
- default:
- ui->label_PPM_3->show();
- ui->ppmDelaySB_3->show();
- ui->label_PPMCH_3->show();
- ui->label_pulsePol_3->show();
- ui->pulsePolCB_3->show();
- ui->numChannelsSB_3->show();
- ui->label_ppmFrameLength_3->show();
- ui->ppmFrameLengthDSB_3->show();
- ui->label_numChannelsStart_3->show();
- ui->numChannelsStart_3->show();
- ui->numChannelsStart_3->setValue(model.moduleData[2].channelsStart+1);
- ui->numChannelsSB_3->setMinimum(model.moduleData[2].channelsStart+4);
- ui->numChannelsSB_3->setValue(model.moduleData[2].channelsStart+model.moduleData[2].channelsCount);
- ui->pulsePolCB_3->setCurrentIndex(model.moduleData[2].ppmPulsePol);
- ui->ppmDelaySB_3->setValue(model.moduleData[2].ppmDelay);
- ui->ppmFrameLengthDSB_3->setMinimum(model.moduleData[2].channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
- if (GetEepromInterface()->getCapability(PPMExtCtrl)) {
- ui->ppmFrameLengthDSB_3->show();
- ui->label_ppmFrameLength_3->show();
- ui->ppmFrameLengthDSB_3->setValue(model.moduleData[2].ppmFrameLength/2.0+22.5);
- }
- break;
- }
-}
-
-void Setup::on_T2ThrTrgChkB_toggled(bool checked)
-{
- model.t2throttle = checked;
- emit modified();
-}
-
-void Setup::on_extendedLimitsChkB_toggled(bool checked)
+void Setup::on_extendedLimits_toggled(bool checked)
{
model.extendedLimits = checked;
emit modified();
}
-void Setup::on_thrwarnChkB_toggled(bool checked)
+void Setup::on_throttleWarning_toggled(bool checked)
{
model.disableThrottleWarning = checked;
emit modified();
}
-void Setup::on_thrrevChkB_toggled(bool checked)
+void Setup::on_throttleReverse_toggled(bool checked)
{
model.throttleReversed = checked;
emit modified();
}
-void Setup::on_extendedTrimsChkB_toggled(bool checked)
+void Setup::on_extendedTrims_toggled(bool checked)
{
model.extendedTrims = checked;
emit modified();
}
-void Setup::on_fsm1CB_currentIndexChanged(int index)
+void Setup::on_trimIncrement_currentIndexChanged(int index)
{
- QSpinBox * fssb[] = { ui->fsm1SB_1, ui->fsm1SB_2,ui->fsm1SB_3,ui->fsm1SB_4,ui->fsm1SB_5,ui->fsm1SB_6,ui->fsm1SB_7,ui->fsm1SB_8,
- ui->fsm1SB_9, ui->fsm1SB_10,ui->fsm1SB_11,ui->fsm1SB_12,ui->fsm1SB_13,ui->fsm1SB_14,ui->fsm1SB_15,ui->fsm1SB_16, NULL };
- QSlider * fssld[] = { ui->fsm1SL_1, ui->fsm1SL_2,ui->fsm1SL_3,ui->fsm1SL_4,ui->fsm1SL_5,ui->fsm1SL_6,ui->fsm1SL_7,ui->fsm1SL_8,
- ui->fsm1SL_9, ui->fsm1SL_10,ui->fsm1SL_11,ui->fsm1SL_12,ui->fsm1SL_13,ui->fsm1SL_14,ui->fsm1SL_15,ui->fsm1SL_16, NULL };
- model.moduleData[0].failsafeMode=index;
- for (int i=0; fssb[i]; i++) {
- if (index==1) {
- fssb[i]->setEnabled(true);
- fssld[i]->setEnabled(true);
- } else {
- fssb[i]->setDisabled(true);
- fssld[i]->setDisabled(true);
- }
- }
+ model.trimInc = index;
emit modified();
}
-void Setup::on_fsm2CB_currentIndexChanged(int index)
+void Setup::on_throttleSource_currentIndexChanged(int index)
{
- QSpinBox * fssb[] = { ui->fsm2SB_1, ui->fsm2SB_2,ui->fsm2SB_3,ui->fsm2SB_4,ui->fsm2SB_5,ui->fsm2SB_6,ui->fsm2SB_7,ui->fsm2SB_8,
- ui->fsm2SB_9, ui->fsm2SB_10,ui->fsm2SB_11,ui->fsm2SB_12,ui->fsm2SB_13,ui->fsm2SB_14,ui->fsm2SB_15,ui->fsm2SB_16, NULL };
- QSlider * fssld[] = { ui->fsm2SL_1, ui->fsm2SL_2,ui->fsm2SL_3,ui->fsm2SL_4,ui->fsm2SL_5,ui->fsm2SL_6,ui->fsm2SL_7,ui->fsm2SL_8,
- ui->fsm2SL_9, ui->fsm2SL_10,ui->fsm2SL_11,ui->fsm2SL_12,ui->fsm2SL_13,ui->fsm2SL_14,ui->fsm2SL_15,ui->fsm2SL_16, NULL };
- model.moduleData[1].failsafeMode=index;
- for (int i=0; fssb[i]; i++) {
- if (index==1) {
- fssb[i]->setEnabled(true);
- fssld[i]->setEnabled(true);
- } else {
- fssb[i]->setDisabled(true);
- fssld[i]->setDisabled(true);
- }
- }
+ model.thrTraceSrc = index;
emit modified();
}
-void Setup::fssldValueChanged()
+void Setup::on_name_editingFinished()
+{
+ int length = ui->name->maxLength();
+ strncpy(model.name, ui->name->text().toAscii(), length);
+ emit modified();
+}
+
+void Setup::on_image_currentIndexChanged(int index)
{
if (!lock) {
- lock = true;
- QSpinBox * fssb1[] = { ui->fsm1SB_1, ui->fsm1SB_2,ui->fsm1SB_3,ui->fsm1SB_4,ui->fsm1SB_5,ui->fsm1SB_6,ui->fsm1SB_7,ui->fsm1SB_8,
- ui->fsm1SB_9, ui->fsm1SB_10,ui->fsm1SB_11,ui->fsm1SB_12,ui->fsm1SB_13,ui->fsm1SB_14,ui->fsm1SB_15,ui->fsm1SB_16, NULL };
- QSpinBox * fssb2[] = { ui->fsm2SB_1, ui->fsm2SB_2,ui->fsm2SB_3,ui->fsm2SB_4,ui->fsm2SB_5,ui->fsm2SB_6,ui->fsm2SB_7,ui->fsm2SB_8,
- ui->fsm2SB_9, ui->fsm2SB_10,ui->fsm2SB_11,ui->fsm2SB_12,ui->fsm2SB_13,ui->fsm2SB_14,ui->fsm2SB_15,ui->fsm2SB_16, NULL };
- QSlider *sl = qobject_cast(sender());
- int fsId=sl->objectName().mid(sl->objectName().lastIndexOf("_")+1).toInt()-1;
- int moduleid=sl->objectName().mid(3,1).toInt();
- if (moduleid==1) {
- fssb1[fsId]->setValue(sl->value());
- } else {
- fssb2[fsId]->setValue(sl->value());
- }
- lock = false;
- }
-}
-
-void Setup::fssbValueChanged()
-{
- if (!lock) {
- lock = true;
- QSlider * fssld1[] = { ui->fsm1SL_1, ui->fsm1SL_2,ui->fsm1SL_3,ui->fsm1SL_4,ui->fsm1SL_5,ui->fsm1SL_6,ui->fsm1SL_7,ui->fsm1SL_8,
- ui->fsm1SL_9, ui->fsm1SL_10,ui->fsm1SL_11,ui->fsm1SL_12,ui->fsm1SL_13,ui->fsm1SL_14,ui->fsm1SL_15,ui->fsm1SL_16, NULL };
- QSlider * fssld2[] = { ui->fsm2SL_1, ui->fsm2SL_2,ui->fsm2SL_3,ui->fsm2SL_4,ui->fsm2SL_5,ui->fsm2SL_6,ui->fsm2SL_7,ui->fsm2SL_8,
- ui->fsm2SL_9, ui->fsm2SL_10,ui->fsm2SL_11,ui->fsm2SL_12,ui->fsm2SL_13,ui->fsm2SL_14,ui->fsm2SL_15,ui->fsm2SL_16, NULL };
- QSpinBox *sb = qobject_cast(sender());
- int fsId=sb->objectName().mid(sb->objectName().lastIndexOf("_")+1).toInt()-1;
- int moduleid=sb->objectName().mid(3,1).toInt();
- if (moduleid==1) {
- fssld1[fsId]->setValue(sb->value());
- } else {
- fssld2[fsId]->setValue(sb->value());
- }
- lock = false;
- }
-}
-
-void Setup::fssldEdited()
-{
- QSlider *sl = qobject_cast(sender());
- int fsId=sl->objectName().mid(sl->objectName().lastIndexOf("_")+1).toInt()-1;
- int moduleid=sl->objectName().mid(3,1).toInt();
- if (moduleid==1) {
- model.moduleData[0].failsafeChannels[fsId]=sl->value();
- } else {
- model.moduleData[1].failsafeChannels[fsId]=sl->value();
- }
- emit modified();
-}
-
-void Setup::fssbEdited()
-{
- QSpinBox *sb = qobject_cast(sender());
- int fsId=sb->objectName().mid(sb->objectName().lastIndexOf("_")+1).toInt()-1;
- int moduleid=sb->objectName().mid(3,1).toInt();
- if (moduleid==1) {
- model.moduleData[0].failsafeChannels[fsId]=sb->value();
- } else {
- model.moduleData[1].failsafeChannels[fsId]=sb->value();
- }
- emit modified();
-}
-
-void Setup::on_modelVoice_SB_editingFinished()
-{
- model.modelVoice=ui->modelVoice_SB->value()-260;
- emit modified();
-}
-
-void Setup::on_timer1Perm_toggled(bool checked)
-{
- model.timers[0].persistent=checked;
- emit modified();
-}
-
-void Setup::on_timer2Perm_toggled(bool checked)
-{
- model.timers[1].persistent=checked;
- emit modified();
-}
-
-void Setup::on_timer1Minute_toggled(bool checked)
-{
- model.timers[0].minuteBeep=checked;
- emit modified();
-}
-
-void Setup::on_timer2Minute_toggled(bool checked)
-{
- model.timers[1].minuteBeep=checked;
- emit modified();
-}
-
-void Setup::on_timer1CountDownBeep_toggled(bool checked)
-{
- model.timers[0].countdownBeep=checked;
- emit modified();
-}
-
-void Setup::on_timer2CountDownBeep_toggled(bool checked)
-{
- model.timers[1].countdownBeep=checked;
- emit modified();
-}
-
-void Setup::on_timer1ModeCB_currentIndexChanged(int index)
-{
- model.timers[0].mode = TimerMode(ui->timer1ModeCB->itemData(index).toInt());
- emit modified();
-}
-
-void Setup::on_timer1DirCB_currentIndexChanged(int index)
-{
- model.timers[0].dir = index;
- emit modified();
-}
-
-void Setup::on_timer1ValTE_editingFinished()
-{
- model.timers[0].val = ui->timer1ValTE->time().minute()*60 + ui->timer1ValTE->time().second();
- emit modified();
-}
-
-void Setup::on_timer1ModeBCB_currentIndexChanged(int index)
-{
- model.timers[0].modeB = ui->timer1ModeBCB->itemData(index).toInt();
- emit modified();
-}
-
-void Setup::on_timer2ModeCB_currentIndexChanged(int index)
-{
- model.timers[1].mode = TimerMode(ui->timer2ModeCB->itemData(index).toInt());
- emit modified();
-}
-
-void Setup::on_timer2DirCB_currentIndexChanged(int index)
-{
- model.timers[1].dir = index;
- emit modified();
-}
-
-void Setup::on_timer2ValTE_editingFinished()
-{
- model.timers[1].val = ui->timer2ValTE->time().minute()*60 + ui->timer2ValTE->time().second();
- emit modified();
-}
-
-void Setup::on_timer2ModeBCB_currentIndexChanged(int index)
-{
- model.timers[1].modeB = ui->timer2ModeBCB->itemData(index).toInt();
- emit modified();
-}
-
-void Setup::on_trimIncCB_currentIndexChanged(int index)
-{
- model.trimInc = index;
- emit modified();
-}
-
-void Setup::on_ttraceCB_currentIndexChanged(int index)
-{
- model.thrTraceSrc = index;
- emit modified();
-}
-
-void Setup::on_pulsePolCB_currentIndexChanged(int index)
-{
- model.moduleData[0].ppmPulsePol = index;
- emit modified();
-}
-
-void Setup::on_pulsePolCB_2_currentIndexChanged(int index)
-{
- model.moduleData[1].ppmPulsePol = index;
- emit modified();
-}
-
-void Setup::on_pulsePolCB_3_currentIndexChanged(int index)
-{
- model.moduleData[2].ppmPulsePol = index;
- emit modified();
-}
-
-void Setup::on_numChannelsSB_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[0].channelsCount = 1+ui->numChannelsSB->value()-ui->numChannelsStart->value();
- ui->ppmFrameLengthDSB->setMinimum(model.moduleData[0].channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
- emit modified();
-}
-
-void Setup::on_numChannelsSB_2_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[1].channelsCount = 1+ui->numChannelsSB_2->value()-ui->numChannelsStart_2->value();
- ui->ppmFrameLengthDSB_2->setMinimum(model.moduleData[1].channelsCount*(model.extendedLimits ? 2.250 :2.0)+3.5);
- emit modified();
-}
-
-void Setup::on_numChannelsSB_3_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[2].channelsCount = 1+ui->numChannelsSB_3->value()-ui->numChannelsStart_3->value();
- ui->ppmFrameLengthDSB_3->setMinimum(model.moduleData[2].channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
- emit modified();
-}
-
-void Setup::on_numChannelsStart_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[0].channelsStart = ui->numChannelsStart->value()-1;
- ui->numChannelsSB->setMinimum(model.moduleData[0].channelsStart+4);
- ui->numChannelsSB->setValue(model.moduleData[0].channelsStart+model.moduleData[0].channelsCount);
- emit modified();
-}
-
-void Setup::on_numChannelsStart_2_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[1].channelsStart = ui->numChannelsStart_2->value()-1;
- ui->numChannelsSB_2->setMinimum(model.moduleData[1].channelsStart+4);
- ui->numChannelsSB_2->setValue(model.moduleData[1].channelsStart+model.moduleData[1].channelsCount);
- emit modified();
-}
-
-void Setup::on_numChannelsStart_3_editingFinished()
-{
- // TODO only accept valid values
- model.moduleData[2].channelsStart = ui->numChannelsStart_3->value()-1;
- ui->numChannelsSB_3->setMinimum(model.moduleData[2].channelsStart+4);
- ui->numChannelsSB_3->setValue(model.moduleData[2].channelsStart+model.moduleData[2].channelsCount);
- emit modified();
-}
-
-void Setup::on_ppmDelaySB_editingFinished()
-{
- if (!lock) {
- // TODO only accept valid values
- model.moduleData[0].ppmDelay = ui->ppmDelaySB->value();
- emit modified();
- }
-}
-
-void Setup::on_ppmDelaySB_2_editingFinished()
-{
- if (!lock) {
- // TODO only accept valid values
- model.moduleData[1].ppmDelay = ui->ppmDelaySB_2->value();
- emit modified();
- }
-}
-
-void Setup::on_ppmDelaySB_3_editingFinished()
-{
- if (!lock) {
- // TODO only accept valid values
- model.moduleData[2].ppmDelay = ui->ppmDelaySB_3->value();
- emit modified();
- }
-}
-
-void Setup::on_DSM_Type_currentIndexChanged(int index)
-{
- if (!lock) {
- // model.moduleData[0].channelsCount = (index*2)+8;
- emit modified();
- }
-}
-
-void Setup::on_DSM_Type_2_currentIndexChanged(int index)
-{
- if (!lock) {
- // model.moduleData[1].channelsCount = (index*2)+8;
- emit modified();
- }
-}
-
-void Setup::on_pxxRxNum_editingFinished()
-{
- if (!lock) {
- if (!GetEepromInterface()->getCapability(DSM2Indexes)) {
- // model.moduleData[0].channelsCount = (ui->pxxRxNum->value()-1)*2+8;
- }
- else {
- model.modelId = ui->pxxRxNum->value();
- }
- emit modified();
- }
-}
-
-void Setup::on_pxxRxNum_2_editingFinished()
-{
- if (!lock) {
- /* if (!GetEepromInterface()->getCapability(DSM2Indexes)) {
- model.moduleData[1].channelsCount = (ui->pxxRxNum_2->value()-1)*2+8;
- } */
- emit modified();
- }
-}
-
-void Setup::on_ppmFrameLengthDSB_editingFinished()
-{
- model.moduleData[0].ppmFrameLength = (ui->ppmFrameLengthDSB->value()-22.5)/0.5;
- emit modified();
-}
-
-void Setup::on_ppmFrameLengthDSB_2_editingFinished()
-{
- model.moduleData[1].ppmFrameLength = (ui->ppmFrameLengthDSB_2->value()-22.5)/0.5;
- emit modified();
-}
-
-void Setup::on_ppmFrameLengthDSB_3_editingFinished()
-{
- model.moduleData[2].ppmFrameLength = (ui->ppmFrameLengthDSB_3->value()-22.5)/0.5;
- emit modified();
-}
-
-void Setup::on_instantTrim_CB_currentIndexChanged(int index)
-{
- if (!lock) {
- bool found=false;
- for (int i=0; i< C9X_MAX_CUSTOM_FUNCTIONS; i++) {
- if (model.funcSw[i].func==FuncInstantTrim) {
- model.funcSw[i].swtch = RawSwitch(ui->instantTrim_CB->itemData(ui->instantTrim_CB->currentIndex()).toInt());
- found=true;
- }
- }
- if (found==false) {
- for (int i=0; i< C9X_MAX_CUSTOM_FUNCTIONS; i++) {
- if (model.funcSw[i].swtch==RawSwitch()) {
- model.funcSw[i].swtch = RawSwitch(ui->instantTrim_CB->itemData(ui->instantTrim_CB->currentIndex()).toInt());
- model.funcSw[i].func = FuncInstantTrim;
- break;
- }
- }
- }
- emit modified();
- }
-}
-
-void Setup::on_modelNameLE_editingFinished()
-{
- int length=ui->modelNameLE->maxLength();
- strncpy(model.name, ui->modelNameLE->text().toAscii(), length);
- emit modified();
-}
-
-void Setup::on_modelImage_CB_currentIndexChanged(int index)
-{
- if (!lock) {
- strncpy(model.bitmap, ui->modelImage_CB->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength));
+ strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength));
QSettings settings("companion9x", "companion9x");
QString path=settings.value("sdPath", ".").toString();
path.append("/BMP/");
@@ -1216,14 +490,14 @@ void Setup::on_modelImage_CB_currentIndexChanged(int index)
image.load(fileName);
}
if (!image.isNull()) {
- ui->modelImage_image->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
+ ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
}
else {
- ui->modelImage_image->clear();
+ ui->imagePreview->clear();
}
}
else {
- ui->modelImage_image->clear();
+ ui->imagePreview->clear();
}
emit modified();
}
@@ -1231,8 +505,27 @@ void Setup::on_modelImage_CB_currentIndexChanged(int index)
void Setup::update()
{
+ ui->name->setText(model.name);
+
+ ui->throttleReverse->setChecked(model.throttleReversed);
+ populateTTraceCB(ui->throttleSource, model.thrTraceSrc);
+ ui->throttleWarning->setChecked(model.disableThrottleWarning);
+
+ //trim inc, thro trim, thro expo, instatrim
+ ui->trimIncrement->setCurrentIndex(model.trimInc);
+ ui->throttleTrim->setChecked(model.thrTrim);
+ ui->extendedLimits->setChecked(model.extendedLimits);
+ ui->extendedTrims->setChecked(model.extendedTrims);
+
updateBeepCenter();
updateStartupSwitches();
+
+ for (int i=0; iupdate();
+
+ for (int i=0; iupdate();
}
void Setup::updateBeepCenter()
@@ -1248,7 +541,7 @@ void Setup::updateStartupSwitches()
unsigned int switchStates = model.switchWarningStates;
bool enabled = !(switchStates & 0x01);
- ui->switchesStartupWarning_CB->setCurrentIndex(switchStates & 0x01);
+ ui->switchesStartupWarning->setCurrentIndex(switchStates & 0x01);
switchStates >>= 1;
for (int i=0; igetCapability(Switches)-1; i++) {
@@ -1311,16 +604,10 @@ void Setup::startupSwitchEdited(int value)
}
}
-void Setup::on_thrTrimChkB_toggled(bool checked)
+void Setup::on_throttleTrim_toggled(bool checked)
{
- model.thrTrim = checked;
- emit modified();
-}
-
-void Setup::on_thrExpoChkB_toggled(bool checked)
-{
- model.thrExpo = checked;
- emit modified();
+ model.thrTrim = checked;
+ emit modified();
}
void Setup::onBeepCenterToggled(bool checked)
@@ -1335,3 +622,8 @@ void Setup::onBeepCenterToggled(bool checked)
emit modified();
}
}
+
+void Setup::onChildModified()
+{
+ emit modified();
+}
diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h
index 7b33a3af0..e3fb8d313 100644
--- a/companion/src/modeledit/setup.h
+++ b/companion/src/modeledit/setup.h
@@ -5,11 +5,65 @@
#include
#include
#include
+#include
namespace Ui {
class Setup;
+ class Timer;
+ class Module;
}
+class TimerPanel : public ModelPanel
+{
+ Q_OBJECT
+
+ public:
+ TimerPanel(QWidget *parent, ModelData & model, TimerData & timer);
+ virtual ~TimerPanel();
+
+ virtual void update();
+
+ private slots:
+ void on_mode_currentIndexChanged(int index);
+ void on_value_editingFinished();
+ void on_persistent_toggled(bool checked);
+ void on_minuteBeep_toggled(bool checked);
+ void on_countdownBeep_toggled(bool checked);
+
+ private:
+ TimerData & timer;
+ Ui::Timer *ui;
+};
+
+class ModulePanel : public ModelPanel
+{
+ Q_OBJECT
+
+ public:
+ ModulePanel(QWidget *parent, ModelData & model, ModuleData & module, int moduleIdx);
+ virtual ~ModulePanel();
+
+ virtual void update();
+
+ private slots:
+ void on_protocol_currentIndexChanged(int index);
+ void on_ppmDelay_editingFinished();
+ void on_channelsCount_editingFinished();
+ void on_channelsStart_editingFinished();
+ void on_ppmPolarity_currentIndexChanged(int index);
+ void on_ppmFrameLength_editingFinished();
+ void on_rxNumber_editingFinished();
+ void on_failsafeMode_currentIndexChanged(int value);
+ void onFailsafeChannelChanged(int value);
+
+ private:
+ ModuleData & module;
+ int moduleIdx;
+ Ui::Module *ui;
+ QVector failsafeSpins;
+ QVector failsafeSliders;
+};
+
class Setup : public ModelPanel
{
Q_OBJECT
@@ -21,72 +75,25 @@ class Setup : public ModelPanel
virtual void update();
private slots:
- void on_protocolCB_currentIndexChanged(int index);
- void on_protocolCB_2_currentIndexChanged(int index);
- void on_protocolCB_3_currentIndexChanged(int index);
- void on_fsm1CB_currentIndexChanged(int index);
- void on_fsm2CB_currentIndexChanged(int index);
- void on_modelVoice_SB_editingFinished();
- void on_T2ThrTrgChkB_toggled(bool checked);
- void on_ttraceCB_currentIndexChanged(int index);
- void on_instantTrim_CB_currentIndexChanged(int index);
- void on_thrExpoChkB_toggled(bool checked);
- void on_thrTrimChkB_toggled(bool checked);
- void on_extendedLimitsChkB_toggled(bool checked);
- void on_extendedTrimsChkB_toggled(bool checked);
- void on_thrwarnChkB_toggled(bool checked);
- void on_thrrevChkB_toggled(bool checked);
- void on_timer1Perm_toggled(bool checked);
- void on_timer2Perm_toggled(bool checked);
- void on_timer1Minute_toggled(bool checked);
- void on_timer2Minute_toggled(bool checked);
- void on_timer1CountDownBeep_toggled(bool checked);
- void on_timer2CountDownBeep_toggled(bool checked);
- void fssldEdited();
- void fssbEdited();
- void fssldValueChanged();
- void fssbValueChanged();
- void on_ppmDelaySB_editingFinished();
- void on_ppmDelaySB_2_editingFinished();
- void on_ppmDelaySB_3_editingFinished();
- void on_numChannelsSB_editingFinished();
- void on_numChannelsSB_2_editingFinished();
- void on_numChannelsSB_3_editingFinished();
- void on_numChannelsStart_editingFinished();
- void on_numChannelsStart_2_editingFinished();
- void on_numChannelsStart_3_editingFinished();
-// void void ModelEdit::on_numChannelsStart_3_editingFinished();
- void on_pulsePolCB_currentIndexChanged(int index);
- void on_pulsePolCB_2_currentIndexChanged(int index);
- void on_pulsePolCB_3_currentIndexChanged(int index);
- void on_ppmFrameLengthDSB_editingFinished();
- void on_ppmFrameLengthDSB_2_editingFinished();
- void on_ppmFrameLengthDSB_3_editingFinished();
- void on_DSM_Type_currentIndexChanged(int index);
- void on_DSM_Type_2_currentIndexChanged(int index);
- void on_pxxRxNum_editingFinished();
- void on_pxxRxNum_2_editingFinished();
-
- // TODO void on_trimSWCB_currentIndexChanged(int index);
- void on_trimIncCB_currentIndexChanged(int index);
- void on_timer1DirCB_currentIndexChanged(int index);
- void on_timer1ModeCB_currentIndexChanged(int index);
- void on_timer1ValTE_editingFinished();
- void on_timer1ModeBCB_currentIndexChanged(int index);
- void on_timer2DirCB_currentIndexChanged(int index);
- void on_timer2ModeCB_currentIndexChanged(int index);
- void on_timer2ValTE_editingFinished();
- void on_timer2ModeBCB_currentIndexChanged(int index);
- void on_modelNameLE_editingFinished();
- void on_modelImage_CB_currentIndexChanged(int index);
+ void on_name_editingFinished();
+ void on_throttleSource_currentIndexChanged(int index);
+ void on_throttleTrim_toggled(bool checked);
+ void on_extendedLimits_toggled(bool checked);
+ void on_extendedTrims_toggled(bool checked);
+ void on_throttleWarning_toggled(bool checked);
+ void on_throttleReverse_toggled(bool checked);
+ void on_image_currentIndexChanged(int index);
+ void on_trimIncrement_currentIndexChanged(int index);
void onBeepCenterToggled(bool checked);
void startupSwitchEdited(int value);
+ void onChildModified();
private:
Ui::Setup *ui;
QVector startupSwitchesSliders;
QVector centerBeepCheckboxes;
- void tabModelEditSetup();
+ ModulePanel * modules[C9X_NUM_MODULES+1];
+ TimerPanel * timers[C9X_MAX_TIMERS];
void updateStartupSwitches();
void updateBeepCenter();
};
diff --git a/companion/src/modeledit/setup.ui b/companion/src/modeledit/setup.ui
index 82f67f43b..c4a632c00 100644
--- a/companion/src/modeledit/setup.ui
+++ b/companion/src/modeledit/setup.ui
@@ -2,158 +2,189 @@
Setup
-
- Qt::NonModal
-
-
- true
-
0
0
- 968
- 660
+ 782
+ 334
-
-
- 0
- 0
-
-
-
-
- 0
- 0
-
-
Form
-
- -
-
-
- true
-
-
-
- 0
- 0
-
-
-
- 0
-
-
- true
-
-
- false
-
-
-
-
- 0
- 0
-
-
-
- ModelSetup
-
-
-
-
-
+
+
-
+
+
-
+
+
+ Model Name
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Timer2
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Timer1
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Throttle Source
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Switch startup Warning
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Center beep
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ -
+
+
+ Trim Increment
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ QLayout::SetMinimumSize
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
-
+
+ ON
+
+
+ -
+
+ OFF
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
- Timer2
+ Check
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+ Qt::AlignCenter
- -
-
+
+
+ -
+
+
-
+
+
+ -
+
-
+
0
0
- 0
- 0
+ 64
+ 32
+
+
+ 64
+ 32
+
+
+
+ QFrame::Panel
+
+
+ QFrame::Raised
+
- Disable Throttle Warning
+
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ true
- -
-
-
-
- 0
- 0
-
-
-
-
- -
-
-
- Extended Limits
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Throttle Trim
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Throttle Source
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Center beep
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
+
-
+
Qt::Horizontal
@@ -165,18 +196,45 @@
- -
-
-
- Trim Increment
+
-
+
+
+ Qt::Horizontal
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Model Image
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+ 10
+
+
+
+
+
+ -
+
+
-
+
0
@@ -210,84 +268,32 @@
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
-
- 0
- 0
-
+
-
+
+
+ Qt::RightToLeft
- Switch startup Warning
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+ Extended Limits
- -
-
-
- -
-
-
-
-
-
-
- -
-
-
- Throttle2Trig
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 16777215
- 16777215
-
-
-
-
- -
-
-
-
- 0
- 0
-
+
-
+
+
+ Qt::RightToLeft
-
+ Extended Trims
- -
-
-
- Instant Trim
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
+
+
+ -
+
+
-
+
0
@@ -296,2742 +302,74 @@
- -
-
+
-
+
+
+ Qt::RightToLeft
+
-
+ Throttle Trim
- -
-
-
- Extended Trims
+
-
+
+
+ Qt::RightToLeft
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ Throttle Warning
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
- -
-
-
- Reverse Throttle Operation
-
-
-
- -
-
+
-
+
Reverse throttle operation.
If this is checked the throttle will be reversed. Idle will be forward, trim will also be reversed and the throttle warning will be reversed as well.
+
+ Qt::RightToLeft
+
-
+ Reverse Throttle
- -
-
+
-
+
- Qt::Vertical
-
-
- QSizePolicy::MinimumExpanding
+ Qt::Horizontal
- 20
- 0
+ 40
+ 20
- -
-
-
-
-
-
-
-
-
-
-
-
- Master
-
-
- -
-
- Slave
-
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- usec
-
-
- 100
-
-
- 800
-
-
- 50
-
-
- 300
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- PPM delay
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Pulse Shift (polarity)
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Trainer Mode
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- mSec
-
-
- 1
-
-
- 12.500000000000000
-
-
- 32.500000000000000
-
-
- 0.500000000000000
-
-
- 22.500000000000000
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
- Negative
-
-
- -
-
- Positive
-
-
-
-
- -
-
-
- PPM Frame Length
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- font-weight:bold;
-
-
- Master/Trainer Port
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 16
-
-
- 2
-
-
- 8
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 32
-
-
- 1
-
-
- 8
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Channels
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Start
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- PPM delay
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Polarity
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
- Negative
-
-
- -
-
- Positive
-
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- usec
-
-
- 100
-
-
- 800
-
-
- 50
-
-
- 300
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- PPM Frame Length
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- mSec
-
-
- 1
-
-
- 12.500000000000000
-
-
- 32.500000000000000
-
-
- 0.500000000000000
-
-
- 22.500000000000000
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- 1
-
-
- 125
-
-
- 1
-
-
- 1
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 5
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- DSM Type
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
- LP4/LP5
-
-
- -
-
- DSM2only
-
-
- -
-
- DSM2/DSMX
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- RX Number
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
-
- PPM
-
-
- -
-
- Silver A
-
-
- -
-
- Silver B
-
-
- -
-
- Silver C
-
-
- -
-
- Trac 09
-
-
-
-
- -
-
-
- font-weight: bold;
-
-
- RF Module 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Protocol
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::MinimumExpanding
-
-
-
- 20
- 0
-
-
-
-
- -
-
-
-
-
-
- Start
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 32
-
-
- 1
-
-
- 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Channels
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 16
-
-
- 2
-
-
- 8
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
- PPM delay
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- usec
-
-
- 100
-
-
- 800
-
-
- 50
-
-
- 300
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
- Negative
-
-
- -
-
- Positive
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Polarity
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- RX Number
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- 1
-
-
- 125
-
-
- 1
-
-
- 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- DSM Type
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
- LP4/LP5
-
-
- -
-
- DSM2only
-
-
- -
-
- DSM2/DSMX
-
-
-
-
- -
-
-
- font-weight:bold;
-
-
- RF Module 2
-
-
-
- -
-
-
- Qt::Vertical
-
-
- QSizePolicy::MinimumExpanding
-
-
-
- 20
- 0
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- PPM Frame Length
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- mSec
-
-
- 1
-
-
- 12.500000000000000
-
-
- 32.500000000000000
-
-
- 0.500000000000000
-
-
- 22.500000000000000
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 5
- 20
-
-
-
-
- -
-
-
-
-
- PPM
-
-
- -
-
- Silver A
-
-
- -
-
- Silver B
-
-
- -
-
- Silver C
-
-
- -
-
- Trac 09
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Protocol
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
-
-
- Start
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 32
-
-
- 1
-
-
- 1
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Channels
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- ch
-
-
- 1
-
-
- 16
-
-
- 2
-
-
- 8
-
-
-
-
-
-
-
-
-
-
- -
-
-
- Throttle Expo
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Model Name
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- Timer1
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
- 2
-
-
-
-
-
- true
-
-
- QDateTimeEdit::MinuteSection
-
-
- mm:ss
-
-
-
- -
-
-
-
-
- Count Down
-
-
- -
-
- Count Up
-
-
-
-
- -
-
-
- -
-
-
-
- 0
- 0
-
-
-
- TriggerB
-
-
-
- -
-
-
- -
-
-
- Persistent
-
-
-
- -
-
-
- (00:00:00)
-
-
-
- -
-
-
- MinuteBeep
-
-
-
- -
-
-
- CountDownBeep
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
- 2
-
-
-
-
-
- true
-
-
- QDateTimeEdit::MinuteSection
-
-
- mm:ss
-
-
-
- -
-
-
-
-
- Count Down
-
-
- -
-
- Count Up
-
-
-
-
- -
-
-
- -
-
-
-
- 0
- 0
-
-
-
- TriggerB
-
-
-
- -
-
-
- -
-
-
- Persistent
-
-
-
- -
-
-
- (00:00:00)
-
-
-
- -
-
-
- MinuteBeep
-
-
-
- -
-
-
- CountDownBeep
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
-
-
- -
-
-
-
-
-
-
- 0
- 0
-
-
-
- 10
-
-
-
- -
-
-
- Model Voice
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
-
-
- 260
-
-
- 511
-
-
- 1
-
-
- 260
-
-
-
- -
-
-
- Model Image
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 64
- 32
-
-
-
-
- 64
- 32
-
-
-
- QFrame::Panel
-
-
- QFrame::Raised
-
-
-
-
-
- true
-
-
-
- -
-
-
-
-
- -
-
-
- QLayout::SetMinimumSize
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 0
- 0
-
-
-
-
-
- ON
-
-
- -
-
- OFF
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- Check
-
-
- Qt::AlignCenter
-
-
-
-
-
-
-
-
- Failsafe
-
-
- -
-
-
- External module
-
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH12
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH01
-
-
-
- -
-
-
- CH04
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH10
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH02
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH11
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH03
-
-
-
- -
-
-
- CH09
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH05
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH06
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH07
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH08
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
- CH13
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH14
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH15
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH16
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- false
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
-
-
-
- Failsafe Mode
-
-
-
- -
-
-
-
-
- Hold
-
-
- -
-
- Custom
-
-
- -
-
- No Pulses
-
-
-
-
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 1
-
-
-
-
- -
-
-
- Internal Module
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
-
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH14
-
-
-
- -
-
-
- CH09
-
-
-
- -
-
-
- CH02
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH01
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH04
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH12
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH10
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH03
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH11
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH05
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH06
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- CH07
-
-
-
- -
-
-
- CH08
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH13
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH15
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- CH16
-
-
-
- -
-
-
- -100
-
-
- 100
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- true
-
-
- -100
-
-
- 100
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- -
-
-
-
-
-
- Failsafe Mode
-
-
-
- -
-
-
-
-
- Hold
-
-
- -
-
- Custom
-
-
- -
-
- No Pulses
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ -
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
diff --git a/companion/src/modeledit/setup_module.ui b/companion/src/modeledit/setup_module.ui
new file mode 100644
index 000000000..048c926e3
--- /dev/null
+++ b/companion/src/modeledit/setup_module.ui
@@ -0,0 +1,343 @@
+
+
+ Module
+
+
+
+ 0
+ 0
+ 562
+ 340
+
+
+
+ Form
+
+
+ -
+
+
+
+
+
+
-
+
+
+ Failsafe Mode
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ -
+
+
+ PPM delay
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ usec
+
+
+ 100
+
+
+ 800
+
+
+ 50
+
+
+ 300
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
-
+
+ Negative
+
+
+ -
+
+ Positive
+
+
+
+
+ -
+
+
+ RX Number
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
-
+
+ Master
+
+
+ -
+
+ Slave
+
+
+
+
+ -
+
+
+ Polarity
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Protocol
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ Trainer Mode
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ 1
+
+
+ 125
+
+
+ 1
+
+
+ 1
+
+
+
+ -
+
+
+ mSec
+
+
+ 1
+
+
+ 12.500000000000000
+
+
+ 32.500000000000000
+
+
+ 0.500000000000000
+
+
+ 22.500000000000000
+
+
+
+ -
+
+
+ PPM Frame Length
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ font-weight: bold;
+
+
+ Label
+
+
+
+ -
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ ch
+
+
+ 1
+
+
+ 16
+
+
+ 2
+
+
+ 8
+
+
+
+ -
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ ch
+
+
+ 1
+
+
+ 32
+
+
+ 1
+
+
+ 1
+
+
+
+ -
+
+
+ Start
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Channels
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
-
+
+ Hold
+
+
+ -
+
+ Custom
+
+
+ -
+
+ No Pulses
+
+
+
+
+ -
+
+
+ Failsafe Positions
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Sunken
+
+
+
-
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/companion/src/modeledit/setup_timer.ui b/companion/src/modeledit/setup_timer.ui
new file mode 100644
index 000000000..96ed9370f
--- /dev/null
+++ b/companion/src/modeledit/setup_timer.ui
@@ -0,0 +1,81 @@
+
+
+ Timer
+
+
+
+ 0
+ 0
+ 726
+ 54
+
+
+
+ Form
+
+
+
+ 0
+
+ -
+
+
+ true
+
+
+ QDateTimeEdit::MinuteSection
+
+
+ mm:ss
+
+
+
+ -
+
+
+ -
+
+
+ Persistent
+
+
+
+ -
+
+
+ (00:00:00)
+
+
+
+ -
+
+
+ MinuteBeep
+
+
+
+ -
+
+
+ CountDownBeep
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 255
+ 17
+
+
+
+
+
+
+
+
+
diff --git a/companion/src/xmlinterface.cpp b/companion/src/xmlinterface.cpp
index e7bd91683..b3514383d 100644
--- a/companion/src/xmlinterface.cpp
+++ b/companion/src/xmlinterface.cpp
@@ -91,8 +91,6 @@ void saveGeneralSettings(GeneralSettings & settings, global_settings & gs)
gs.warnings(warns);
gs.beeper(settings.beeperMode);
sticks stks(settings.stickMode);
- if (settings.throttleReversed)
- stks.throttle_reverse(true);
gs.sticks(stks);
gs.inactivity_timer(settings.inactivityTimer);
if (settings.minuteBeep || settings.preBeep || settings.flashBeep) {