From 539f722e9b29b4abd0a0f2d276363d5de2abf40c Mon Sep 17 00:00:00 2001 From: Neil Horne <15316949+elecpower@users.noreply.github.com> Date: Sat, 7 Feb 2026 11:37:11 +1100 Subject: [PATCH] chore(cpn): remove redundant macro and unused fields (#7071) --- companion/src/firmwares/boards.cpp | 5 - companion/src/firmwares/boards.h | 5 - .../src/firmwares/customfunctiondata.cpp | 3 - companion/src/firmwares/generalsettings.h | 2 - companion/src/firmwares/modeldata.cpp | 5 +- companion/src/firmwares/moduledata.cpp | 326 ++- .../src/firmwares/opentx/opentxinterface.cpp | 5 +- companion/src/firmwares/rawsource.cpp | 2 +- companion/src/firmwares/rawswitch.cpp | 27 +- companion/src/generaledit/generalsetup.cpp | 100 +- companion/src/generaledit/generalsetup.h | 2 - companion/src/generaledit/generalsetup.ui | 1842 ++++++----------- companion/src/modeledit/channels.cpp | 23 +- companion/src/modeledit/flightmodes.cpp | 6 +- companion/src/modeledit/setup.cpp | 17 +- companion/src/modeledit/setup_module.cpp | 24 +- companion/src/modeledit/telemetry.cpp | 8 +- companion/src/print/modelprinter.cpp | 12 +- companion/src/print/multimodelprinter.cpp | 36 +- 19 files changed, 859 insertions(+), 1591 deletions(-) diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index d92200be2..0ddc33ff8 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -1181,9 +1181,4 @@ bool Boards::isSurface(Board::Type board) void Boards::tests() { qDebug() << "**** Board checks ****"; - for (int i = 0; i < BOARD_TYPE_COUNT; i++) { - if (!IS_HORUS_OR_TARANIS((Type)i)) - qDebug() << "Not member of" << "IS_HORUS_OR_TARANIS" << getBoardName((Type)i); - } - qDebug() << "**** Board checks ****"; } diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index 64ae51a74..60f56d53f 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -816,11 +816,6 @@ inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board) IS_FLYSKY_PA01(board)/*generally*/ || IS_FLYSKY_NB4P(board)/*generally*/; } -inline bool IS_HORUS_OR_TARANIS(Board::Type board) -{ - return IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board); -} - inline bool IS_STM32(Board::Type board) { return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) || diff --git a/companion/src/firmwares/customfunctiondata.cpp b/companion/src/firmwares/customfunctiondata.cpp index ca7c57634..68ce9f1d5 100644 --- a/companion/src/firmwares/customfunctiondata.cpp +++ b/companion/src/firmwares/customfunctiondata.cpp @@ -245,15 +245,12 @@ bool CustomFunctionData::isFuncAvailable(const int index, const ModelData * mode Firmware * fw = getCurrentFirmware(); bool ret = (((index >= FuncOverrideCH1 && index <= FuncOverrideCHLast) && !fw->getCapability(SafetyChannelCustomFunction)) || - ((index == FuncPlayScript && !IS_HORUS_OR_TARANIS(fw->getBoard()))) || ((index == FuncPlayHaptic) && !fw->getCapability(Haptic)) || ((index >= FuncSetTimer1 && index <= FuncSetTimerLast) && (index > FuncSetTimer1 + fw->getCapability(Timers) || (model ? model->timers[index - FuncSetTimer1].isModeOff() : false))) || - ((index == FuncScreenshot) && !IS_HORUS_OR_TARANIS(fw->getBoard())) || ((index >= FuncRangeCheckInternalModule && index <= FuncBindExternalModule) && !fw->getCapability(DangerousFunctions)) || ((index >= FuncAdjustGV1 && index <= FuncAdjustGVLast) && ((index - FuncAdjustGV1) >= fw->getCapability(Gvars))) || - ((index == FuncDisableTouch) && !IS_HORUS_OR_TARANIS(fw->getBoard())) || ((index == FuncDisableAudioAmp && !Boards::getCapability(fw->getBoard(), Board::HasAudioMuteGPIO))) || ((index == FuncRGBLed && !(Boards::getCapability(fw->getBoard(), Board::HasBlingLEDS) || Boards::getCapability(fw->getBoard(), Board::FunctionSwitchColors)))) || ((index == FuncLCDtoVideo && !IS_FATFISH_F16(fw->getBoard()))) || diff --git a/companion/src/firmwares/generalsettings.h b/companion/src/firmwares/generalsettings.h index bc65cb156..aba4d54ef 100644 --- a/companion/src/firmwares/generalsettings.h +++ b/companion/src/firmwares/generalsettings.h @@ -337,7 +337,6 @@ class GeneralSettings { int PPM_Multiplier; int hapticLength; unsigned int reNavigation; - unsigned int stickReverse; unsigned int speakerPitch; int hapticStrength; char ownerName[OWNER_NAME_LEN + 1]; @@ -373,7 +372,6 @@ class GeneralSettings { int varioRepeat; int backgroundVolume; unsigned int mavbaud; - unsigned int switchUnlockStates; unsigned int serialPort[SP_COUNT]; bool serialPower[SP_COUNT]; int antennaMode; diff --git a/companion/src/firmwares/modeldata.cpp b/companion/src/firmwares/modeldata.cpp index 94cf79696..cdf548a26 100644 --- a/companion/src/firmwares/modeldata.cpp +++ b/companion/src/firmwares/modeldata.cpp @@ -531,10 +531,7 @@ ModelData ModelData::removeGlobalVars() int ModelData::getChannelsMax(bool forceExtendedLimits) const { - if (forceExtendedLimits || extendedLimits) - return IS_HORUS_OR_TARANIS(getCurrentBoard()) ? 150 : 125; - else - return 100; + return (forceExtendedLimits || extendedLimits) ? 150 : 100; } bool ModelData::isFunctionSwitchPositionAvailable(int swIndex, int swPos, const GeneralSettings * const gs) const diff --git a/companion/src/firmwares/moduledata.cpp b/companion/src/firmwares/moduledata.cpp index d8fcf3589..cbadecfca 100644 --- a/companion/src/firmwares/moduledata.cpp +++ b/companion/src/firmwares/moduledata.cpp @@ -85,90 +85,74 @@ bool ModuleData::isAvailable(PulsesProtocol proto, int port) QString id = fw->getId(); - if (IS_HORUS_OR_TARANIS(board)) { - switch (port) { - case 0: - switch (proto) { - case PULSES_OFF: - return true; - case PULSES_PXX_XJT_X16: - case PULSES_PXX_XJT_LR12: - return !IS_ACCESS_RADIO(board, id) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_EL18(board) && !IS_FLYSKY_PL18(board) && !IS_FLYSKY_ST16(board); - case PULSES_PXX_XJT_D8: - return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_EL18(board) && !IS_FLYSKY_PL18(board) && !IS_FLYSKY_ST16(board); - case PULSES_ACCESS_ISRM: - case PULSES_ACCST_ISRM_D16: - return IS_ACCESS_RADIO(board, id); - case PULSES_MULTIMODULE: - return fw->getCapability(HasIntModuleMulti); - case PULSES_CROSSFIRE: - return fw->getCapability(HasIntModuleCRSF) || fw->getCapability(HasIntModuleELRS); - case PULSES_FLYSKY_AFHDS2A: - return IS_FLYSKY_NV14(board); - case PULSES_FLYSKY_AFHDS3: - return (IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board)); - default: - return false; - } + switch (port) { + case 0: + switch (proto) { + case PULSES_OFF: + return true; + case PULSES_PXX_XJT_X16: + case PULSES_PXX_XJT_LR12: + return !IS_ACCESS_RADIO(board, id) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_EL18(board) && !IS_FLYSKY_PL18(board) && !IS_FLYSKY_ST16(board); + case PULSES_PXX_XJT_D8: + return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_EL18(board) && !IS_FLYSKY_PL18(board) && !IS_FLYSKY_ST16(board); + case PULSES_ACCESS_ISRM: + case PULSES_ACCST_ISRM_D16: + return IS_ACCESS_RADIO(board, id); + case PULSES_MULTIMODULE: + return fw->getCapability(HasIntModuleMulti); + case PULSES_CROSSFIRE: + return fw->getCapability(HasIntModuleCRSF) || fw->getCapability(HasIntModuleELRS); + case PULSES_FLYSKY_AFHDS2A: + return IS_FLYSKY_NV14(board); + case PULSES_FLYSKY_AFHDS3: + return (IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board)); + default: + return false; + } - case 1: - switch (proto) { - case PULSES_OFF: - case PULSES_PPM: - return true; - case PULSES_PXX_XJT_X16: - case PULSES_PXX_XJT_D8: - case PULSES_PXX_XJT_LR12: - return !(IS_TARANIS_XLITES(board) || IS_TARANIS_X9LITE(board)); - case PULSES_PXX_R9M: - case PULSES_LP45: - case PULSES_DSM2: - case PULSES_DSMX: - case PULSES_SBUS: - case PULSES_MULTIMODULE: - case PULSES_CROSSFIRE: - case PULSES_FLYSKY_AFHDS2A: - case PULSES_FLYSKY_AFHDS3: - case PULSES_GHOST: - return true; - case PULSES_ACCESS_R9M: - return IS_ACCESS_RADIO(board, id) || (IS_FAMILY_HORUS_OR_T16(board) && id.contains("externalaccessmod")); - case PULSES_PXX_R9M_LITE: - case PULSES_ACCESS_R9M_LITE: - case PULSES_ACCESS_R9M_LITE_PRO: - case PULSES_XJT_LITE_X16: - case PULSES_XJT_LITE_D8: - case PULSES_XJT_LITE_LR12: - return (IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_RADIOMASTER_ZORRO(board)); - default: - return false; - } + case 1: + switch (proto) { + case PULSES_OFF: + case PULSES_PPM: + return true; + case PULSES_PXX_XJT_X16: + case PULSES_PXX_XJT_D8: + case PULSES_PXX_XJT_LR12: + return !(IS_TARANIS_XLITES(board) || IS_TARANIS_X9LITE(board)); + case PULSES_PXX_R9M: + case PULSES_LP45: + case PULSES_DSM2: + case PULSES_DSMX: + case PULSES_SBUS: + case PULSES_MULTIMODULE: + case PULSES_CROSSFIRE: + case PULSES_FLYSKY_AFHDS2A: + case PULSES_FLYSKY_AFHDS3: + case PULSES_GHOST: + return true; + case PULSES_ACCESS_R9M: + return IS_ACCESS_RADIO(board, id) || (IS_FAMILY_HORUS_OR_T16(board) && id.contains("externalaccessmod")); + case PULSES_PXX_R9M_LITE: + case PULSES_ACCESS_R9M_LITE: + case PULSES_ACCESS_R9M_LITE_PRO: + case PULSES_XJT_LITE_X16: + case PULSES_XJT_LITE_D8: + case PULSES_XJT_LITE_LR12: + return (IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_RADIOMASTER_ZORRO(board)); + default: + return false; + } - case -1: - switch (proto) { - case PULSES_PPM: - return true; - default: - return false; - } + case -1: + switch (proto) { + case PULSES_PPM: + return true; + default: + return false; + } - default: - return false; - } - } - else { - switch (proto) { - case PULSES_PPM: - case PULSES_DSMX: - case PULSES_LP45: - case PULSES_DSM2: - // case PULSES_PXX_DJT: // Unavailable for now - case PULSES_PPM16: - case PULSES_PPMSIM: - return true; - default: - return false; - } + default: + return false; } return false; // to avoid compiler warning @@ -273,12 +257,9 @@ QString ModuleData::indexToString(int index, Firmware * fw) if (index < 0) return tr("Trainer Port"); - if (fw->getCapability(NumModules) > 1) { - if (IS_HORUS_OR_TARANIS(fw->getBoard())) - return index == 0 ? tr("Internal Radio System") : tr("External Radio Module"); - if (index > 0) - return tr("Extra Radio System"); - } + if (fw->getCapability(NumModules) > 1) + return index == 0 ? tr("Internal Radio System") : tr("External Radio Module"); + return tr("Radio System"); } @@ -519,107 +500,88 @@ bool ModuleData::isProtocolAvailable(int moduleidx, unsigned int protocol, Gener if (protocol == PULSES_OFF) return true; - Firmware *fw = getCurrentFirmware(); - Board::Type board = fw->getBoard(); - if (moduleidx == 0) return (int)generalSettings.internalModule == getTypeFromProtocol(protocol); - if (IS_HORUS_OR_TARANIS(board)) { - switch (moduleidx) { - case 1: { - const int moduleSize = g.currentProfile().externalModuleSize(); - const int moduleType = getTypeFromProtocol(protocol); + switch (moduleidx) { + case 1: { + const int moduleSize = g.currentProfile().externalModuleSize(); + const int moduleType = getTypeFromProtocol(protocol); - switch(moduleSize) { - case Board::EXTMODSIZE_NONE: - return false; - case Board::EXTMODSIZE_BOTH: - switch (moduleType) { - case MODULE_TYPE_XJT_PXX1: - case MODULE_TYPE_ISRM_PXX2: - case MODULE_TYPE_R9M_PXX1: - case MODULE_TYPE_R9M_PXX2: - case MODULE_TYPE_DSM2: - case MODULE_TYPE_CROSSFIRE: - case MODULE_TYPE_MULTIMODULE: - case MODULE_TYPE_GHOST: - case MODULE_TYPE_FLYSKY_AFHDS2A: - case MODULE_TYPE_FLYSKY_AFHDS3: - case MODULE_TYPE_LEMON_DSMP: - case MODULE_TYPE_R9M_LITE_PXX1: - case MODULE_TYPE_R9M_LITE_PXX2: - case MODULE_TYPE_R9M_LITE_PRO_PXX2: - case MODULE_TYPE_XJT_LITE_PXX2: - case MODULE_TYPE_PPM: - case MODULE_TYPE_SBUS: - return true; - default: - return false; - } - case Board::EXTMODSIZE_STD: - switch (moduleType) { - case MODULE_TYPE_XJT_PXX1: - case MODULE_TYPE_ISRM_PXX2: - case MODULE_TYPE_R9M_PXX1: - case MODULE_TYPE_R9M_PXX2: - case MODULE_TYPE_DSM2: - case MODULE_TYPE_CROSSFIRE: - case MODULE_TYPE_MULTIMODULE: - case MODULE_TYPE_GHOST: - case MODULE_TYPE_FLYSKY_AFHDS2A: - case MODULE_TYPE_FLYSKY_AFHDS3: - case MODULE_TYPE_LEMON_DSMP: - case MODULE_TYPE_PPM: - case MODULE_TYPE_SBUS: - return true; - default: - return false; - } - case Board::EXTMODSIZE_SMALL: - switch (moduleType) { - case MODULE_TYPE_R9M_LITE_PXX1: - case MODULE_TYPE_R9M_LITE_PXX2: - case MODULE_TYPE_R9M_LITE_PRO_PXX2: - case MODULE_TYPE_XJT_LITE_PXX2: - case MODULE_TYPE_CROSSFIRE: - case MODULE_TYPE_MULTIMODULE: - case MODULE_TYPE_GHOST: - case MODULE_TYPE_PPM: - case MODULE_TYPE_SBUS: - return true; - default: - return false; - } - default: - return false; - } + switch(moduleSize) { + case Board::EXTMODSIZE_NONE: + return false; + case Board::EXTMODSIZE_BOTH: + switch (moduleType) { + case MODULE_TYPE_XJT_PXX1: + case MODULE_TYPE_ISRM_PXX2: + case MODULE_TYPE_R9M_PXX1: + case MODULE_TYPE_R9M_PXX2: + case MODULE_TYPE_DSM2: + case MODULE_TYPE_CROSSFIRE: + case MODULE_TYPE_MULTIMODULE: + case MODULE_TYPE_GHOST: + case MODULE_TYPE_FLYSKY_AFHDS2A: + case MODULE_TYPE_FLYSKY_AFHDS3: + case MODULE_TYPE_LEMON_DSMP: + case MODULE_TYPE_R9M_LITE_PXX1: + case MODULE_TYPE_R9M_LITE_PXX2: + case MODULE_TYPE_R9M_LITE_PRO_PXX2: + case MODULE_TYPE_XJT_LITE_PXX2: + case MODULE_TYPE_PPM: + case MODULE_TYPE_SBUS: + return true; + default: + return false; + } + case Board::EXTMODSIZE_STD: + switch (moduleType) { + case MODULE_TYPE_XJT_PXX1: + case MODULE_TYPE_ISRM_PXX2: + case MODULE_TYPE_R9M_PXX1: + case MODULE_TYPE_R9M_PXX2: + case MODULE_TYPE_DSM2: + case MODULE_TYPE_CROSSFIRE: + case MODULE_TYPE_MULTIMODULE: + case MODULE_TYPE_GHOST: + case MODULE_TYPE_FLYSKY_AFHDS2A: + case MODULE_TYPE_FLYSKY_AFHDS3: + case MODULE_TYPE_LEMON_DSMP: + case MODULE_TYPE_PPM: + case MODULE_TYPE_SBUS: + return true; + default: + return false; + } + case Board::EXTMODSIZE_SMALL: + switch (moduleType) { + case MODULE_TYPE_R9M_LITE_PXX1: + case MODULE_TYPE_R9M_LITE_PXX2: + case MODULE_TYPE_R9M_LITE_PRO_PXX2: + case MODULE_TYPE_XJT_LITE_PXX2: + case MODULE_TYPE_CROSSFIRE: + case MODULE_TYPE_MULTIMODULE: + case MODULE_TYPE_GHOST: + case MODULE_TYPE_PPM: + case MODULE_TYPE_SBUS: + return true; + default: + return false; + } + default: + return false; + } + } + case -1: + switch (protocol) { + case PULSES_PPM: + return true; + default: + return false; } - case -1: - switch (protocol) { - case PULSES_PPM: - return true; - default: - return false; - } - default: - return false; - } - } - else { - switch (protocol) { - case PULSES_PPM: - case PULSES_DSMX: - case PULSES_LP45: - case PULSES_DSM2: - // case PULSES_PXX_DJT: // Unavailable for now - case PULSES_PPM16: - case PULSES_PPMSIM: - return true; - default: - return false; - } + default: + return false; } return false; // to avoid compiler warning diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index e7313ade8..513767455 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -234,10 +234,7 @@ QString OpenTxFirmware::getCapabilityStr(::Capability capability) QTime OpenTxFirmware::getMaxTimerStart() { - if (IS_HORUS_OR_TARANIS(board)) - return QTime(23, 59, 59); - else - return QTime(8, 59, 59); + return QTime(23, 59, 59); } template diff --git a/companion/src/firmwares/rawsource.cpp b/companion/src/firmwares/rawsource.cpp index 34fd9ae96..3b6d087eb 100644 --- a/companion/src/firmwares/rawsource.cpp +++ b/companion/src/firmwares/rawsource.cpp @@ -416,7 +416,7 @@ bool RawSource::isAvailable(const ModelData * const model, return false; } - if (type == SOURCE_TYPE_SWITCH && !b.isSwitchFunc(abs(index) - 1, board) && IS_HORUS_OR_TARANIS(board) && + if (type == SOURCE_TYPE_SWITCH && !b.isSwitchFunc(abs(index) - 1, board) && !gs->switchSourceAllowed(abs(index) - 1)) return false; } diff --git a/companion/src/firmwares/rawswitch.cpp b/companion/src/firmwares/rawswitch.cpp index 196048626..57d486cf9 100644 --- a/companion/src/firmwares/rawswitch.cpp +++ b/companion/src/firmwares/rawswitch.cpp @@ -87,26 +87,21 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen div_t qr; switch(type) { case SWITCH_TYPE_SWITCH: - if (IS_HORUS_OR_TARANIS(board)) { - qr = div(index - 1, 3); - swName = Boards::getSwitchInfo(qr.quot, board).name.c_str(); - if (Boards::isSwitchFunc(qr.quot, board)) { - if (modelData) { - int fsindex = Boards::getSwitchTagNum(qr.quot, board) - 1; - custName = QString(modelData->customSwitches[fsindex].name).trimmed(); - } + qr = div(index - 1, 3); + swName = Boards::getSwitchInfo(qr.quot, board).name.c_str(); + if (Boards::isSwitchFunc(qr.quot, board)) { + if (modelData) { + int fsindex = Boards::getSwitchTagNum(qr.quot, board) - 1; + custName = QString(modelData->customSwitches[fsindex].name).trimmed(); } - else { - if (generalSettings) { - custName = QString(generalSettings->switchConfig[qr.quot].name).trimmed(); - } - } - return DataHelpers::getCompositeName(swName, custName, prefixCustomName) + - directionIndicators.at(qr.rem > -1 && qr.rem < directionIndicators.size() ? qr.rem : 1); } else { - return CHECK_IN_ARRAY(switches9X, index - 1); + if (generalSettings) { + custName = QString(generalSettings->switchConfig[qr.quot].name).trimmed(); + } } + return DataHelpers::getCompositeName(swName, custName, prefixCustomName) + + directionIndicators.at(qr.rem > -1 && qr.rem < directionIndicators.size() ? qr.rem : 1); case SWITCH_TYPE_VIRTUAL: if (modelData) diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index 4e5fe02dc..5355206bf 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -51,48 +51,6 @@ ui(new Ui::GeneralSetup) panelFilteredModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_ControlSource)), FIM_CONTROLSRC); - QLabel *pmsl[] = {ui->ro_label, ui->ro1_label, ui->ro2_label, ui->ro3_label, ui->ro4_label, ui->ro5_label, ui->ro6_label, ui->ro7_label, ui->ro8_label, NULL}; - QSlider *tpmsld[] = {ui->chkSA, ui->chkSB, ui->chkSC, ui->chkSD, ui->chkSE, ui->chkSF, ui->chkSG, ui->chkSH, NULL}; - - if (IS_TARANIS(board)) { - if (firmware->getId().contains("readonly")) { - uint16_t switchstate = generalSettings.switchUnlockStates; - ui->chkSA->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSB->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSC->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSD->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSE->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSF->setValue((switchstate & 0x3) / 2); - switchstate >>= 2; - ui->chkSG->setValue(switchstate & 0x3); - switchstate >>= 2; - ui->chkSH->setValue(switchstate & 0x3); - } - else { - for (int i = 0; pmsl[i]; i++) { - pmsl[i]->hide(); - } - for (int i = 0; tpmsld[i]; i++) { - tpmsld[i]->hide(); - } - this->layout()->removeItem(ui->TaranisReadOnlyUnlock); - } - } - else { - for (int i = 0; pmsl[i]; i++) { - pmsl[i]->hide(); - } - for (int i = 0; tpmsld[i]; i++) { - tpmsld[i]->hide(); - } - this->layout()->removeItem(ui->TaranisReadOnlyUnlock); - } - lock = true; ui->volumeCtrl_CB->setSizeAdjustPolicy(QComboBox::AdjustToContents); @@ -135,13 +93,7 @@ ui(new Ui::GeneralSetup) ui->ppm_units_CB->setCurrentIndex(generalSettings.ppmunit); ui->gpsFormatCB->setCurrentIndex(generalSettings.gpsFormat); ui->timezoneLE->setTime((generalSettings.timezone * 3600) + (generalSettings.timezoneMinutes/*quarter hours*/ * 15 * 60)); - - if (IS_HORUS_OR_TARANIS(board)) { - ui->adjustRTC->setChecked(generalSettings.adjustRTC); - } - else { - ui->adjustRTC->hide(); - } + ui->adjustRTC->setChecked(generalSettings.adjustRTC); if (IS_STM32(board)) { ui->usbModeCB->setCurrentIndex(generalSettings.usbMode); @@ -235,28 +187,6 @@ ui(new Ui::GeneralSetup) lock = false; - for (int i = 0; tpmsld[i]; i++) { - connect(tpmsld[i], SIGNAL(valueChanged(int)),this,SLOT(unlockSwitchEdited())); - } - - if (!IS_HORUS_OR_TARANIS(board)) { - ui->stickReverse1->setChecked(generalSettings.stickReverse & (1 << 0)); - ui->stickReverse2->setChecked(generalSettings.stickReverse & (1 << 1)); - ui->stickReverse3->setChecked(generalSettings.stickReverse & (1 << 2)); - ui->stickReverse4->setChecked(generalSettings.stickReverse & (1 << 3)); - connect(ui->stickReverse1, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); - connect(ui->stickReverse2, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); - connect(ui->stickReverse3, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); - connect(ui->stickReverse4, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); - } - else { - ui->stickReverseLB->hide(); - ui->stickReverse1->hide(); - ui->stickReverse2->hide(); - ui->stickReverse3->hide(); - ui->stickReverse4->hide(); - } - if (Boards::getCapability(board, Board::HasBacklightColor)) { ui->backlightColor_SL->setValue(generalSettings.backlightColor); } @@ -954,23 +884,6 @@ void GeneralSetupPanel::on_stickmodeCB_currentIndexChanged(int index) } } -void GeneralSetupPanel::unlockSwitchEdited() -{ - if (!lock) { - int i = 0; - i |= (((uint16_t)ui->chkSA->value())); - i |= (((uint16_t)ui->chkSB->value()) << 2); - i |= (((uint16_t)ui->chkSC->value()) << 4); - i |= (((uint16_t)ui->chkSD->value()) << 6); - i |= (((uint16_t)ui->chkSE->value()) << 8); - i |= (((uint16_t)ui->chkSF->value()) << 10); - i |= (((uint16_t)ui->chkSG->value()) << 12); - i |= (((uint16_t)ui->chkSH->value()) << 14); - generalSettings.switchUnlockStates=i; - emit modified(); - } -} - void GeneralSetupPanel::on_blAlarm_ChkB_stateChanged() { if (!lock) { @@ -987,17 +900,6 @@ void GeneralSetupPanel::on_registrationId_editingFinished() } } -void GeneralSetupPanel::stickReverseEdited() -{ - if (!lock) { - generalSettings.stickReverse = ((int)ui->stickReverse1->isChecked()) | - ((int)ui->stickReverse2->isChecked() << 1) | - ((int)ui->stickReverse3->isChecked() << 2) | - ((int)ui->stickReverse4->isChecked() << 3); - emit modified(); - } -} - void GeneralSetupPanel::on_modelQuickSelect_CB_stateChanged(int) { if (!lock) { diff --git a/companion/src/generaledit/generalsetup.h b/companion/src/generaledit/generalsetup.h index 8ccac7c24..4570e1eb0 100644 --- a/companion/src/generaledit/generalsetup.h +++ b/companion/src/generaledit/generalsetup.h @@ -67,10 +67,8 @@ class GeneralSetupPanel : public GeneralPanel void on_mavbaud_CB_currentIndexChanged(int index); void on_voiceLang_CB_currentIndexChanged(int index); void on_textLang_CB_currentIndexChanged(int index); - void stickReverseEdited(); void on_switchesDelay_valueChanged(int); void on_blAlarm_ChkB_stateChanged(); - void unlockSwitchEdited(); void on_beepVolume_SL_valueChanged(); void on_bgVolume_SL_valueChanged(); void on_varioVolume_SL_valueChanged(); diff --git a/companion/src/generaledit/generalsetup.ui b/companion/src/generaledit/generalsetup.ui index 34e31839e..62153da95 100644 --- a/companion/src/generaledit/generalsetup.ui +++ b/companion/src/generaledit/generalsetup.ui @@ -7,1187 +7,25 @@ 0 0 878 - 1231 + 951 Form - - - - Readonly Unlock + + + + Qt::Orientation::Vertical - - - - - - QLayout::SizeConstraint::SetDefaultConstraint + + + 40 + 20 + - - 0 - - - 0 - - - - - - 0 - 0 - - - - SC - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - SE - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 1 - - - 1 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 2 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - SA - - - - - - - - 0 - 0 - - - - SF - - - - - - - - 0 - 0 - - - - SH - - - - - - - - 0 - 0 - - - - SD - - - - - - - - 0 - 0 - - - - SB - - - - - - - - 0 - 0 - - - - - 0 - 50 - - - - - 16777215 - 50 - - - - 0 - - - 1 - - - 1 - - - 1 - - - 0 - - - true - - - QSlider::TickPosition::NoTicks - - - 1 - - - - - - - - 0 - 0 - - - - SG - - - - - - - Qt::Orientation::Vertical - - - - 40 - 0 - - - - - - - - - - - - - Large image (2 columns) - - - - - Small image (3 columns) - - - - - Name only (2 columns) - - - - - Name only (1 column) - - - - - - - - - - - - - - - - - 1 - - - - - - - 2 - - - - - - - 3 - - - - - - - 4 - - - - - - - - - Speaker Volume - - - - - - - Hz - - - 300 - - - 1100 - - - 10 - - - 700 - - - - - - - Enable this to quickly change model on the model select page (a long press can then be used to open the model edit menu). - - - - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - - - Vario volume - - - - - - - 8 - - - - - - - - - - Vario repeat at zero - - - - - - - ms - - - 200 - - - 1000 - - - 10 - - - 500 - - - - - - - Voice Language - - - - - - - Text Language - - - - - - - Favorites matching - - - - - - - - - - - - Automatically adjust the radio's clock if a GPS is connected to telemetry. - - - Qt::LayoutDirection::LeftToRight - - - Adjust RTC - - - - - - - - - Backlight Brightness - - - - - - - 100 - - - - - - - - - - - - - This is the switch selectrion for turning on the backlight (if installed). - - - - - -1 - - - - - - - Backlight Switch - - - - - - - Beep volume - - - - - - - Model quick select - - - - - - - Label matching - - - - - - - - - - - - - - Backlight flash on alarm - - - - - - - Label selection mode - - - - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - - - - - - Color 1 - - - - - - - 20 - - - 5 - - - - - - - Color 2 - - - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - - - - - - Speaker Pitch (spkr only) - - - - - - - Manage Models layout - - - - - - - Country Code - - - - - - - Rotary Encoder Mode - - - - - - - - - - - 0 - 0 - - - - Stick reverse - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - - - - Must match - - - - - Optional match - - - - - - - - Vario pitch at max - - - - - - - Wav volume - - - - - - - Vario pitch at zero - - - - - - - - - - Backlight Auto OFF after - - - - - - - Backlight OFF Brightness - - - - - - - If you enable FAI, only RSSI and RxBt sensors will keep working. This function cannot be disabled by the radio. - - - - - - - - - - 23 - - - 5 - - - 0 - - - Qt::Orientation::Horizontal - - - - - - - Volume Control - - - - - - - - America - - - - - Japan - - - - - Europe - - - - - - - - FAI Mode - - - - - - - Backlight color - - - - - - - - Match all - - - - - Match any - - - - - - - - Keys Backlight - - - - - - - Hz - - - 1300 - - - 2900 - - - 10 - - - 1700 - - - - - - - Backlight Control - - - - - - - 5 - - - 100 - - - - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html> - - - 1 - - - 20 - - - 1 - - - - - - - Owner Registration ID - - - - - - - - Multi select - - - - - Single select - - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - - - - 0 - 0 - - - - - - - - - - If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. - - - sec - - - 600 - - - 5 - - - - - - - - - - Background volume - - - - - - - Timeshift from UTC - - - - + @@ -2476,20 +1314,7 @@ p, li { white-space: pre-wrap; } - - - - Qt::Orientation::Vertical - - - - 40 - 20 - - - - - + Qt::Orientation::Vertical @@ -2502,6 +1327,649 @@ p, li { white-space: pre-wrap; } + + + + + + + + + + + + + Vario volume + + + + + + + Voice Language + + + + + + + Hz + + + 1300 + + + 2900 + + + 10 + + + 1700 + + + + + + + + + + + + + FAI Mode + + + + + + + Backlight Brightness + + + + + + + Vario pitch at zero + + + + + + + Background volume + + + + + + + Backlight flash on alarm + + + + + + + Timeshift from UTC + + + + + + + + 0 + 0 + + + + + + + + + + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. + + + sec + + + 600 + + + 5 + + + + + + + + + + + + + This is the switch selectrion for turning on the backlight (if installed). + + + + + -1 + + + + + + + Rotary Encoder Mode + + + + + + + + + + Label matching + + + + + + + Owner Registration ID + + + + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal + + + + + + + Enable this to quickly change model on the model select page (a long press can then be used to open the model edit menu). + + + + + + + + + + Backlight OFF Brightness + + + + + + + Vario pitch at max + + + + + + + 8 + + + + + + + Favorites matching + + + + + + + + + + + + Automatically adjust the radio's clock if a GPS is connected to telemetry. + + + Qt::LayoutDirection::LeftToRight + + + Adjust RTC + + + + + + + + + + Must match + + + + + Optional match + + + + + + + + Backlight Control + + + + + + + Speaker Volume + + + + + + + + + Color 1 + + + + + + + 20 + + + 5 + + + + + + + Color 2 + + + + + + + + + Model quick select + + + + + + + Beep volume + + + + + + + Wav volume + + + + + + + Backlight Auto OFF after + + + + + + + 23 + + + 5 + + + 0 + + + Qt::Orientation::Horizontal + + + + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal + + + + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal + + + + + + + + + + Manage Models layout + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html> + + + 1 + + + 20 + + + 1 + + + + + + + If you enable FAI, only RSSI and RxBt sensors will keep working. This function cannot be disabled by the radio. + + + + + + + + + + Speaker Pitch (spkr only) + + + + + + + Vario repeat at zero + + + + + + + Country Code + + + + + + + Backlight color + + + + + + + Keys Backlight + + + + + + + 100 + + + + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal + + + + + + + + America + + + + + Japan + + + + + Europe + + + + + + + + 5 + + + 100 + + + + + + + Backlight Switch + + + + + + + + Multi select + + + + + Single select + + + + + + + + Label selection mode + + + + + + + Volume Control + + + + + + + Hz + + + 300 + + + 1100 + + + 10 + + + 700 + + + + + + + Text Language + + + + + + + ms + + + 200 + + + 1000 + + + 10 + + + 500 + + + + + + + + + + + Match all + + + + + Match any + + + + + + + + + Large image (2 columns) + + + + + Small image (3 columns) + + + + + Name only (2 columns) + + + + + Name only (1 column) + + + + + + + + + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + + diff --git a/companion/src/modeledit/channels.cpp b/companion/src/modeledit/channels.cpp index 980ae5883..3b95f657f 100644 --- a/companion/src/modeledit/channels.cpp +++ b/companion/src/modeledit/channels.cpp @@ -112,8 +112,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting headerLabels << tr("Name"); } headerLabels << tr("Subtrim") << tr("Min") << tr("Max") << tr("Direction"); - if (IS_HORUS_OR_TARANIS(board)) - headerLabels << tr("Curve") << tr("Plot"); + headerLabels << tr("Curve") << tr("Plot"); if (firmware->getCapability(PPMCenter)) headerLabels << tr("PPM Center"); headerLabels << tr("Linear Subtrim"); @@ -160,19 +159,17 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting tableLayout->addWidget(i, col++, invCB[i]); // Curve - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - curveCB[i] = new QComboBox(this); - curveCB[i]->setProperty("index", i); - tableLayout->addWidget(i, col++, curveCB[i]); + curveCB[i] = new QComboBox(this); + curveCB[i]->setProperty("index", i); + tableLayout->addWidget(i, col++, curveCB[i]); - curveImage[i] = new CurveImageWidget(this); - curveImage[i]->setProperty("index", i); - curveImage[i]->setFixedSize(QSize(100, 100)); - tableLayout->addWidget(i, col++, curveImage[i]); + curveImage[i] = new CurveImageWidget(this); + curveImage[i]->setProperty("index", i); + curveImage[i]->setFixedSize(QSize(100, 100)); + tableLayout->addWidget(i, col++, curveImage[i]); - curveGroup[i] = new CurveReferenceUIManager(curveCB[i], curveImage[i], model.limitData[i].curve, model, sharedItemModels, - curveRefFilteredItemModels, this); - } + curveGroup[i] = new CurveReferenceUIManager(curveCB[i], curveImage[i], model.limitData[i].curve, model, sharedItemModels, + curveRefFilteredItemModels, this); // PPM center int ppmCenterMax = firmware->getCapability(PPMCenter); diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index cd60fc2ac..71b941e34 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -109,9 +109,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI } else if (phaseIdx > 0) { cb->addItem(tr("Use Trim from %1 Mode %2").arg(radioMode).arg(m), m * 2); - if (IS_HORUS_OR_TARANIS(board)) { - cb->addItem(tr("Use Trim from %1 Mode %2 + Own Trim as an offset").arg(radioMode).arg(m), m * 2 + 1); - } + cb->addItem(tr("Use Trim from %1 Mode %2 + Own Trim as an offset").arg(radioMode).arg(m), m * 2 + 1); } } @@ -219,7 +217,7 @@ void FlightModePanel::trimUpdate(unsigned int trim) else { trimsUse[trim]->setCurrentIndex(2 + 2 * phase.trimRef[chn] + phase.trimMode[chn] - (phase.trimRef[chn] > phaseIdx ? 1 : 0)); - if (phaseIdx == 0 || phase.trimRef[chn] == phaseIdx || (IS_HORUS_OR_TARANIS(board) && phase.trimMode[chn] != 0)) { + if (phaseIdx == 0 || phase.trimRef[chn] == phaseIdx || phase.trimMode[chn] != 0) { trimsValue[trim]->setEnabled(true); trimsSlider[trim]->setEnabled(true); } diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index da03850d1..ac9b39ae3 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -197,12 +197,10 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge ui->centerBeepLayout->addWidget(checkbox, 0, i + 1); connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(onBeepCenterToggled(bool))); centerBeepCheckboxes << checkbox; - if (IS_HORUS_OR_TARANIS(board)) { - if (!(generalSettings.isInputAvailable(i) && - (generalSettings.isInputStick(i) || (generalSettings.isInputPot(i) && !generalSettings.isInputMultiPosPot(i)) || - generalSettings.isInputSlider(i)))) - checkbox->hide(); - } + if (!(generalSettings.isInputAvailable(i) && + (generalSettings.isInputStick(i) || (generalSettings.isInputPot(i) && !generalSettings.isInputMultiPosPot(i)) || + generalSettings.isInputSlider(i)))) + checkbox->hide(); QWidget::setTabOrder(prevFocus, checkbox); prevFocus = checkbox; } @@ -248,7 +246,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge // Pot warnings prevFocus = ui->potWarningMode; - if (IS_HORUS_OR_TARANIS(board) && ttlInputs > 0) { + if (ttlInputs > 0) { for (int i = ttlSticks; i < ttlInputs; i++) { RawSource src(SOURCE_TYPE_INPUT, i + 1); QCheckBox * cb = new QCheckBox(this); @@ -471,10 +469,7 @@ void SetupPanel::update() updateBeepCenter(); updateStartupSwitches(); - - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - updatePotWarnings(); - } + updatePotWarnings(); for (int i = 0; i < CPN_MAX_MODULES + 1; i++) { if (modules[i]) { diff --git a/companion/src/modeledit/setup_module.cpp b/companion/src/modeledit/setup_module.cpp index 588863a99..ca7e8c36b 100644 --- a/companion/src/modeledit/setup_module.cpp +++ b/companion/src/modeledit/setup_module.cpp @@ -73,19 +73,13 @@ ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & modul ui->label_module->setText(ModuleData::indexToString(moduleIdx, firmware)); if (isTrainerModule(moduleIdx)) { ui->formLayout_col1->setSpacing(0); - if (!IS_HORUS_OR_TARANIS(firmware->getBoard())) { - ui->label_trainerMode->hide(); - ui->trainerMode->hide(); - } - else { - updateTrainerModeItemModel(); - ui->trainerMode->setField(model.trainerMode); - connect(ui->trainerMode, &AutoComboBox::currentDataChanged, this, [=] () { - update(); - emit updateItemModels(); - emit modified(); - }); - } + updateTrainerModeItemModel(); + ui->trainerMode->setField(model.trainerMode); + connect(ui->trainerMode, &AutoComboBox::currentDataChanged, this, [=] () { + update(); + emit updateItemModels(); + emit modified(); + }); } else { ui->label_trainerMode->hide(); @@ -419,10 +413,8 @@ void ModulePanel::update() if (protocol != PULSES_MULTIMODULE && module.hasFailsafes(firmware)) mask |= MASK_FAILSAFES; } - else if (IS_HORUS_OR_TARANIS(board)) { - if (model->trainerMode == TRAINER_MODE_SLAVE_JACK) { + else if (model->trainerMode == TRAINER_MODE_SLAVE_JACK) { mask |= MASK_PPM_FIELDS | MASK_SBUSPPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT; - } } else if (model->trainerMode != TRAINER_MODE_MASTER_JACK) { mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE | MASK_CHANNELS_COUNT; diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index 1006b6151..81d8462fb 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -482,11 +482,9 @@ void TelemetryPanel::update() { lock = true; - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - ui->voltsSource->updateValue(); - ui->altitudeSource->updateValue(); - ui->varioSource->updateValue(); - } + ui->voltsSource->updateValue(); + ui->altitudeSource->updateValue(); + ui->varioSource->updateValue(); for (int i = 0; i < sensorCapability; ++i) { sensorPanels[i]->update(); diff --git a/companion/src/print/modelprinter.cpp b/companion/src/print/modelprinter.cpp index 194e5445c..b2751f952 100644 --- a/companion/src/print/modelprinter.cpp +++ b/companion/src/print/modelprinter.cpp @@ -189,13 +189,11 @@ QString ModelPrinter::printModule(int idx) ModuleData module = model.moduleData[(idx<0 ? CPN_MAX_MODULES : idx)]; if (idx < 0) { str << printLabelValue(tr("Mode"), model.trainerModeToString()); - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - if (model.trainerMode == TRAINER_MODE_SLAVE_JACK) { - str << printLabelValue(tr("Channels"), QString("%1-%2").arg(module.channelsStart + 1).arg(module.channelsStart + module.channelsCount)); - str << printLabelValue(tr("Frame length"), QString("%1ms").arg(printPPMFrameLength(module.ppm.frameLength))); - str << printLabelValue(tr("PPM delay"), QString("%1us").arg(module.ppm.delay)); - str << printLabelValue(tr("Polarity"), module.polarityToString()); - } + if (model.trainerMode == TRAINER_MODE_SLAVE_JACK) { + str << printLabelValue(tr("Channels"), QString("%1-%2").arg(module.channelsStart + 1).arg(module.channelsStart + module.channelsCount)); + str << printLabelValue(tr("Frame length"), QString("%1ms").arg(printPPMFrameLength(module.ppm.frameLength))); + str << printLabelValue(tr("PPM delay"), QString("%1us").arg(module.ppm.delay)); + str << printLabelValue(tr("Polarity"), module.polarityToString()); } result = str.join(" "); } diff --git a/companion/src/print/multimodelprinter.cpp b/companion/src/print/multimodelprinter.cpp index 99ff67196..9817e3501 100644 --- a/companion/src/print/multimodelprinter.cpp +++ b/companion/src/print/multimodelprinter.cpp @@ -318,9 +318,7 @@ QString MultiModelPrinter::printSetup() ROWLABELCOMPARECELL(tr("Trims"), 0, modelPrinter->printSettingsTrim(), 0); ROWLABELCOMPARECELL(tr("Center Beep"), 0, modelPrinter->printCenterBeep(), 0); ROWLABELCOMPARECELL(tr("Switch Warnings"), 0, modelPrinter->printSwitchWarnings(), 0); - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - ROWLABELCOMPARECELL(tr("Pot Warnings"), 0, modelPrinter->printPotWarnings(), 0); - } + ROWLABELCOMPARECELL(tr("Pot Warnings"), 0, modelPrinter->printPotWarnings(), 0); ROWLABELCOMPARECELL(tr("Other"), 0, modelPrinter->printSettingsOther(), 0); columns.appendTableEnd(); str.append(columns.print()); @@ -525,15 +523,13 @@ QString MultiModelPrinter::printOutputs() MultiColumns columns(modelPrinterMap.size()); columns.appendSectionTableStart(); QStringList hd = QStringList() << tr("Channel") << tr("Subtrim") << tr("Min") << tr("Max") << tr("Direct"); - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) - hd << tr("Curve"); + hd << tr("Curve"); if (firmware->getCapability(PPMCenter)) hd << tr("PPM"); hd << tr("Linear"); columns.appendRowHeader(hd); int cols = 4; - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) - cols++; + cols++; if (firmware->getCapability(PPMCenter)) cols++; cols++; @@ -552,9 +548,7 @@ QString MultiModelPrinter::printOutputs() COMPARECELLWIDTH(modelPrinter->printOutputMin(i), wd); COMPARECELLWIDTH(modelPrinter->printOutputMax(i), wd); COMPARECELLWIDTH(modelPrinter->printOutputRevert(i), wd); - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - COMPARECELLWIDTH(modelPrinter->printOutputCurve(i), wd); - } + COMPARECELLWIDTH(modelPrinter->printOutputCurve(i), wd); if (firmware->getCapability(PPMCenter)) { COMPARECELLWIDTH(modelPrinter->printOutputPpmCenter(i), wd); } @@ -757,12 +751,7 @@ QString MultiModelPrinter::printTelemetry() // Altimetry if (firmware->getCapability(HasVario)) { columns.appendRowStart(tr("Altimetry"), 20); - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - LABELCOMPARECELL(tr("Vario source"), SensorData::sourceToString(model, model->frsky.varioSource), 80); - } - else { - LABELCOMPARECELL(tr("Vario source"), modelPrinter->printVarioSource(model->frsky.varioSource), 80); - } + LABELCOMPARECELL(tr("Vario source"), SensorData::sourceToString(model, model->frsky.varioSource), 80); columns.appendRowEnd(); columns.appendRowStart("", 20); columns.appendCellStart(80); @@ -779,15 +768,12 @@ QString MultiModelPrinter::printTelemetry() } // Top Bar - if (IS_HORUS_OR_TARANIS(firmware->getBoard())) { - columns.appendRowStart(tr("Top Bar"), 20); - columns.appendCellStart(80); - COMPARESTRING(tr("Volts source"), SensorData::sourceToString(model, model->frsky.voltsSource), true); - COMPARESTRING(tr("Altitude source"), SensorData::sourceToString(model, model->frsky.altitudeSource), false); - columns.appendCellEnd(); - columns.appendRowEnd(); - } - + columns.appendRowStart(tr("Top Bar"), 20); + columns.appendCellStart(80); + COMPARESTRING(tr("Volts source"), SensorData::sourceToString(model, model->frsky.voltsSource), true); + COMPARESTRING(tr("Altitude source"), SensorData::sourceToString(model, model->frsky.altitudeSource), false); + columns.appendCellEnd(); + columns.appendRowEnd(); ROWLABELCOMPARECELL(tr("Multi sensors"), 0, modelPrinter->printIgnoreSensorIds(!model->frsky.ignoreSensorIds), 0); ROWLABELCOMPARECELL(tr("Show Instance IDs"), 0, modelPrinter->printIgnoreSensorIds(!model->showInstanceIds), 0);