Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for Jumper T-Pro S #5325

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
- t12;t12max
- t15;t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
- tlite;tpro;tprov2;tpros;lr3pro
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- t12;t12max
- t15,t16;t18
- t8;zorro;pocket;mt12;commando8
- tlite;tpro;tprov2;lr3pro
- tlite;tpro;tprov2;tpros;lr3pro
- t20;t20v2;t14
- tx12;tx12mk2;boxer
- tx16s
Expand Down
8 changes: 8 additions & 0 deletions companion/src/companion.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@
<file>images/simulator/JumperTPRO/left.png</file>
<file>images/simulator/JumperTPRO/right.png</file>
<file>images/simulator/JumperTPRO/top.png</file>
<file>images/simulator/JumperTPROS/bottom.png</file>
<file>images/simulator/JumperTPROS/left.png</file>
<file>images/simulator/JumperTPROS/right.png</file>
<file>images/simulator/JumperTPROS/right-ent.png</file>
<file>images/simulator/JumperTPROS/top.png</file>
<file>images/simulator/JumperTPROS/exit.png</file>
<file>images/simulator/JumperTPROS/menu.png</file>
<file>images/simulator/JumperTPROS/page.png</file>
<file>images/simulator/TX12/left.png</file>
<file>images/simulator/TX12/left-pageup.png</file>
<file>images/simulator/TX12/left-pagedn.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 @@ -192,6 +192,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
case BOARD_JUMPER_TPROV2:
case BOARD_JUMPER_TPROS:
case BOARD_RADIOMASTER_TX12:
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_RADIOMASTER_T8:
Expand Down Expand Up @@ -247,6 +248,7 @@ int Boards::getFlashSize(Type board)
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
case BOARD_JUMPER_TPROV2:
case BOARD_JUMPER_TPROS:
case BOARD_RADIOMASTER_TX12:
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_RADIOMASTER_ZORRO:
Expand Down Expand Up @@ -537,6 +539,8 @@ QString Boards::getBoardName(Board::Type board)
return "Jumper T-Pro";
case BOARD_JUMPER_TPROV2:
return "Jumper T-Pro V2";
case BOARD_JUMPER_TPROS:
return "Jumper T-Pro S";
case BOARD_JUMPER_T12MAX:
return "Jumper T12 MAX";
case BOARD_JUMPER_T14:
Expand Down Expand Up @@ -687,6 +691,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
case BOARD_JUMPER_T14:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
case BOARD_JUMPER_TPROS:
case BOARD_JUMPER_T15:
case BOARD_FATFISH_F16:
return (int)MODULE_TYPE_CROSSFIRE;
Expand Down
9 changes: 8 additions & 1 deletion companion/src/firmwares/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ namespace Board {
BOARD_IFLIGHT_COMMANDO8,
BOARD_FLYSKY_EL18,
BOARD_JUMPER_TPROV2,
BOARD_JUMPER_TPROS,
BOARD_RADIOMASTER_POCKET,
BOARD_JUMPER_T20V2,
BOARD_FATFISH_F16,
Expand Down Expand Up @@ -425,7 +426,7 @@ inline bool IS_JUMPER_TLITE(Board::Type board)

inline bool IS_JUMPER_TPRO(Board::Type board)
{
return board == Board::BOARD_JUMPER_TPRO || board == Board::BOARD_JUMPER_TPROV2;
return board == Board::BOARD_JUMPER_TPRO || board == Board::BOARD_JUMPER_TPROV2 || board == Board::BOARD_JUMPER_TPROS;
}

inline bool IS_JUMPER_TPROV1(Board::Type board)
Expand All @@ -438,6 +439,11 @@ inline bool IS_JUMPER_TPROV2(Board::Type board)
return board == Board::BOARD_JUMPER_TPROV2;
}

inline bool IS_JUMPER_TPROS(Board::Type board)
{
return board == Board::BOARD_JUMPER_TPROS;
}

