diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 95c1f331f..778ba2230 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -325,6 +325,8 @@ elseif(PCB STREQUAL X7 AND PCBREV STREQUAL ZORRO) set(FLAVOUR zorro) elseif(PCB STREQUAL X7 AND PCBREV STREQUAL LR3PRO) set(FLAVOUR lr3pro) +elseif(PCB STREQUAL X7 AND PCBREV STREQUAL COMMANDO8) + set(FLAVOUR commando8) elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T8) set(FLAVOUR t8) elseif(PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019) diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index 62af87e77..dcb9eb145 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -165,6 +165,26 @@ images/simulator/XLITE/right_left.png images/simulator/XLITE/right_up.png images/simulator/XLITE/right_down.png + images/simulator/LR3PRO/top.png + images/simulator/LR3PRO/bottom.png + images/simulator/LR3PRO/left.png + images/simulator/LR3PRO/right.png + images/simulator/LR3PRO/right_plus.png + images/simulator/LR3PRO/right_minus.png + images/simulator/LR3PRO/right_up.png + images/simulator/LR3PRO/right_down.png + images/simulator/LR3PRO/right_enter.png + images/simulator/LR3PRO/left_escape.png + images/simulator/Commando8/left-mdl.png + images/simulator/Commando8/left-rtn.png + images/simulator/Commando8/left-sys.png + images/simulator/Commando8/right-up.png + images/simulator/Commando8/right-dn.png + images/simulator/Commando8/right-pageup.png + images/simulator/Commando8/right-pagedn.png + images/simulator/Commando8/right-ent.png + images/simulator/Commando8/top.png + images/simulator/Commando8/bottom.png images/simulator/JumperT12/right_up.png images/simulator/JumperT12/right_down.png images/simulator/JumperT12/right_right.png @@ -214,16 +234,6 @@ images/simulator/Zorro/right-mdl.png images/simulator/Zorro/bottom.png images/simulator/Zorro/top.png - images/simulator/LR3PRO/top.png - images/simulator/LR3PRO/bottom.png - images/simulator/LR3PRO/left.png - images/simulator/LR3PRO/right.png - images/simulator/LR3PRO/right_plus.png - images/simulator/LR3PRO/right_minus.png - images/simulator/LR3PRO/right_up.png - images/simulator/LR3PRO/right_down.png - images/simulator/LR3PRO/right_enter.png - images/simulator/LR3PRO/left_escape.png images/simulator/T8/left.png images/simulator/T8/left-pageup.png images/simulator/T8/left-pagedn.png diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index da3bb1db1..6e2f92aa4 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -81,6 +81,8 @@ uint32_t Boards::getFourCC(Type board) return 0x3278746F; case BOARD_BETAFPV_LR3PRO: return 0x4578746F; + case BOARD_IFLIGHT_COMMANDO8: + return 0x4B78746F; // TODO : Check this value case BOARD_JUMPER_T12: return 0x3D78746F; case BOARD_JUMPER_TLITE: @@ -127,6 +129,7 @@ int Boards::getEEpromSize(Board::Type board) case BOARD_TARANIS_X9DP_2019: case BOARD_TARANIS_X9E: case BOARD_BETAFPV_LR3PRO: + case BOARD_IFLIGHT_COMMANDO8: case BOARD_JUMPER_T12: case BOARD_JUMPER_TLITE: case BOARD_JUMPER_TPRO: @@ -169,6 +172,7 @@ int Boards::getFlashSize(Type board) case BOARD_TARANIS_X9DP_2019: case BOARD_TARANIS_X9E: case BOARD_BETAFPV_LR3PRO: + case BOARD_IFLIGHT_COMMANDO8: case BOARD_JUMPER_T12: case BOARD_JUMPER_TLITE: case BOARD_JUMPER_TPRO: @@ -296,6 +300,16 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index) if (index < DIM(switches)) return switches[index]; } + else if (IS_IFLIGHT_COMMANDO8(board)) { + const Board::SwitchInfo switches[] = { + {SWITCH_2POS, "SA"}, + {SWITCH_3POS, "SB"}, + {SWITCH_3POS, "SC"}, + {SWITCH_2POS, "SD"} + }; + if (index < DIM(switches)) + return switches[index]; + } else if (IS_JUMPER_T12(board)) { const Board::SwitchInfo switches[] = { {SWITCH_3POS, "SA"}, @@ -388,7 +402,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) case Pots: if (IS_TARANIS_X9LITE(board)) return 1; - else if (IS_JUMPER_TLITE(board) || IS_BETAFPV_LR3PRO(board)) + else if (IS_JUMPER_TLITE(board) || IS_BETAFPV_LR3PRO(board) || IS_IFLIGHT_COMMANDO8(board)) return 0; else if (IS_TARANIS_SMALL(board) || IS_JUMPER_TPRO(board)) return 2; @@ -452,7 +466,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) return 7; else if (board == BOARD_TARANIS_X7) return 8; - else if (board == BOARD_JUMPER_TLITE || board == BOARD_JUMPER_TPRO || board == BOARD_BETAFPV_LR3PRO) + else if (board == BOARD_JUMPER_TLITE || board == BOARD_JUMPER_TPRO || board == BOARD_BETAFPV_LR3PRO || board == BOARD_IFLIGHT_COMMANDO8) return 4; else if (board == BOARD_FLYSKY_NV14) return 8; @@ -477,7 +491,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) case FactoryInstalledSwitches: if (IS_TARANIS_X9E(board)) return 8; - else if (IS_JUMPER_TLITE(board) || IS_JUMPER_TPRO(board) || IS_BETAFPV_LR3PRO(board)) + else if (IS_JUMPER_TLITE(board) || IS_JUMPER_TPRO(board) || IS_BETAFPV_LR3PRO(board) || IS_IFLIGHT_COMMANDO8(board)) return 4; else if(IS_RADIOMASTER_ZORRO(board)) return 8; @@ -501,6 +515,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability) case NumTrims: if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)) return 6; + else if (IS_IFLIGHT_COMMANDO8(board)) + return 0; else return 4; @@ -697,6 +713,8 @@ QString Boards::getBoardName(Board::Type board) return "FlySky NV14"; case BOARD_BETAFPV_LR3PRO: return "BETAFPV LR3PRO"; + case BOARD_IFLIGHT_COMMANDO8: + return "iFlight Commando 8"; default: return CPN_STR_UNKNOWN_ITEM; } @@ -910,6 +928,7 @@ int Boards::getDefaultInternalModules(Board::Type board) case BOARD_RADIOMASTER_ZORRO: case BOARD_BETAFPV_LR3PRO: case BOARD_RADIOMASTER_TX12_MK2: + case BOARD_IFLIGHT_COMMANDO8: return (int)MODULE_TYPE_CROSSFIRE; case BOARD_FLYSKY_NV14: diff --git a/companion/src/firmwares/boards.h b/companion/src/firmwares/boards.h index 3db0081df..a4b91e687 100644 --- a/companion/src/firmwares/boards.h +++ b/companion/src/firmwares/boards.h @@ -67,6 +67,7 @@ namespace Board { BOARD_RADIOMASTER_ZORRO, BOARD_JUMPER_TPRO, BOARD_BETAFPV_LR3PRO, + BOARD_IFLIGHT_COMMANDO8, BOARD_TYPE_COUNT, BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1 }; @@ -249,6 +250,11 @@ inline bool IS_BETAFPV_LR3PRO(Board::Type board) return board == Board::BOARD_BETAFPV_LR3PRO; } +inline bool IS_IFLIGHT_COMMANDO8(Board::Type board) +{ + return board == Board::BOARD_IFLIGHT_COMMANDO8; +} + inline bool IS_JUMPER_T12(Board::Type board) { return board == Board::BOARD_JUMPER_T12; @@ -312,8 +318,9 @@ inline bool IS_FAMILY_T12(Board::Type board) board == Board::BOARD_RADIOMASTER_ZORRO || board == Board::BOARD_RADIOMASTER_T8 || board == Board::BOARD_JUMPER_TLITE || + board == Board::BOARD_JUMPER_TPRO || board == Board::BOARD_BETAFPV_LR3PRO || - board == Board::BOARD_JUMPER_TPRO; + board == Board::BOARD_IFLIGHT_COMMANDO8; } inline bool IS_FLYSKY_NV14(Board::Type board) @@ -373,7 +380,7 @@ inline bool IS_TARANIS_X9E(Board::Type board) inline bool IS_TARANIS_SMALL(Board::Type board) { - return IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_FAMILY_T12(board) || IS_JUMPER_TPRO(board); + return IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_FAMILY_T12(board); } inline bool IS_TARANIS(Board::Type board) diff --git a/companion/src/firmwares/opentx/opentxeeprom.h b/companion/src/firmwares/opentx/opentxeeprom.h index a30ca5f3a..5e026d84a 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.h +++ b/companion/src/firmwares/opentx/opentxeeprom.h @@ -37,12 +37,13 @@ #define TARANIS_X9LITES_VARIANT 0x0801 #define JUMPER_T12_VARIANT 0x4001 #define RADIOMASTER_TX12_VARIANT 0x4002 -#define BETAFPV_LR3PRO_VARIANT 0x4007 #define JUMPER_TLITE_VARIANT 0x4003 #define RADIOMASTER_T8_VARIANT 0x4004 -#define RADIOMASTER_ZORRO_VARIANT 0x4006 #define JUMPER_TPRO_VARIANT 0x4005 +#define RADIOMASTER_ZORRO_VARIANT 0x4006 +#define BETAFPV_LR3PRO_VARIANT 0x4007 #define RADIOMASTER_TX12_MK2_VARIANT 0x4008 +#define IFLIGHT_COMMANDO8_VARIANT 0x4009 class OpenTxGeneralData: public TransformedField { public: diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 4f0c33aaf..8269b5c7d 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -114,6 +114,8 @@ const char * OpenTxEepromInterface::getName() return "EdgeTX for FlySky NV14"; case BOARD_BETAFPV_LR3PRO: return "EdgeTx for BETAFPV LR3PRO"; + case BOARD_IFLIGHT_COMMANDO8: + return "EdgeTX for iFlight Commando 8"; default: return "Board is unknown to EdgeTX"; } @@ -347,9 +349,6 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u else if (IS_TARANIS_XLITE(board)) { variant |= TARANIS_XLITE_VARIANT; } - else if (IS_BETAFPV_LR3PRO(board)) { - variant |= BETAFPV_LR3PRO_VARIANT; - } else if (IS_JUMPER_T12(board)) { variant |= JUMPER_T12_VARIANT; } @@ -721,6 +720,8 @@ int OpenTxFirmware::getCapability(::Capability capability) return TARANIS_XLITE_VARIANT; else if (IS_BETAFPV_LR3PRO(board)) return BETAFPV_LR3PRO_VARIANT; + else if (IS_IFLIGHT_COMMANDO8(board)) + return IFLIGHT_COMMANDO8_VARIANT; else if (IS_JUMPER_T12(board)) return JUMPER_T12_VARIANT; else if (IS_JUMPER_TLITE(board)) @@ -793,7 +794,7 @@ int OpenTxFirmware::getCapability(::Capability capability) case HasIntModuleCRSF: return id.contains("internalcrsf"); case HasIntModuleELRS: - return id.contains("internalelrs") || IS_RADIOMASTER_TX12_MK2(board); + return id.contains("internalelrs") || IS_RADIOMASTER_TX12_MK2(board) || IS_IFLIGHT_COMMANDO8(board); case HasIntModuleFlySky: return id.contains("afhds3") || IS_FLYSKY_NV14(board); default: @@ -1068,11 +1069,6 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari variantError = true; } } - else if (IS_BETAFPV_LR3PRO(board)) { - if (variant != BETAFPV_LR3PRO_VARIANT) { - variantError = true; - } - } else if (IS_JUMPER_T12(board)) { if (variant != JUMPER_T12_VARIANT) { variantError = true; @@ -1523,6 +1519,16 @@ void registerOpenTxFirmwares() registerOpenTxFirmware(firmware); addOpenTxRfOptions(firmware, FLEX); + /* Radiomaster T8 board */ + firmware = new OpenTxFirmware(FIRMWAREID("commando8"), QCoreApplication::translate("Firmware", "iFlight Commando8"), BOARD_IFLIGHT_COMMANDO8); + addOpenTxCommonOptions(firmware); + firmware->addOption("noheli", Firmware::tr("Disable HELI menu and cyclic mix support")); + firmware->addOption("nogvars", Firmware::tr("Disable Global variables")); + firmware->addOption("lua", Firmware::tr("Enable Lua custom scripts screen")); + addOpenTxFontOptions(firmware); + registerOpenTxFirmware(firmware); + addOpenTxRfOptions(firmware, NONE); + /* 9XR-Pro */ firmware = new OpenTxFirmware(FIRMWAREID("9xrpro"), Firmware::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO); addOpenTxArm9xOptions(firmware, false); diff --git a/companion/src/images/simulator/Commando8/bottom.png b/companion/src/images/simulator/Commando8/bottom.png new file mode 100644 index 000000000..d4bd49202 Binary files /dev/null and b/companion/src/images/simulator/Commando8/bottom.png differ diff --git a/companion/src/images/simulator/Commando8/left-mdl.png b/companion/src/images/simulator/Commando8/left-mdl.png new file mode 100644 index 000000000..f387b2fdb Binary files /dev/null and b/companion/src/images/simulator/Commando8/left-mdl.png differ diff --git a/companion/src/images/simulator/Commando8/left-rtn.png b/companion/src/images/simulator/Commando8/left-rtn.png new file mode 100644 index 000000000..8ef0c6e25 Binary files /dev/null and b/companion/src/images/simulator/Commando8/left-rtn.png differ diff --git a/companion/src/images/simulator/Commando8/left-sys.png b/companion/src/images/simulator/Commando8/left-sys.png new file mode 100644 index 000000000..9d1be42d9 Binary files /dev/null and b/companion/src/images/simulator/Commando8/left-sys.png differ diff --git a/companion/src/images/simulator/Commando8/right-dn.png b/companion/src/images/simulator/Commando8/right-dn.png new file mode 100644 index 000000000..c63e0adad Binary files /dev/null and b/companion/src/images/simulator/Commando8/right-dn.png differ diff --git a/companion/src/images/simulator/Commando8/right-ent.png b/companion/src/images/simulator/Commando8/right-ent.png new file mode 100644 index 000000000..658b2ef3c Binary files /dev/null and b/companion/src/images/simulator/Commando8/right-ent.png differ diff --git a/companion/src/images/simulator/Commando8/right-pagedn.png b/companion/src/images/simulator/Commando8/right-pagedn.png new file mode 100644 index 000000000..187d20765 Binary files /dev/null and b/companion/src/images/simulator/Commando8/right-pagedn.png differ diff --git a/companion/src/images/simulator/Commando8/right-pageup.png b/companion/src/images/simulator/Commando8/right-pageup.png new file mode 100644 index 000000000..26529c177 Binary files /dev/null and b/companion/src/images/simulator/Commando8/right-pageup.png differ diff --git a/companion/src/images/simulator/Commando8/right-up.png b/companion/src/images/simulator/Commando8/right-up.png new file mode 100644 index 000000000..2ff23d724 Binary files /dev/null and b/companion/src/images/simulator/Commando8/right-up.png differ diff --git a/companion/src/images/simulator/Commando8/top.png b/companion/src/images/simulator/Commando8/top.png new file mode 100644 index 000000000..f945c91b0 Binary files /dev/null and b/companion/src/images/simulator/Commando8/top.png differ diff --git a/companion/src/simulation/CMakeLists.txt b/companion/src/simulation/CMakeLists.txt index 70d6dcac4..d0d4f03be 100644 --- a/companion/src/simulation/CMakeLists.txt +++ b/companion/src/simulation/CMakeLists.txt @@ -12,6 +12,8 @@ set(simulation_SRCS simulateduiwidgetX9D2019.cpp simulateduiwidgetX10.cpp simulateduiwidgetX12.cpp + simulateduiwidgetLR3PRO.cpp + simulateduiwidgetCommando8.cpp simulateduiwidgetJumperT12.cpp simulateduiwidgetJumperTLITE.cpp simulateduiwidgetJumperTPRO.cpp @@ -19,7 +21,6 @@ set(simulation_SRCS simulateduiwidgetJumperT18.cpp simulateduiwidgetTX12.cpp simulateduiwidgetZorro.cpp - simulateduiwidgetLR3PRO.cpp simulateduiwidgetT8.cpp simulateduiwidgetTX16S.cpp simulateduiwidgetNV14.cpp @@ -46,6 +47,8 @@ set(simulation_UIS simulateduiwidgetX9D2019.ui simulateduiwidgetX10.ui simulateduiwidgetX12.ui + simulateduiwidgetLR3PRO.ui + simulateduiwidgetCommando8.ui simulateduiwidgetJumperT12.ui simulateduiwidgetJumperTLITE.ui simulateduiwidgetJumperTPRO.ui @@ -53,7 +56,6 @@ set(simulation_UIS simulateduiwidgetJumperT18.ui simulateduiwidgetTX12.ui simulateduiwidgetZorro.ui - simulateduiwidgetLR3PRO.ui simulateduiwidgetT8.ui simulateduiwidgetTX16S.ui simulateduiwidgetNV14.ui diff --git a/companion/src/simulation/simulateduiwidget.h b/companion/src/simulation/simulateduiwidget.h index 23400d237..c08e4ef18 100644 --- a/companion/src/simulation/simulateduiwidget.h +++ b/companion/src/simulation/simulateduiwidget.h @@ -111,6 +111,8 @@ namespace Ui { class SimulatedUIWidgetX9D2019; class SimulatedUIWidgetX10; class SimulatedUIWidgetX12; + class SimulatedUIWidgetLR3PRO; + class SimulatedUIWidgetCommando8; class SimulatedUIWidgetJumperT12; class SimulatedUIWidgetJumperTLITE; class SimulatedUIWidgetJumperTPRO; @@ -119,7 +121,6 @@ namespace Ui { class SimulatedUIWidgetTX16S; class SimulatedUIWidgetTX12; class SimulatedUIWidgetZorro; - class SimulatedUIWidgetLR3PRO; class SimulatedUIWidgetT8; class SimulatedUIWidgetNV14; } @@ -236,6 +237,30 @@ class SimulatedUIWidgetX12: public SimulatedUIWidget Ui::SimulatedUIWidgetX12 * ui; }; +class SimulatedUIWidgetLR3PRO: public SimulatedUIWidget +{ + Q_OBJECT + + public: + explicit SimulatedUIWidgetLR3PRO(SimulatorInterface * simulator, QWidget * parent = NULL); + virtual ~SimulatedUIWidgetLR3PRO(); + + private: + Ui::SimulatedUIWidgetLR3PRO * ui; +}; + +class SimulatedUIWidgetCommando8: public SimulatedUIWidget +{ + Q_OBJECT + + public: + explicit SimulatedUIWidgetCommando8(SimulatorInterface * simulator, QWidget * parent = nullptr); + virtual ~SimulatedUIWidgetCommando8(); + + private: + Ui::SimulatedUIWidgetCommando8 * ui; +}; + class SimulatedUIWidgetJumperT12: public SimulatedUIWidget { Q_OBJECT @@ -272,18 +297,6 @@ class SimulatedUIWidgetJumperTPRO: public SimulatedUIWidget Ui::SimulatedUIWidgetJumperTPRO * ui; }; -class SimulatedUIWidgetLR3PRO: public SimulatedUIWidget -{ - Q_OBJECT - - public: - explicit SimulatedUIWidgetLR3PRO(SimulatorInterface * simulator, QWidget * parent = NULL); - virtual ~SimulatedUIWidgetLR3PRO(); - - private: - Ui::SimulatedUIWidgetLR3PRO * ui; -}; - class SimulatedUIWidgetJumperT16: public SimulatedUIWidget { Q_OBJECT diff --git a/companion/src/simulation/simulateduiwidgetCommando8.cpp b/companion/src/simulation/simulateduiwidgetCommando8.cpp new file mode 100644 index 000000000..427447cb0 --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetCommando8.cpp @@ -0,0 +1,67 @@ +#include "simulateduiwidget.h" +#include "ui_simulateduiwidgetCommando8.h" + +// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h + +SimulatedUIWidgetCommando8::SimulatedUIWidgetCommando8(SimulatorInterface *simulator, QWidget * parent): + SimulatedUIWidget(simulator, parent), + ui(new Ui::SimulatedUIWidgetCommando8) +{ + RadioUiAction * act; + + ui->setupUi(this); + + // add actions in order of appearance on the help menu + + act = new RadioUiAction(5, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + addRadioWidget(ui->bottom->addArea(QRect(50, 44, 18, 18), "Commando8/left-mdl.png", act)); + + act = new RadioUiAction(6, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP); + addRadioWidget(ui->bottom->addArea(QRect(248, 25, 18, 18), "Commando8/right-up.png", act)); + + act = new RadioUiAction(7, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN); + addRadioWidget(ui->bottom->addArea(QRect(248, 62, 18, 18), "Commando8/right-dn.png", act)); + + act = new RadioUiAction(1, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT); + addRadioWidget(ui->bottom->addArea(QRect(250, 45, 15, 15), "Commando8/right-ent.png", act)); + + act = new RadioUiAction(4, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + addRadioWidget(ui->bottom->addArea(QRect(34, 46, 15, 15), "Commando8/left-sys.png", act)); + + act = new RadioUiAction(0, QList() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + addRadioWidget(ui->bottom->addArea(QRect(14, 44, 18, 18), "Commando8/left-rtn.png", act)); + + act = new RadioUiAction(3, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + addRadioWidget(ui->bottom->addArea(QRect(267, 43, 18, 18), "Commando8/right-pagedn.png", act)); + + act = new RadioUiAction(2, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + addRadioWidget(ui->bottom->addArea(QRect(230, 43, 18, 18), "Commando8/right-pageup.png", act)); + + + m_backlightColors << QColor(215, 243, 255); // X7 Blue + m_backlightColors << QColor(166,247,159); + m_backlightColors << QColor(247,159,166); + m_backlightColors << QColor(255,195,151); + m_backlightColors << QColor(247,242,159); + + setLcd(ui->lcd); + + QString css = "#radioUiWidget {" + "background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1," + "stop:0 rgba(255, 255, 255, 255)," + "stop:0.757062 rgba(241, 238, 238, 255)," + "stop:1 rgba(247, 245, 245, 255));" + "}"; + + QTimer * tim = new QTimer(this); + tim->setSingleShot(true); + connect(tim, &QTimer::timeout, [this, css]() { + emit customStyleRequest(css); + }); + tim->start(100); +} + +SimulatedUIWidgetCommando8::~SimulatedUIWidgetCommando8() +{ + delete ui; +} diff --git a/companion/src/simulation/simulateduiwidgetCommando8.ui b/companion/src/simulation/simulateduiwidgetCommando8.ui new file mode 100644 index 000000000..aae45c37e --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetCommando8.ui @@ -0,0 +1,149 @@ + + + SimulatedUIWidgetCommando8 + + + + 0 + 0 + 300 + 310 + + + + + 0 + 0 + + + + + 300 + 310 + + + + + 300 + 310 + + + + iFlight Commando8 Simulator + + + background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 255, 255, 255), stop:0.757062 rgba(241, 238, 238, 255), stop:1 rgba(247, 245, 245, 255)); + + + + + 0 + 0 + 300 + 79 + + + + + 0 + 0 + + + + + 300 + 79 + + + + + 254 + 79 + + + + background:url(:/images/simulator/Commando8/top.png) + + + + + + 22 + 80 + 256 + 128 + + + + + 0 + 0 + + + + + 256 + 128 + + + + + 256 + 128 + + + + background-color: rgb(215, 243, 255); + + + + + + 0 + 210 + 300 + 99 + + + + + 0 + 0 + + + + + 300 + 99 + + + + + 300 + 99 + + + + background:url(:/images/simulator/Commando8/bottom.png) + + + + + + LcdWidget + QWidget +
lcdwidget.h
+ 1 +
+ + ButtonsWidget + QWidget +
buttonswidget.h
+ 1 +
+
+ + + + +
diff --git a/companion/src/simulation/simulatorwidget.cpp b/companion/src/simulation/simulatorwidget.cpp index b61713ff5..c03fab3d6 100644 --- a/companion/src/simulation/simulatorwidget.cpp +++ b/companion/src/simulation/simulatorwidget.cpp @@ -88,6 +88,12 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato case Board::BOARD_X10_EXPRESS: radioUiWidget = new SimulatedUIWidgetX10(simulator, this); break; + case Board::BOARD_BETAFPV_LR3PRO: + radioUiWidget = new SimulatedUIWidgetLR3PRO(simulator, this); + break; + case Board::BOARD_IFLIGHT_COMMANDO8: + radioUiWidget = new SimulatedUIWidgetCommando8(simulator, this); + break; case Board::BOARD_JUMPER_T12: radioUiWidget = new SimulatedUIWidgetJumperT12(simulator, this); break; @@ -110,9 +116,6 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato case Board::BOARD_RADIOMASTER_ZORRO: radioUiWidget = new SimulatedUIWidgetZorro(simulator, this); break; - case Board::BOARD_BETAFPV_LR3PRO: - radioUiWidget = new SimulatedUIWidgetLR3PRO(simulator, this); - break; case Board::BOARD_RADIOMASTER_T8: radioUiWidget = new SimulatedUIWidgetT8(simulator, this); break; diff --git a/radio/src/gui/gui_common.cpp b/radio/src/gui/gui_common.cpp index 8b81ca99a..c89e51db1 100644 --- a/radio/src/gui/gui_common.cpp +++ b/radio/src/gui/gui_common.cpp @@ -882,7 +882,7 @@ bool isTrainerModeAvailable(int mode) ) return false; -#if defined(PCBXLITE) && !defined(PCBXLITES) +#if (defined(PCBXLITE) && !defined(PCBXLITES)) || defined(RADIO_COMMANDO8) if (mode == TRAINER_MODE_MASTER_TRAINER_JACK || mode == TRAINER_MODE_SLAVE) return false; #endif diff --git a/radio/src/storage/conversions/CMakeLists.txt b/radio/src/storage/conversions/CMakeLists.txt index ed4cc9e50..e06b4dab5 100644 --- a/radio/src/storage/conversions/CMakeLists.txt +++ b/radio/src/storage/conversions/CMakeLists.txt @@ -1,7 +1,7 @@ set(STORAGE_CONVERSIONS 219) if(PCB STREQUAL X7) - if(PCBREV STREQUAL ZORRO OR PCBREV STREQUAL TPRO OR PCBREV STREQUAL TX12MK2 OR PCBREV STREQUAL LR3PRO) + if(PCBREV STREQUAL ZORRO OR PCBREV STREQUAL TPRO OR PCBREV STREQUAL TX12MK2 OR PCBREV STREQUAL LR3PRO OR PCBREV STREQUAL COMMANDO8) set(STORAGE_CONVERSIONS 221) endif() endif() diff --git a/radio/src/targets/taranis/CMakeLists.txt b/radio/src/targets/taranis/CMakeLists.txt index deba92379..97ff660df 100644 --- a/radio/src/targets/taranis/CMakeLists.txt +++ b/radio/src/targets/taranis/CMakeLists.txt @@ -300,7 +300,6 @@ elseif(PCB STREQUAL X7) add_definitions(-DRADIO_COMMANDO8) add_definitions(-DSTICKS_PWM) add_definitions(-DMUTUALLY_EXCLUSIVE_MODULES) - add_definitions(-DEEPROM_VARIANT=0x4008) add_definitions(-DMANUFACTURER_IFLIGHT) elseif(PCBREV STREQUAL ACCESS) set(DEFAULT_INTERNAL_MODULE ISRM_PXX2 CACHE STRING "Default internal module") diff --git a/tools/build-companion.sh b/tools/build-companion.sh index a607c8e7c..7df4b1f8a 100755 --- a/tools/build-companion.sh +++ b/tools/build-companion.sh @@ -66,7 +66,7 @@ cd build declare -a simulator_plugins=(x9lite x9lites x7 x7-access t8 t12 tx12 tx12mk2 - zorro + zorro commando8 tlite tpro lr3pro x9d x9dp x9dp2019 x9e xlite xlites @@ -155,6 +155,9 @@ do nv14) BUILD_OPTIONS+="-DPCB=NV14" ;; + commando8) + BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=COMMANDO8" + ;; esac rm -f CMakeCache.txt native/CMakeCache.txt