Add Jumper t12 support by 3djc (#6451)
* Jumper T12 - companion part * more work * Add definitions * fix libsimulator key handling * Fix simu keys handling * Cosmetics * Continued * Fix wrong regplace * Fix wrong regplace * Please travis * Please travis * Add T12 to Travis Switch naming and display * Cosmetics * Work on modules * Work on modules * typo * Fix navigation * Cosmetics * Introduce NAVIGATION_type * Fix * Make NAVIGATION_type more future proof * Lots of cleanups and improvements * Cosmetics * Fix internal module menu * Cosmetics * Fix screen reversed * Small fixes * Fix navigation issue * Please travis * Fix LCD contrast * Fix T12 switch layout * Fix T12 keys screen and all radios keys translations * Complete rework of SWITCHES screen for all radios * comsetics * VC++ compilation
@@ -333,7 +333,11 @@ file(GLOB simulator_plugins "${CMAKE_BINARY_DIR}/Release/*opentx-*simulator${CMA
|
||||
|
||||
# the current flavour is not automatically added if build in the current cmake iteration, so always
|
||||
# add its library name to be sure
|
||||
string(TOLOWER ${PCB} FLAVOUR)
|
||||
if(PCB STREQUAL X7 AND PCBREV STREQUAL T12)
|
||||
set(FLAVOUR t12)
|
||||
else()
|
||||
string(TOLOWER ${PCB} FLAVOUR)
|
||||
endif()
|
||||
if(POLICY CMP0026)
|
||||
cmake_policy(SET CMP0026 OLD) # https://cmake.org/cmake/help/v3.0/policy/CMP0026.html
|
||||
endif()
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<file>images/simulator/X10/left_rtn.png</file>
|
||||
<file>images/simulator/X10/left_sys.png</file>
|
||||
<file>images/simulator/X10/left_tele.png</file>
|
||||
<file>images/simulator/X10/right_ent.png</file>
|
||||
<file>images/simulator/X10/right_ent.png</file>
|
||||
<file>images/simulator/9X/9xdb.png</file>
|
||||
<file>images/simulator/9X/9xdl.png</file>
|
||||
<file>images/simulator/9X/9xdr.png</file>
|
||||
@@ -157,15 +157,28 @@
|
||||
<file>images/simulator/XLITE/right_left.png</file>
|
||||
<file>images/simulator/XLITE/right_up.png</file>
|
||||
<file>images/simulator/XLITE/right_down.png</file>
|
||||
<file>images/simulator/JumperT12/right_up.png</file>
|
||||
<file>images/simulator/JumperT12/right_down.png</file>
|
||||
<file>images/simulator/JumperT12/right_right.png</file>
|
||||
<file>images/simulator/JumperT12/right_left.png</file>
|
||||
<file>images/simulator/JumperT12/left_ent.png</file>
|
||||
<file>images/simulator/JumperT12/left_exit.png</file>
|
||||
<file>images/simulator/JumperT12/JumperT12.png</file>
|
||||
<file>images/simulator/JumperT12/JumperT12-208.png</file>
|
||||
<file>images/simulator/JumperT12/JumperT12-left.png</file>
|
||||
<file>images/simulator/JumperT12/JumperT12-right.png</file>
|
||||
<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/wizard/ailerons.png</file>
|
||||
<file>images/wizard/airbrakes.png</file>
|
||||
<file>images/wizard/elevons.png</file>
|
||||
<file>images/wizard/elevons.png</file>
|
||||
<file>images/wizard/conclusion.png</file>
|
||||
<file>images/wizard/cyclic.png</file>
|
||||
<file>images/wizard/fblheli.png</file>
|
||||
<file>images/wizard/flaps.png</file>
|
||||
<file>images/wizard/flybar.png</file>
|
||||
<file>images/wizard/gyro.png</file>
|
||||
<file>images/wizard/gyro.png</file>
|
||||
<file>images/wizard/helictrl.png</file>
|
||||
<file>images/wizard/models.png</file>
|
||||
<file>images/wizard/multirotor.png</file>
|
||||
@@ -1136,6 +1149,6 @@
|
||||
<file>themes/yerico/48/contributors.png</file>
|
||||
<file>themes/yerico/48/stop.png</file>
|
||||
<file>themes/yerico/48/write_eeprom.png</file>
|
||||
<file>themes/yerico/48/sdsync.png</file>
|
||||
<file>themes/yerico/48/sdsync.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -83,6 +83,8 @@ uint32_t Boards::getFourCC(Type board)
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
return 0;
|
||||
case BOARD_JUMPER_T12:
|
||||
return 0x3D78746F;
|
||||
case BOARD_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
@@ -112,6 +114,7 @@ const int Boards::getEEpromSize(Board::Type board)
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_JUMPER_T12:
|
||||
return EESIZE_TARANIS;
|
||||
case BOARD_UNKNOWN:
|
||||
return EESIZE_MAX;
|
||||
@@ -221,6 +224,18 @@ const SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else if (IS_JUMPER_T12(board)) {
|
||||
const Board::SwitchInfo switches[] = {
|
||||
{SWITCH_3POS, "SA"},
|
||||
{SWITCH_3POS, "SB"},
|
||||
{SWITCH_3POS, "SC"},
|
||||
{SWITCH_3POS, "SD"},
|
||||
{SWITCH_2POS, "SG"},
|
||||
{SWITCH_2POS, "SH"}
|
||||
};
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else {
|
||||
const Board::SwitchInfo switches[] = {
|
||||
{SWITCH_3POS, "3POS"},
|
||||
@@ -247,7 +262,7 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
case Pots:
|
||||
if (IS_TARANIS_X9LITE(board))
|
||||
return 1;
|
||||
else if (IS_TARANIS_SMALL(board))
|
||||
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
|
||||
return 2;
|
||||
else if (IS_TARANIS_X9E(board))
|
||||
return 4;
|
||||
@@ -302,6 +317,8 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return 4;
|
||||
else if (IS_HORUS_OR_TARANIS(board))
|
||||
return 8;
|
||||
else if (IS_JUMPER_T12(board))
|
||||
return 6;
|
||||
else
|
||||
return 7;
|
||||
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace Board {
|
||||
BOARD_X10,
|
||||
BOARD_TARANIS_XLITE,
|
||||
BOARD_TARANIS_XLITES,
|
||||
BOARD_TARANIS_X9LITE
|
||||
BOARD_TARANIS_X9LITE,
|
||||
BOARD_JUMPER_T12
|
||||
};
|
||||
|
||||
constexpr int BOARD_TYPE_MAX = BOARD_TARANIS_X9LITE ;
|
||||
@@ -190,6 +191,7 @@ class Boards
|
||||
#define IS_2560(board) (board==Board::BOARD_GRUVIN9X || board==Board::BOARD_MEGA2560)
|
||||
#define IS_SKY9X(board) (board==Board::BOARD_SKY9X || board==Board::BOARD_9XRPRO || board==Board::BOARD_AR9X)
|
||||
#define IS_9XRPRO(board) (board==Board::BOARD_9XRPRO)
|
||||
#define IS_JUMPER_T12(board) (board==Board::BOARD_JUMPER_T12)
|
||||
#define IS_TARANIS_XLITE(board) (board==Board::BOARD_TARANIS_XLITE || board==Board::BOARD_TARANIS_XLITES)
|
||||
#define IS_TARANIS_XLITES(board) (board==Board::BOARD_TARANIS_XLITES)
|
||||
#define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
|
||||
|
||||
@@ -90,7 +90,7 @@ GeneralSettings::GeneralSettings()
|
||||
// Lipo 2S
|
||||
vBatWarn = 66;
|
||||
vBatMin = -23; // 6.7V
|
||||
vBatMax = -37; // 8.3V
|
||||
vBatMax = -37; // 8.3V
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
// NI-MH 7.2V, X9D, X9D+ and X7
|
||||
@@ -249,6 +249,10 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
|
||||
potConfig[0] = Board::POT_WITH_DETENT;
|
||||
potConfig[1] = Board::POT_WITH_DETENT;
|
||||
}
|
||||
else if (IS_JUMPER_T12(board)) {
|
||||
potConfig[0] = Board::POT_WITH_DETENT;
|
||||
potConfig[1] = Board::POT_WITH_DETENT;
|
||||
}
|
||||
else {
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITHOUT_DETENT;
|
||||
@@ -317,6 +321,20 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_JUMPER_T12(cstate.toType)) {
|
||||
if (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(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)) {
|
||||
if (IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) {
|
||||
strncpy(switchName[5], switchName[4], sizeof(switchName[0]));
|
||||
strncpy(switchName[7], switchName[5], sizeof(switchName[0]));
|
||||
}
|
||||
}
|
||||
|
||||
// LS and RS sliders are after 2 aux sliders on X12 and X9E
|
||||
if ((IS_HORUS_X12S(cstate.toType) || IS_TARANIS_X9E(cstate.toType)) && !IS_HORUS_X12S(cstate.fromType) && !IS_TARANIS_X9E(cstate.fromType)) {
|
||||
strncpy(sliderName[0], sliderName[2], sizeof(sliderName[0]));
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#define TARANIS_XLITE_VARIANT 0x2000
|
||||
#define TARANIS_XLITES_VARIANT 0x1000
|
||||
#define TARANIS_X9LITE_VARIANT 0x0800
|
||||
#define JUMPER_T12_VARIANT TARANIS_X7_VARIANT
|
||||
|
||||
#define SIMU_STOCK_VARIANTS (GVARS_VARIANT|FRSKY_VARIANT)
|
||||
#define SIMU_M128_VARIANTS (M128_VARIANT|SIMU_STOCK_VARIANTS)
|
||||
|
||||
@@ -66,6 +66,8 @@ const char * OpenTxEepromInterface::getName()
|
||||
return "OpenTX for MEGA2560 board";
|
||||
case BOARD_GRUVIN9X:
|
||||
return "OpenTX for Gruvin9x board / 9X";
|
||||
case BOARD_JUMPER_T12:
|
||||
return "OpenTX for Jumper T12";
|
||||
case BOARD_TARANIS_X9D:
|
||||
return "OpenTX for FrSky Taranis X9D";
|
||||
case BOARD_TARANIS_X9DP:
|
||||
@@ -331,6 +333,9 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
|
||||
else if (IS_TARANIS_XLITE(board)) {
|
||||
variant |= TARANIS_XLITE_VARIANT;
|
||||
}
|
||||
else if (IS_JUMPER_T12(board)) {
|
||||
variant |= JUMPER_T12_VARIANT;
|
||||
}
|
||||
|
||||
OpenTxGeneralData generator((GeneralSettings &)radioData.generalSettings, board, version, variant);
|
||||
// generator.dump();
|
||||
@@ -543,7 +548,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || IS_TARANIS_SMALL(board) || IS_TARANIS_X9E(board) || IS_HORUS(board) || id.contains("haptic"));
|
||||
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || IS_TARANIS_SMALL(board) || IS_TARANIS_X9E(board) || IS_HORUS(board) || IS_JUMPER_T12(board) || id.contains("haptic"));
|
||||
case ModelTrainerEnable:
|
||||
if (IS_HORUS_OR_TARANIS(board))
|
||||
return 1;
|
||||
@@ -552,7 +557,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case MaxVolume:
|
||||
return (IS_ARM(board) ? 23 : 7);
|
||||
case MaxContrast:
|
||||
if (IS_TARANIS_SMALL(board))
|
||||
if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
|
||||
return 30;
|
||||
else
|
||||
return 45;
|
||||
@@ -644,7 +649,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case LcdWidth:
|
||||
if (IS_HORUS(board))
|
||||
return 480;
|
||||
else if (IS_TARANIS_SMALL(board))
|
||||
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
|
||||
return 128;
|
||||
else if (IS_TARANIS(board))
|
||||
return 212;
|
||||
@@ -658,7 +663,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case LcdDepth:
|
||||
if (IS_HORUS(board))
|
||||
return 16;
|
||||
else if (IS_TARANIS_SMALL(board))
|
||||
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
|
||||
return 1;
|
||||
else if (IS_TARANIS(board))
|
||||
return 4;
|
||||
@@ -708,6 +713,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
return TARANIS_XLITES_VARIANT;
|
||||
else if (IS_TARANIS_XLITE(board))
|
||||
return TARANIS_XLITE_VARIANT;
|
||||
else if (IS_JUMPER_T12(board))
|
||||
return JUMPER_T12_VARIANT;
|
||||
else
|
||||
return 0;
|
||||
case MavlinkTelemetry:
|
||||
@@ -973,6 +980,11 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
|
||||
variantError = true;
|
||||
}
|
||||
}
|
||||
else if (IS_JUMPER_T12(board)) {
|
||||
if (variant != JUMPER_T12_VARIANT) {
|
||||
variantError = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (variantError) {
|
||||
qWarning() << " wrong variant (" << variant << ")";
|
||||
@@ -1242,6 +1254,17 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("pcbdev", Firmware::tr("Use ONLY with first DEV pcb version"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* Jumper T12 board */
|
||||
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12"), BOARD_JUMPER_T12);
|
||||
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"));
|
||||
firmware->addOption("luac", Firmware::tr("Enable Lua compiler"));
|
||||
firmware->addOption("crossfire", Firmware::tr("Support for Crossfire TX Module"));
|
||||
addOpenTxFontOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", Firmware::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
|
||||
addOpenTxArm9xOptions(firmware, false);
|
||||
|
||||
@@ -615,6 +615,19 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
|
||||
index = 5; // SH to SH
|
||||
}
|
||||
}
|
||||
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType))) {
|
||||
// No SE and SG on T12 board
|
||||
if (index == 4 || index == 6) {
|
||||
index = 3; // SG and SE to SD
|
||||
evt = RadioDataConversionState::EVT_CVRT;
|
||||
}
|
||||
else if (index == 5) {
|
||||
index = 4; // SF to SF
|
||||
}
|
||||
else if (index == 7) {
|
||||
index = 5; // SH to SH
|
||||
}
|
||||
}
|
||||
// Compensate for SE and SG on X9/Horus board if converting from X7
|
||||
else if ((IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) && IS_TARANIS_X7(cstate.fromType)) {
|
||||
if (index == 4) {
|
||||
@@ -624,6 +637,22 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
|
||||
index = 7; // SH to SH
|
||||
}
|
||||
}
|
||||
else if ((IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
|
||||
if (index == 4) {
|
||||
index = 5; // SF to SF
|
||||
}
|
||||
else if (index == 5) {
|
||||
index = 7; // SH to SH
|
||||
}
|
||||
}
|
||||
else if ((IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
|
||||
if (index == 4) {
|
||||
index = 5; // SF to SF
|
||||
}
|
||||
else if (index == 5) {
|
||||
index = 7; // SH to SH
|
||||
}
|
||||
}
|
||||
} // SOURCE_TYPE_SWITCH
|
||||
|
||||
// final validation (we do not pass model to isAvailable() because we don't know what has or hasn't been converted)
|
||||
|
||||
@@ -208,6 +208,20 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
|
||||
delta = 6; // SH to SH
|
||||
}
|
||||
}
|
||||
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType))) {
|
||||
if (srcIdx == 4 || srcIdx == 5) {
|
||||
delta = 3; // SE to SD & SF to SF
|
||||
if (srcIdx == 4)
|
||||
evt = RadioDataConversionState::EVT_CVRT;
|
||||
}
|
||||
else if (srcIdx == 6) {
|
||||
delta = 9; // SG to SD
|
||||
evt = RadioDataConversionState::EVT_CVRT;
|
||||
}
|
||||
else if (srcIdx == 7) {
|
||||
delta = 6; // SH to SH
|
||||
}
|
||||
}
|
||||
// Compensate for SE and SG on X9/Horus board if converting from X7
|
||||
else if ((IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) && IS_TARANIS_X7(cstate.fromType)) {
|
||||
if (srcIdx == 4) {
|
||||
@@ -217,6 +231,14 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
|
||||
delta = -6; // SH to SH
|
||||
}
|
||||
}
|
||||
else if ((IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
|
||||
if (srcIdx == 4) {
|
||||
delta = -3; // SF to SF
|
||||
}
|
||||
else if (srcIdx == 5) {
|
||||
delta = -6; // SH to SH
|
||||
}
|
||||
}
|
||||
|
||||
if (index < 0) {
|
||||
delta = -delta; // invert for !switch
|
||||
|
||||
@@ -41,6 +41,14 @@ void HardwarePanel::setupSwitchType(int index, QLabel * label, AutoLineEdit * na
|
||||
label->setText("SH");
|
||||
}
|
||||
}
|
||||
if (IS_JUMPER_T12(board)) {
|
||||
if (index == 4) {
|
||||
label->setText("SG");
|
||||
}
|
||||
else if (index == 5) {
|
||||
label->setText("SH");
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
@@ -157,7 +165,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board)) {
|
||||
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board) || IS_JUMPER_T12(board)) {
|
||||
ui->bluetoothMode->addItem(tr("OFF"), 0);
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
ui->bluetoothMode->addItem(tr("Enabled"), 1);
|
||||
|
||||
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 502 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -11,6 +11,7 @@ set(simulation_SRCS
|
||||
simulateduiwidgetX9E.cpp
|
||||
simulateduiwidgetX10.cpp
|
||||
simulateduiwidgetX12.cpp
|
||||
simulateduiwidgetJumperT12.cpp
|
||||
simulatorinterface.cpp
|
||||
simulatormainwindow.cpp
|
||||
simulatorstartupdialog.cpp
|
||||
@@ -32,6 +33,7 @@ set(simulation_UIS
|
||||
simulateduiwidgetX9E.ui
|
||||
simulateduiwidgetX10.ui
|
||||
simulateduiwidgetX12.ui
|
||||
simulateduiwidgetJumperT12.ui
|
||||
simulatormainwindow.ui
|
||||
simulatorstartupdialog.ui
|
||||
simulatorwidget.ui
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace Ui {
|
||||
class SimulatedUIWidgetX9E;
|
||||
class SimulatedUIWidgetX10;
|
||||
class SimulatedUIWidgetX12;
|
||||
class SimulatedUIWidgetJumperT12;
|
||||
}
|
||||
|
||||
class SimulatedUIWidget9X: public SimulatedUIWidget
|
||||
@@ -213,4 +214,16 @@ class SimulatedUIWidgetX12: public SimulatedUIWidget
|
||||
Ui::SimulatedUIWidgetX12 * ui;
|
||||
};
|
||||
|
||||
class SimulatedUIWidgetJumperT12: public SimulatedUIWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatedUIWidgetJumperT12(SimulatorInterface * simulator, QWidget * parent = NULL);
|
||||
virtual ~SimulatedUIWidgetJumperT12();
|
||||
|
||||
private:
|
||||
Ui::SimulatedUIWidgetJumperT12 * ui;
|
||||
};
|
||||
|
||||
#endif // SIMULATEDUIWIDGET_H
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#include "simulateduiwidget.h"
|
||||
#include "ui_simulateduiwidgetJumperT12.h"
|
||||
|
||||
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
|
||||
|
||||
SimulatedUIWidgetJumperT12::SimulatedUIWidgetJumperT12(SimulatorInterface *simulator, QWidget * parent):
|
||||
SimulatedUIWidget(simulator, parent),
|
||||
ui(new Ui::SimulatedUIWidgetJumperT12)
|
||||
{
|
||||
RadioUiAction * act;
|
||||
QPolygon polygon;
|
||||
|
||||
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(69, 11, 60, 25), "JumperT12/right_up.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(61, 115, 60, 25), "JumperT12/right_down.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->rightbuttons->addArea(QRect(109, 53, 30, 40), "JumperT12/right_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->rightbuttons->addArea(QRect(49, 62, 30, 40), "JumperT12/right_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(21, 30, 60, 25), "JumperT12/left_ent.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(21, 80, 60, 60), "JumperT12/left_exit.png", act));
|
||||
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(9, 154, 30, 30), "JumperT12/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);
|
||||
}
|
||||
|
||||
SimulatedUIWidgetJumperT12::~SimulatedUIWidgetJumperT12()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SimulatedUIWidgetJumperT12</class>
|
||||
<widget class="QWidget" name="SimulatedUIWidgetJumperT12">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>570</width>
|
||||
<height>208</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>570</width>
|
||||
<height>208</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>570</width>
|
||||
<height>208</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Jumper T12 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="5" 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>
|
||||
<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="1" column="2" rowspan="4">
|
||||
<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>157</width>
|
||||
<height>186</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>157</width>
|
||||
<height>186</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/JumperT12/JumperT12-right.png)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="4">
|
||||
<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>157</width>
|
||||
<height>186</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>157</width>
|
||||
<height>186</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/JumperT12/JumperT12-left.png);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" 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>256</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/JumperT12/bottom.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>256</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>256</width>
|
||||
<height>48</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/JumperT12/JumperT12-top.png)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" 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>
|
||||
</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_X10:
|
||||
radioUiWidget = new SimulatedUIWidgetX10(simulator, this);
|
||||
break;
|
||||
case Board::BOARD_JUMPER_T12:
|
||||
radioUiWidget = new SimulatedUIWidgetJumperT12(simulator, this);
|
||||
break;
|
||||
default:
|
||||
radioUiWidget = new SimulatedUIWidget9X(simulator, this);
|
||||
break;
|
||||
|
||||