inline bool IS_JUMPER_T15(Board::Type board)
{
return board == Board::BOARD_JUMPER_T15;
Expand Down Expand Up @@ -525,6 +531,7 @@ inline bool IS_FAMILY_T12(Board::Type board)
board == Board::BOARD_JUMPER_TLITE_F4 ||
board == Board::BOARD_JUMPER_TPRO ||
board == Board::BOARD_JUMPER_TPROV2 ||
board == Board::BOARD_JUMPER_TPROS ||
board == Board::BOARD_RADIOMASTER_TX12 ||
board == Board::BOARD_RADIOMASTER_TX12_MK2 ||
board == Board::BOARD_RADIOMASTER_ZORRO ||
Expand Down
12 changes: 12 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_TPROS:
return "EdgeTX for Jumper T-Pro S";
case BOARD_JUMPER_T12MAX:
return "EdgeTX for Jumper T12 MAX";
case BOARD_JUMPER_T14:
Expand Down Expand Up @@ -1439,6 +1441,16 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);

/* Jumper T-Pro S board */
firmware = new OpenTxFirmware(FIRMWAREID("tpros"), QCoreApplication::translate("Firmware", "Jumper T-Pro S"), BOARD_JUMPER_TPROS);
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, FLEX);

/* Jumper T12 board */
firmware = new OpenTxFirmware(FIRMWAREID("t12"), QCoreApplication::translate("Firmware", "Jumper T12 / T12 Pro"), BOARD_JUMPER_T12);
addOpenTxCommonOptions(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 @@ -43,6 +43,7 @@ set(${PROJECT_NAME}_SRCS
simulateduiwidgetJumperT20.cpp
simulateduiwidgetJumperTLITE.cpp
simulateduiwidgetJumperTPRO.cpp
simulateduiwidgetJumperTPROS.cpp
simulateduiwidgetLR3PRO.cpp
simulateduiwidgetNV14.cpp
simulateduiwidgetPL18.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 @@ -116,6 +116,7 @@ namespace Ui {
class SimulatedUIWidgetJumperT12;
class SimulatedUIWidgetJumperTLITE;
class SimulatedUIWidgetJumperTPRO;
class SimulatedUIWidgetJumperTPROS;
class SimulatedUIWidgetJumperT12max;
class SimulatedUIWidgetJumperT14;
class SimulatedUIWidgetJumperT15;
Expand Down Expand Up @@ -306,6 +307,18 @@ class SimulatedUIWidgetJumperTPRO: public SimulatedUIWidget
Ui::SimulatedUIWidgetJumperTPRO * ui;
};

class SimulatedUIWidgetJumperTPROS: public SimulatedUIWidget
{
Q_OBJECT

public:
explicit SimulatedUIWidgetJumperTPROS(SimulatorInterface * simulator, QWidget * parent = NULL);
virtual ~SimulatedUIWidgetJumperTPROS();

private:
Ui::SimulatedUIWidgetJumperTPROS * ui;
};

class SimulatedUIWidgetJumperT15: public SimulatedUIWidget
{
Q_OBJECT
Expand Down
57 changes: 57 additions & 0 deletions companion/src/simulation/simulateduiwidgetJumperTPROS.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetJumperTPROS.h"
#include "eeprominterface.h"

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

SimulatedUIWidgetJumperTPROS::SimulatedUIWidgetJumperTPROS(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetJumperTPROS)
{
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(85, 85, 70, 70), "JumperTPROS/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(53, 160, 70, 70), "JumperTPROS/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(20, 230, 70, 70), "JumperTPROS/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(10, 96, 200, 220), "JumperTPROS/right-ent.png", m_mouseMidClickAction));

//addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperTPROS/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);

if (getCurrentBoard() == Board::BOARD_JUMPER_TPROV2) {
ui->lcd->setBgDefaultColor(QColor(0, 0, 0));
ui->lcd->setFgDefaultColor(QColor(255, 255, 255));
}

setLcd(ui->lcd);

QString css = "#radioUiWidget {"
"background-color: rgb(167, 167, 167);"
"}";

QTimer * tim = new QTimer(this);
tim->setSingleShot(true);
connect(tim, &QTimer::timeout, [this, css]() {
emit customStyleRequest(css);
});
tim->start(100);
}

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