diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index c28331e9a..79426070f 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -278,6 +278,10 @@ images/simulator/JumperT18/left_tele.png images/simulator/JumperT18/right_ent.png images/simulator/JumperT18/right_rtn.png + images/simulator/JumperT20/left.png + images/simulator/JumperT20/right.png + images/simulator/JumperT20/top.png + images/simulator/JumperT20/bottom.png images/simulator/TX16S/left.png images/simulator/TX16S/right.png images/simulator/TX16S/top.png @@ -297,6 +301,10 @@ images/simulator/PL18/right.png images/simulator/PL18/top.png images/simulator/PL18/bottom.png + images/simulator/Pocket/left.png + images/simulator/Pocket/right.png + images/simulator/Pocket/top.png + images/simulator/Pocket/bottom.png images/wizard/ailerons.png images/wizard/airbrakes.png images/wizard/elevons.png diff --git a/companion/src/firmwares/boards.cpp b/companion/src/firmwares/boards.cpp index 85d729156..943bc92c5 100644 --- a/companion/src/firmwares/boards.cpp +++ b/companion/src/firmwares/boards.cpp @@ -526,7 +526,7 @@ QString Boards::getBoardName(Board::Type board) case BOARD_JUMPER_TPRO: return "Jumper T-Pro"; case BOARD_JUMPER_TPROV2: - return "Jumper T-ProV2"; + return "Jumper T-Pro V2"; case BOARD_JUMPER_T16: return "Jumper T16"; case BOARD_JUMPER_T18: diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index ca9b74a2a..46eb0269e 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -1382,7 +1382,7 @@ void registerOpenTxFirmwares() addOpenTxRfOptions(firmware, FLEX); /* Jumper T-Pro V2 board */ - firmware = new OpenTxFirmware(FIRMWAREID("tprov2"), QCoreApplication::translate("Firmware", "Jumper T-Pro v2"), BOARD_JUMPER_TPROV2); + firmware = new OpenTxFirmware(FIRMWAREID("tprov2"), QCoreApplication::translate("Firmware", "Jumper T-Pro V2"), BOARD_JUMPER_TPROV2); addOpenTxCommonOptions(firmware); firmware->addOption("noheli", Firmware::tr("Disable HELI menu and cyclic mix support")); firmware->addOption("nogvars", Firmware::tr("Disable Global variables")); diff --git a/companion/src/images/simulator/JumperT20/bottom.png b/companion/src/images/simulator/JumperT20/bottom.png new file mode 100644 index 000000000..88ab44d41 Binary files /dev/null and b/companion/src/images/simulator/JumperT20/bottom.png differ diff --git a/companion/src/images/simulator/JumperT20/left.png b/companion/src/images/simulator/JumperT20/left.png new file mode 100644 index 000000000..803238075 Binary files /dev/null and b/companion/src/images/simulator/JumperT20/left.png differ diff --git a/companion/src/images/simulator/JumperT20/right.png b/companion/src/images/simulator/JumperT20/right.png new file mode 100644 index 000000000..dacd3e240 Binary files /dev/null and b/companion/src/images/simulator/JumperT20/right.png differ diff --git a/companion/src/images/simulator/JumperT20/top.png b/companion/src/images/simulator/JumperT20/top.png new file mode 100644 index 000000000..583444838 Binary files /dev/null and b/companion/src/images/simulator/JumperT20/top.png differ diff --git a/companion/src/images/simulator/Pocket/bottom.png b/companion/src/images/simulator/Pocket/bottom.png new file mode 100644 index 000000000..649ac5e8a Binary files /dev/null and b/companion/src/images/simulator/Pocket/bottom.png differ diff --git a/companion/src/images/simulator/Pocket/left.png b/companion/src/images/simulator/Pocket/left.png new file mode 100644 index 000000000..b6a0f4312 Binary files /dev/null and b/companion/src/images/simulator/Pocket/left.png differ diff --git a/companion/src/images/simulator/Pocket/right.png b/companion/src/images/simulator/Pocket/right.png new file mode 100644 index 000000000..4391f34fe Binary files /dev/null and b/companion/src/images/simulator/Pocket/right.png differ diff --git a/companion/src/images/simulator/Pocket/top.png b/companion/src/images/simulator/Pocket/top.png new file mode 100644 index 000000000..7e9497ac7 Binary files /dev/null and b/companion/src/images/simulator/Pocket/top.png differ diff --git a/companion/src/simulation/CMakeLists.txt b/companion/src/simulation/CMakeLists.txt index f700a917d..6e0e9fdd9 100644 --- a/companion/src/simulation/CMakeLists.txt +++ b/companion/src/simulation/CMakeLists.txt @@ -36,11 +36,13 @@ set(${PROJECT_NAME}_SRCS simulateduiwidgetJumperT12.cpp simulateduiwidgetJumperT16.cpp simulateduiwidgetJumperT18.cpp + simulateduiwidgetJumperT20.cpp simulateduiwidgetJumperTLITE.cpp simulateduiwidgetJumperTPRO.cpp simulateduiwidgetLR3PRO.cpp simulateduiwidgetNV14.cpp simulateduiwidgetPL18.cpp + simulateduiwidgetPocket.cpp simulateduiwidgetT8.cpp simulateduiwidgetTX12.cpp simulateduiwidgetTX16S.cpp diff --git a/companion/src/simulation/simulateduiwidget.h b/companion/src/simulation/simulateduiwidget.h index 11f99a337..00ba7c2e5 100644 --- a/companion/src/simulation/simulateduiwidget.h +++ b/companion/src/simulation/simulateduiwidget.h @@ -118,10 +118,12 @@ namespace Ui { class SimulatedUIWidgetJumperTPRO; class SimulatedUIWidgetJumperT16; class SimulatedUIWidgetJumperT18; + class SimulatedUIWidgetJumperT20; class SimulatedUIWidgetTX16S; class SimulatedUIWidgetTX12; class SimulatedUIWidgetZorro; class SimulatedUIWidgetBoxer; + class SimulatedUIWidgetPocket; class SimulatedUIWidgetT8; class SimulatedUIWidgetNV14; class SimulatedUIWidgetEL18; @@ -324,6 +326,18 @@ class SimulatedUIWidgetJumperT18: public SimulatedUIWidget Ui::SimulatedUIWidgetJumperT18 * ui; }; +class SimulatedUIWidgetJumperT20: public SimulatedUIWidget +{ + Q_OBJECT + + public: + explicit SimulatedUIWidgetJumperT20(SimulatorInterface * simulator, QWidget * parent = nullptr); + virtual ~SimulatedUIWidgetJumperT20(); + + private: + Ui::SimulatedUIWidgetJumperT20 * ui; +}; + class SimulatedUIWidgetTX12: public SimulatedUIWidget { Q_OBJECT @@ -360,6 +374,18 @@ class SimulatedUIWidgetBoxer: public SimulatedUIWidget Ui::SimulatedUIWidgetBoxer * ui; }; +class SimulatedUIWidgetPocket: public SimulatedUIWidget +{ + Q_OBJECT + + public: + explicit SimulatedUIWidgetPocket(SimulatorInterface * simulator, QWidget * parent = nullptr); + virtual ~SimulatedUIWidgetPocket(); + + private: + Ui::SimulatedUIWidgetPocket * ui; +}; + class SimulatedUIWidgetT8: public SimulatedUIWidget { Q_OBJECT diff --git a/companion/src/simulation/simulateduiwidgetJumperT20.cpp b/companion/src/simulation/simulateduiwidgetJumperT20.cpp new file mode 100644 index 000000000..a58fcdf63 --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetJumperT20.cpp @@ -0,0 +1,52 @@ +#include "simulateduiwidget.h" +#include "ui_simulateduiwidgetJumperT20.h" + +// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h + +SimulatedUIWidgetJumperT20::SimulatedUIWidgetJumperT20(SimulatorInterface *simulator, QWidget * parent): + SimulatedUIWidget(simulator, parent), + ui(new Ui::SimulatedUIWidgetJumperT20) +{ + RadioUiAction * act; + + ui->setupUi(this); + + act = new RadioUiAction(0, QList() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN); + addRadioWidget(ui->leftbuttons->addArea(QRect(0, 30, 51, 28), "JumperT20/left.png", act)); + + act = new RadioUiAction(3, QList() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE); + addRadioWidget(ui->leftbuttons->addArea(QRect(0, 70, 51, 28), "JumperT20/left.png", act)); + + act = new RadioUiAction(1, QList() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT); + addRadioWidget(ui->leftbuttons->addArea(QRect(10, 110, 51, 28), "JumperT20/left.png", act)); + + m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + addRadioWidget(ui->rightbuttons->addArea(QRect(130, 50, 50, 70), "JumperT20/right.png", m_mouseMidClickAction)); + + 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); +} + +SimulatedUIWidgetJumperT20::~SimulatedUIWidgetJumperT20() +{ + delete ui; +} diff --git a/companion/src/simulation/simulateduiwidgetJumperT20.ui b/companion/src/simulation/simulateduiwidgetJumperT20.ui new file mode 100644 index 000000000..529f527c0 --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetJumperT20.ui @@ -0,0 +1,211 @@ + + + SimulatedUIWidgetJumperT20 + + + + 0 + 0 + 627 + 164 + + + + + 0 + 0 + + + + + 627 + 164 + + + + + 627 + 164 + + + + Jumper T20 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 + 184 + 164 + + + + + 0 + 0 + + + + + 184 + 164 + + + + + 184 + 164 + + + + background:url(:/images/simulator/JumperT20/left.png); + + + + + + 184 + 19 + 256 + 128 + + + + + 0 + 0 + + + + + 256 + 128 + + + + + 256 + 128 + + + + background-color: rgb(215, 243, 255); + + + + + + 440 + 0 + 184 + 164 + + + + + 0 + 0 + + + + + 184 + 164 + + + + + 184 + 164 + + + + background:url(:/images/simulator/JumperT20/right.png) + + + + + + 184 + 0 + 256 + 19 + + + + + 0 + 0 + + + + + 256 + 19 + + + + + 256 + 19 + + + + background:url(:/images/simulator/JumperT20/top.png) + + + + + + 184 + 147 + 256 + 17 + + + + + 0 + 0 + + + + + 256 + 17 + + + + + 256 + 17 + + + + background:url(:/images/simulator/JumperT20/bottom.png) + + + + + + LcdWidget + QWidget +
lcdwidget.h
+ 1 +
+ + ButtonsWidget + QWidget +
buttonswidget.h
+ 1 +
+
+ + + + +
diff --git a/companion/src/simulation/simulateduiwidgetPocket.cpp b/companion/src/simulation/simulateduiwidgetPocket.cpp new file mode 100644 index 000000000..303de1354 --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetPocket.cpp @@ -0,0 +1,67 @@ +#include "simulateduiwidget.h" +#include "ui_simulateduiwidgetPocket.h" + +// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h + +SimulatedUIWidgetPocket::SimulatedUIWidgetPocket(SimulatorInterface *simulator, QWidget * parent): + SimulatedUIWidget(simulator, parent), + ui(new Ui::SimulatedUIWidgetPocket) +{ + RadioUiAction * act; + + ui->setupUi(this); + + // add actions in order of appearance on the help menu + + act = new RadioUiAction(12, QList() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL); + addRadioWidget(ui->rightbuttons->addArea(QRect(30, 95, 60, 60), "Pocket/right.png", act)); + + m_mouseMidClickAction = new RadioUiAction(2, QList() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN); + addRadioWidget(ui->rightbuttons->addArea(QRect(130, 60, 60, 130), "Pocket/right.png", m_mouseMidClickAction)); + + act = new RadioUiAction(14, QList() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS); + addRadioWidget(ui->leftbuttons->addArea(QRect(150, 95, 60, 60), "Pocket/left.png", act)); + + act = new RadioUiAction(13, QList() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE); + addRadioWidget(ui->leftbuttons->addArea(QRect(40, 179, 60, 30), "Pocket/left.png", act)); + + act = new RadioUiAction(5, QList() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN); + addRadioWidget(ui->leftbuttons->addArea(QRect(40, 90, 60, 30), "Pocket/left.png", act)); + + act = new RadioUiAction(4, QList() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP); + addRadioWidget(ui->leftbuttons->addArea(QRect(40, 130, 60, 30), "Pocket/left.png", act)); + + act = new RadioUiAction(1, 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->leftbuttons->addArea(QRect(40, 40, 60, 30), "Pocket/left.png", act)); + + m_scrollUpAction = new RadioUiAction(-1, QList() << Qt::Key_Minus << Qt::Key_Equal << Qt::Key_Left, SIMU_STR_HLP_KEYS_GO_LFT, SIMU_STR_HLP_ACT_ROT_LFT); + m_scrollDnAction = new RadioUiAction(-1, QList() << Qt::Key_Plus << Qt::Key_Right, SIMU_STR_HLP_KEYS_GO_RGT, SIMU_STR_HLP_ACT_ROT_RGT); + connectScrollActions(); + + 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); +} + +SimulatedUIWidgetPocket::~SimulatedUIWidgetPocket() +{ + delete ui; +} diff --git a/companion/src/simulation/simulateduiwidgetPocket.ui b/companion/src/simulation/simulateduiwidgetPocket.ui new file mode 100644 index 000000000..ef4c77de4 --- /dev/null +++ b/companion/src/simulation/simulateduiwidgetPocket.ui @@ -0,0 +1,219 @@ + + + SimulatedUIWidgetPocket + + + + 0 + 0 + 737 + 246 + + + + + 0 + 0 + + + + + 737 + 246 + + + + + 737 + 246 + + + + Radiomaster Pocket 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)); + + + + true + + + + 0 + 0 + 241 + 246 + + + + + 0 + 0 + + + + + 241 + 246 + + + + + 241 + 246 + + + + background:url(:/images/simulator/Pocket/left.png); + + + + + + 496 + 0 + 241 + 246 + + + + + 0 + 0 + + + + + 241 + 246 + + + + + 241 + 246 + + + + background:url(:/images/simulator/Pocket/right.png) + + + + + + 241 + 188 + 255 + 58 + + + + + 0 + 0 + + + + + 255 + 58 + + + + + 255 + 58 + + + + background:url(:/images/simulator/Pocket/bottom.png) + + + + + + 240 + 59 + 256 + 128 + + + + + 0 + 0 + + + + + 200 + 100 + + + + + 424 + 180 + + + + background-color: rgb(215, 243, 255); + + + + + + 241 + 0 + 255 + 59 + + + + + 0 + 0 + + + + + 255 + 59 + + + + + 255 + 59 + + + + background:url(:/images/simulator/Pocket/top.png) + + + bottom + top + rightbuttons + leftbuttons + lcd + + + + 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 9b1abe3c0..f673eeeea 100644 --- a/companion/src/simulation/simulatorwidget.cpp +++ b/companion/src/simulation/simulatorwidget.cpp @@ -111,6 +111,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato case Board::BOARD_JUMPER_T18: radioUiWidget = new SimulatedUIWidgetJumperT18(simulator, this); break; + case Board::BOARD_JUMPER_T20: + radioUiWidget = new SimulatedUIWidgetJumperT20(simulator, this); + break; case Board::BOARD_RADIOMASTER_TX12: case Board::BOARD_RADIOMASTER_TX12_MK2: radioUiWidget = new SimulatedUIWidgetTX12(simulator, this); @@ -136,6 +139,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato case Board::BOARD_FLYSKY_PL18: radioUiWidget = new SimulatedUIWidgetPL18(simulator, this); break; + case Board::BOARD_RADIOMASTER_POCKET: + radioUiWidget = new SimulatedUIWidgetPocket(simulator, this); + break; default: radioUiWidget = new SimulatedUIWidget9X(simulator, this); break; diff --git a/radio/util/hw_defs/switch_config.py b/radio/util/hw_defs/switch_config.py index 13be24a36..4b005aad5 100644 --- a/radio/util/hw_defs/switch_config.py +++ b/radio/util/hw_defs/switch_config.py @@ -145,11 +145,11 @@ SWITCH_CONFIG = { # left side "SA": {"default": "3POS", "display": [0, 0]}, "SC": {"default": "TOGGLE", "display": [0, 1]}, - "SE": {"default": "TOGGLE", "display": [0, 2]}, + "SE": {"default": "NONE", "display": [0, 2]}, # right side "SB": {"default": "3POS", "display": [1, 0]}, "SD": {"default": "TOGGLE", "display": [1, 1]}, - "SF": {"default": "TOGGLE", "display": [1, 2]}, + "SF": {"default": "NONE", "display": [1, 2]}, }, "tprov2": { # left side diff --git a/tools/build-companion.sh b/tools/build-companion.sh index 704833837..96a7d35cd 100755 --- a/tools/build-companion.sh +++ b/tools/build-companion.sh @@ -66,13 +66,13 @@ cd build declare -a simulator_plugins=(x9lite x9lites x7 x7-access t8 t12 tx12 tx12mk2 - zorro commando8 boxer - tlite tpro lr3pro + zorro commando8 boxer pocket + tlite tpro tprov2 lr3pro x9d x9dp x9dp2019 x9e xlite xlites - nv14 pl18 pl18ev + nv14 el18 pl18 pl18ev x10 x10-access x12s - t16 t18 tx16s) + t16 t18 t20 tx16s) for plugin in "${simulator_plugins[@]}" do @@ -125,6 +125,9 @@ do tpro) BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=TPRO" ;; + tprov2) + BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=TPROV2" + ;; t20) BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=T20" ;; @@ -170,6 +173,9 @@ do nv14) BUILD_OPTIONS+="-DPCB=NV14" ;; + el18) + BUILD_OPTIONS+="-DPCB=NV14 -DPCBREV=EL18" + ;; commando8) BUILD_OPTIONS+="-DPCB=X7 -DPCBREV=COMMANDO8" ;;