diff --git a/companion/src/firmwares/er9x/er9xeeprom.cpp b/companion/src/firmwares/er9x/er9xeeprom.cpp index d889b2fa5..b78538f70 100644 --- a/companion/src/firmwares/er9x/er9xeeprom.cpp +++ b/companion/src/firmwares/er9x/er9xeeprom.cpp @@ -95,7 +95,6 @@ Er9xGeneral::operator GeneralSettings () result.view = std::min((uint8_t)4, view); result.disableThrottleWarning = disableThrottleWarning; - result.switchWarning = disableSwitchWarning ? 0 : -1; result.disableMemoryWarning = disableMemoryWarning; switch (beeperVal) { diff --git a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp index 6c57766de..647cdd8d0 100644 --- a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp +++ b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp @@ -120,7 +120,6 @@ Ersky9xGeneral::operator GeneralSettings () result.trainer = trainer; result.view = std::min((uint8_t)4, view); result.disableThrottleWarning = disableThrottleWarning; - result.switchWarning = disableSwitchWarning ? 0 : -1; result.disableMemoryWarning = disableMemoryWarning; switch (beeperVal) { diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index aef18d0be..5716f30b4 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -3673,7 +3673,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type internalField.Append(new UnsignedField<1>(this, generalData.imperial)); if (version >= 218) { internalField.Append(new BoolField<1>(this, generalData.jitterFilter)); - internalField.Append(new SpareBitsField<6>(this)); + internalField.Append(new BoolField<1>(this, generalData.disableRssiPoweroffAlarm)); + internalField.Append(new SpareBitsField<5>(this)); } else { internalField.Append(new SpareBitsField<7>(this)); diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index b050707c8..265bb5b2a 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -197,7 +197,7 @@ ui(new Ui::GeneralSetup) } int reCount = firmware->getCapability(RotaryEncoders); - if (reCount==0) { + if (reCount == 0) { ui->re_label->hide(); ui->re_CB->hide(); } @@ -210,8 +210,15 @@ ui(new Ui::GeneralSetup) ui->backlightautoSB->setValue(generalSettings.backlightDelay*5); ui->inactimerSB->setValue(generalSettings.inactivityTimer); - ui->memwarnChkB->setChecked(!generalSettings.disableMemoryWarning); //Default is zero=checked - ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning);//Default is zero=checked + ui->memwarnChkB->setChecked(!generalSettings.disableMemoryWarning); // Default is zero=checked + ui->alarmwarnChkB->setChecked(!generalSettings.disableAlarmWarning); // Default is zero=checked + + if (IS_ARM(firmware->getBoard())) { + ui->rssiPowerOffWarnChkB->setChecked(!generalSettings.disableRssiPoweroffAlarm); // Default is zero=checked + } + else { + ui->rssiPowerOffWarnChkB->hide(); + } if (IS_HORUS(firmware->getBoard())) { ui->splashScreenChkB->hide(); @@ -607,18 +614,24 @@ void GeneralSetupPanel::on_inactimerSB_editingFinished() emit modified(); } -void GeneralSetupPanel::on_memwarnChkB_stateChanged(int ) +void GeneralSetupPanel::on_memwarnChkB_stateChanged(int) { generalSettings.disableMemoryWarning = ui->memwarnChkB->isChecked() ? 0 : 1; emit modified(); } -void GeneralSetupPanel::on_alarmwarnChkB_stateChanged(int ) +void GeneralSetupPanel::on_alarmwarnChkB_stateChanged(int) { generalSettings.disableAlarmWarning = ui->alarmwarnChkB->isChecked() ? 0 : 1; emit modified(); } +void GeneralSetupPanel::on_rssiPowerOffWarnChkB_stateChanged(int) +{ + generalSettings.disableRssiPoweroffAlarm = ui->rssiPowerOffWarnChkB->isChecked() ? 0 : 1; + emit modified(); +} + void GeneralSetupPanel::on_beeperCB_currentIndexChanged(int index) { generalSettings.beeperMode = (GeneralSettings::BeeperMode)(index-2); diff --git a/companion/src/generaledit/generalsetup.h b/companion/src/generaledit/generalsetup.h index f45c31e9d..d4183cddf 100644 --- a/companion/src/generaledit/generalsetup.h +++ b/companion/src/generaledit/generalsetup.h @@ -40,6 +40,7 @@ class GeneralSetupPanel : public GeneralPanel void on_splashScreenChkB_stateChanged(int); void on_splashScreenDuration_currentIndexChanged(int index); void on_alarmwarnChkB_stateChanged(int); + void on_rssiPowerOffWarnChkB_stateChanged(int); void on_gpsFormatCB_currentIndexChanged(int index); void on_displayTypeCB_currentIndexChanged(int index); void on_BLBright_SB_editingFinished(); diff --git a/companion/src/generaledit/generalsetup.ui b/companion/src/generaledit/generalsetup.ui index d99744db3..8c8dc1b0f 100644 --- a/companion/src/generaledit/generalsetup.ui +++ b/companion/src/generaledit/generalsetup.ui @@ -6,8 +6,8 @@ 0 0 - 782 - 694 + 806 + 801 @@ -1121,7 +1121,7 @@ p, li { white-space: pre-wrap; } QLayout::SetDefaultConstraint - + @@ -1175,7 +1175,7 @@ Mode 4: - + @@ -1311,14 +1311,14 @@ Mode 4: - + Stick Mode - + @@ -1332,7 +1332,7 @@ Mode 4: - + @@ -1345,14 +1345,14 @@ Mode 4: - + GPS Coordinates - + @@ -1462,7 +1462,7 @@ p, li { white-space: pre-wrap; } - Low Memory Warning + Low EEPROM Warning @@ -1643,7 +1643,7 @@ p, li { white-space: pre-wrap; } - + @@ -1939,7 +1939,7 @@ Acceptable values are 5v..10v - + @@ -2024,6 +2024,20 @@ p, li { white-space: pre-wrap; } + + + + + hh° (N/S) mm' ss''.dd + + + + + NMEA + + + + @@ -2100,21 +2114,7 @@ p, li { white-space: pre-wrap; } - - - - - hh° (N/S) mm' ss''.dd - - - - - NMEA - - - - - + @@ -2127,14 +2127,14 @@ p, li { white-space: pre-wrap; } - + Measurement Units - + Qt::Vertical @@ -2185,6 +2185,47 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + + 0 + 22 + + + + + X-Short + + + + + Short + + + + + Normal + + + + + Long + + + + + X-Long + + + + @@ -2255,8 +2296,8 @@ p, li { white-space: pre-wrap; } - - + + 0 @@ -2266,34 +2307,47 @@ p, li { white-space: pre-wrap; } 0 - 22 + 0 - - - X-Short - - - - - Short - - - - - Normal - - - - - Long - - - - - X-Long - - + + RSSI Poweroff 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 + diff --git a/companion/src/radiodata.h b/companion/src/radiodata.h index c9fde2a68..a1e0d03e8 100644 --- a/companion/src/radiodata.h +++ b/companion/src/radiodata.h @@ -1168,11 +1168,10 @@ class GeneralSettings { unsigned int view; // main screen view // TODO enum bool disableThrottleWarning; bool fai; - int switchWarning; // -1=down, 0=off, 1=up bool disableMemoryWarning; BeeperMode beeperMode; bool disableAlarmWarning; - bool enableTelemetryAlarm; + bool disableRssiPoweroffAlarm; BeeperMode hapticMode; unsigned int stickMode; // TODO enum int timezone; diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 3bcee2b25..cc4dc8afe 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -894,7 +894,7 @@ PACK(struct TrainerData { NOBACKUP(uint8_t countryCode); \ NOBACKUP(uint8_t imperial:1); \ NOBACKUP(uint8_t jitterFilter:1); /* 0 - active */\ - NOBACKUP(uint8_t rssiPoweroffAlarm:1); \ + NOBACKUP(uint8_t disableRssiPoweroffAlarm:1); \ NOBACKUP(uint8_t spareExtraArm:5); \ NOBACKUP(char ttsLanguage[2]); \ NOBACKUP(int8_t beepVolume:4); \ diff --git a/radio/src/gui/128x64/radio_setup.cpp b/radio/src/gui/128x64/radio_setup.cpp index c7d37a32b..d4c56c49a 100644 --- a/radio/src/gui/128x64/radio_setup.cpp +++ b/radio/src/gui/128x64/radio_setup.cpp @@ -383,7 +383,7 @@ void menuRadioSetup(event_t event) case ITEM_SETUP_ALARM_WARNING: { - uint8_t b = 1-g_eeGeneral.disableAlarmWarning; + uint8_t b = 1 - g_eeGeneral.disableAlarmWarning; g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event); break; } @@ -391,7 +391,8 @@ void menuRadioSetup(event_t event) #if defined(CPUARM) case ITEM_SETUP_RSSI_POWEROFF_ALARM: { - g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event); + uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm; + g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event); break; } #endif diff --git a/radio/src/gui/212x64/radio_setup.cpp b/radio/src/gui/212x64/radio_setup.cpp index 01d9a7661..1172b1652 100644 --- a/radio/src/gui/212x64/radio_setup.cpp +++ b/radio/src/gui/212x64/radio_setup.cpp @@ -332,21 +332,22 @@ void menuRadioSetup(event_t event) case ITEM_SETUP_MEMORY_WARNING: { - uint8_t b = 1-g_eeGeneral.disableMemoryWarning; + uint8_t b = 1 - g_eeGeneral.disableMemoryWarning; g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_MEMORYWARNING, attr, event); break; } case ITEM_SETUP_ALARM_WARNING: { - uint8_t b = 1-g_eeGeneral.disableAlarmWarning; + uint8_t b = 1 - g_eeGeneral.disableAlarmWarning; g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_ALARMWARNING, attr, event); break; } case ITEM_SETUP_RSSI_POWEROFF_ALARM: { - g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event); + uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm; + g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, STR_RSSISHUTDOWNALARM, attr, event); break; } diff --git a/radio/src/gui/480x272/radio_setup.cpp b/radio/src/gui/480x272/radio_setup.cpp index 25aa6222e..5afa8c8f5 100644 --- a/radio/src/gui/480x272/radio_setup.cpp +++ b/radio/src/gui/480x272/radio_setup.cpp @@ -331,20 +331,10 @@ bool menuRadioSetup(event_t event) if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V break; -#if 0 - case ITEM_SETUP_MEMORY_WARNING: - { - lcdDrawText(MENUS_MARGIN_LEFT, y, STR_MEMORYWARNING); - uint8_t b = 1-g_eeGeneral.disableMemoryWarning; - g_eeGeneral.disableMemoryWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event); - break; - } -#endif - case ITEM_SETUP_ALARM_WARNING: { lcdDrawText(MENUS_MARGIN_LEFT, y, STR_ALARMWARNING); - uint8_t b = 1-g_eeGeneral.disableAlarmWarning; + uint8_t b = 1 - g_eeGeneral.disableAlarmWarning; g_eeGeneral.disableAlarmWarning = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event); break; } @@ -352,7 +342,8 @@ bool menuRadioSetup(event_t event) case ITEM_SETUP_RSSI_POWEROFF_ALARM: { lcdDrawText(MENUS_MARGIN_LEFT, y, STR_RSSISHUTDOWNALARM); - g_eeGeneral.rssiPoweroffAlarm = editCheckBox(g_eeGeneral.rssiPoweroffAlarm, RADIO_SETUP_2ND_COLUMN, y, attr, event); + uint8_t b = 1 - g_eeGeneral.disableRssiPoweroffAlarm; + g_eeGeneral.disableRssiPoweroffAlarm = 1 - editCheckBox(b, RADIO_SETUP_2ND_COLUMN, y, attr, event); break; } diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 9a1bba73a..dc7bbff98 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2763,7 +2763,7 @@ uint32_t pwrCheck() } else if (pwr_press_time == 0) { pwr_press_time = get_tmr10ms(); - if (message && g_eeGeneral.rssiPoweroffAlarm) { + if (message && !g_eeGeneral.disableRssiPoweroffAlarm) { audioEvent(AU_MODEL_STILL_POWERED); } } @@ -2792,7 +2792,7 @@ uint32_t pwrCheck() } } #else - while ((TELEMETRY_STREAMING() && g_eeGeneral.rssiPoweroffAlarm)) { + while ((TELEMETRY_STREAMING() && !g_eeGeneral.disableRssiPoweroffAlarm)) { lcdRefreshWait(); lcdClear(); POPUP_CONFIRMATION("Confirm Shutdown"); @@ -2846,7 +2846,7 @@ uint32_t pwrCheck() } #endif - if (g_eeGeneral.rssiPoweroffAlarm) { + if (!g_eeGeneral.disableRssiPoweroffAlarm) { if (TELEMETRY_STREAMING()) { RAISE_ALERT(STR_MODEL, STR_MODEL_STILL_POWERED, STR_PRESS_ENTER_TO_CONFIRM, AU_MODEL_STILL_POWERED); while (TELEMETRY_STREAMING()) {