3djc/2.4 add 2.3 pr (#8099)

This commit is contained in:
3djc
2020-11-19 16:32:50 +01:00
committed by GitHub
parent 87cd9047b1
commit 24f93a7cbe
94 changed files with 22779 additions and 205 deletions
+2
View File
@@ -343,6 +343,8 @@ 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 TX12)
set(FLAVOUR tx12)
elseif(PCB STREQUAL X9D+ AND PCBREV STREQUAL 2019)
set(FLAVOUR x9d+2019)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL EXPRESS)
+11
View File
@@ -179,6 +179,17 @@
<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/TX12/left.png</file>
<file>images/simulator/TX12/left-pageup.png</file>
<file>images/simulator/TX12/left-pagedn.png</file>
<file>images/simulator/TX12/left-rtn.png</file>
<file>images/simulator/TX12/left-sys.png</file>
<file>images/simulator/TX12/left-tele.png</file>
<file>images/simulator/TX12/right.png</file>
<file>images/simulator/TX12/right-ent.png</file>
<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/JumperT16/left.png</file>
<file>images/simulator/JumperT16/right.png</file>
<file>images/simulator/JumperT16/top.png</file>
+42 -4
View File
@@ -85,6 +85,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x4078746F;
case BOARD_RADIOMASTER_TX16S:
return 0x3878746F;
case BOARD_RADIOMASTER_TX12:
return 0x4178746F;
case BOARD_UNKNOWN:
break;
}
@@ -111,6 +113,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_TARANIS_X9DP_2019:
case BOARD_TARANIS_X9E:
case BOARD_JUMPER_T12:
case BOARD_RADIOMASTER_TX12:
return EESIZE_TARANIS;
case BOARD_UNKNOWN:
return EESIZE_MAX;
@@ -145,6 +148,7 @@ int Boards::getFlashSize(Type board)
case BOARD_TARANIS_X9DP_2019:
case BOARD_TARANIS_X9E:
case BOARD_JUMPER_T12:
case BOARD_RADIOMASTER_TX12:
return FSIZE_TARANIS;
case BOARD_HORUS_X12S:
case BOARD_X10:
@@ -201,6 +205,20 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_RADIOMASTER_TX12(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_TOGGLE, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_TOGGLE, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_3POS, "SF"},
{SWITCH_2POS, "SI"},
{SWITCH_2POS, "SJ"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_JUMPER_T12(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
@@ -213,7 +231,23 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
if (index < DIM(switches))
return switches[index];
}
else if (IS_HORUS_OR_TARANIS(board)) {
else if (IS_FAMILY_HORUS_OR_T16(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
{SWITCH_3POS, "SC"},
{SWITCH_3POS, "SD"},
{SWITCH_3POS, "SE"},
{SWITCH_2POS, "SF"},
{SWITCH_3POS, "SG"},
{SWITCH_TOGGLE, "SH"},
{SWITCH_2POS, "SI"},
{SWITCH_2POS, "SJ"}
};
if (index < DIM(switches))
return switches[index];
}
else if (IS_TARANIS(board)) {
const Board::SwitchInfo switches[] = {
{SWITCH_3POS, "SA"},
{SWITCH_3POS, "SB"},
@@ -263,7 +297,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case Pots:
if (IS_TARANIS_X9LITE(board))
return 1;
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
else if (IS_TARANIS_SMALL(board))
return 2;
else if (IS_TARANIS_X9E(board))
return 4;
@@ -318,8 +352,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 7;
else if (IS_TARANIS_X7(board))
return 8;
else if (IS_JUMPER_T12(board))
return 6;
else if (IS_FAMILY_T12(board))
return 8;
else if (IS_TARANIS_XLITE(board))
return 6;
else if (board == Board::BOARD_TARANIS_X9DP_2019)
@@ -334,6 +368,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case FactoryInstalledSwitches:
if (IS_TARANIS_X9E(board))
return 8;
if (IS_FAMILY_T12(board))
return 6;
if (IS_HORUS_X12S(board))
return 8;
else
@@ -515,6 +551,8 @@ QString Boards::getBoardName(Board::Type board)
return "Jumper T18";
case BOARD_RADIOMASTER_TX16S:
return "Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
return "Radiomaster TX12";
default:
return tr("Unknown");
}
+18 -7
View File
@@ -52,9 +52,10 @@ namespace Board {
BOARD_JUMPER_T16,
BOARD_RADIOMASTER_TX16S,
BOARD_JUMPER_T18,
BOARD_RADIOMASTER_TX12,
};
constexpr int BOARD_TYPE_MAX = BOARD_JUMPER_T18;
constexpr int BOARD_TYPE_MAX = BOARD_RADIOMASTER_TX12;
enum PotType
{
@@ -218,11 +219,21 @@ inline bool IS_RADIOMASTER_TX16S(Board::Type board)
return board == Board::BOARD_RADIOMASTER_TX16S;
}
inline bool IS_RADIOMASTER_TX12(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_TX12;
}
inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S || board == Board::BOARD_JUMPER_T18;
}
inline bool IS_FAMILY_T12(Board::Type board)
{
return board == Board::BOARD_JUMPER_T12 || board == Board::BOARD_RADIOMASTER_TX12;
}
inline bool IS_TARANIS_XLITE(Board::Type board)
{
return board == Board::BOARD_TARANIS_XLITE || board == Board::BOARD_TARANIS_XLITES;
@@ -273,14 +284,14 @@ inline bool IS_TARANIS_X9E(Board::Type board)
return board == Board::BOARD_TARANIS_X9E;
}
inline bool IS_TARANIS(Board::Type board)
{
return IS_TARANIS_X9(board) || IS_TARANIS_X7(board) || IS_TARANIS_X9LITE(board) || IS_TARANIS_XLITE(board) || IS_JUMPER_T12(board);
}
inline bool IS_TARANIS_SMALL(Board::Type board)
{
return IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || IS_JUMPER_T12(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)
{
return IS_TARANIS_X9(board) || IS_TARANIS_SMALL(board);
}
inline bool IS_HORUS_X10(Board::Type board)
+4 -4
View File
@@ -253,11 +253,11 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
potConfig[0] = Board::POT_WITHOUT_DETENT;
potConfig[1] = Board::POT_WITH_DETENT;
}
else if (IS_TARANIS(board)) {
else if (IS_FAMILY_T12(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_WITH_DETENT;
}
else if (IS_JUMPER_T12(board)) {
else if (IS_TARANIS(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_WITH_DETENT;
}
@@ -329,14 +329,14 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
}
}
if (IS_JUMPER_T12(cstate.toType)) {
if (IS_FAMILY_T12(cstate.toType)) {
if (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType)) {
strncpy(switchName[4], switchName[5], sizeof(switchName[0]));
strncpy(switchName[5], switchName[7], sizeof(switchName[0]));
}
}
else if (IS_JUMPER_T12(cstate.fromType)) {
else if (IS_FAMILY_T12(cstate.fromType)) {
if (IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) {
strncpy(switchName[5], switchName[4], sizeof(switchName[0]));
strncpy(switchName[7], switchName[5], sizeof(switchName[0]));
@@ -45,7 +45,7 @@ inline int MAX_SWITCHES(Board::Type board, int version)
if (IS_TARANIS_X9D(board))
return 9;
if (IS_JUMPER_T12(board))
if (IS_FAMILY_T12(board))
return 8;
return Boards::getCapability(board, Board::Switches);
@@ -36,6 +36,7 @@
#define TARANIS_X9LITE_VARIANT 0x0800
#define TARANIS_X9LITES_VARIANT 0x0801
#define JUMPER_T12_VARIANT 0x4001
#define RADIOMASTER_TX12_VARIANT 0x4002
class OpenTxGeneralData: public TransformedField {
public:
@@ -66,6 +66,8 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for Jumper T18";
case BOARD_RADIOMASTER_TX16S:
return "OpenTX for Radiomaster TX16S";
case BOARD_RADIOMASTER_TX12:
return "OpenTX for Radiomaster TX12";
case BOARD_TARANIS_X9D:
return "OpenTX for FrSky Taranis X9D";
case BOARD_TARANIS_X9DP:
@@ -334,7 +336,9 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
else if (IS_JUMPER_T12(board)) {
variant |= JUMPER_T12_VARIANT;
}
else if (IS_RADIOMASTER_TX12(board)) {
variant |= RADIOMASTER_TX12_VARIANT;
}
OpenTxGeneralData generator((GeneralSettings &)radioData.generalSettings, board, version, variant);
// generator.dump();
QByteArray data;
@@ -520,7 +524,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case MaxVolume:
return 23;
case MaxContrast:
if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
if (IS_TARANIS_SMALL(board))
return 30;
else
return 45;
@@ -615,7 +619,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdWidth:
if (IS_FAMILY_HORUS_OR_T16(board))
return 480;
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
else if (IS_TARANIS_SMALL(board))
return 128;
else if (IS_TARANIS(board))
return 212;
@@ -629,7 +633,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case LcdDepth:
if (IS_FAMILY_HORUS_OR_T16(board))
return 16;
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
else if (IS_TARANIS_SMALL(board))
return 1;
else if (IS_TARANIS(board))
return 4;
@@ -679,6 +683,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
return TARANIS_XLITE_VARIANT;
else if (IS_JUMPER_T12(board))
return JUMPER_T12_VARIANT;
else if (IS_RADIOMASTER_TX12(board))
return RADIOMASTER_TX12_VARIANT;
else
return 0;
case MavlinkTelemetry:
@@ -733,9 +739,9 @@ bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
return true;
case PULSES_PXX_XJT_X16:
case PULSES_PXX_XJT_LR12:
return !IS_ACCESS_RADIO(board, id) && !IS_FAMILY_T16(board) && !IS_JUMPER_T12(board);
return !IS_ACCESS_RADIO(board, id) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board);
case PULSES_PXX_XJT_D8:
return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && !IS_FAMILY_T16(board) && !IS_JUMPER_T12(board);
return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && !IS_FAMILY_T16(board) && !IS_FAMILY_T12(board);
case PULSES_ACCESS_ISRM:
case PULSES_ACCST_ISRM_D16:
return IS_ACCESS_RADIO(board, id);
@@ -943,6 +949,11 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
variantError = true;
}
}
else if (IS_RADIOMASTER_TX12(board)) {
if (variant != RADIOMASTER_TX12_VARIANT) {
variantError = true;
}
}
else if (IS_TARANIS(board)) {
if (variant != 0) {
variantError = true;
@@ -1273,6 +1284,16 @@ void registerOpenTxFirmwares()
addOpenTxRfOptions(firmware, FLEX);
registerOpenTxFirmware(firmware);
/* Radiomaster TX12 board */
firmware = new OpenTxFirmware("opentx-tx12", QCoreApplication::translate("Firmware", "Radiomaster TX12"), BOARD_RADIOMASTER_TX12);
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 + AFHDS3);
/* Radiomaster TX16S board */
firmware = new OpenTxFirmware("opentx-tx16s", Firmware::tr("Radiomaster TX16S / SE / Hall / Masterfire"), BOARD_RADIOMASTER_TX16S);
addOpenTxFrskyOptions(firmware);
+1 -1
View File
@@ -364,7 +364,7 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
if (index >= 0)
evt = RadioDataConversionState::EVT_CVRT;
}
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
else if (IS_FAMILY_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
// No SE and SG on T12 board
index = toSwitchList.indexOf("SD");
if (index >= 0)
+1 -1
View File
@@ -200,7 +200,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
if (newIdx >= 0)
evt = RadioDataConversionState::EVT_CVRT;
}
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
else if (IS_FAMILY_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
// No SE and SG on T12 board
newIdx = toSwitchList.indexOf("SD");
if (newIdx >= 0)
+29 -12
View File
@@ -47,7 +47,15 @@ void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * na
label->setText("SJ");
}
}
if (IS_JUMPER_T12(board)) {
else if (IS_RADIOMASTER_TX12(board)) {
if (index == 6) {
label->setText("SI");
}
else if (index == 7) {
label->setText("SJ");
}
}
else if (IS_FAMILY_T12(board)) {
if (index == 4) {
label->setText("SG");
}
@@ -101,6 +109,15 @@ void HardwarePanel::setupSliderType(int index, QLabel *label, AutoLineEdit *name
}
}
bool HardwarePanel::isSwitch3Pos(int idx)
{
Board::Type board = firmware->getBoard();
Board::SwitchInfo switchInfo = Boards::getSwitchInfo(board, idx);
switchInfo.config = Board::SwitchType(generalSettings.switchConfig[idx]);
return switchInfo.config == Board::SWITCH_3POS;
};
HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
GeneralPanel(parent, generalSettings, firmware),
ui(new Ui::Hardware)
@@ -147,17 +164,17 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
setupSliderType(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
setupSliderType(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
setupSwitchType(0, ui->saLabel, ui->saName, ui->saType);
setupSwitchType(1, ui->sbLabel, ui->sbName, ui->sbType);
setupSwitchType(2, ui->scLabel, ui->scName, ui->scType);
setupSwitchType(3, ui->sdLabel, ui->sdName, ui->sdType);
setupSwitchType(4, ui->seLabel, ui->seName, ui->seType);
setupSwitchType(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
setupSwitchType(6, ui->sgLabel, ui->sgName, ui->sgType);
setupSwitchType(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
setupSwitchType(8, ui->siLabel, ui->siName, ui->siType);
setupSwitchType(9, ui->sjLabel, ui->sjName, ui->sjType);
setupSwitchType(10, ui->skLabel, ui->skName, ui->skType);
setupSwitchType(0, ui->saLabel, ui->saName, ui->saType, isSwitch3Pos(0));
setupSwitchType(1, ui->sbLabel, ui->sbName, ui->sbType, isSwitch3Pos(1));
setupSwitchType(2, ui->scLabel, ui->scName, ui->scType, isSwitch3Pos(2));
setupSwitchType(3, ui->sdLabel, ui->sdName, ui->sdType, isSwitch3Pos(3));
setupSwitchType(4, ui->seLabel, ui->seName, ui->seType, isSwitch3Pos(4));
setupSwitchType(5, ui->sfLabel, ui->sfName, ui->sfType, isSwitch3Pos(5));
setupSwitchType(6, ui->sgLabel, ui->sgName, ui->sgType, isSwitch3Pos(6));
setupSwitchType(7, ui->shLabel, ui->shName, ui->shType, isSwitch3Pos(7));
setupSwitchType(8, ui->siLabel, ui->siName, ui->siType, isSwitch3Pos(8));
setupSwitchType(9, ui->sjLabel, ui->sjName, ui->sjType, isSwitch3Pos(9));
setupSwitchType(10, ui->skLabel, ui->skName, ui->skType); // Here starts X9E, only 3 switches
setupSwitchType(11, ui->slLabel, ui->slName, ui->slType);
setupSwitchType(12, ui->smLabel, ui->smName, ui->smType);
setupSwitchType(13, ui->snLabel, ui->snName, ui->snType);
+1
View File
@@ -63,6 +63,7 @@ class HardwarePanel : public GeneralPanel
Ui::Hardware *ui;
void setValues();
bool isSwitch3Pos(int idx);
};
#endif // _HARDWARE_H_
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+1
View File
@@ -412,6 +412,7 @@ void Curves::onPointEdited()
model->curves[currentCurve].points[index].x = spnx[index]->value();
model->curves[currentCurve].points[index].y = spny[index]->value();
updateCurve();
updateCurvePoints();
emit modified();
}
}
+2
View File
@@ -15,6 +15,7 @@ set(simulation_SRCS
simulateduiwidgetJumperT12.cpp
simulateduiwidgetJumperT16.cpp
simulateduiwidgetJumperT18.cpp
simulateduiwidgetTX12.cpp
simulateduiwidgetTX16S.cpp
simulatorinterface.cpp
simulatormainwindow.cpp
@@ -41,6 +42,7 @@ set(simulation_UIS
simulateduiwidgetJumperT12.ui
simulateduiwidgetJumperT16.ui
simulateduiwidgetJumperT18.ui
simulateduiwidgetTX12.ui
simulateduiwidgetTX16S.ui
simulatormainwindow.ui
simulatorstartupdialog.ui
@@ -115,6 +115,7 @@ namespace Ui {
class SimulatedUIWidgetJumperT16;
class SimulatedUIWidgetJumperT18;
class SimulatedUIWidgetTX16S;
class SimulatedUIWidgetTX12;
}
class SimulatedUIWidget9X: public SimulatedUIWidget
@@ -265,6 +266,19 @@ class SimulatedUIWidgetJumperT18: public SimulatedUIWidget
Ui::SimulatedUIWidgetJumperT18 * ui;
};
class SimulatedUIWidgetTX12: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetTX12(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetTX12();
private:
Ui::SimulatedUIWidgetTX12 * ui;
};
class SimulatedUIWidgetTX16S: public SimulatedUIWidget
{
Q_OBJECT
@@ -0,0 +1,67 @@
#include "simulateduiwidget.h"
#include "ui_simulateduiwidgetTX12.h"
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
SimulatedUIWidgetTX12::SimulatedUIWidgetTX12(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetTX12)
{
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(60, 5, 90, 60), "TX12/right-mdl.png", act));
m_mouseMidClickAction = new RadioUiAction(1, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
addRadioWidget(ui->rightbuttons->addArea(QRect(45, 100, 70, 120), "TX12/right-ent.png", m_mouseMidClickAction));
act = new RadioUiAction(4, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
addRadioWidget(ui->leftbuttons->addArea(QRect(35, 5, 80, 50), "TX12/left-sys.png", act));
act = new RadioUiAction(6, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
addRadioWidget(ui->leftbuttons->addArea(QRect(90, 210, 80, 35), "TX12/left-tele.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(75, 125, 80, 35), "TX12/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(80, 170, 80, 35), "TX12/left-pageup.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(70, 85, 80, 35), "TX12/left-rtn.png", act));
m_scrollUpAction = new RadioUiAction(-1, QList<int>() << 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<int>() << 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);
}
SimulatedUIWidgetTX12::~SimulatedUIWidgetTX12()
{
delete ui;
}
@@ -0,0 +1,258 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetTX12</class>
<widget class="QWidget" name="SimulatedUIWidgetTX12">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>641</width>
<height>272</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>641</width>
<height>272</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>641</width>
<height>272</height>
</size>
</property>
<property name="windowTitle">
<string notr="true">Taranis TX12 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>196</width>
<height>253</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>196</width>
<height>253</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX12/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>256</width>
<height>128</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>424</width>
<height>128</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>189</width>
<height>253</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>189</width>
<height>253</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX12/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>261</width>
<height>101</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>261</width>
<height>101</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX12/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>261</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>261</width>
<height>24</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX12/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>
@@ -97,6 +97,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_JUMPER_T18:
radioUiWidget = new SimulatedUIWidgetJumperT18(simulator, this);
break;
case Board::BOARD_RADIOMASTER_TX12:
radioUiWidget = new SimulatedUIWidgetTX12(simulator, this);
break;
case Board::BOARD_RADIOMASTER_TX16S:
radioUiWidget = new SimulatedUIWidgetTX16S(simulator, this);
break;
+1
View File
@@ -48,6 +48,7 @@ QStringList const Translations::getAvailableTranslations()
<< "ru_RU"
<< "sv_SE"
<< "zh_CN"
<< "zh_TW"
<< "ja_JP" ;
}
return locales;
File diff suppressed because it is too large Load Diff