Skip to content

Commit

Permalink
feat: Jumper T12Max support (#5273)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Jul 13, 2024
1 parent 2407212 commit 195f039
Show file tree
Hide file tree
Showing 36 changed files with 419 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
- pl18
- pl18ev
- t12
- t12max
- t15
- t16
- t18
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:
target:
- nv14;el18
- pl18;pl18ev
- t12
- t12;t12max
- t15;t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
target:
- nv14;el18
- pl18;pl18ev
- t12
- t12;t12max
- t15;t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
Expand Down
8 changes: 8 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@
<file>images/simulator/Fatfish/F16/right.png</file>
<file>images/simulator/Fatfish/F16/top.png</file>
<file>images/simulator/Fatfish/F16/bottom.png</file>
<file>images/simulator/JumperT12max/bottom.png</file>
<file>images/simulator/JumperT12max/left.png</file>
<file>images/simulator/JumperT12max/right.png</file>
<file>images/simulator/JumperT12max/right-ent.png</file>
<file>images/simulator/JumperT12max/top.png</file>
<file>images/simulator/JumperT12max/exit.png</file>
<file>images/simulator/JumperT12max/menu.png</file>
<file>images/simulator/JumperT12max/page.png</file>
<file>images/simulator/JumperT14/bottom.png</file>
<file>images/simulator/JumperT14/left.png</file>
<file>images/simulator/JumperT14/right.png</file>
Expand Down
5 changes: 5 additions & 0 deletions companion/src/firmwares/boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_BETAFPV_LR3PRO:
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_T12MAX:
case BOARD_JUMPER_T14:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
Expand Down Expand Up @@ -237,6 +238,7 @@ int Boards::getFlashSize(Type board)
case BOARD_BETAFPV_LR3PRO:
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_T12MAX:
case BOARD_JUMPER_T14:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
Expand Down Expand Up @@ -534,6 +536,8 @@ QString Boards::getBoardName(Board::Type board)
return "Jumper T-Pro";
case BOARD_JUMPER_TPROV2:
return "Jumper T-Pro V2";
case BOARD_JUMPER_T12MAX:
return "Jumper T12 MAX";
case BOARD_JUMPER_T14:
return "Jumper T14";
case BOARD_JUMPER_T15:
Expand Down Expand Up @@ -678,6 +682,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_JUMPER_T12MAX:
case BOARD_JUMPER_T14:
case BOARD_JUMPER_T15:
case BOARD_JUMPER_T20:
Expand Down
7 changes: 7 additions & 0 deletions companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ namespace Board {
BOARD_TARANIS_X9LITE,
BOARD_TARANIS_X9LITES,
BOARD_JUMPER_T12,
BOARD_JUMPER_T12MAX,
BOARD_JUMPER_T14,
BOARD_JUMPER_T15,
BOARD_JUMPER_T16,
Expand Down Expand Up @@ -446,6 +447,11 @@ inline bool IS_JUMPER_T16(Board::Type board)
return board == Board::BOARD_JUMPER_T16;
}

inline bool IS_JUMPER_T12MAX(Board::Type board)
{
return board == Board::BOARD_JUMPER_T12MAX;
}

inline bool IS_JUMPER_T14(Board::Type board)
{
return board == Board::BOARD_JUMPER_T14;
Expand Down Expand Up @@ -509,6 +515,7 @@ inline bool IS_FAMILY_T16(Board::Type board)
inline bool IS_FAMILY_T12(Board::Type board)
{
return board == Board::BOARD_JUMPER_T12 ||
board == Board::BOARD_JUMPER_T12MAX ||
board == Board::BOARD_JUMPER_T14 ||
board == Board::BOARD_JUMPER_T20 ||
board == Board::BOARD_JUMPER_T20V2 ||
Expand Down
9 changes: 9 additions & 0 deletions companion/src/firmwares/opentx/opentxinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const char * OpenTxEepromInterface::getName()
return "EdgeTX for Jumper T-Pro";
case BOARD_JUMPER_TPROV2:
return "EdgeTX for Jumper T-Pro V2";
case BOARD_JUMPER_T12MAX:
return "EdgeTX for Jumper T12 MAX";
case BOARD_JUMPER_T14:
return "EdgeTX for Jumper T14";
case BOARD_JUMPER_T15:
Expand Down Expand Up @@ -1448,6 +1450,13 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

/* Jumper T12 MAX board */
firmware = new OpenTxFirmware(FIRMWAREID("t12max"), Firmware::tr("Jumper T12 MAX"), BOARD_JUMPER_T12MAX);
addOpenTxFrskyOptions(firmware);
firmware->addOption("internalelrs", Firmware::tr("Select if internal ELRS module is installed"));
addOpenTxRfOptions(firmware, NONE);
registerOpenTxFirmware(firmware);

/* Jumper T14 board */
firmware = new OpenTxFirmware(FIRMWAREID("t14"), Firmware::tr("Jumper T14"), BOARD_JUMPER_T14);
addOpenTxFrskyOptions(firmware);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions companion/src/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetEL18.cpp
simulateduiwidgetFatfishF16.cpp
simulateduiwidgetJumperT12.cpp
simulateduiwidgetJumperT12max.cpp
simulateduiwidgetJumperT14.cpp
simulateduiwidgetJumperT15.cpp
simulateduiwidgetJumperT16.cpp
Expand Down
13 changes: 13 additions & 0 deletions companion/src/simulation/simulateduiwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ namespace Ui {
class SimulatedUIWidgetJumperT12;
class SimulatedUIWidgetJumperTLITE;
class SimulatedUIWidgetJumperTPRO;
class SimulatedUIWidgetJumperT12max;
class SimulatedUIWidgetJumperT14;
class SimulatedUIWidgetJumperT15;
class SimulatedUIWidgetJumperT16;
Expand Down Expand Up @@ -357,6 +358,18 @@ class SimulatedUIWidgetJumperT16: public SimulatedUIWidget
Ui::SimulatedUIWidgetJumperT16 * ui;
};

class SimulatedUIWidgetJumperT12max: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidgetJumperT12max(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetJumperT12max();

private:
Ui::SimulatedUIWidgetJumperT12max * ui;
};

class SimulatedUIWidgetJumperT14: public SimulatedUIWidget
{
Q_OBJECT
Expand Down
54 changes: 54 additions & 0 deletions companion/src/simulation/simulateduiwidgetJumperT12max.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetJumperT12max.h"

// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h

SimulatedUIWidgetJumperT12max::SimulatedUIWidgetJumperT12max(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetJumperT12max)
{
RadioUiAction * act;

ui->setupUi(this);

act = new RadioUiAction(0, QList<int>() << Qt::Key_PageUp << Qt::Key_Up, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_MENU_ICN);
addRadioWidget(ui->leftbuttons->addArea(QRect(17, 45, 90, 30), "JumperT12max/menu.png", act));

act = new RadioUiAction(3, QList<int>() << Qt::Key_PageDown << Qt::Key_Down, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_PAGE);
addRadioWidget(ui->leftbuttons->addArea(QRect(17, 107, 90, 30), "JumperT12max/page.png", act));

act = new RadioUiAction(1, QList<int>() << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace, SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_EXIT);
addRadioWidget(ui->leftbuttons->addArea(QRect(17, 180, 90, 30), "JumperT12max/exit.png", act));

m_mouseMidClickAction = new RadioUiAction(2, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
addRadioWidget(ui->rightbuttons->addArea(QRect(130, 65, 70, 130), "JumperT12max/right-ent.png", m_mouseMidClickAction));

//addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperT12max/left_scrnshot.png", m_screenshotAction));

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);
}

SimulatedUIWidgetJumperT12max::~SimulatedUIWidgetJumperT12max()
{
delete ui;
}
Loading

0 comments on commit 195f039

Please sign in to comment.