diff --git a/companion/src/constants.h b/companion/src/constants.h index 77d0989b8..5c0fe79d0 100644 --- a/companion/src/constants.h +++ b/companion/src/constants.h @@ -34,6 +34,7 @@ #define CPN_MAX_CHNOUT 32 // number of real output channels #define CPN_MAX_LOGICAL_SWITCHES 64 // number of custom switches #define CPN_MAX_SPECIAL_FUNCTIONS 64 // number of functions assigned to switches +#define CPN_MAX_MODELS 60 // B&W #define CPN_MAX_MODULES 2 #define CPN_MAX_STICKS Board::STICK_AXIS_COUNT #define CPN_MAX_TRIMS Board::TRIM_AXIS_COUNT @@ -45,6 +46,7 @@ #define CPN_MAX_SENSORS 99 #define CPN_MAX_SCRIPTS 9 #define CPN_MAX_SCRIPT_INPUTS 10 +#define CPN_MAX_SCRIPT_OUTPUTS 6 #define CPN_MAX_SPACEMOUSE 6 #define CPN_MAX_INPUTS 32 // v2.10 replaces CPN_MAX_ANALOGS - the value is abitary as radio ADC refactor is still a WIP diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 4bcecbff8..d92200be2 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -305,19 +305,94 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) // TODO investigate usage of any that should be covered in BoardJson::getCapability or are no longer required // some could be used when importing pre v2.10 configurations switch (capability) { + case BacklightLevelMin: + if (IS_HORUS_X12S(board)) { + return 5; + } else if (IS_FAMILY_T16(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) + || IS_FLYSKY_ST16(board) || IS_FAMILY_PL18(board)) { + return 1; + } else { + return 46; + } + + case HasAuxSerialMode: + return (IS_FAMILY_HORUS_OR_T16(board) && + !(IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || + IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board))) || + (IS_TARANIS_X9(board) && !IS_TARANIS_X9DP_2019(board)) || + IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX12_MK2(board) || + IS_RADIOMASTER_MT12(board); + + case HasAux2SerialMode: + return IS_FAMILY_T16(board); + + case HasBluetooth: + return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X7(board) || + IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || + IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board) || + IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board)); + case HasIMU: - return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board) || IS_RADIOMASTER_TX15(board)); + return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board) || + IS_RADIOMASTER_TX15(board)); + + case HasSoftwareSerialPower: + return IS_RADIOMASTER_TX16S(board); + + case HasSwitchableJack: + return IS_TARANIS_XLITES(board); case HasTrainerModuleCPPM: - return (getCapability(board, HasTrainerModuleSBUS) || IS_FAMILY_HORUS_OR_T16(board)); + return (getCapability(board, HasTrainerModuleSBUS) || + IS_FAMILY_HORUS_OR_T16(board)); case HasTrainerModuleSBUS: - return ((IS_TARANIS_X9LITE(board) || (IS_TARANIS_XLITE(board) && !IS_TARANIS_X9LITES(board)) || - IS_TARANIS_X9DP_2019(board) || IS_TARANIS_X7_ACCESS(board) || IS_RADIOMASTER_ZORRO(board) || - IS_RADIOMASTER_TX12_MK2(board) || IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_POCKET(board) || - IS_RADIOMASTER_MT12(board) || IS_RADIOMASTER_GX12(board) || IS_JUMPER_T20(board) || - IS_JUMPER_BUMBLEBEE(board)) || IS_FAMILY_T16(board) || IS_FAMILY_HORUS(board) || - (getCapability(board, HasExternalModuleSupport) && (IS_TARANIS(board) && !IS_FAMILY_T12(board)))); + return ((IS_TARANIS_X9LITE(board) || + (IS_TARANIS_XLITE(board) && !IS_TARANIS_X9LITES(board)) || + IS_TARANIS_X9DP_2019(board) || IS_TARANIS_X7_ACCESS(board) || + IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX12_MK2(board) || + IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_POCKET(board) || + IS_RADIOMASTER_MT12(board) || IS_RADIOMASTER_GX12(board) || + IS_JUMPER_T20(board) || IS_JUMPER_BUMBLEBEE(board)) || + IS_FAMILY_T16(board) || IS_FAMILY_HORUS(board) || + (getCapability(board, HasExternalModuleSupport) && + (IS_TARANIS(board) && !IS_FAMILY_T12(board)))); + + case HasVCPSerialMode: + return IS_FAMILY_HORUS_OR_T16(board) || IS_JUMPER_TPRO(board) || + IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_MT12(board) || + IS_RADIOMASTER_POCKET(board) || IS_RADIOMASTER_TX12_MK2(board) || + IS_RADIOMASTER_ZORRO(board); + + case MaxContrast: + if (IS_TARANIS_SMALL(board)) + return 30; + else + return 45; + + case MaxVolume: + return 23; + + case MinContrast: + if (IS_TARANIS_X9(board)) + return 0; + else + return 10; + + case PwrButtonPress: + return (board != Board::BOARD_TARANIS_X9D && board != Board::BOARD_TARANIS_X9DP); + + case RotaryEncoderNavigation: + return (IS_TARANIS_X7(board) || IS_TARANIS_X9DP_2019(board) || + IS_TARANIS_X9E(board) || IS_TARANIS_X9LITE(board) || + IS_JUMPER_T15(board) || IS_JUMPER_T18(board) || IS_JUMPER_T20(board)|| + IS_JUMPER_TPRO(board) || IS_RADIOMASTER_BOXER(board) || + IS_RADIOMASTER_GX12(board) || IS_RADIOMASTER_MT12(board) || + IS_RADIOMASTER_POCKET(board) || IS_RADIOMASTER_TX12(board) || + IS_RADIOMASTER_TX12_MK2(board) || IS_RADIOMASTER_TX16S(board) || + IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX15(board) || + IS_JUMPER_T15PRO(board) || IS_FLYSKY_PA01(board) || + IS_FLYSKY_ST16(board) || IS_RADIOMASTER_TX16SMK3(board)); default: return getBoardJson(board)->getCapability(capability); @@ -1102,3 +1177,13 @@ bool Boards::isSurface(Board::Type board) { return getCapability(board == Board::BOARD_UNKNOWN ? getCurrentBoard() : board, Board::Surface); } + +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 2e7502f80..64ae51a74 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -212,6 +212,7 @@ namespace Board { enum Capability { Air, + BacklightLevelMin, FlexInputs, FlexSwitches, FunctionSwitchColors, @@ -220,7 +221,10 @@ namespace Board { GyroAxes, Gyros, HasAudioMuteGPIO, + HasAuxSerialMode, + HasAux2SerialMode, HasBacklightColor, + HasBluetooth, HasColorLcd, HasExternalModuleSupport, HasIMU, @@ -229,9 +233,12 @@ namespace Board { HasBlingLEDS, HasRTC, HasSDCard, + HasSoftwareSerialPower, + HasSwitchableJack, HasTrainerModuleCPPM, HasTrainerModuleSBUS, HasVBat, + HasVCPSerialMode, Inputs, InputSwitches, JoystickAxes, @@ -241,12 +248,17 @@ namespace Board { LcdHeight, LcdOLED, LcdWidth, + MaxContrast, + MaxVolume, + MinContrast, MultiposPots, MultiposPotsPositions, NumFunctionSwitchesPositions, NumTrims, NumTrimSwitches, Pots, + PwrButtonPress, + RotaryEncoderNavigation, Sliders, SportMaxBaudRate, StandardSwitches, @@ -469,6 +481,8 @@ class Boards static bool isAir(Board::Type board = Board::BOARD_UNKNOWN); static bool isSurface(Board::Type board = Board::BOARD_UNKNOWN); + static void tests(); + private: Board::Type m_boardType = Board::BOARD_UNKNOWN; @@ -640,6 +654,7 @@ inline bool IS_FAMILY_T16(Board::Type board) return board == Board::BOARD_FATFISH_F16 || board == Board::BOARD_HELLORADIOSKY_V16 || board == Board::BOARD_JUMPER_T15 || + board == Board::BOARD_JUMPER_T15PRO || board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_JUMPER_T18 || board == Board::BOARD_RADIOMASTER_TX15 || @@ -683,6 +698,11 @@ inline bool IS_FLYSKY_EL18(Board::Type board) return (board == Board::BOARD_FLYSKY_EL18); } +inline bool IS_FLYSKY_NB4P(Board::Type board) +{ + return (board == Board::BOARD_FLYSKY_NB4P); +} + inline bool IS_FLYSKY_PA01(Board::Type board) { return (board == Board::BOARD_FLYSKY_PA01); @@ -792,7 +812,8 @@ inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board) { return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board)/*generally*/ || IS_FLYSKY_EL18(board)/*generally*/ - || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)/*generally*/ || IS_FLYSKY_PA01(board)/*generally*/; + || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)/*generally*/ || + IS_FLYSKY_PA01(board)/*generally*/ || IS_FLYSKY_NB4P(board)/*generally*/; } inline bool IS_HORUS_OR_TARANIS(Board::Type board) diff --git a/companion/src/firmwares/curvereference.cpp b/companion/src/firmwares/curvereference.cpp index 6e98f2c1c..570242e80 100644 --- a/companion/src/firmwares/curvereference.cpp +++ b/companion/src/firmwares/curvereference.cpp @@ -111,25 +111,7 @@ QString CurveReference::functionToString(const int value) // static bool CurveReference::isTypeAvailable(const CurveRefType type) { - bool ret = false; - Firmware * fw = getCurrentFirmware(); - - switch(type) { - case CURVE_REF_DIFF: - if (fw->getCapability(HasInputDiff)) - ret = true; - break; - case CURVE_REF_EXPO: - if (fw->getCapability(HasMixerExpo)) - ret = true; - break; - case CURVE_REF_FUNC: - case CURVE_REF_CUSTOM: - ret = true; - break; - } - - return ret; + return true; } // static diff --git a/companion/src/firmwares/customfunctiondata.cpp b/companion/src/firmwares/customfunctiondata.cpp index 9a01f24e2..ca7c57634 100644 --- a/companion/src/firmwares/customfunctiondata.cpp +++ b/companion/src/firmwares/customfunctiondata.cpp @@ -90,8 +90,6 @@ QString CustomFunctionData::funcToString(const AssignFunc func, const ModelData return tr("Vario"); else if (func == FuncPlayPrompt) return tr("Play Track"); - else if (func == FuncPlayBoth) - return tr("Play Both"); else if (func == FuncPlayValue) return tr("Play Value"); else if (func == FuncPlayScript) @@ -181,13 +179,8 @@ QString CustomFunctionData::paramToString(const ModelData * model) const else if (func == FuncVolume || func == FuncPlayValue || func == FuncBacklight) { return RawSource(param).toString(model); } - else if (func == FuncPlayPrompt || func == FuncPlayBoth) { - if ( getCurrentFirmware()->getCapability(VoicesAsNumbers)) { - return QString("%1").arg(param); - } - else { - return paramarm; - } + else if (func == FuncPlayPrompt) { + return paramarm; } else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast) { switch (adjustMode) { @@ -252,11 +245,8 @@ bool CustomFunctionData::isFuncAvailable(const int index, const ModelData * mode Firmware * fw = getCurrentFirmware(); bool ret = (((index >= FuncOverrideCH1 && index <= FuncOverrideCHLast) && !fw->getCapability(SafetyChannelCustomFunction)) || - ((index == FuncVolume || index == FuncBackgroundMusic || index == FuncBackgroundMusicPause) && !fw->getCapability(HasVolume)) || ((index == FuncPlayScript && !IS_HORUS_OR_TARANIS(fw->getBoard()))) || ((index == FuncPlayHaptic) && !fw->getCapability(Haptic)) || - ((index == FuncPlayBoth) && !fw->getCapability(HasBeeper)) || - ((index == FuncLogs) && !fw->getCapability(HasSDLogs)) || ((index >= FuncSetTimer1 && index <= FuncSetTimerLast) && (index > FuncSetTimer1 + fw->getCapability(Timers) || (model ? model->timers[index - FuncSetTimer1].isModeOff() : false))) || @@ -522,7 +512,6 @@ bool CustomFunctionData::isRepeatParamAvailable(const AssignFunc func) FuncPlayHaptic, FuncPlayValue, FuncPlayPrompt, - FuncPlayBoth, FuncSetScreen }; diff --git a/companion/src/firmwares/customfunctiondata.h b/companion/src/firmwares/customfunctiondata.h index d4f824e88..06f2585da 100644 --- a/companion/src/firmwares/customfunctiondata.h +++ b/companion/src/firmwares/customfunctiondata.h @@ -51,7 +51,6 @@ enum AssignFunc { FuncSetTimerLast = FuncSetTimer1 + CPN_MAX_TIMERS - 1, FuncVario, FuncPlayPrompt, - FuncPlayBoth, FuncPlayValue, FuncPlayScript, FuncLogs, diff --git a/companion/src/firmwares/eeprominterface.h b/companion/src/firmwares/eeprominterface.h index 4377e5009..6a14530ab 100644 --- a/companion/src/firmwares/eeprominterface.h +++ b/companion/src/firmwares/eeprominterface.h @@ -47,133 +47,72 @@ const uint8_t modn12x3[8][4]= { }; enum Capability { - Models, - ModelName, + ChannelsName, + CustomFunctions, + DangerousFunctions, + ExtendedTrimsRange, FlightModes, FlightModesName, - FlightModesHaveFades, - Imperial, - Mixes, - Timers, - TimersName, - VoicesAsNumbers, - VoicesMaxLength, - MultiLangVoice, - HasModelImage, - ModelImageNameLen, - ModelImageFilters, - ModelImageKeepExtn, - CustomFunctions, - SafetyChannelCustomFunction, - LogicalSwitches, - CustomAndSwitches, - HasNegAndSwitches, - LogicalSwitchesExt, - Outputs, - ChannelsName, - ExtraInputs, - TrimsRange, - ExtendedTrimsRange, - NumCurves, - NumCurvePoints, - OffsetWeight, - Simulation, - SoundMod, - SoundPitch, - MaxVolume, - MaxContrast, - MinContrast, - Haptic, - HasBeeper, - ModelTrainerEnable, - HasExpoNames, - HasNoExpo, - HasMixerNames, - HasCvNames, - HasPxxCountry, - HasPPMStart, - HasGeneralUnits, - HasFAIMode, - OptrexDisplay, - PPMExtCtrl, - PPMFrameLength, - Telemetry, - TelemetryUnits, - TelemetryBars, - Heli, - Gvars, - GvarsInCS, - GvarsAreNamed, - GvarsFlightModes, - GvarsName, - NoTelemetryProtocol, - TelemetryCustomScreens, - TelemetryCustomScreensBars, - TelemetryCustomScreensLines, - TelemetryCustomScreensFieldsPerLine, - TelemetryMaxMultiplier, - HasVario, - HasVarioSink, - HasFailsafe, - HasSoundMixer, - NumModules, - NumFirstUsableModule, - HasModuleR9MFlex, - HasModuleR9MMini, - PPMCenter, - SYMLimits, - HastxCurrentCalibration, - HasVolume, - HasBrightness, - PerModelTimers, - SlowScale, - SlowRange, - PermTimers, - HasSDLogs, - CSFunc, - GetThrSwitch, - HasDisplayText, - HasTopLcd, GlobalFunctions, - VirtualInputs, - InputsLength, - TrainerInputs, - SportTelemetry, - LuaScripts, - LuaInputsPerScript, - LuaOutputsPerScript, - LimitsPer1000, - EnhancedCurves, - HasFasOffset, - HasMahPersistent, - MavlinkTelemetry, - HasInputDiff, - HasMixerExpo, - HasBatMeterRange, - DangerousFunctions, - HasModelLabels, - HasSwitchableJack, - HasSportConnector, - PwrButtonPress, - Sensors, - HasAuxSerialMode, - HasAux2SerialMode, - HasVCPSerialMode, - HasBluetooth, - HasADCJitterFilter, - HasTelemetryBaudrate, - TopBarZones, - HasModelsList, + Gvars, + GvarsName, + Haptic, // TODO remove with X9D + HasExpoNames, + HasFailsafe, HasFlySkyGimbals, - RotaryEncoderNavigation, - HasSoftwareSerialPower, - HasIntModuleMulti, HasIntModuleCRSF, HasIntModuleELRS, HasIntModuleFlySky, - BacklightLevelMin, - QMFavourites, + HasIntModuleMulti, + HasMixerNames, + HasModelImage, + HasModelLabels, + HasModelsList, + HasModuleR9MFlex, + HasModuleR9MMini, + HasSportConnector, + HasTopLcd, + HasVario, + HasVarioSink, + Heli, + InputsLength, KeyShortcuts, + LogicalSwitches, + LuaInputsPerScript, + LuaOutputsPerScript, + LuaScripts, + MavlinkTelemetry, + Mixes, + ModelImageFilters, + ModelImageKeepExtn, + ModelImageNameLen, + ModelName, + Models, + ModelTrainerEnable, + NumCurvePoints, + NumCurves, + NumFirstUsableModule, + NumModules, + OffsetWeight, + Outputs, + PPMCenter, + PPMFrameLength, + QMFavourites, + SafetyChannelCustomFunction, + Sensors, + SlowRange, + SlowScale, + TelemetryCustomScreens, + TelemetryCustomScreensBars, + TelemetryCustomScreensFieldsPerLine, + TelemetryCustomScreensLines, + Timers, + TimersName, + TopBarZones, + TrainerInputs, + TrimsRange, + VirtualInputs, + VoicesMaxLength, }; float ValToTim(int value); diff --git a/companion/src/firmwares/generalsettings.cpp b/companion/src/firmwares/generalsettings.cpp index 388efde40..806fffd77 100644 --- a/companion/src/firmwares/generalsettings.cpp +++ b/companion/src/firmwares/generalsettings.cpp @@ -426,7 +426,8 @@ void GeneralSettings::convert(RadioDataConversionState & cstate) } if (IS_TARANIS(cstate.toType)) { - contrast = qBound(getCurrentFirmware()->getCapability(MinContrast), contrast, getCurrentFirmware()->getCapability(MaxContrast)); + contrast = qBound(Boards::getCapability(cstate.toType, Board::MinContrast), + contrast, Boards::getCapability(cstate.toType, Board::MaxContrast)); } // TODO: Would be nice at this point to have GUI pause and ask the user to set up any custom hardware they have on the destination radio. diff --git a/companion/src/firmwares/generalsettings.h b/companion/src/firmwares/generalsettings.h index f29b68333..bc65cb156 100644 --- a/companion/src/firmwares/generalsettings.h +++ b/companion/src/firmwares/generalsettings.h @@ -302,7 +302,6 @@ class GeneralSettings { unsigned int contrast; unsigned int vBatWarn; int txVoltageCalibration; - int txCurrentCalibration; int vBatMin; int vBatMax; int backlightMode; @@ -326,7 +325,6 @@ class GeneralSettings { int timezone; int timezoneMinutes; bool adjustRTC; - bool optrexDisplay; unsigned int inactivityTimer; unsigned int internalModuleBaudrate; bool minuteBeep; @@ -342,7 +340,6 @@ class GeneralSettings { unsigned int stickReverse; unsigned int speakerPitch; int hapticStrength; - unsigned int speakerMode; char ownerName[OWNER_NAME_LEN + 1]; int beeperLength; unsigned int gpsFormat; diff --git a/companion/src/firmwares/mixdata.h b/companion/src/firmwares/mixdata.h index 1d6eb654a..0eca71e05 100644 --- a/companion/src/firmwares/mixdata.h +++ b/companion/src/firmwares/mixdata.h @@ -55,7 +55,6 @@ class MixData { unsigned int speedUp; unsigned int speedDown; int carryTrim; - bool noExpo; MltpxValue mltpx; unsigned int mixWarn; unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4 diff --git a/companion/src/firmwares/modeldata.cpp b/companion/src/firmwares/modeldata.cpp index 8d8a7c946..94cf79696 100644 --- a/companion/src/firmwares/modeldata.cpp +++ b/companion/src/firmwares/modeldata.cpp @@ -936,37 +936,36 @@ int ModelData::updateReference() //s1.report("Heli"); } - if (fw->getCapability(Telemetry)) { - updateTelemetryRef(frsky.voltsSource); - updateTelemetryRef(frsky.altitudeSource); - updateTelemetryRef(frsky.currentSource); - updateTelemetryRef(frsky.varioSource); - for (int i = 0; i < fw->getCapability(TelemetryCustomScreens); i++) { - switch(frsky.screens[i].type) { - case TELEMETRY_SCREEN_BARS: - for (int j = 0; j < fw->getCapability(TelemetryCustomScreensBars); j++) { - FrSkyBarData *fbd = &frsky.screens[i].body.bars[j]; - updateSourceRef(fbd->source); - if (!fbd->source.isSet()) { - fbd->barMin = 0; - fbd->barMax = 0; - } + updateTelemetryRef(frsky.voltsSource); + updateTelemetryRef(frsky.altitudeSource); + updateTelemetryRef(frsky.currentSource); + updateTelemetryRef(frsky.varioSource); + + for (int i = 0; i < fw->getCapability(TelemetryCustomScreens); i++) { + switch(frsky.screens[i].type) { + case TELEMETRY_SCREEN_BARS: + for (int j = 0; j < fw->getCapability(TelemetryCustomScreensBars); j++) { + FrSkyBarData *fbd = &frsky.screens[i].body.bars[j]; + updateSourceRef(fbd->source); + if (!fbd->source.isSet()) { + fbd->barMin = 0; + fbd->barMax = 0; } - break; - case TELEMETRY_SCREEN_NUMBERS: - for (int j = 0; j < fw->getCapability(TelemetryCustomScreensLines); j++) { - FrSkyLineData *fld = &frsky.screens[i].body.lines[j]; - for (int k = 0; k < fw->getCapability(TelemetryCustomScreensFieldsPerLine); k++) { - updateSourceRef(fld->source[k]); - } + } + break; + case TELEMETRY_SCREEN_NUMBERS: + for (int j = 0; j < fw->getCapability(TelemetryCustomScreensLines); j++) { + FrSkyLineData *fld = &frsky.screens[i].body.lines[j]; + for (int k = 0; k < fw->getCapability(TelemetryCustomScreensFieldsPerLine); k++) { + updateSourceRef(fld->source[k]); } - break; - default: - break; - } + } + break; + default: + break; } - //s1.report("Telemetry"); } + //s1.report("Telemetry"); for (int i = 0; i < CPN_MAX_SENSORS; i++) { SensorData *sd = &sensorData[i]; diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 776abbf70..e7313ade8 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -55,291 +55,37 @@ Firmware * OpenTxFirmware::getFirmwareVariant(const QString &id) } } +// TODO centralise those related to data sizes so common to struct and capability +// current method is too risky int OpenTxFirmware::getCapability(::Capability capability) { switch (capability) { - case Models: - if (IS_FAMILY_HORUS_OR_T16(board)) - return 0; - else - return 60; - case Imperial: - return 0; - case HasModelImage: - return (board == BOARD_TARANIS_X9D || IS_TARANIS_PLUS(board) || board == BOARD_TARANIS_X9DP_2019 || IS_FAMILY_HORUS_OR_T16(board)); - case ModelImageNameLen: - return (IS_FAMILY_HORUS_OR_T16(board) ? 14 : 10); // including extension if saved and <= CPN_MAX_BITMAP_LEN - case ModelImageKeepExtn: - return (IS_FAMILY_HORUS_OR_T16(board) ? true : false); - case HasBeeper: - return false; - case HasPxxCountry: - return 1; - case HasGeneralUnits: - return true; - case HasNegAndSwitches: - return true; - case PPMExtCtrl: - return 1; - case PPMFrameLength: - return 40; - case FlightModes: - return 9; - case FlightModesHaveFades: - return 1; - case Heli: - if (Boards::getCapability(board, Board::Surface)) - return false; - else if (IS_HORUS_OR_TARANIS(board)) - return id.contains("noheli") ? 0 : 1; - else - return id.contains("heli") ? 1 : 0; - case Gvars: - if (IS_STM32H7(board) || IS_STM32H5(board)) - return id.contains("nogvars") ? 0 : 15; - else if (IS_HORUS_OR_TARANIS(board)) - return id.contains("nogvars") ? 0 : 9; - else if (id.contains("gvars")) - return 9; - else - return 0; - case ModelName: - return (IS_FAMILY_HORUS_OR_T16(board) ? 15 : (HAS_LARGE_LCD(board) ? 12 : 10)); - case FlightModesName: - return (IS_HORUS_OR_TARANIS(board) ? 10 : 6); - case GvarsName: - return 3; - case GvarsInCS: - case HasFAIMode: - return 1; - case GvarsAreNamed: - case GvarsFlightModes: - return 1; - case Mixes: - return 64; - case OffsetWeight: - return 500; - case Timers: - return 3; - case TimersName: - if (HAS_LARGE_LCD(board)) - return 8; - else - return 3; - case PermTimers: - return true; - case CustomFunctions: - return 64; - case SafetyChannelCustomFunction: - return id.contains("nooverridech") ? 0 : 1; - case LogicalSwitches: - return 64; - case CustomAndSwitches: - return getCapability(LogicalSwitches); - case LogicalSwitchesExt: - return true; - case Outputs: - return 32; - case NumCurvePoints: - return 512; - case VoicesAsNumbers: - return 0; - case VoicesMaxLength: - return 8; - case MultiLangVoice: - return 1; - case SoundPitch: - return 1; - case Haptic: - return board != Board::BOARD_TARANIS_X9D || id.contains("haptic"); - case ModelTrainerEnable: - if (IS_HORUS_OR_TARANIS(board) && board!=Board::BOARD_TARANIS_XLITE) - return 1; - else - return 0; - case MaxVolume: - return 23; - case MaxContrast: - if (IS_TARANIS_SMALL(board)) - return 30; - else - return 45; - case MinContrast: - if (IS_TARANIS_X9(board)) - return 0; - else - return 10; - case HasSoundMixer: - return 1; - case ExtraInputs: - return 1; - case TrimsRange: - return 128; - case ExtendedTrimsRange: - return 512; - case Simulation: - return 1; - case NumCurves: - return 32; - case HasMixerNames: - return (IS_TARANIS_X9(board) ? 8 : 6); - case HasExpoNames: - return (IS_TARANIS_X9(board) ? 8 : 6); - case HasNoExpo: - return (IS_HORUS_OR_TARANIS(board) ? false : true); case ChannelsName: return (HAS_LARGE_LCD(board) ? 6 : 4); - case HasCvNames: - return 1; - case Telemetry: - return 1; - case TelemetryBars: - return 1; - case TelemetryCustomScreens: - if (IS_FAMILY_HORUS_OR_T16(board)) - return 0; - else - return 4; - case TelemetryCustomScreensBars: - return (getCapability(TelemetryCustomScreens) ? 4 : 0); - case TelemetryCustomScreensLines: - return (getCapability(TelemetryCustomScreens) ? 4 : 0); - case TelemetryCustomScreensFieldsPerLine: - return HAS_LARGE_LCD(board) ? 3 : 2; - case NoTelemetryProtocol: - return IS_HORUS_OR_TARANIS(board) ? 1 : 0; - case TelemetryUnits: - return 0; - case TelemetryMaxMultiplier: - return 32; - case PPMCenter: - return (IS_HORUS_OR_TARANIS(board) ? 500 : (id.contains("ppmca") ? 125 : 0)); - case SYMLimits: - return 1; - case HasVario: - return Boards::isAir(board); - case HasVarioSink: - return Boards::isAir(board); - case HasFailsafe: - return 32; - case NumModules: - return 2; - case NumFirstUsableModule: - return (IS_JUMPER_T12(board) && !id.contains("internalmulti") ? 1 : 0); - case HasModuleR9MFlex: - return id.contains("flexr9m"); - case HasModuleR9MMini: - return IS_TARANIS_XLITE(board) && !id.contains("stdr9m"); - case HasPPMStart: - return true; - case HasVolume: - return true; - case HasBrightness: - return true; - case PerModelTimers: - return 1; - case SlowScale: - return 10; - case SlowRange: - return 250; - case CSFunc: - return 18; - case HasSDLogs: - return true; - case GetThrSwitch: - return (IS_HORUS_OR_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR); - case HasDisplayText: - return 1; - case HasTopLcd: - return IS_TARANIS_X9E(board) ? 1 : 0; - case GlobalFunctions: - return 64; - case VirtualInputs: - return 32; - case InputsLength: - return HAS_LARGE_LCD(board) ? 4 : 3; - case TrainerInputs: - return 16; - case LuaScripts: - return IS_HORUS_OR_TARANIS(board) && id.contains("lua") ? 7 : 0; - case LuaInputsPerScript: - return IS_HORUS_OR_TARANIS(board) ? 10 : 0; - case LuaOutputsPerScript: - return IS_HORUS_OR_TARANIS(board) ? 6 : 0; - case LimitsPer1000: - case EnhancedCurves: - return 1; - case HasFasOffset: - return true; - case HasMahPersistent: - return true; - case MavlinkTelemetry: - return id.contains("mavlink") ? 1 : 0; - case SportTelemetry: - return 1; - case HasInputDiff: - case HasMixerExpo: - return (IS_HORUS_OR_TARANIS(board) ? true : false); - case HasBatMeterRange: - return (IS_HORUS_OR_TARANIS(board) ? true : id.contains("battgraph")); + case CustomFunctions: + return CPN_MAX_SPECIAL_FUNCTIONS; case DangerousFunctions: return id.contains("danger") ? 1 : 0; - case HasModelLabels: - return IS_FAMILY_HORUS_OR_T16(board); - case HasSwitchableJack: - return IS_TARANIS_XLITES(board); - case HasSportConnector: - return IS_ACCESS_RADIO(board, id) || IS_TARANIS_X7(board) || IS_HORUS_X10(board) || IS_TARANIS_XLITE(board); - case PwrButtonPress: - return IS_HORUS_OR_TARANIS(board) && (board!=Board::BOARD_TARANIS_X9D) && (board!=Board::BOARD_TARANIS_X9DP); - case Sensors: - if (IS_STM32H7(board)) - return 99; - else if (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board)) - return 60; - else - return 40; - case HasAuxSerialMode: - return (IS_FAMILY_HORUS_OR_T16(board) && !(IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board))) || - (IS_TARANIS_X9(board) && !IS_TARANIS_X9DP_2019(board)) || - IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX12_MK2(board) || IS_RADIOMASTER_MT12(board); - case HasAux2SerialMode: - return IS_FAMILY_T16(board); - case HasVCPSerialMode: - return IS_FAMILY_HORUS_OR_T16(board) || IS_RADIOMASTER_ZORRO(board) || - IS_JUMPER_TPRO(board) || IS_RADIOMASTER_TX12_MK2(board) || - IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_POCKET(board) || - IS_RADIOMASTER_MT12(board); - case HasBluetooth: - return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || - IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board)) ? true : false; - case HasADCJitterFilter: - return IS_HORUS_OR_TARANIS(board); - case HasTelemetryBaudrate: - return IS_HORUS_OR_TARANIS(board); - case TopBarZones: - return Boards::getCapability(board, Board::LcdWidth) > Boards::getCapability(board, Board::LcdHeight) ? 4 : 2; - case HasModelsList: - return IS_FAMILY_HORUS_OR_T16(board); + case ExtendedTrimsRange: + return 512; + case FlightModes: + return CPN_MAX_FLIGHT_MODES; + case FlightModesName: + return 10; + case GlobalFunctions: + return CPN_MAX_SPECIAL_FUNCTIONS; + case Gvars: + return id.contains("nogvars") ? 0 : (IS_STM32H7(board) || IS_STM32H5(board) ? CPN_MAX_GVARS : 9); + case GvarsName: + return 3; + case Haptic: // TODO remove with X9D + return board != Board::BOARD_TARANIS_X9D || id.contains("haptic"); + case HasExpoNames: + return (IS_TARANIS_X9(board) ? 8 : 6); + case HasFailsafe: + return 32; case HasFlySkyGimbals: return (IS_RADIOMASTER_TX16S(board) && id.contains("flyskygimbals")); - case RotaryEncoderNavigation: - return (IS_TARANIS_X7(board) || IS_TARANIS_X9DP_2019(board) || IS_TARANIS_X9E(board) || IS_TARANIS_X9LITE(board) || - IS_JUMPER_T15(board) || IS_JUMPER_T18(board) || IS_JUMPER_T20(board) || IS_JUMPER_TPRO(board) || - IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_GX12(board) || IS_RADIOMASTER_MT12(board) || - IS_RADIOMASTER_POCKET(board) || IS_RADIOMASTER_TX12(board) || IS_RADIOMASTER_TX12_MK2(board) || - IS_RADIOMASTER_TX16S(board) || IS_RADIOMASTER_ZORRO(board) || IS_RADIOMASTER_TX15(board) || IS_JUMPER_T15PRO(board) || - IS_FLYSKY_PA01(board) || IS_FLYSKY_ST16(board) || - IS_RADIOMASTER_TX16SMK3(board)); - case HasSoftwareSerialPower: - return IS_RADIOMASTER_TX16S(board); - case HasIntModuleMulti: - return id.contains("internalmulti") || IS_RADIOMASTER_TX16S(board) || IS_JUMPER_T18(board) || - IS_RADIOMASTER_TX12(board) || IS_JUMPER_TLITE(board) || IS_BETAFPV_LR3PRO(board) || - (IS_RADIOMASTER_ZORRO(board) && !id.contains("internalelrs")) || - (IS_RADIOMASTER_BOXER(board) && !id.contains("internalelrs")) || - (IS_RADIOMASTER_POCKET(board) && !id.contains("internalelrs")) || - (IS_RADIOMASTER_MT12(board) && !id.contains("internalelrs")); case HasIntModuleCRSF: return id.contains("internalcrsf"); case HasIntModuleELRS: @@ -350,18 +96,127 @@ int OpenTxFirmware::getCapability(::Capability capability) case HasIntModuleFlySky: return id.contains("afhds2a") || id.contains("afhds3") || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board); - case BacklightLevelMin: - if (IS_HORUS_X12S(board)) { - return 5; - } else if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FAMILY_PL18(board) || IS_FLYSKY_ST16(board)) { - return 1; - } else { - return 46; - } - case QMFavourites: - return VERSION_MAJOR > 2 && Boards::getCapability(board, Board::HasColorLcd) ? MAX_QMFAVOURITES : 0; + case HasIntModuleMulti: + return id.contains("internalmulti") || IS_RADIOMASTER_TX16S(board) || IS_JUMPER_T18(board) || + IS_RADIOMASTER_TX12(board) || IS_JUMPER_TLITE(board) || IS_BETAFPV_LR3PRO(board) || + (IS_RADIOMASTER_ZORRO(board) && !id.contains("internalelrs")) || + (IS_RADIOMASTER_BOXER(board) && !id.contains("internalelrs")) || + (IS_RADIOMASTER_POCKET(board) && !id.contains("internalelrs")) || + (IS_RADIOMASTER_MT12(board) && !id.contains("internalelrs")); + case HasMixerNames: + return (IS_TARANIS_X9(board) ? 8 : 6); + case HasModelImage: + return (board == BOARD_TARANIS_X9D || IS_TARANIS_PLUS(board) || board == BOARD_TARANIS_X9DP_2019 || IS_FAMILY_HORUS_OR_T16(board)); + case HasModelLabels: + return IS_FAMILY_HORUS_OR_T16(board); + case HasModelsList: + return IS_FAMILY_HORUS_OR_T16(board); + case HasModuleR9MFlex: + return id.contains("flexr9m"); + case HasModuleR9MMini: + return IS_TARANIS_XLITE(board) && !id.contains("stdr9m"); + case HasSportConnector: + return IS_ACCESS_RADIO(board, id) || IS_TARANIS_X7(board) || IS_HORUS_X10(board) || IS_TARANIS_XLITE(board); + case HasTopLcd: + return IS_TARANIS_X9E(board) ? 1 : 0; + case HasVario: + return Boards::isAir(board); + case HasVarioSink: + return Boards::isAir(board); + case Heli: + if (Boards::getCapability(board, Board::Surface)) + return false; + else + return !id.contains("noheli"); + case InputsLength: + return HAS_LARGE_LCD(board) ? 4 : 3; case KeyShortcuts: return VERSION_MAJOR > 2 && Boards::getCapability(board, Board::HasColorLcd) ? MAX_KEYSHORTCUTS : 0; + case LogicalSwitches: + return CPN_MAX_LOGICAL_SWITCHES; + case LuaInputsPerScript: + return CPN_MAX_SCRIPT_INPUTS; + case LuaOutputsPerScript: + return CPN_MAX_SCRIPT_OUTPUTS; + case LuaScripts: + return id.contains("lua") ? CPN_MAX_SCRIPTS : 0; + case MavlinkTelemetry: + return id.contains("mavlink") ? 1 : 0; + case Mixes: + return CPN_MAX_MIXERS; + case ModelImageKeepExtn: + return IS_FAMILY_HORUS_OR_T16(board); + case ModelImageNameLen: + return (IS_FAMILY_HORUS_OR_T16(board) ? 14 : 10); // including extension if saved and <= CPN_MAX_BITMAP_LEN + case ModelName: + return (IS_FAMILY_HORUS_OR_T16(board) ? 15 : (HAS_LARGE_LCD(board) ? 12 : 10)); + case Models: + if (IS_FAMILY_HORUS_OR_T16(board)) + return 0; + else + return CPN_MAX_MODELS; + case ModelTrainerEnable: + return board != Board::BOARD_TARANIS_XLITE; + case NumCurvePoints: + return 512; // Note: less than CPN_MAX_CURVES x CPN_MAX_POINTS + case NumCurves: + return CPN_MAX_CURVES; + case NumFirstUsableModule: + return (IS_JUMPER_T12(board) && !id.contains("internalmulti") ? 1 : 0); + case NumModules: + return CPN_MAX_MODULES; + case OffsetWeight: + return 500; + case Outputs: + return CPN_MAX_CHNOUT; + case PPMCenter: + return 500; + case PPMFrameLength: + return 40; + case QMFavourites: + return VERSION_MAJOR > 2 && Boards::getCapability(board, Board::HasColorLcd) ? MAX_QMFAVOURITES : 0; + case SafetyChannelCustomFunction: + return id.contains("nooverridech") ? 0 : 1; + case Sensors: + if (IS_STM32H7(board)) + return CPN_MAX_SENSORS; + else if (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board)) + return 60; + else + return 40; + case SlowRange: + return 250; + case SlowScale: + return 10; + case TelemetryCustomScreens: + if (IS_FAMILY_HORUS_OR_T16(board)) + return 0; + else + return 4; + case TelemetryCustomScreensBars: + return (getCapability(TelemetryCustomScreens) ? 4 : 0); + case TelemetryCustomScreensFieldsPerLine: + return HAS_LARGE_LCD(board) ? 3 : 2; + case TelemetryCustomScreensLines: + return (getCapability(TelemetryCustomScreens) ? 4 : 0); + case Timers: + return CPN_MAX_TIMERS; + case TimersName: + if (HAS_LARGE_LCD(board)) + return 8; + else + return 3; + case TopBarZones: + return Boards::getCapability(board, Board::LcdWidth) > Boards::getCapability(board, Board::LcdHeight) ? 4 : 2; + case TrainerInputs: + return 16; + case TrimsRange: + return 128; + case VirtualInputs: + return CPN_MAX_INPUTS; + case VoicesMaxLength: + return 8; + default: return 0; } diff --git a/companion/src/firmwares/opentx/opentxinterface.h b/companion/src/firmwares/opentx/opentxinterface.h index 3f4c68ad2..132892498 100644 --- a/companion/src/firmwares/opentx/opentxinterface.h +++ b/companion/src/firmwares/opentx/opentxinterface.h @@ -72,9 +72,9 @@ class OpenTxFirmware: public Firmware virtual QString getFirmwareUrl() override { return ""; } // depreciated; - virtual int getCapability(Capability) override; + virtual int getCapability(::Capability) override; - virtual QString getCapabilityStr(Capability) override; + virtual QString getCapabilityStr(::Capability) override; virtual QString getAnalogInputName(unsigned int index) override { diff --git a/companion/src/generaledit/generalsetup.cpp b/companion/src/generaledit/generalsetup.cpp index 5869b9779..4e5fe02dc 100644 --- a/companion/src/generaledit/generalsetup.cpp +++ b/companion/src/generaledit/generalsetup.cpp @@ -110,13 +110,7 @@ ui(new Ui::GeneralSetup) ui->backlightswCB->setModel(panelFilteredModels->getItemModel(FIM_BACKLIGHTMODE)); ui->backlightswCB->setCurrentIndex(ui->backlightswCB->findData(generalSettings.backlightMode)); - if (!firmware->getCapability(MultiLangVoice)) { - ui->VoiceLang_label->hide(); - ui->voiceLang_CB->hide(); - } - else { - populateVoiceLangCB(ui->voiceLang_CB, generalSettings.ttsLanguage); - } + populateVoiceLangCB(ui->voiceLang_CB, generalSettings.ttsLanguage); populateTextLangCB(ui->textLang_CB, generalSettings.uiLanguage, Boards::getCapability(board, Board::HasColorLcd)); if (!firmware->getCapability(MavlinkTelemetry)) { @@ -127,61 +121,19 @@ ui(new Ui::GeneralSetup) ui->mavbaud_CB->setCurrentIndex(generalSettings.mavbaud); } - if (!firmware->getCapability(HasSoundMixer)) { - ui->beepVolume_SL->hide(); - ui->beepVolume_label->hide(); - ui->varioVolume_SL->hide(); - ui->varioVolume_label->hide(); - ui->bgVolume_SL->hide(); - ui->bgVolume_label->hide(); - ui->wavVolume_SL->hide(); - ui->wavVolume_label->hide(); - ui->varioP0_label->hide(); - ui->varioP0_SB->hide(); - ui->varioPMax_label->hide(); - ui->varioPMax_SB->hide(); - ui->varioR0_label->hide(); - ui->varioR0_SB->hide(); - } - else { - ui->beepVolume_SL->setValue(generalSettings.beepVolume); - ui->varioVolume_SL->setValue(generalSettings.varioVolume); - ui->bgVolume_SL->setValue(generalSettings.backgroundVolume); - ui->wavVolume_SL->setValue(generalSettings.wavVolume); - ui->varioP0_SB->setValue(700 + (generalSettings.varioPitch * 10)); - updateVarioPitchRange(); - ui->varioPMax_SB->setValue(700 + (generalSettings.varioPitch * 10) + 1000 + (generalSettings.varioRange * 10)); - ui->varioR0_SB->setValue(500 + (generalSettings.varioRepeat * 10)); - } - - if (!firmware->getCapability(HasFAIMode)) { - ui->faimode_CB->hide(); - ui->label_faimode->hide(); - } - else { - ui->faimode_CB->setChecked(generalSettings.fai); - } - - if (!firmware->getCapability(HasPxxCountry)) { - ui->countrycode_label->hide(); - ui->countrycode_CB->hide(); - } - else { - ui->countrycode_CB->setCurrentIndex(generalSettings.countryCode); - } - - if (!firmware->getCapability(HasGeneralUnits)) { - ui->units_label->hide(); - ui->units_CB->hide(); - } - else { - ui->units_CB->setCurrentIndex(generalSettings.imperial); - } - + ui->beepVolume_SL->setValue(generalSettings.beepVolume); + ui->varioVolume_SL->setValue(generalSettings.varioVolume); + ui->bgVolume_SL->setValue(generalSettings.backgroundVolume); + ui->wavVolume_SL->setValue(generalSettings.wavVolume); + ui->varioP0_SB->setValue(700 + (generalSettings.varioPitch * 10)); + updateVarioPitchRange(); + ui->varioPMax_SB->setValue(700 + (generalSettings.varioPitch * 10) + 1000 + (generalSettings.varioRange * 10)); + ui->varioR0_SB->setValue(500 + (generalSettings.varioRepeat * 10)); + ui->faimode_CB->setChecked(generalSettings.fai); + ui->countrycode_CB->setCurrentIndex(generalSettings.countryCode); + ui->units_CB->setCurrentIndex(generalSettings.imperial); 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)) { @@ -208,7 +160,7 @@ ui(new Ui::GeneralSetup) ui->hatsModeCB->hide(); } - if (firmware->getCapability(HasSwitchableJack)) { + if (Boards::getCapability(board, Board::HasSwitchableJack)) { ui->jackModeCB->setCurrentIndex(generalSettings.jackMode); } else { @@ -216,29 +168,7 @@ ui(new Ui::GeneralSetup) ui->jackModeCB->hide(); } - if (!firmware->getCapability(OptrexDisplay)) { - ui->label_displayType->hide(); - ui->displayTypeCB->setDisabled(true); - ui->displayTypeCB->hide(); - } - else { - ui->displayTypeCB->setCurrentIndex(generalSettings.optrexDisplay); - } - - if (!firmware->getCapability(HasVolume)) { - ui->volume_SL->hide(); - ui->volume_SL->setDisabled(true); - ui->label_volume->hide(); - } - else { - ui->volume_SL->setMaximum(firmware->getCapability(MaxVolume)); - } - - if (!firmware->getCapability(HasBrightness)) { - ui->BLBright_SB->hide(); - ui->BLBright_SB->setDisabled(true); - ui->label_BLBright->hide(); - } + ui->volume_SL->setMaximum(Boards::getCapability(board, Board::MaxVolume)); if (!IS_FAMILY_HORUS_OR_T16(board)) { ui->OFFBright_SB->hide(); @@ -252,18 +182,6 @@ ui(new Ui::GeneralSetup) ui->label_KeysBl->hide(); } - if (!firmware->getCapability(SoundMod)) { - ui->soundModeCB->setDisabled(true); - ui->label_soundMode->hide(); - ui->soundModeCB->hide(); - } - - if (!firmware->getCapability(SoundPitch)) { - ui->speakerPitchSB->setDisabled(true); - ui->label_speakerPitch->hide(); - ui->speakerPitchSB->hide(); - } - if (!firmware->getCapability(Haptic)) { ui->hapticStrength->setDisabled(true); ui->hapticmodeCB->setDisabled(true); @@ -273,8 +191,8 @@ ui(new Ui::GeneralSetup) ui->backlightautoSB->setMinimum(5); } - ui->contrastSB->setMinimum(firmware->getCapability(MinContrast)); - ui->contrastSB->setMaximum(firmware->getCapability(MaxContrast)); + ui->contrastSB->setMinimum(Boards::getCapability(board, Board::MinContrast)); + ui->contrastSB->setMaximum(Boards::getCapability(board, Board::MaxContrast)); ui->contrastSB->setValue(generalSettings.contrast); ui->battwarningDSB->setValue((double)generalSettings.vBatWarn / 10); @@ -292,7 +210,7 @@ ui(new Ui::GeneralSetup) ui->splashScreenDuration->setItemText(0, QCoreApplication::translate("GeneralSetup", "1s", nullptr)); } - if (!firmware->getCapability(PwrButtonPress)) { + if (!Boards::getCapability(board, Board::PwrButtonPress)) { ui->pwrOnDelayLabel->hide(); ui->pwrOnDelay->hide(); ui->pwrOffDelayLabel->hide(); @@ -352,14 +270,6 @@ ui(new Ui::GeneralSetup) ui->switchesDelay->setValue(10 * (generalSettings.switchesDelay + 15)); ui->blAlarm_ChkB->setChecked(generalSettings.alarmsFlash); - if (!firmware->getCapability(HasBatMeterRange)) { - ui->batMeterRangeLabel->hide(); - ui->HasBatMeterMinRangeLabel->hide(); - ui->HasBatMeterMaxRangeLabel->hide(); - ui->vBatMinDSB->hide(); - ui->vBatMaxDSB->hide(); - } - if (Boards::getCapability(board, Board::Surface)) { ui->stickModeLabel->hide(); ui->stickmodeCB->hide(); @@ -620,33 +530,25 @@ void GeneralSetupPanel::setValues() ui->label_HL->hide(); ui->hapticLengthCB->hide(); } - ui->OFFBright_SB->setMinimum(firmware->getCapability(BacklightLevelMin)); + ui->OFFBright_SB->setMinimum(Boards::getCapability(board, Board::BacklightLevelMin)); if (generalSettings.backlightOffBright > 100 - generalSettings.backlightBright) generalSettings.backlightOffBright = 100 - generalSettings.backlightBright; ui->BLBright_SB->setValue(100 - generalSettings.backlightBright); ui->OFFBright_SB->setValue(generalSettings.backlightOffBright); ui->BLBright_SB->setMinimum(ui->OFFBright_SB->value()); ui->OFFBright_SB->setMaximum(ui->BLBright_SB->value()); - ui->soundModeCB->setCurrentIndex(generalSettings.speakerMode); ui->volume_SL->setValue(generalSettings.speakerVolume + 12); ui->beeperlenCB->setCurrentIndex(generalSettings.beeperLength + 2); ui->speakerPitchSB->setValue(generalSettings.speakerPitch); ui->hapticStrength->setValue(generalSettings.hapticStrength); ui->hapticmodeCB->setCurrentIndex(generalSettings.hapticMode + 2); - - if (firmware->getCapability(HasBatMeterRange)) { - ui->vBatMinDSB->setValue((double)(generalSettings.vBatMin + 90) / 10); - ui->vBatMaxDSB->setValue((double)(generalSettings.vBatMax + 120) / 10); - } - + ui->vBatMinDSB->setValue((double)(generalSettings.vBatMin + 90) / 10); + ui->vBatMaxDSB->setValue((double)(generalSettings.vBatMax + 120) / 10); ui->pwrOnDelay->setCurrentIndex(pwrDelayFromYaml(generalSettings.pwrOnSpeed)); ui->pwrOffDelay->setCurrentIndex(pwrDelayFromYaml(generalSettings.pwrOffSpeed)); ui->pwrOffIfInactiveSB->setValue(generalSettings.pwrOffIfInactive); - ui->registrationId->setText(generalSettings.registrationId); - ui->startSoundCB->setChecked(!generalSettings.dontPlayHello); - ui->modelQuickSelect_CB->setChecked(generalSettings.modelQuickSelect); if (Boards::getCapability(board, Board::HasColorLcd)) { @@ -724,14 +626,6 @@ void GeneralSetupPanel::on_hapticStrength_valueChanged() } } -void GeneralSetupPanel::on_soundModeCB_currentIndexChanged(int index) -{ - if (!lock) { - generalSettings.speakerMode = index; - emit modified(); - } -} - void GeneralSetupPanel::on_splashScreenDuration_currentIndexChanged(int index) { if (!lock) { @@ -1036,14 +930,6 @@ void GeneralSetupPanel::on_beeperCB_currentIndexChanged(int index) } } -void GeneralSetupPanel::on_displayTypeCB_currentIndexChanged(int index) -{ - if (!lock) { - generalSettings.optrexDisplay = index; - emit modified(); - } -} - void GeneralSetupPanel::on_hapticmodeCB_currentIndexChanged(int index) { if (!lock) { @@ -1052,7 +938,6 @@ void GeneralSetupPanel::on_hapticmodeCB_currentIndexChanged(int index) } } - void GeneralSetupPanel::on_channelorderCB_currentIndexChanged(int index) { if (!lock) { diff --git a/companion/src/generaledit/generalsetup.h b/companion/src/generaledit/generalsetup.h index 2e996e45d..8ccac7c24 100644 --- a/companion/src/generaledit/generalsetup.h +++ b/companion/src/generaledit/generalsetup.h @@ -44,7 +44,6 @@ class GeneralSetupPanel : public GeneralPanel void on_rssiPowerOffWarnChkB_stateChanged(int); void on_trainerPowerOffWarnChkB_stateChanged(int); void on_gpsFormatCB_currentIndexChanged(int index); - void on_displayTypeCB_currentIndexChanged(int index); void on_BLBright_SB_editingFinished(); void on_OFFBright_SB_editingFinished(); void on_brightCtrl_CB_currentIndexChanged(int index); @@ -57,7 +56,6 @@ class GeneralSetupPanel : public GeneralPanel void on_timezoneLE_textEdited(const QString &text); void on_adjustRTC_stateChanged(int); void on_hapticStrength_valueChanged(); - void on_soundModeCB_currentIndexChanged(int index); void on_beeperlenCB_currentIndexChanged(int index); void on_volume_SL_valueChanged(); void on_hapticmodeCB_currentIndexChanged(int index); diff --git a/companion/src/generaledit/generalsetup.ui b/companion/src/generaledit/generalsetup.ui index 8bb5eb434..34e31839e 100644 --- a/companion/src/generaledit/generalsetup.ui +++ b/companion/src/generaledit/generalsetup.ui @@ -503,41 +503,38 @@ - - + + + + + Large image (2 columns) + + + + + Small image (3 columns) + + + + + Name only (2 columns) + + + + + Name only (1 column) + + + + + + - Backlight Brightness + - - - - - - - - - Automatically adjust the radio's clock if a GPS is connected to telemetry. - - - Qt::LayoutDirection::LeftToRight - - - Adjust RTC - - - - - - - - - Backlight Auto OFF after - - - - + @@ -569,28 +566,33 @@ - - + + - Wav volume + Speaker Volume - - - - - Match all - - - - - Match any - - + + + + 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). @@ -600,77 +602,8 @@ - - - - Keys Backlight - - - - - - - Background volume - - - - - - - Vario repeat at zero - - - - - - - Owner Registration ID - - - - - - - Label selection mode - - - - - - - 23 - - - 5 - - - 0 - - - Qt::Orientation::Horizontal - - - - - - - - - - - 100 - - - - - - - Label matching - - - - - + + -2 @@ -685,80 +618,31 @@ - - + + - FAI Mode + Vario volume - - - - - Multi select - - - - - Single select - - + + + + 8 + - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - + + - - + + - + Vario repeat at zero - - - - Backlight OFF Brightness - - - - - - - Backlight Control - - - - - - - - - - - - - This is the switch selectrion for turning on the backlight (if installed). - - - - - -1 - - - - + ms @@ -777,76 +661,142 @@ - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal + + + + Voice Language - - - - If you enable FAI, only RSSI and RxBt sensors will keep working. This function cannot be disabled by the radio. + + + + 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 + + + + + - - - - Hz - - - 1300 - - - 2900 - - - 10 - - - 1700 + + + + Backlight flash on alarm - - - - - Large image (2 columns) - - - - - Small image (3 columns) - - - - - Name only (2 columns) - - - - - Name only (1 column) - - + + + + Label selection mode + - + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + @@ -874,97 +824,57 @@ - - - - - - - - Beeper - - - - - Speaker - - - - - BeeperVoice - - - - - SpeakerVoice - - - - - - - - Vario volume + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal - - - - 8 - - + + - - - - Country Code - - - - - - - Voice Language - - - - - - - Text Language - - - - + Speaker Pitch (spkr only) - - + + - Vario pitch at zero + Manage Models layout - - - - 5 - - - 100 + + + + Country Code - - + + + + Rotary Encoder Mode + - + + + + @@ -977,39 +887,23 @@ - - - - Hz - + + - 300 + -2 - 1100 + 2 - - 10 + + 1 - - 700 + + Qt::Orientation::Horizontal - - - - - - - - - - - - - - + @@ -1023,49 +917,232 @@ - - + + - Sound Mode + Vario pitch at max - - + + - Timeshift from UTC + 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 + + + + + + - Beep volume + Keys Backlight - - - - Backlight flash on alarm + + + + Hz + + + 1300 + + + 2900 + + + 10 + + + 1700 - - + + - Backlight Switch + 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 + + + + @@ -1093,130 +1170,20 @@ - - - - - America - - - - - Japan - - - - - Europe - - - + + - - + + - Manage Models layout + Background volume - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - + + - Rotary Encoder Mode - - - - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal - - - - - - - Model quick select - - - - - - - Speaker Volume - - - - - - - Volume Control - - - - - - - - - - - - - <!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 - - - - - - - Vario pitch at max - - - - - - - Favorites matching + Timeshift from UTC @@ -1227,291 +1194,7 @@ p, li { white-space: pre-wrap; } QLayout::SizeConstraint::SetDefaultConstraint - - - - - 0s - - - - - 0.5s - - - - - 1s - - - - - 2s - - - - - 3s - - - - - - - - - - - - - - <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> - - - -1 - - - - - - - - 0 - 0 - - - - Play Delay (switch mid position) - - - - - - - - 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 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Haptic Strength - - - - - - - - 0 - 0 - - - - - 20 - 0 - - - - - - - Battery Warning - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Haptic Mode - - - - - - - - - - 0 - 0 - - - - - --- - - - - - 2s - - - - - 3s - - - - - 4s - - - - - 6s - - - - - 8s - - - - - 10s - - - - - 15s - - - - - - - - - - Trainer Poweroff Warning - - - - - - - Measurement Units - - - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Beeper Length - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - - - - - - - - - 10 - - - 45 - - - 25 - - - - - - - GPS Coordinates - - - - + @@ -1552,153 +1235,6 @@ p, li { white-space: pre-wrap; } - - - - Hats Mode - - - - - - - - Ask on Connect - - - - - Joystick (HID) - - - - - USB Mass Storage - - - - - USB Serial (CDC) - - - - - - - - PPM Units - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - X-Short - - - - - Short - - - - - Normal - - - - - Long - - - - - X-Long - - - - - - - - - 0 - 0 - - - - MAVLink Baud Rate - - - - - - - - 0s - - - - - 0.5s - - - - - 1s - - - - - 2s - - - - - 3s - - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - Standard - - - - - Optrex - - - - @@ -1748,363 +1284,20 @@ Acceptable values are 3v..12v - - + + - USB Mode + GPS Coordinates - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - Contrast - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Show Splash Screen on Startup - - - - - - - - 0 - 0 - - - - Default Channel Order - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - Quiet - - - - - Only Alarms - - - - - No Keys - - - - - All - - - - - - - - - DMS - - - - - NMEA - - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - - - - - - If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. - - - min - - - 120 - - - - + - - - - - - - - - - Mode selection: - -Mode 1: - Left stick: Elevator, Rudder - Right stick: Throttle, Aileron - -Mode 2: - Left stick: Throttle, Rudder - Right stick: Elevator, Aileron - -Mode 3: - Left stick: Elevator, Aileron - Right stick: Throttle, Rudder - -Mode 4: - Left stick: Throttle, Aileron - Right stick: Elevator, Rudder - - - - - -1 - - - - - - - Power ON/OFF Haptic - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - LCD Display Type - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Inactivity Timer - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - - X-Short - - - - - Short - - - - - Normal - - - - - Long - - - - - X-Long - - - - - - - - Power Off Delay - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - Low EEPROM Warning - - - - - - - - Metric - - - - - Imperial - - - - - - - - 0.-- - - - - 0.-- - - - - - 0.0 - - - - - us - - - - - - - - - Ask on Connect - - - - - Audio - - - - - Trainer - - - - - - - - Stick Mode - - - @@ -2156,14 +1349,62 @@ Mode 4: - + Play Startup Sound - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + Contrast + + + + + + + Power Off Delay + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Haptic Mode + + + + @@ -2182,40 +1423,322 @@ Mode 4: - - - - + + + + + 0 + 0 + - - + + + 0 + 0 + + + + Show Splash Screen on Startup + + + + + + + + DMS + + + + + NMEA + + + + + + + + + 0 + 0 + + + + MAVLink Baud Rate + + + + + + + + Metric + + + + + Imperial + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Haptic Strength + + + + + + + Measurement Units + + + + + + + + 0 + 0 + + + + Default Channel Order + + + + + + + + 0s + + + + + 0.5s + + + + + 1s + + + + + 2s + + + + + 3s + + + + + + + + Stick Mode + + + + + + + + 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=" 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> +<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> - - ms + + - - 0 - - - 1000 - - - 10 - - - 0 + + true - + + + + + + + 0 + 0 + + + + + --- + + + + + 2s + + + + + 3s + + + + + 4s + + + + + 6s + + + + + 8s + + + + + 10s + + + + + 15s + + + + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + X-Short + + + + + Short + + + + + Normal + + + + + Long + + + + + X-Long + + + + + + + + Power ON/OFF Haptic + + + + + + + Trainer Poweroff Warning + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + Quiet + + + + + Only Alarms + + + + + No Keys + + + + + All + + + + + @@ -2256,29 +1779,70 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 0 - 0 - - + + + + + 0s + + + + + 0.5s + + + + + 1s + + + + + 2s + + + + + 3s + + + + + + + + + Ask on Connect + + + + + Joystick (HID) + + + + + USB Mass Storage + + + + + USB Serial (CDC) + + + + + + - Haptic Length + Jack Mode - - + + - Power On Delay + Power Auto Off @@ -2301,7 +1865,41 @@ p, li { white-space: pre-wrap; } - + + + + + + + + + + Mode selection: + +Mode 1: + Left stick: Elevator, Rudder + Right stick: Throttle, Aileron + +Mode 2: + Left stick: Throttle, Rudder + Right stick: Elevator, Aileron + +Mode 3: + Left stick: Elevator, Aileron + Right stick: Throttle, Rudder + +Mode 4: + Left stick: Throttle, Aileron + Right stick: Elevator, Rudder + + + + + -1 + + + + @@ -2345,52 +1943,26 @@ p, li { white-space: pre-wrap; } - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - - - - Jack Mode - - - - - - - - 0 - 0 - - - - - 0 - 22 - - - - -2 - - - 2 - - - 1 - - - Qt::Orientation::Horizontal + + + + 0.-- + + + 0.-- + + + + + 0.0 + + + + + us + + @@ -2455,26 +2027,7 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 0 - 0 - - - - Battery Meter Range - - - - + @@ -2493,15 +2046,215 @@ 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=" 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> + + + ms + + + 0 + + + 1000 + + + 10 + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + + + + + + + + + 10 + + + 45 + + + 25 + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + + + + + + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. + + + min + + + 120 + + + + + + + PPM Units + + + + + + + + + + + 0 + 0 + + + + + 0 + 22 + + + + + X-Short + + + + + Short + + + + + Normal + + + + + Long + + + + + X-Long + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Haptic Length + + + + + + + Qt::Orientation::Vertical + + + + 20 + 40 + + + + + - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + Beeper Length + + + + + 0 @@ -2535,14 +2288,80 @@ p, li { white-space: pre-wrap; } - - - - Power Auto Off + + + + + 0 + 0 + + + + + 0 + 22 + + + + -2 + + + 2 + + + 1 + + + Qt::Orientation::Horizontal - + + + + + + + + + + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> + + + -1 + + + + + + + + 0 + 0 + + + + + 20 + 0 + + + + + + + Battery Warning + + + + + + + Power On Delay + + + + min @@ -2552,6 +2371,109 @@ p, li { white-space: pre-wrap; } + + + + + Ask on Connect + + + + + Audio + + + + + Trainer + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Inactivity Timer + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Battery Meter Range + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Low EEPROM Warning + + + + + + + Hats Mode + + + + + + + USB Mode + + + + + + + + 0 + 0 + + + + Play Delay (switch mid position) + + + diff --git a/companion/src/generaledit/hardware.cpp b/companion/src/generaledit/hardware.cpp index 8c9ba3989..72a7b447b 100644 --- a/companion/src/generaledit/hardware.cpp +++ b/companion/src/generaledit/hardware.cpp @@ -192,13 +192,11 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings addParams(); } - if (firmware->getCapability(HasADCJitterFilter)) { - addLabel(tr("ADC Filter")); - AutoCheckBox *filterEnable = new AutoCheckBox(this); - filterEnable->setField(generalSettings.noJitterFilter, this, true); - params->append(filterEnable); - addParams(); - } + addLabel(tr("ADC Filter")); + AutoCheckBox *filterEnable = new AutoCheckBox(this); + filterEnable->setField(generalSettings.noJitterFilter, this, true); + params->append(filterEnable); + addParams(); if (Boards::getCapability(board, Board::HasAudioMuteGPIO)) { addLabel(tr("Mute if no sound")); @@ -208,7 +206,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings addParams(); } - if (firmware->getCapability(HasBluetooth)) { + if (Boards::getCapability(board, Board::HasBluetooth)) { addLabel(tr("Bluetooth")); AutoComboBox *bluetoothMode = new AutoComboBox(this); @@ -284,10 +282,12 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings ExclusiveComboGroup *exclGroup = new ExclusiveComboGroup( this, [=](const QVariant &value) { return value == 0; }); - if (firmware->getCapability(HasAuxSerialMode) || firmware->getCapability(HasAux2SerialMode) || firmware->getCapability(HasVCPSerialMode)) + if (Boards::getCapability(board, Board::HasAuxSerialMode) || + Boards::getCapability(board, Board::HasAux2SerialMode) || + Boards::getCapability(board, Board::HasVCPSerialMode)) addSection(tr("Serial ports")); - if (firmware->getCapability(HasAuxSerialMode)) { + if (Boards::getCapability(board, Board::HasAuxSerialMode)) { addLabel(tr("AUX1")); AutoComboBox *serialPortMode = new AutoComboBox(this); serialPortMode->setModel(tabFilteredModels->getItemModel(FIM_AUX1SERIALMODES)); @@ -302,11 +302,11 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings addParams(); - if (!firmware->getCapability(HasSoftwareSerialPower)) + if (!Boards::getCapability(board, Board::HasSoftwareSerialPower)) serialPortPower->setVisible(false); } - if (firmware->getCapability(HasAux2SerialMode)) { + if (Boards::getCapability(board, Board::HasAux2SerialMode)) { addLabel(tr("AUX2")); AutoComboBox *serialPortMode = new AutoComboBox(this); serialPortMode->setModel(tabFilteredModels->getItemModel(FIM_AUX2SERIALMODES)); @@ -321,11 +321,11 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings addParams(); - if (!firmware->getCapability(HasSoftwareSerialPower)) + if (!Boards::getCapability(board, Board::HasSoftwareSerialPower)) serialPortPower->setVisible(false); } - if (firmware->getCapability(HasVCPSerialMode)) { + if (Boards::getCapability(board, Board::HasVCPSerialMode)) { addLabel(tr("USB-VCP")); serialPortUSBVCP = new AutoComboBox(this); serialPortUSBVCP->setModel(tabFilteredModels->getItemModel(FIM_VCPSERIALMODES)); @@ -345,16 +345,6 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings addParams(); } - if (firmware->getCapability(HastxCurrentCalibration)) { - addLabel(tr("Current Offset")); - AutoSpinBox *txCurrentCalibration = new AutoSpinBox(this); - FieldRange txCCRng = GeneralSettings::getTxCurrentCalibration(); - txCurrentCalibration->setSuffix(txCCRng.unit); - txCurrentCalibration->setField(generalSettings.txCurrentCalibration); - params->append(txCurrentCalibration); - addParams(); - } - if (Boards::getCapability(board, Board::LcdWidth) == 128) { addSection(tr("Screen")); diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 0cf558576..d64ccab66 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -55,6 +55,8 @@ MainWindow::MainWindow(): updateFactories(nullptr), windowsListActions(new QActionGroup(this)) { + //Boards::tests(); + // setUnifiedTitleAndToolBarOnMac(true); this->setWindowIcon(QIcon(":/icon.png")); setAcceptDrops(true); diff --git a/companion/src/modeledit/channels.cpp b/companion/src/modeledit/channels.cpp index b05717e98..980ae5883 100644 --- a/companion/src/modeledit/channels.cpp +++ b/companion/src/modeledit/channels.cpp @@ -104,9 +104,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting connectItemModelEvents(dialogFilteredItemModels->getItemModel(crvid)); int gvid = dialogFilteredItemModels->registerItemModel(new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_GVarRef)), "GVarRef"); - - curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, - firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter); + curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0); QStringList headerLabels; headerLabels << "#"; @@ -118,8 +116,7 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting headerLabels << tr("Curve") << tr("Plot"); if (firmware->getCapability(PPMCenter)) headerLabels << tr("PPM Center"); - if (firmware->getCapability(SYMLimits)) - headerLabels << tr("Linear Subtrim"); + headerLabels << tr("Linear Subtrim"); TableLayout *tableLayout = new TableLayout(this, chnCapability, headerLabels); for (int i = 0; i < chnCapability; i++) { @@ -192,13 +189,11 @@ ChannelsPanel::ChannelsPanel(QWidget * parent, ModelData & model, GeneralSetting } // Symetrical limits - if (firmware->getCapability(SYMLimits)) { - symlimitsChk[i] = new QCheckBox(this); - symlimitsChk[i]->setProperty("index", i); - symlimitsChk[i]->setChecked(model.limitData[i].symetrical); - connect(symlimitsChk[i], SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited())); - tableLayout->addWidget(i, col++, symlimitsChk[i]); - } + symlimitsChk[i] = new QCheckBox(this); + symlimitsChk[i]->setProperty("index", i); + symlimitsChk[i]->setChecked(model.limitData[i].symetrical); + connect(symlimitsChk[i], SIGNAL(toggled(bool)), this, SLOT(symlimitsEdited())); + tableLayout->addWidget(i, col++, symlimitsChk[i]); } update(); @@ -301,12 +296,12 @@ void ChannelsPanel::updateLine(int i) chnMin[i]->setValue(chn.min); chnMax[i]->setValue(chn.max); invCB[i]->setCurrentIndex((chn.revert) ? 1 : 0); + if (firmware->getCapability(PPMCenter)) { centerSB[i]->setValue(chn.ppmCenter + 1500); } - if (firmware->getCapability(SYMLimits)) { - symlimitsChk[i]->setChecked(chn.symetrical); - } + + symlimitsChk[i]->setChecked(chn.symetrical); lock = false; } diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 1077c327c..736487dc2 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -75,14 +75,12 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, "RawSource GVars"); connectItemModelEvents(tabFilterFactory->getItemModel(rawSourceGVarsId)); - if (!firmware->getCapability(VoicesAsNumbers)) { - tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength)); - for (int i = 0; i < fswCapability; i++) { - if (functions[i].func == FuncPlayPrompt || functions[i].func == FuncBackgroundMusic) { - QString temp = functions[i].paramarm; - if (!temp.isEmpty()) { - tracksSet.insert(temp); - } + tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength)); + for (int i = 0; i < fswCapability; i++) { + if (functions[i].func == FuncPlayPrompt || functions[i].func == FuncBackgroundMusic) { + QString temp = functions[i].paramarm; + if (!temp.isEmpty()) { + tracksSet.insert(temp); } } } @@ -270,15 +268,10 @@ bool CustomFunctionsPanel::playSound(int index) if (!QDir(path).exists()) return false; // unlikely - if (firmware->getCapability(VoicesAsNumbers)) { // AVR - path.append(QString("/%1.wav").arg(int(fswtchParam[index]->value()), 4, 10, QChar('0'))); - } - else { - QString lang(generalSettings.ttsLanguage); - if (lang.isEmpty()) - lang = "en"; - path.append(QString("/SOUNDS/%1/%2.wav").arg(lang).arg(fswtchParamArmT[index]->currentText())); - } + QString lang(generalSettings.ttsLanguage); + if (lang.isEmpty()) + lang = "en"; + path.append(QString("/SOUNDS/%1/%2.wav").arg(lang).arg(fswtchParamArmT[index]->currentText())); } if (!QFileInfo::exists(path) || !QFileInfo(path).isReadable()) { @@ -488,7 +481,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool changed) populateFuncParamCB(fswtchParamT[i], func, cfn.param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; } - else if (func == FuncPlaySound || func == FuncPlayHaptic || func == FuncPlayValue || func == FuncPlayPrompt || func == FuncPlayBoth || func == FuncBackgroundMusic || func == FuncSetScreen) { + else if (func == FuncPlaySound || func == FuncPlayHaptic || func == FuncPlayValue || func == FuncPlayPrompt || func == FuncBackgroundMusic || func == FuncSetScreen) { if (func != FuncBackgroundMusic) { if (changed) cfn.repeatParam = fswtchRepeat[i]->currentData().toInt(); @@ -502,49 +495,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool changed) populateFuncParamCB(fswtchParamT[i], func, cfn.param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_REPEAT; } - else if (func == FuncPlayPrompt || func == FuncPlayBoth) { - if (firmware->getCapability(VoicesAsNumbers)) { - fswtchParam[i]->setDecimals(0); - fswtchParam[i]->setSingleStep(1); - fswtchParam[i]->setMinimum(0); - if (func == FuncPlayPrompt) { - widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT | CUSTOM_FUNCTION_GV_TOOGLE; - } - else { - widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM | CUSTOM_FUNCTION_REPEAT; - fswtchParamGV[i]->setChecked(false); - } - fswtchParam[i]->setMaximum(func == FuncPlayBoth ? 254 : 255); - if (changed) { - if (fswtchParamGV[i]->isChecked()) { - fswtchParam[i]->setMinimum(1); - cfn.param = std::min(fswtchParam[i]->value(), 5.0) + (fswtchParamGV[i]->isChecked() ? 250 : 0); - } - else { - cfn.param = fswtchParam[i]->value(); - } - } - if (cfn.param > 250 && (func != FuncPlayBoth)) { - fswtchParamGV[i]->setChecked(true); - fswtchParam[i]->setValue(cfn.param - 250); - fswtchParam[i]->setMaximum(5); - } - else { - fswtchParamGV[i]->setChecked(false); - fswtchParam[i]->setValue(cfn.param); - } - if (cfn.param < 251) - widgetsMask |= CUSTOM_FUNCTION_PLAY; + else if (func == FuncPlayPrompt) { + widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM; + if (changed) { + Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength)); } - else { - widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM; - if (changed) { - Helpers::getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength)); - } - Helpers::populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm); - if (fswtchParamArmT[i]->currentText() != CPN_STR_NONE_ITEM) { - widgetsMask |= CUSTOM_FUNCTION_PLAY; - } + Helpers::populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm); + if (fswtchParamArmT[i]->currentText() != CPN_STR_NONE_ITEM) { + widgetsMask |= CUSTOM_FUNCTION_PLAY; } } else if (func == FuncBackgroundMusic) { diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index e71798ad5..f48251d4c 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -67,8 +67,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); }); - curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, - firmware->getCapability(HasInputDiff) ? 0 : FilteredItemModel::PositiveFilter); + curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0); curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc, ui->imgCurve, ed->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this); diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index c024bd412..cd60fc2ac 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -62,23 +62,16 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI ui->swtch->hide(); } - // FadeIn / FadeOut - if (firmware->getCapability(FlightModesHaveFades)) { - int scale = firmware->getCapability(SlowScale); - int range = firmware->getCapability(SlowRange); - ui->fadeIn->setMaximum(float(range) / scale); - ui->fadeIn->setSingleStep(1.0 / scale); - ui->fadeIn->setDecimals((scale == 1 ? 0 :1) ); - connect(ui->fadeIn, SIGNAL(editingFinished()), this, SLOT(phaseFadeIn_editingFinished())); - ui->fadeOut->setMaximum(float(range) / scale); - ui->fadeOut->setSingleStep(1.0 / scale); - ui->fadeOut->setDecimals((scale == 1 ? 0 :1)); - connect(ui->fadeOut, SIGNAL(editingFinished()), this, SLOT(phaseFadeOut_editingFinished())); - } - else { - ui->fadeIn->setDisabled(true); - ui->fadeOut->setDisabled(true); - } + int scale = firmware->getCapability(SlowScale); + int range = firmware->getCapability(SlowRange); + ui->fadeIn->setMaximum(float(range) / scale); + ui->fadeIn->setSingleStep(1.0 / scale); + ui->fadeIn->setDecimals((scale == 1 ? 0 :1) ); + connect(ui->fadeIn, SIGNAL(editingFinished()), this, SLOT(phaseFadeIn_editingFinished())); + ui->fadeOut->setMaximum(float(range) / scale); + ui->fadeOut->setSingleStep(1.0 / scale); + ui->fadeOut->setDecimals((scale == 1 ? 0 :1)); + connect(ui->fadeOut, SIGNAL(editingFinished()), this, SLOT(phaseFadeOut_editingFinished())); // The trims QString labels[CPN_MAX_TRIMS]; diff --git a/companion/src/modeledit/logicalswitches.cpp b/companion/src/modeledit/logicalswitches.cpp index 1115af76a..62eba859c 100644 --- a/companion/src/modeledit/logicalswitches.cpp +++ b/companion/src/modeledit/logicalswitches.cpp @@ -36,8 +36,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, RawSwitch::LogicalSwitchesContext); connectItemModelEvents(rawSwitchFilteredModel); - const int srcGroups = firmware->getCapability(GvarsInCS) ? 0 : (RawSource::AllSourceGroups & ~RawSource::GVarsGroup); - rawSourceFilteredModel = new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource), srcGroups); + rawSourceFilteredModel = new FilteredItemModel(sharedItemModels->getItemModel(AbstractItemModel::IMID_RawSource)); connectItemModelEvents(rawSourceFilteredModel); lsCapability = firmware->getCapability(LogicalSwitches); diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index f8697e5a9..2c3a51749 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -79,21 +79,13 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, connect(offsetEditor, &SourceNumRefEditor::resized, this, [=] () { shrink(); }); - curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, - firmware->getCapability(HasMixerExpo) ? 0 : FilteredItemModel::PositiveFilter); + curveRefFilteredItemModels = new CurveRefFilteredFactory(sharedItemModels, 0); curveGroup = new CurveReferenceUIManager(ui->cboCurveType, ui->chkCurveUseSource, ui->sbCurveValue, ui->cboCurveSource, ui->cboCurveFunc, ui->imgCurve, md->curve, model, sharedItemModels, curveRefFilteredItemModels, esMdl, this); connect(curveGroup, &CurveReferenceUIManager::resized, this, [=] () { shrink(); }); - ui->MixDR_CB->setChecked(md->noExpo == 0); - - if (!firmware->getCapability(HasNoExpo)) { - ui->MixDR_CB->hide(); - ui->label_MixDR->hide(); - } - if (index == 0 || model.mixData[index - 1].destCh != mixdata->destCh) { ui->mltpxCB->hide(); ui->mltpxLbl->hide(); @@ -182,7 +174,6 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData * mixdata, connect(ui->mixerName, SIGNAL(editingFinished()), this, SLOT(valuesChanged())); connect(ui->sourceCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->trimCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); - connect(ui->MixDR_CB, SIGNAL(toggled(bool)), this, SLOT(valuesChanged())); connect(ui->switchesCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->warningCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); connect(ui->mltpxCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged())); @@ -227,13 +218,7 @@ void MixerDialog::valuesChanged() if (!lock) { lock = true; md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt()); - if (firmware->getCapability(HasNoExpo)) { - bool drVisible = (md->srcRaw.type == SOURCE_TYPE_INPUT && md->srcRaw.index < CPN_MAX_STICKS); - ui->MixDR_CB->setEnabled(drVisible); - ui->label_MixDR->setEnabled(drVisible); - } md->carryTrim = -(ui->trimCB->currentIndex() - 1); - md->noExpo = ui->MixDR_CB->checkState() ? 0 : 1; md->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt()); md->mixWarn = ui->warningCB->currentIndex(); md->mltpx = (MltpxValue)ui->mltpxCB->currentIndex(); diff --git a/companion/src/modeledit/mixerdialog.ui b/companion/src/modeledit/mixerdialog.ui index 478b6b90f..d182ff532 100644 --- a/companion/src/modeledit/mixerdialog.ui +++ b/companion/src/modeledit/mixerdialog.ui @@ -29,6 +29,288 @@ + + + + Offset + + + + + + + + + + + + + + OFF + + + + + 1 Beep + + + + + 2 Beeps + + + + + 3 Beeps + + + + + + + + The curve used by the mix + + + + + + + Name + + + + + + + Multiplex + + + + + + + Warning + + + + + + + Switch + + + + + + + Curve + + + + + + + + ADD + + + + + MULTIPLY + + + + + REPLACE + + + + + + + + + No + + + + + Yes + + + + + + + + + + 4 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 3 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 7 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + 2 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + + + + + + + 8 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 0 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + 6 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + 5 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + + + + + + + + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + @@ -51,7 +333,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -63,9 +345,6 @@ - - - @@ -73,146 +352,10 @@ - - - - - - - - - Source - - - - - - - The source for the mixer - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Warning - - - - - - - Weight - - - - - - - Switch - - - - - - - - ADD - - - - - MULTIPLY - - - - - REPLACE - - - - - + - Include DR/Expo - - - - - - - Source - - - - - - - Multiplex - - - - - - - Curve - - - - - - - - - - - No - - - - - Yes - - - - - - - - The curve used by the mix - - - - - - - - - - - - - - Name + Modes @@ -260,7 +403,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal @@ -272,211 +415,54 @@ - - + + + + + + Source + + + + + + + The source for the mixer + + + + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + + - Modes + Weight - - - - - OFF - - - - - 1 Beep - - - - - 2 Beeps - - - - - 3 Beeps - - - - - - - - - - 4 - - - Qt::AlignCenter - - - - - - - 3 - - - Qt::AlignCenter - - - - - - - 7 - - - Qt::AlignCenter - - - - - - - - - - - - - - 2 - - - Qt::AlignCenter - - - - - - - - - - - - - - - - - - - - - 8 - - - Qt::AlignCenter - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - Qt::AlignCenter - - - - - - - 0 - - - Qt::AlignCenter - - - - - - - 6 - - - Qt::AlignCenter - - - - - - - - - - - - - - 5 - - - Qt::AlignCenter - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - + + - Offset + Source @@ -491,10 +477,10 @@ - Qt::Horizontal + Qt::Orientation::Horizontal - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok @@ -516,7 +502,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter 1 @@ -543,7 +529,7 @@ p, li { white-space: pre-wrap; } Up - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -553,7 +539,7 @@ p, li { white-space: pre-wrap; } Down - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -580,7 +566,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter 1 @@ -609,7 +595,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter 1 @@ -632,7 +618,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">If Slow is not zero then the speed of the mix will be set by the value specified -&gt; the value states the number of seconds it takes to transit from -100 to 100.</p></body></html> - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter 1 @@ -651,7 +637,7 @@ p, li { white-space: pre-wrap; } Precision - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -706,7 +692,6 @@ p, li { white-space: pre-wrap; } cboCurveSource sbCurveValue trimCB - MixDR_CB cb_FP0 cb_FP1 cb_FP2 diff --git a/companion/src/modeledit/modeledit.cpp b/companion/src/modeledit/modeledit.cpp index 66585016f..7f9f0ddf1 100644 --- a/companion/src/modeledit/modeledit.cpp +++ b/companion/src/modeledit/modeledit.cpp @@ -112,10 +112,8 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw addTab(new CustomFunctionsPanel(this, &model, generalSettings, firmware, sharedItemModels), tr("Special Functions")); s1.report("Special Functions"); - if (firmware->getCapability(Telemetry)) { - addTab(new TelemetryPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Telemetry")); - s1.report("Telemetry"); - } + addTab(new TelemetryPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Telemetry")); + s1.report("Telemetry"); if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) { addTab(new ColorCustomScreensPanel(this, model, generalSettings, firmware, sharedItemModels), tr("Custom Screens")); diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index 3307211e7..da03850d1 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -178,20 +178,10 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge ui->throttleSource->setModel(panelFilteredModels->getItemModel(FIM_THRSOURCE)); ui->throttleSource->setField(model.thrTraceSrc, this); - if (!firmware->getCapability(HasDisplayText)) { - ui->displayText->hide(); - ui->editChecklist->hide(); - } - if (!firmware->getCapability(GlobalFunctions)) { ui->gfEnabled->hide(); } - if (!firmware->getCapability(HasADCJitterFilter)) - { - ui->jitterFilter->hide(); - } - // Beep Center checkboxes prevFocus = ui->trimsDisplay; diff --git a/companion/src/modeledit/setup_module.cpp b/companion/src/modeledit/setup_module.cpp index 9815ff293..588863a99 100644 --- a/companion/src/modeledit/setup_module.cpp +++ b/companion/src/modeledit/setup_module.cpp @@ -451,8 +451,8 @@ void ModulePanel::update() ui->channelsCount->setEnabled(mask & MASK_CHANNELS_COUNT); ui->channelsCount->setMaximum(module.getMaxChannelCount()); ui->channelsCount->setValue(module.channelsCount); - ui->channelsCount->setSingleStep(firmware->getCapability(HasPPMStart) ? 1 : 2); - + ui->channelsCount->setSingleStep(1); + // CRSF ui->label_crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE); ui->crsfArmingMode->setVisible(mask & MASK_CSRF_ARMING_MODE); diff --git a/companion/src/modeledit/setup_timer.cpp b/companion/src/modeledit/setup_timer.cpp index 2138a85b1..c1ee2b2fd 100644 --- a/companion/src/modeledit/setup_timer.cpp +++ b/companion/src/modeledit/setup_timer.cpp @@ -63,20 +63,10 @@ TimerPanel::TimerPanel(QWidget * parent, ModelData & model, TimerData & timer, G connect(ui->countdownBeep, SIGNAL(currentDataChanged(int)), this, SLOT(onCountdownBeepChanged(int))); ui->minuteBeep->setField(timer.minuteBeep, this); - - if (firmware->getCapability(PermTimers)) { - ui->persistent->setModel(panelItemModels->getItemModel(AIM_TIMER_PERSISTENT)); - ui->persistent->setField(timer.persistent, this); - } - else { - ui->persistent->hide(); - ui->persistentValue->hide(); - } - + ui->persistent->setModel(panelItemModels->getItemModel(AIM_TIMER_PERSISTENT)); + ui->persistent->setField(timer.persistent, this); ui->countdownStart->setModel(panelItemModels->getItemModel(AIM_TIMER_COUNTDOWNSTART)); ui->countdownStart->setField(timer.countdownStart, this); - - ui->showElapsed->setModel(panelItemModels->getItemModel(AIM_TIMER_SHOWELAPSED)); ui->showElapsed->setField(timer.showElapsed, this); @@ -126,10 +116,8 @@ void TimerPanel::update() ui->countdownStart->setEnabled(true); } - if (firmware->getCapability(PermTimers)) { - ui->persistent->updateValue(); - ui->persistentValue->setText(timer.pvalueToString()); - } + ui->persistent->updateValue(); + ui->persistentValue->setText(timer.pvalueToString()); if (timer.val) { ui->showElapsed->setEnabled(true); diff --git a/companion/src/modeledit/telemetry.cpp b/companion/src/modeledit/telemetry.cpp index b24f95e86..1006b6151 100644 --- a/companion/src/modeledit/telemetry.cpp +++ b/companion/src/modeledit/telemetry.cpp @@ -434,9 +434,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin if (sensorCapability > CPN_MAX_SENSORS) // TODO should be role of getCapability sensorCapability = CPN_MAX_SENSORS; - if (firmware->getCapability(NoTelemetryProtocol)) { - model.frsky.usrProto = 1; - } + model.frsky.usrProto = 1; ui->varioSource->setModel(panelFilteredItemModels->getItemModel(FIM_TELEVARIOSRC)); ui->varioSource->setField(model.frsky.varioSource, this); @@ -542,16 +540,9 @@ void TelemetryPanel::setup() } ui->altimetryGB->setVisible(firmware->getCapability(HasVario)), - ui->frskyProtoCB->setDisabled(firmware->getCapability(NoTelemetryProtocol)); - - if (firmware->getCapability(Telemetry)) { - ui->frskyProtoCB->addItem(tr("Winged Shadow How High")); - } - else { - ui->frskyProtoCB->addItem(tr("Winged Shadow How High (not supported)")); - } - - ui->variousGB->hide(); + ui->frskyProtoCB->setDisabled(true); + ui->frskyProtoCB->addItem(tr("Winged Shadow How High")); + ui->variousGB->hide(); // TODO remove from ui design and code lock = false; } diff --git a/companion/src/print/modelprinter.cpp b/companion/src/print/modelprinter.cpp index ed0b5c6ca..194e5445c 100644 --- a/companion/src/print/modelprinter.cpp +++ b/companion/src/print/modelprinter.cpp @@ -420,8 +420,6 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in else if (mix.carryTrim < 0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(mix.carryTrim)-1) + 1).toString(&model, &generalSettings); - if (firmware->getCapability(HasNoExpo) && mix.noExpo) - str += " " + tr("No DR/Expo").toHtmlEscaped(); if (mix.sOffset) str += " " + tr("Offset(%1)").arg(SourceNumRef(mix.sOffset).toString(&model, &generalSettings)).toHtmlEscaped(); if (mix.curve.value) @@ -634,12 +632,11 @@ QString ModelPrinter::printLogicalSwitchLine(int idx) result += RawSwitch(ls.andsw).toString(getCurrentBoard(), &generalSettings); } - if (firmware->getCapability(LogicalSwitchesExt)) { - if (ls.duration) - result += " " + tr("Duration") + QString("(%1s)").arg(ls.duration/10.0); - if (ls.delay) - result += " " + tr("Delay") + QString("(%1s)").arg(ls.delay/10.0); - } + if (ls.duration) + result += " " + tr("Duration") + QString("(%1s)").arg(ls.duration/10.0); + + if (ls.delay) + result += " " + tr("Delay") + QString("(%1s)").arg(ls.delay/10.0); return result; } @@ -746,8 +743,7 @@ QString ModelPrinter::printSettingsOther() { QStringList str; str << printLabelValue(tr("Extended Limits"), printBoolean(model.extendedLimits, BOOLEAN_YESNO)); - if (firmware->getCapability(HasDisplayText)) - str << printLabelValue(tr("Display Checklist"), printBoolean(model.displayChecklist, BOOLEAN_YESNO)); + str << printLabelValue(tr("Display Checklist"), printBoolean(model.displayChecklist, BOOLEAN_YESNO)); if (firmware->getCapability(GlobalFunctions)) str << printLabelValue(tr("Global Functions"), printBoolean(!model.noGlobalFunctions, BOOLEAN_YESNO)); return str.join(" "); diff --git a/companion/src/print/multimodelprinter.cpp b/companion/src/print/multimodelprinter.cpp index ef3205ef3..99ff67196 100644 --- a/companion/src/print/multimodelprinter.cpp +++ b/companion/src/print/multimodelprinter.cpp @@ -274,8 +274,7 @@ QString MultiModelPrinter::print(QTextDocument * document) document->setDefaultStyleSheet(css.text()); QString str = ""; // attributes not settable via QT stylesheet str.append(printSetup()); - if (firmware->getCapability(HasDisplayText)) - str.append(printChecklist()); + str.append(printChecklist()); if (firmware->getCapability(Timers)) { str.append(printTimers()); } @@ -292,18 +291,14 @@ QString MultiModelPrinter::print(QTextDocument * document) str.append(printMixers()); str.append(printOutputs()); str.append(printCurves(document)); - if (firmware->getCapability(Gvars) && !firmware->getCapability(GvarsFlightModes)) - str.append(printGvars()); str.append(printLogicalSwitches()); if (firmware->getCapability(GlobalFunctions)) str.append(printGlobalFunctions()); str.append(printSpecialFunctions()); - if (firmware->getCapability(Telemetry)) { - str.append(printTelemetry()); - str.append(printSensors()); - if (firmware->getCapability(TelemetryCustomScreens)) { - str.append(printTelemetryScreens()); - } + str.append(printTelemetry()); + str.append(printSensors()); + if (firmware->getCapability(TelemetryCustomScreens)) { + str.append(printTelemetryScreens()); } str.append("
"); return str; @@ -463,71 +458,63 @@ QString MultiModelPrinter::printFlightModes() // GVars int gvars = firmware->getCapability(Gvars); - if (gvars && firmware->getCapability(GvarsFlightModes)) { - MultiColumns columns(modelPrinterMap.size()); - columns.appendSectionTableStart(); - QStringList hd = QStringList() << tr("Global vars"); - if (firmware->getCapability(GvarsFlightModes)) { - for (int i = 0; i < gvars; i++) { - hd << tr("GV%1").arg(i + 1); - } - } - columns.appendRowHeader(hd); - int wd = 80 / gvars; - if (firmware->getCapability(GvarsFlightModes)) { - columns.appendRowStart(tr("Name"), 20); - for (int i = 0; i < gvars; i++) { - COMPARECELLWIDTH(model->gvarData[i].name, wd); - } - columns.appendRowEnd(); - columns.appendRowStart(tr("Unit")); - for (int i = 0; i < gvars; i++) { - COMPARECELL(modelPrinter->printGlobalVarUnit(i)); - } - columns.appendRowEnd(); - columns.appendRowStart(tr("Prec")); - for (int i = 0; i < gvars; i++) { - COMPARECELL(modelPrinter->printGlobalVarPrec(i)); - } - columns.appendRowEnd(); - columns.appendRowStart(tr("Min")); - for (int i = 0; i < gvars; i++) { - COMPARECELL(modelPrinter->printGlobalVarMin(i)); - } - columns.appendRowEnd(); - columns.appendRowStart(tr("Max")); - for (int i = 0; i < gvars; i++) { - COMPARECELL(modelPrinter->printGlobalVarMax(i)); - } - columns.appendRowEnd(); - columns.appendRowStart(tr("Popup")); - for (int i = 0; i < gvars; i++) { - COMPARECELL(modelPrinter->printGlobalVarPopup(i)); - } - columns.appendRowEnd(); - } - - columns.appendRowHeader( - QStringList() << (Boards::getCapability(getCurrentBoard(), Board::Air) - ? tr("Flight mode") - : tr("Drive mode"))); - - for (int i = 0; i < firmware->getCapability(FlightModes); i++) { - columns.appendRowStart(); - columns.appendCellStart(0, true); - COMPARE(modelPrinter->printFlightModeName(i)); - columns.appendCellEnd(true); - if (firmware->getCapability(GvarsFlightModes)) { - for (int k = 0; k < gvars; k++) { - COMPARECELL(modelPrinter->printGlobalVar(i, k)); - } - } - - columns.appendRowEnd(); - } - columns.appendTableEnd(); - str.append(columns.print()); + MultiColumns columns(modelPrinterMap.size()); + columns.appendSectionTableStart(); + QStringList hd = QStringList() << tr("Global vars"); + for (int i = 0; i < gvars; i++) { + hd << tr("GV%1").arg(i + 1); } + columns.appendRowHeader(hd); + int wd = 80 / gvars; + columns.appendRowStart(tr("Name"), 20); + for (int i = 0; i < gvars; i++) { + COMPARECELLWIDTH(model->gvarData[i].name, wd); + } + columns.appendRowEnd(); + columns.appendRowStart(tr("Unit")); + for (int i = 0; i < gvars; i++) { + COMPARECELL(modelPrinter->printGlobalVarUnit(i)); + } + columns.appendRowEnd(); + columns.appendRowStart(tr("Prec")); + for (int i = 0; i < gvars; i++) { + COMPARECELL(modelPrinter->printGlobalVarPrec(i)); + } + columns.appendRowEnd(); + columns.appendRowStart(tr("Min")); + for (int i = 0; i < gvars; i++) { + COMPARECELL(modelPrinter->printGlobalVarMin(i)); + } + columns.appendRowEnd(); + columns.appendRowStart(tr("Max")); + for (int i = 0; i < gvars; i++) { + COMPARECELL(modelPrinter->printGlobalVarMax(i)); + } + columns.appendRowEnd(); + columns.appendRowStart(tr("Popup")); + for (int i = 0; i < gvars; i++) { + COMPARECELL(modelPrinter->printGlobalVarPopup(i)); + } + columns.appendRowEnd(); + + columns.appendRowHeader( + QStringList() << (Boards::getCapability(getCurrentBoard(), Board::Air) + ? tr("Flight mode") + : tr("Drive mode"))); + + for (int i = 0; i < firmware->getCapability(FlightModes); i++) { + columns.appendRowStart(); + columns.appendCellStart(0, true); + COMPARE(modelPrinter->printFlightModeName(i)); + columns.appendCellEnd(true); + for (int k = 0; k < gvars; k++) { + COMPARECELL(modelPrinter->printGlobalVar(i, k)); + } + + columns.appendRowEnd(); + } + columns.appendTableEnd(); + str.append(columns.print()); return str; } @@ -542,16 +529,14 @@ QString MultiModelPrinter::printOutputs() hd << tr("Curve"); if (firmware->getCapability(PPMCenter)) hd << tr("PPM"); - if (firmware->getCapability(SYMLimits)) - hd << tr("Linear"); + hd << tr("Linear"); columns.appendRowHeader(hd); int cols = 4; if (IS_HORUS_OR_TARANIS(firmware->getBoard())) cols++; if (firmware->getCapability(PPMCenter)) cols++; - if (firmware->getCapability(SYMLimits)) - cols++; + cols++; int wd = 80/cols; for (int i=0; igetCapability(Outputs); i++) { int count = 0; @@ -573,9 +558,7 @@ QString MultiModelPrinter::printOutputs() if (firmware->getCapability(PPMCenter)) { COMPARECELLWIDTH(modelPrinter->printOutputPpmCenter(i), wd); } - if (firmware->getCapability(SYMLimits)) { - COMPARECELLWIDTH(modelPrinter->printOutputSymetrical(i), wd); - } + COMPARECELLWIDTH(modelPrinter->printOutputSymetrical(i), wd); columns.appendRowEnd(); } columns.appendTableEnd(); @@ -583,27 +566,6 @@ QString MultiModelPrinter::printOutputs() return str; } -QString MultiModelPrinter::printGvars() -{ - QString str = printTitle(tr("Global Variables")); - int gvars = firmware->getCapability(Gvars); - MultiColumns columns(modelPrinterMap.size()); - columns.appendSectionTableStart(); - QStringList hd; - for (int i=0; iflightModeData[0].gvars[i]); - } - columns.appendRowEnd(); - columns.appendTableEnd(); - str.append(columns.print()); - return str; -} - QString MultiModelPrinter::printInputs() { QString str = printTitle(tr("Inputs")); diff --git a/companion/src/print/multimodelprinter.h b/companion/src/print/multimodelprinter.h index 39dae4f5e..dd2a2aeb6 100644 --- a/companion/src/print/multimodelprinter.h +++ b/companion/src/print/multimodelprinter.h @@ -87,7 +87,6 @@ class MultiModelPrinter: public QObject QString printInputs(); QString printMixers(); QString printCurves(QTextDocument * document); - QString printGvars(); QString printLogicalSwitches(); QString printSpecialFunctions(); QString printTelemetry(); diff --git a/companion/src/simulation/simulateduiwidget.cpp b/companion/src/simulation/simulateduiwidget.cpp index 71f150267..ca574c72f 100644 --- a/companion/src/simulation/simulateduiwidget.cpp +++ b/companion/src/simulation/simulateduiwidget.cpp @@ -304,7 +304,7 @@ static const QList radioKeyDefinitions = { void SimulatedUIWidget::addScrollActions() { - if (g.simuScrollButtons() || !getCurrentFirmware()->getCapability(RotaryEncoderNavigation)) + if (g.simuScrollButtons() || !Boards::getCapability(m_board, Board::RotaryEncoderNavigation)) return; const RadioKeyDefinition *updefn = getRadioKeyDefinition(KEY_SCRLUP); @@ -395,7 +395,7 @@ void SimulatedUIWidget::addPushButtons(ButtonsWidget * leftButtons, ButtonsWidge qDebug() << "Unknown key:" << info.key.c_str() << info.name.c_str() << info.label.c_str(); } - if (g.simuScrollButtons() && getCurrentFirmware()->getCapability(RotaryEncoderNavigation)) { + if (g.simuScrollButtons() && Boards::getCapability(m_board, Board::RotaryEncoderNavigation)) { addPushButton(KEY_SCRLUP, tr("Scrl Up"), leftButtons, leftButtonsGrid, rightButtons, rightButtonsGrid); addPushButton(KEY_SCRLDN, tr("Scrl Dn"), leftButtons, leftButtonsGrid, rightButtons, rightButtonsGrid); connectScrollActions(); diff --git a/companion/src/storage/labeled.cpp b/companion/src/storage/labeled.cpp index 0d699d92e..a9dffc28f 100644 --- a/companion/src/storage/labeled.cpp +++ b/companion/src/storage/labeled.cpp @@ -188,7 +188,6 @@ bool LabelsStorageFormat::write(RadioData & radioData) if (loadRadioSettings(gsCur)) { GeneralSettings & gsNew = radioData.generalSettings; - gsNew.txCurrentCalibration = gsCur.txCurrentCalibration; gsNew.txVoltageCalibration = gsCur.txVoltageCalibration; for (int i = 0; i < CPN_MAX_INPUTS; i++) {