/* * Copyright (C) EdgeTX * * Based on code named * opentx - https://github.com/opentx/opentx * th9x - http://code.google.com/p/th9x * er9x - http://code.google.com/p/er9x * gruvin9x - http://code.google.com/p/gruvin9x * * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #pragma once #include "boards.h" #include "macros.h" #include "radiodata.h" #include "../../radio/src/definitions.h" #include "simulatorinterface.h" #include "datahelpers.h" #include #include #include #include #include #include const uint8_t modn12x3[8][4]= { {1, 2, 3, 4}, // air mode 1 {1, 3, 2, 4}, // air mode 2 {4, 2, 3, 1}, // air mode 3 {4, 3, 2, 1}, // air mode 4 {2, 3, 4, 1}, // surface mode 1 {2, 3, 4, 1}, // surface mode 2 {2, 3, 4, 1}, // surface mode 3 {2, 3, 4, 1} // surface mode 4 }; enum Capability { Models, ModelName, FlightModes, FlightModesName, FlightModesHaveFades, Imperial, Mixes, Timers, TimersName, VoicesAsNumbers, VoicesMaxLength, MultiLangVoice, HasModelImage, ModelImageNameLen, ModelImageFilters, ModelImageKeepExtn, CustomFunctions, SafetyChannelCustomFunction, LogicalSwitches, CustomAndSwitches, HasNegAndSwitches, LogicalSwitchesExt, RotaryEncoders, 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, HasFlySkyGimbals, RotaryEncoderNavigation, HasSoftwareSerialPower, HasIntModuleMulti, HasIntModuleCRSF, HasIntModuleELRS, HasIntModuleFlySky, BacklightLevelMin, }; float ValToTim(int value); int TimToVal(float value); void registerOpenTxFirmwares(); void unregisterOpenTxFirmwares(); constexpr char FIRMWARE_ID_PREFIX[] = { "edgetx-" }; class Firmware { Q_DECLARE_TR_FUNCTIONS(Firmware) public: struct Option { const char * name = nullptr; QString tooltip; unsigned variant = 0; explicit Option(const char * name, const QString & description, unsigned variant = 0) : name(name), tooltip(description), variant(variant) { } }; typedef QList