Merge remote-tracking branch 'origin/2.3' into elecpower/cpn-tele-edit-prt

This commit is contained in:
elecpower
2021-02-01 06:39:51 +11:00
140 changed files with 2870 additions and 822 deletions
+4
View File
@@ -343,8 +343,12 @@ if(PCB STREQUAL X7 AND PCBREV STREQUAL ACCESS)
set(FLAVOUR x7access)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T12)
set(FLAVOUR t12)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL TLITE)
set(FLAVOUR tlite)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL TX12)
set(FLAVOUR tx12)
elseif(PCB STREQUAL X7 AND PCBREV STREQUAL T8)
set(FLAVOUR t8)
elseif(PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019)
set(FLAVOUR x9d+2019)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL EXPRESS)
+22
View File
@@ -179,6 +179,16 @@
<file>images/simulator/JumperT12/JumperT12-x.png</file>
<file>images/simulator/JumperT12/JumperT12-center.png</file>
<file>images/simulator/JumperT12/JumperT12-top.png</file>
<file>images/simulator/JumperTLITE/bottom.png</file>
<file>images/simulator/JumperTLITE/bottom_right.png</file>
<file>images/simulator/JumperTLITE/bottom_left.png</file>
<file>images/simulator/JumperTLITE/left.png</file>
<file>images/simulator/JumperTLITE/left_top.png</file>
<file>images/simulator/JumperTLITE/left_bottom.png</file>
<file>images/simulator/JumperTLITE/right.png</file>
<file>images/simulator/JumperTLITE/right_top.png</file>
<file>images/simulator/JumperTLITE/right_bottom.png</file>
<file>images/simulator/JumperTLITE/top.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>
@@ -190,6 +200,18 @@
<file>images/simulator/TX12/right-mdl.png</file>
<file>images/simulator/TX12/bottom.png</file>
<file>images/simulator/TX12/top.png</file>
<file>images/simulator/T8/left.png</file>
<file>images/simulator/T8/left-pageup.png</file>
<file>images/simulator/T8/left-pagedn.png</file>
<file>images/simulator/T8/left-rtn.png</file>
<file>images/simulator/T8/left-sys.png</file>
<file>images/simulator/T8/right.png</file>
<file>images/simulator/T8/right-ent.png</file>
<file>images/simulator/T8/right-mdl.png</file>
<file>images/simulator/T8/right-up.png</file>
<file>images/simulator/T8/right-dn.png</file>
<file>images/simulator/T8/bottom.png</file>
<file>images/simulator/T8/top.png</file>
<file>images/simulator/JumperT16/left.png</file>
<file>images/simulator/JumperT16/right.png</file>
<file>images/simulator/JumperT16/top.png</file>
+33 -5
View File
@@ -79,6 +79,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x3278746F;
case BOARD_JUMPER_T12:
return 0x3D78746F;
case BOARD_JUMPER_TLITE:
return 0x4278746F;
case BOARD_JUMPER_T16:
return 0x3F78746F;
case BOARD_JUMPER_T18:
@@ -87,6 +89,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x3878746F;
case BOARD_RADIOMASTER_TX12:
return 0x4178746F;
case BOARD_RADIOMASTER_T8:
return 0x4378746F;
case BOARD_UNKNOWN:
break;
}
@@ -113,7 +117,9 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_TARANIS_X9DP_2019:
case BOARD_TARANIS_X9E:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_TLITE:
case BOARD_RADIOMASTER_TX12:
case BOARD_RADIOMASTER_T8:
return EESIZE_TARANIS;
case BOARD_UNKNOWN:
return EESIZE_MAX;
@@ -148,7 +154,9 @@ int Boards::getFlashSize(Type board)
case BOARD_TARANIS_X9DP_2019:
case BOARD_TARANIS_X9E:
case BOARD_JUMPER_T12:
case BOARD_JUMPER_TLITE:
case BOARD_RADIOMASTER_TX12:
case BOARD_RADIOMASTER_T8:
return FSIZE_TARANIS;
case BOARD_HORUS_X12S:
case BOARD_X10:
@@ -181,7 +189,7 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_TARANIS_XLITE(board)) {
else if (IS_TARANIS_XLITE(board) || IS_JUMPER_TLITE(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
@@ -232,6 +240,16 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_RADIOMASTER_T8(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_TOGGLE, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_TOGGLE, "SD"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_JUMPER_T12(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
@@ -310,6 +328,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case Pots:
if (IS_TARANIS_X9LITE(board))
return 1;
else if (IS_JUMPER_TLITE(board))
return 0;
else if (IS_TARANIS_SMALL(board))
return 2;
else if (IS_TARANIS_X9E(board))
@@ -367,6 +387,8 @@ 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)
return 4;
else if (IS_FAMILY_T12(board))
return 8;
else if (IS_TARANIS_XLITE(board))
@@ -383,9 +405,11 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case FactoryInstalledSwitches:
if (IS_TARANIS_X9E(board))
return 8;
if (IS_FAMILY_T12(board))
else if (IS_JUMPER_TLITE(board))
return 4;
else if (IS_FAMILY_T12(board))
return 6;
if (IS_HORUS_X12S(board))
else if (IS_HORUS_X12S(board))
return 8;
else
return getCapability(board, Switches);
@@ -530,8 +554,6 @@ QString Boards::getBoardName(Board::Type board)
return "Taranis X7/X7S";
case BOARD_TARANIS_X7_ACCESS:
return "Taranis X7/X7S Access";
case BOARD_JUMPER_T12:
return "Jumper T12";
case BOARD_TARANIS_XLITE:
return "Taranis X-Lite";
case BOARD_TARANIS_XLITES:
@@ -560,6 +582,10 @@ QString Boards::getBoardName(Board::Type board)
return "Horus X10/X10S";
case BOARD_X10_EXPRESS:
return "Horus X10/X10S Express";
case BOARD_JUMPER_T12:
return "Jumper T12";
case BOARD_JUMPER_TLITE:
return "Jumper T-Lite";
case BOARD_JUMPER_T16:
return "Jumper T16";
case BOARD_JUMPER_T18:
@@ -568,6 +594,8 @@ QString Boards::getBoardName(Board::Type board)
return "Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
return "Radiomaster TX12";
case BOARD_RADIOMASTER_T8:
return "Radiomaster T8";
default:
return tr("Unknown");
}
+15 -3
View File
@@ -53,10 +53,12 @@ namespace Board {
BOARD_RADIOMASTER_TX16S,
BOARD_JUMPER_T18,
BOARD_RADIOMASTER_TX12,
BOARD_RADIOMASTER_T8,
BOARD_JUMPER_TLITE,
BOARD_TYPE_COUNT,
BOARD_TYPE_MAX = BOARD_TYPE_COUNT - 1
};
constexpr int BOARD_TYPE_MAX = BOARD_RADIOMASTER_TX12;
enum PotType
{
POT_NONE,
@@ -204,6 +206,11 @@ inline bool IS_JUMPER_T12(Board::Type board)
return board == Board::BOARD_JUMPER_T12;
}
inline bool IS_JUMPER_TLITE(Board::Type board)
{
return board == Board::BOARD_JUMPER_TLITE;
}
inline bool IS_JUMPER_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T16;
@@ -224,6 +231,11 @@ inline bool IS_RADIOMASTER_TX12(Board::Type board)
return board == Board::BOARD_RADIOMASTER_TX12;
}
inline bool IS_RADIOMASTER_T8(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_T8;
}
inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18;
@@ -231,7 +243,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_RADIOMASTER_TX12;
return board == Board::BOARD_JUMPER_T12 || board == Board::BOARD_RADIOMASTER_TX12 || board == Board::BOARD_RADIOMASTER_T8 || board == Board::BOARD_JUMPER_TLITE;
}
inline bool IS_TARANIS_XLITE(Board::Type board)
@@ -94,6 +94,12 @@ GeneralSettings::GeneralSettings()
vBatMin = -23; // 6.7V
vBatMax = -37; // 8.3V
}
else if (IS_JUMPER_TLITE(board)) {
// 1S Li-Ion
vBatWarn = 32;
vBatMin = -60; //3V
vBatMax = -78; //4.2V
}
else if (IS_TARANIS(board)) {
// NI-MH 7.2V, X9D, X9D+ and X7
vBatWarn = 65;
@@ -239,6 +245,10 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
switchConfig[i] = Boards::getSwitchInfo(board, i).config;
}
// TLite does not have pots or sliders
if (IS_JUMPER_TLITE(board))
return;
// TODO: move to Boards, like with switches
if (IS_FAMILY_HORUS_OR_T16(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
@@ -76,6 +76,8 @@ inline int MAX_POTS(Board::Type board, int version)
{
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 3;
if (IS_FAMILY_T12(board))
return 2;
return Boards::getCapability(board, Board::Pots);
}
@@ -85,6 +87,8 @@ inline int MAX_POTS_STORAGE(Board::Type board, int version)
return 3;
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
return 5;
if (IS_FAMILY_T12(board))
return 2;
return Boards::getCapability(board, Board::Pots);
}
@@ -92,6 +96,8 @@ inline int MAX_POTS_SOURCES(Board::Type board, int version)
{
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 5;
if (IS_FAMILY_T12(board))
return 2;
return Boards::getCapability(board, Board::Pots);
}
@@ -37,6 +37,8 @@
#define TARANIS_X9LITES_VARIANT 0x0801
#define JUMPER_T12_VARIANT 0x4001
#define RADIOMASTER_TX12_VARIANT 0x4002
#define JUMPER_TLITE_VARIANT 0x4003
#define RADIOMASTER_T8_VARIANT 0x4004
class OpenTxGeneralData: public TransformedField {
public:
@@ -60,6 +60,8 @@ const char * OpenTxEepromInterface::getName()
switch (board) {
case BOARD_JUMPER_T12:
return "OpenTX for Jumper T12";
case BOARD_JUMPER_TLITE:
return "OpenTX for Jumper T-Lite";
case BOARD_JUMPER_T16:
return "OpenTX for Jumper T16";
case BOARD_JUMPER_T18:
@@ -68,6 +70,8 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
return "OpenTX for Radiomaster TX12";
case BOARD_RADIOMASTER_T8:
return "OpenTX for Radiomaster T8";
case BOARD_TARANIS_X9D:
return "OpenTX for FrSky Taranis X9D";
case BOARD_TARANIS_X9DP:
@@ -336,9 +340,15 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
else if (IS_JUMPER_T12(board)) {
variant |= JUMPER_T12_VARIANT;
}
else if (IS_JUMPER_TLITE(board)) {
variant |= JUMPER_TLITE_VARIANT;
}
else if (IS_RADIOMASTER_TX12(board)) {
variant |= RADIOMASTER_TX12_VARIANT;
}
else if (IS_RADIOMASTER_T8(board)) {
variant |= RADIOMASTER_T8_VARIANT;
}
OpenTxGeneralData generator((GeneralSettings &)radioData.generalSettings, board, version, variant);
// generator.dump();
QByteArray data;
@@ -683,8 +693,12 @@ int OpenTxFirmware::getCapability(::Capability capability)
return TARANIS_XLITE_VARIANT;
else if (IS_JUMPER_T12(board))
return JUMPER_T12_VARIANT;
else if (IS_JUMPER_TLITE(board))
return JUMPER_TLITE_VARIANT;
else if (IS_RADIOMASTER_TX12(board))
return RADIOMASTER_TX12_VARIANT;
else if (IS_RADIOMASTER_T8(board))
return RADIOMASTER_T8_VARIANT;
else
return 0;
case MavlinkTelemetry:
@@ -746,7 +760,7 @@ bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_ACCST_ISRM_D16:
return IS_ACCESS_RADIO(board, id);
case PULSES_MULTIMODULE:
return id.contains("internalmulti") || IS_RADIOMASTER_TX16S(board) || IS_JUMPER_T18(board);
return id.contains("internalmulti") || IS_RADIOMASTER_TX16S(board) || IS_JUMPER_T18(board) || IS_RADIOMASTER_TX12(board) || IS_JUMPER_TLITE(board);
default:
return false;
}
@@ -778,7 +792,7 @@ bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_XJT_LITE_X16:
case PULSES_XJT_LITE_D8:
case PULSES_XJT_LITE_LR12:
return (IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board));
return (IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_JUMPER_TLITE(board));
default:
return false;
}
@@ -949,11 +963,21 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
variantError = true;
}
}
else if (IS_JUMPER_TLITE(board)) {
if (variant != JUMPER_TLITE_VARIANT) {
variantError = true;
}
}
else if (IS_RADIOMASTER_TX12(board)) {
if (variant != RADIOMASTER_TX12_VARIANT) {
variantError = true;
}
}
else if (IS_RADIOMASTER_T8(board)) {
if (variant != RADIOMASTER_T8_VARIANT) {
variantError = true;
}
}
else if (IS_TARANIS(board)) {
if (variant != 0) {
variantError = true;
@@ -1275,6 +1299,16 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);
/* Jumper T-Lite board */
firmware = new OpenTxFirmware("opentx-tlite", QCoreApplication::translate("Firmware", "Jumper T-Lite"), BOARD_JUMPER_TLITE);
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 T16 board */
firmware = new OpenTxFirmware("opentx-t16", Firmware::tr("Jumper T16 / T16+ / T16 Pro"), BOARD_JUMPER_T16);
addOpenTxFrskyOptions(firmware);
@@ -1294,6 +1328,17 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);
/* Radiomaster T8 board */
firmware = new OpenTxFirmware("opentx-t8", QCoreApplication::translate("Firmware", "Radiomaster T8"), BOARD_RADIOMASTER_T8);
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);
firmware->addOption("bindkey", Firmware::tr("Allow bind using bind key"));
/* Radiomaster TX16S board */
firmware = new OpenTxFirmware("opentx-tx16s", Firmware::tr("Radiomaster TX16S / SE / Hall / Masterfire"), BOARD_RADIOMASTER_TX16S);
addOpenTxFrskyOptions(firmware);
+1 -1
View File
@@ -309,7 +309,7 @@ bool SensorData::isSourceAvailable(const ModelData * model, const int index)
const int sensorcnt = firmware->getCapability(Sensors);
const int i = abs(index);
if (model && sensorcnt > 0 and i <= sensorcnt) {
if (model && sensorcnt > 0 && i <= sensorcnt) {
if (i > 0)
return model->sensorData[i - 1].isAvailable();
else
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+1 -1
View File
@@ -1585,7 +1585,7 @@ void MainWindow::updateWindowActions()
QString scut;
if (++count < 10)
scut = tr("Alt+%1").arg(count);
QAction * act = addActToGroup(windowsListActions, "", "", "window_ptr", qVariantFromValue(win), QVariant(), scut);
QAction * act = addActToGroup(windowsListActions, "", "", "window_ptr", QVariant::fromValue(win), QVariant(), scut);
act->setChecked(win == mdiArea->activeSubWindow());
updateWindowActionTitle(win, act);
}
+4
View File
@@ -13,9 +13,11 @@ set(simulation_SRCS
simulateduiwidgetX10.cpp
simulateduiwidgetX12.cpp
simulateduiwidgetJumperT12.cpp
simulateduiwidgetJumperTLITE.cpp
simulateduiwidgetJumperT16.cpp
simulateduiwidgetJumperT18.cpp
simulateduiwidgetTX12.cpp
simulateduiwidgetT8.cpp
simulateduiwidgetTX16S.cpp
simulatorinterface.cpp
simulatormainwindow.cpp
@@ -40,9 +42,11 @@ set(simulation_UIS
simulateduiwidgetX10.ui
simulateduiwidgetX12.ui
simulateduiwidgetJumperT12.ui
simulateduiwidgetJumperTLITE.ui
simulateduiwidgetJumperT16.ui
simulateduiwidgetJumperT18.ui
simulateduiwidgetTX12.ui
simulateduiwidgetT8.ui
simulateduiwidgetTX16S.ui
simulatormainwindow.ui
simulatorstartupdialog.ui
@@ -112,10 +112,12 @@ namespace Ui {
class SimulatedUIWidgetX10;
class SimulatedUIWidgetX12;
class SimulatedUIWidgetJumperT12;
class SimulatedUIWidgetJumperTLITE;
class SimulatedUIWidgetJumperT16;
class SimulatedUIWidgetJumperT18;
class SimulatedUIWidgetTX16S;
class SimulatedUIWidgetTX12;
class SimulatedUIWidgetT8;
}
class SimulatedUIWidget9X: public SimulatedUIWidget
@@ -242,6 +244,18 @@ class SimulatedUIWidgetJumperT12: public SimulatedUIWidget
Ui::SimulatedUIWidgetJumperT12 * ui;
};
class SimulatedUIWidgetJumperTLITE: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetJumperTLITE(SimulatorInterface * simulator, QWidget * parent = NULL);
virtual ~SimulatedUIWidgetJumperTLITE();
private:
Ui::SimulatedUIWidgetJumperTLITE * ui;
};
class SimulatedUIWidgetJumperT16: public SimulatedUIWidget
{
Q_OBJECT
@@ -278,6 +292,17 @@ class SimulatedUIWidgetTX12: public SimulatedUIWidget
Ui::SimulatedUIWidgetTX12 * ui;
};
class SimulatedUIWidgetT8: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetT8(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetT8();
private:
Ui::SimulatedUIWidgetT8 * ui;
};
class SimulatedUIWidgetTX16S: public SimulatedUIWidget
{
@@ -0,0 +1,60 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetJumperTLITE.h"
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
SimulatedUIWidgetJumperTLITE::SimulatedUIWidgetJumperTLITE(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetJumperTLITE)
{
RadioUiAction * act;
ui->setupUi(this);
act = new RadioUiAction(3, QList<int>() << Qt::Key_Up << Qt::Key_PageUp, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP);
addRadioWidget(ui->rightbuttons->addArea(QRect(40, 15, 70, 50), "JumperTLITE/right_top.png", act));
act = new RadioUiAction(2, QList<int>() << Qt::Key_Down << Qt::Key_PageDown, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN);
addRadioWidget(ui->rightbuttons->addArea(QRect(47, 65, 70, 50), "JumperTLITE/right_bottom.png", act));
act = new RadioUiAction(4, QList<int>() << Qt::Key_Right << Qt::Key_Plus, SIMU_STR_HLP_KEY_RGT % "|" % SIMU_STR_HLP_KEY_PLS, SIMU_STR_HLP_ACT_PLS);
addRadioWidget(ui->bottombuttons->addArea(QRect(150, 73, 80, 30), "JumperTLITE/bottom_right.png", act));
act = new RadioUiAction(5, QList<int>() << Qt::Key_Left << Qt::Key_Minus, SIMU_STR_HLP_KEY_LFT % "|" % SIMU_STR_HLP_KEY_MIN, SIMU_STR_HLP_ACT_MIN);
addRadioWidget(ui->bottombuttons->addArea(QRect(24, 73, 80, 30), "JumperTLITE/bottom_left.png", act));
m_mouseMidClickAction = new RadioUiAction(1, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT);
addRadioWidget(ui->leftbuttons->addArea(QRect(5, 15, 70, 50), "JumperTLITE/left_top.png", m_mouseMidClickAction));
act = new RadioUiAction(0, 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(10, 65, 70, 50), "JumperTLITE/left_bottom.png", act));
//addRadioWidget(ui->leftbuttons->addArea(QRect(10, 65, 70, 50), "JumperTLITE/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);
}
SimulatedUIWidgetJumperTLITE::~SimulatedUIWidgetJumperTLITE()
{
delete ui;
}
@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetJumperTLITE</class>
<widget class="QWidget" name="SimulatedUIWidgetJumperTLITE">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>501</width>
<height>310</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>501</width>
<height>310</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>501</width>
<height>310 </height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Jumper T-Lite Simulator</string>
</property>
<property name="styleSheet">
<string notr="true">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));</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="0" rowspan="3">
<widget class="ButtonsWidget" name="leftbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>122</width>
<height>287</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>122</width>
<height>287</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTLITE/left.png);</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="LcdWidget" name="lcd" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>800</width>
<height>155</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>800</width>
<height>155</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(215, 243, 255);</string>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="3">
<widget class="ButtonsWidget" name="rightbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>122</width>
<height>287</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>122</width>
<height>287</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTLITE/right.png)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="top" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>258</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>258</width>
<height>26</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTLITE/top.png)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="ButtonsWidget" name="bottombuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>258</width>
<height>106</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>258</width>
<height>106</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/JumperTLITE/bottom.png)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>12</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>12</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>10</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(247, 245, 245);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LcdWidget</class>
<extends>QWidget</extends>
<header>lcdwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonsWidget</class>
<extends>QWidget</extends>
<header>buttonswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,67 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetT8.h"
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
SimulatedUIWidgetT8::SimulatedUIWidgetT8(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetT8)
{
RadioUiAction * act;
ui->setupUi(this);
// add actions in order of appearance on the help menu
act = new RadioUiAction(5, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
addRadioWidget(ui->rightbuttons->addArea(QRect(25, 40, 35, 20), "T8/right-mdl.png", act));
act = new RadioUiAction(6, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_UP, SIMU_STR_HLP_ACT_UP);
addRadioWidget(ui->rightbuttons->addArea(QRect(25, 90, 35, 20), "T8/right-up.png", act));
act = new RadioUiAction(7, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_GO_DN, SIMU_STR_HLP_ACT_DN);
addRadioWidget(ui->rightbuttons->addArea(QRect(25, 135, 35, 20), "T8/right-dn.png", act));
act = new RadioUiAction(1, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ENT);
addRadioWidget(ui->rightbuttons->addArea(QRect(25, 180, 35, 20), "T8/right-ent.png", act));
act = new RadioUiAction(4, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->leftbuttons->addArea(QRect(60, 45, 35, 20), "T8/left-sys.png", act));
act = new RadioUiAction(0, QList<int>() << 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(60, 85, 35, 20), "T8/left-rtn.png", act));
act = new RadioUiAction(3, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
addRadioWidget(ui->leftbuttons->addArea(QRect(60, 135, 35, 20), "T8/left-pagedn.png", act));
act = new RadioUiAction(2, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
addRadioWidget(ui->leftbuttons->addArea(QRect(60, 180, 35, 20), "T8/left-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);
}
SimulatedUIWidgetT8::~SimulatedUIWidgetT8()
{
delete ui;
}
@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetT8</class>
<widget class="QWidget" name="SimulatedUIWidgetT8">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>480</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Radiomaster T8 Simulator</string>
</property>
<property name="styleSheet">
<string notr="true">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));</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="1" column="0" rowspan="3">
<widget class="ButtonsWidget" name="leftbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>113</width>
<height>280</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>113</width>
<height>280</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/T8/left.png);</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="LcdWidget" name="lcd" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>254</width>
<height>158</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>254</width>
<height>158</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(215, 243, 255);</string>
</property>
</widget>
</item>
<item row="1" column="2" rowspan="3">
<widget class="ButtonsWidget" name="rightbuttons" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>113</width>
<height>280</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>113</width>
<height>280</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/T8/right.png)</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QWidget" name="top" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>254</width>
<height>35</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>254</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/T8/top.png)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QWidget" name="bottom" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>254</width>
<height>113</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>254</width>
<height>113</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/T8/bottom.png)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>12</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>12</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>10</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(247, 245, 245);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LcdWidget</class>
<extends>QWidget</extends>
<header>lcdwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ButtonsWidget</class>
<extends>QWidget</extends>
<header>buttonswidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -91,6 +91,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_JUMPER_T12:
radioUiWidget = new SimulatedUIWidgetJumperT12(simulator, this);
break;
case Board::BOARD_JUMPER_TLITE:
radioUiWidget = new SimulatedUIWidgetJumperTLITE(simulator, this);
break;
case Board::BOARD_JUMPER_T16:
radioUiWidget = new SimulatedUIWidgetJumperT16(simulator, this);
break;
@@ -100,6 +103,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_RADIOMASTER_TX12:
radioUiWidget = new SimulatedUIWidgetTX12(simulator, this);
break;
case Board::BOARD_RADIOMASTER_T8:
radioUiWidget = new SimulatedUIWidgetT8(simulator, this);
break;
case Board::BOARD_RADIOMASTER_TX16S:
radioUiWidget = new SimulatedUIWidgetTX16S(simulator, this);
break;
File diff suppressed because it is too large Load Diff