feat: Flysky PL18 Support (#4105)
Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com> Co-authored-by: rotorman <risto.koiva@web.de> Co-authored-by: Xy201207 <yaoxu@flysky.com> Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
This commit is contained in:
co-authored by
raphaelcoeffic
rotorman
Xy201207
Peter Feerick
parent
5153aaeea0
commit
cc17046e7a
@@ -318,6 +318,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T18)
|
||||
set(FLAVOUR t18)
|
||||
elseif(PCB STREQUAL NV14 AND PCBREV STREQUAL EL18)
|
||||
set(FLAVOUR el18)
|
||||
elseif(PCB STREQUAL PL18)
|
||||
set(FLAVOUR pl18)
|
||||
else()
|
||||
string(TOLOWER ${PCB} FLAVOUR)
|
||||
endif()
|
||||
|
||||
@@ -293,6 +293,10 @@
|
||||
<file>images/simulator/NV14/right.png</file>
|
||||
<file>images/simulator/NV14/top.png</file>
|
||||
<file>images/simulator/NV14/bottom.png</file>
|
||||
<file>images/simulator/PL18/left.png</file>
|
||||
<file>images/simulator/PL18/right.png</file>
|
||||
<file>images/simulator/PL18/top.png</file>
|
||||
<file>images/simulator/PL18/bottom.png</file>
|
||||
<file>images/wizard/ailerons.png</file>
|
||||
<file>images/wizard/airbrakes.png</file>
|
||||
<file>images/wizard/elevons.png</file>
|
||||
|
||||
@@ -110,7 +110,9 @@ uint32_t Boards::getFourCC(Type board)
|
||||
case BOARD_FLYSKY_NV14:
|
||||
return 0x3A78746F;
|
||||
case BOARD_FLYSKY_EL18:
|
||||
return 0x3A78746F; // TODO: check this
|
||||
return 0x3A78746F;
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return 0x4878746F;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -159,6 +161,7 @@ int Boards::getEEpromSize(Board::Type board)
|
||||
case BOARD_RADIOMASTER_TX16S:
|
||||
case BOARD_FLYSKY_NV14:
|
||||
case BOARD_FLYSKY_EL18:
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
@@ -206,6 +209,7 @@ int Boards::getFlashSize(Type board)
|
||||
case BOARD_RADIOMASTER_TX16S:
|
||||
case BOARD_FLYSKY_NV14:
|
||||
case BOARD_FLYSKY_EL18:
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return FSIZE_HORUS;
|
||||
case BOARD_UNKNOWN:
|
||||
return FSIZE_MAX;
|
||||
@@ -419,6 +423,20 @@ SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else if (IS_FLYSKY_PL18(board)) {
|
||||
const Board::SwitchInfo switches[] = {
|
||||
{SWITCH_2POS, "SA"},
|
||||
{SWITCH_3POS, "SB"},
|
||||
{SWITCH_2POS, "SC"},
|
||||
{SWITCH_3POS, "SD"},
|
||||
{SWITCH_3POS, "SE"},
|
||||
{SWITCH_2POS, "SF"},
|
||||
{SWITCH_3POS, "SG"},
|
||||
{SWITCH_3POS, "SH"}
|
||||
};
|
||||
if (index < DIM(switches))
|
||||
return switches[index];
|
||||
}
|
||||
else if (IS_FAMILY_HORUS_OR_T16(board)) {
|
||||
const Board::SwitchInfo switches[] = {
|
||||
{SWITCH_3POS, "SA"},
|
||||
@@ -497,6 +515,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return 7;
|
||||
else if (IS_HORUS_X12S(board))
|
||||
return 3;
|
||||
else if (IS_FLYSKY_PL18(board))
|
||||
return 3;
|
||||
else
|
||||
return 3;
|
||||
|
||||
@@ -509,7 +529,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
case Sliders:
|
||||
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board) || IS_JUMPER_T20(board))
|
||||
return 4;
|
||||
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board))
|
||||
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board) || IS_FLYSKY_PL18(board))
|
||||
return 2;
|
||||
else
|
||||
return 0;
|
||||
@@ -531,7 +551,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
getCapability(board, Board::MouseAnalogs) + getCapability(board, Board::GyroAnalogs);
|
||||
|
||||
case MultiposPots:
|
||||
if (IS_HORUS_OR_TARANIS(board) && !(IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)))
|
||||
if (IS_HORUS_OR_TARANIS(board) && !(IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board)))
|
||||
return getCapability(board, Board::Pots);
|
||||
else
|
||||
return 0;
|
||||
@@ -558,6 +578,8 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return 6;
|
||||
else if (board == BOARD_FLYSKY_NV14 || board == BOARD_FLYSKY_EL18)
|
||||
return 8;
|
||||
else if (board == BOARD_FLYSKY_PL18)
|
||||
return 8;
|
||||
else if (board == BOARD_RADIOMASTER_TX12_MK2 || board == BOARD_RADIOMASTER_BOXER || board == BOARD_JUMPER_TPRO)
|
||||
return 6;
|
||||
else if (board == BOARD_RADIOMASTER_POCKET)
|
||||
@@ -600,7 +622,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return getCapability(board, Board::Switches);
|
||||
|
||||
case SwitchPositions:
|
||||
if (IS_HORUS_OR_TARANIS(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
|
||||
if (IS_HORUS_OR_TARANIS(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board))
|
||||
return getCapability(board, Board::Switches) * 3;
|
||||
else
|
||||
return 9;
|
||||
@@ -610,7 +632,9 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
|
||||
|
||||
case NumTrims:
|
||||
if (IS_FAMILY_HORUS_OR_T16(board) && !(IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)))
|
||||
if (IS_FLYSKY_PL18(board))
|
||||
return 8;
|
||||
else if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
|
||||
return 6;
|
||||
else if (IS_IFLIGHT_COMMANDO8(board))
|
||||
return 0;
|
||||
@@ -626,7 +650,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return IS_STM32(board) ? true : false;
|
||||
|
||||
case HasColorLcd:
|
||||
return IS_FAMILY_HORUS_OR_T16(board);
|
||||
return IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board);
|
||||
|
||||
case HasSDCard:
|
||||
return IS_STM32(board);
|
||||
@@ -647,7 +671,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
return false;
|
||||
|
||||
case SportMaxBaudRate:
|
||||
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_TARANIS_X7_ACCESS(board) ||
|
||||
if (IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board) ||IS_TARANIS_X7_ACCESS(board) ||
|
||||
(IS_TARANIS(board) && !IS_TARANIS_XLITE(board) && !IS_TARANIS_X7(board) && !IS_TARANIS_X9LITE(board)))
|
||||
return 400000; // 400K and higher
|
||||
else
|
||||
@@ -833,6 +857,14 @@ StringTagMappingTable Boards::getAnalogNamesLookupTable(Board::Type board, const
|
||||
{tr("TltY").toStdString(), "TILT_Y", 14},
|
||||
});
|
||||
}
|
||||
} else if (IS_FLYSKY_PL18(board)) {
|
||||
tbl.insert(tbl.end(), {
|
||||
{tr("VRA").toStdString(), "POT1"},
|
||||
{tr("VRB").toStdString(), "POT2"},
|
||||
{tr("VRC").toStdString(), "POT3"},
|
||||
{tr("LS").toStdString(), "LS"},
|
||||
{tr("RS").toStdString(), "RS"},
|
||||
});
|
||||
} else if (IS_HORUS_X10(board) || IS_FAMILY_T16(board)) {
|
||||
if (version < adcVersion) {
|
||||
tbl.insert(tbl.end(), {
|
||||
@@ -964,6 +996,8 @@ QString Boards::getBoardName(Board::Type board)
|
||||
return "FlySky NV14";
|
||||
case BOARD_FLYSKY_EL18:
|
||||
return "FlySky EL18";
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return "FlySky PL18";
|
||||
case BOARD_BETAFPV_LR3PRO:
|
||||
return "BETAFPV LR3PRO";
|
||||
case BOARD_IFLIGHT_COMMANDO8:
|
||||
@@ -1198,6 +1232,7 @@ int Boards::getDefaultInternalModules(Board::Type board)
|
||||
case BOARD_JUMPER_TLITE_F4:
|
||||
case BOARD_JUMPER_TPRO:
|
||||
case BOARD_JUMPER_TPROV2:
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return (int)MODULE_TYPE_MULTIMODULE;
|
||||
|
||||
case BOARD_BETAFPV_LR3PRO:
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Board {
|
||||
BOARD_JUMPER_TLITE,
|
||||
BOARD_JUMPER_TLITE_F4,
|
||||
BOARD_FLYSKY_NV14,
|
||||
BOARD_FLYSKY_PL18,
|
||||
BOARD_RADIOMASTER_ZORRO,
|
||||
BOARD_JUMPER_TPRO,
|
||||
BOARD_BETAFPV_LR3PRO,
|
||||
@@ -398,6 +399,11 @@ inline bool IS_FLYSKY_EL18(Board::Type board)
|
||||
return (board == Board::BOARD_FLYSKY_EL18);
|
||||
}
|
||||
|
||||
inline bool IS_FLYSKY_PL18(Board::Type board)
|
||||
{
|
||||
return (board == Board::BOARD_FLYSKY_PL18);
|
||||
}
|
||||
|
||||
inline bool IS_TARANIS_XLITE(Board::Type board)
|
||||
{
|
||||
return board == Board::BOARD_TARANIS_XLITE || board == Board::BOARD_TARANIS_XLITES;
|
||||
@@ -475,7 +481,9 @@ inline bool IS_FAMILY_HORUS(Board::Type board)
|
||||
|
||||
inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board)
|
||||
{
|
||||
return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) || IS_FLYSKY_NV14(board)/*generally*/ || IS_FLYSKY_EL18(board)/*generally*/;
|
||||
return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board) ||
|
||||
IS_FLYSKY_NV14(board)/*generally*/ || IS_FLYSKY_EL18(board)/*generally*/
|
||||
|| IS_FLYSKY_PL18(board);
|
||||
}
|
||||
|
||||
inline bool IS_HORUS_OR_TARANIS(Board::Type board)
|
||||
@@ -485,7 +493,8 @@ inline bool IS_HORUS_OR_TARANIS(Board::Type board)
|
||||
|
||||
inline bool IS_STM32(Board::Type board)
|
||||
{
|
||||
return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board);
|
||||
return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board) ||
|
||||
IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board);
|
||||
}
|
||||
|
||||
inline bool IS_ARM(Board::Type board)
|
||||
|
||||
@@ -154,6 +154,8 @@ void GeneralSettings::init()
|
||||
strcpy(bluetoothName, "t16");
|
||||
else if (IS_FLYSKY_NV14(board))
|
||||
strcpy(bluetoothName, "nv14");
|
||||
else if (IS_FLYSKY_PL18(board))
|
||||
strcpy(bluetoothName, "pl18");
|
||||
else if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
strcpy(bluetoothName, "horus");
|
||||
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board))
|
||||
@@ -269,7 +271,7 @@ void GeneralSettings::init()
|
||||
|
||||
internalModule = g.profile[g.sessionId()].defaultInternalModule();
|
||||
|
||||
if (IS_FLYSKY_NV14(board))
|
||||
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board))
|
||||
stickDeadZone = 2;
|
||||
|
||||
}
|
||||
@@ -285,7 +287,7 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
|
||||
return;
|
||||
|
||||
// TODO: move to Boards, like with switches
|
||||
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)) {
|
||||
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)) {
|
||||
potConfig[0] = Board::POT_WITH_DETENT;
|
||||
potConfig[1] = Board::POT_MULTIPOS_SWITCH;
|
||||
potConfig[2] = Board::POT_WITH_DETENT;
|
||||
@@ -294,6 +296,11 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITHOUT_DETENT;
|
||||
}
|
||||
else if (IS_FLYSKY_PL18(board)) {
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[2] = Board::POT_WITHOUT_DETENT;
|
||||
}
|
||||
else if (IS_TARANIS_XLITE(board)) {
|
||||
potConfig[0] = Board::POT_WITHOUT_DETENT;
|
||||
potConfig[1] = Board::POT_WITHOUT_DETENT;
|
||||
|
||||
@@ -116,7 +116,7 @@ inline int MAX_POTS_STORAGE(Board::Type board, int version)
|
||||
{
|
||||
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 3;
|
||||
if (version <= 220 && IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
|
||||
if (version <= 220 && IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
|
||||
return 5;
|
||||
if (IS_FAMILY_T12(board))
|
||||
return 2;
|
||||
@@ -147,7 +147,7 @@ inline int MAX_XPOTS(Board::Type board, int version)
|
||||
|
||||
inline int MAX_SLIDERS_STORAGE(Board::Type board, int version)
|
||||
{
|
||||
if (version >= 219 && (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)))
|
||||
if (version >= 219 && (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)))
|
||||
return 4;
|
||||
return Boards::getCapability(board, Board::Sliders);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ inline int SWITCHES_CONFIG_SIZE(Board::Type board, int version)
|
||||
|
||||
inline int MAX_MOUSE_ANALOG_SOURCES(Board::Type board, int version)
|
||||
{
|
||||
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board))
|
||||
if (IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
|
||||
return 2;
|
||||
else
|
||||
return 0;
|
||||
@@ -211,10 +211,10 @@ inline int MAX_GYRO_ANALOGS(Board::Type board, int version)
|
||||
#define MAX_CURVES(board, version) ((version >= 219 || HAS_LARGE_LCD(board)) ? 32 : 16)
|
||||
#define MAX_GVARS(board, version) 9
|
||||
#define MAX_SCRIPTS(board) (IS_FAMILY_HORUS_OR_T16(board) ? 9 : 7)
|
||||
#define MAX_TELEMETRY_SENSORS(board, version) (version <= 218 ? 32 : ((IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board) || IS_FLYSKY_NV14(board)) ? 60 : 40))
|
||||
#define MAX_TELEMETRY_SENSORS(board, version) (version <= 218 ? 32 : ((IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) ? 60 : 40))
|
||||
#define NUM_PPM_INPUTS(board, version) 16
|
||||
#define ROTENC_COUNT(board, version) ((IS_STM32(board) && version >= 218) ? 0 : 1)
|
||||
#define MAX_AUX_TRIMS(board) ((IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board)) ? 2 : 0)
|
||||
#define MAX_AUX_TRIMS(board) ((IS_FAMILY_HORUS_OR_T16(board) && !IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board)) ? 2 : 0)
|
||||
#define MAX_SOURCE_TYPE_SPECIAL(board, version) SOURCE_TYPE_SPECIAL_COUNT
|
||||
|
||||
inline int switchIndex(int i, Board::Type board, unsigned int version)
|
||||
@@ -2910,7 +2910,7 @@ void OpenTxModelData::beforeExport()
|
||||
|
||||
// TODO remove when enum not radio specific requires eeprom change and conversion
|
||||
// Note: this must mirror reverse afterImport
|
||||
if (!IS_FLYSKY_NV14(board))
|
||||
if (!IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
|
||||
modelData.trainerMode -= 1;
|
||||
|
||||
if (modelData.trainerMode > TRAINER_MODE_SLAVE_JACK) {
|
||||
@@ -2957,7 +2957,7 @@ void OpenTxModelData::afterImport()
|
||||
|
||||
// TODO remove when enum not radio specific requires eeprom change and conversion
|
||||
// Note: this must mirror reverse beforeExport
|
||||
if (!IS_FLYSKY_NV14(board))
|
||||
if (!IS_FLYSKY_NV14(board) && !IS_FLYSKY_PL18(board))
|
||||
modelData.trainerMode += 1;
|
||||
|
||||
if (modelData.trainerMode > TRAINER_MODE_SLAVE_JACK) {
|
||||
@@ -3003,7 +3003,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
|
||||
internalField.Append(new UnsignedField<16>(this, chkSum));
|
||||
|
||||
if (!IS_FAMILY_HORUS_OR_T16(board) || (IS_FLYSKY_NV14(board))) {
|
||||
if (!IS_FAMILY_HORUS_OR_T16(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.currModelIndex));
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.contrast));
|
||||
}
|
||||
@@ -3067,11 +3067,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
internalField.Append(new SignedField<8>(this, generalData.PPM_Multiplier));
|
||||
internalField.Append(new SignedField<8>(this, generalData.hapticLength));
|
||||
|
||||
if (version < 218 || (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board)) {
|
||||
if (version < 218 || (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.reNavigation));
|
||||
}
|
||||
|
||||
if ((!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board)) {
|
||||
if ((!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.stickReverse));
|
||||
}
|
||||
|
||||
|
||||
@@ -124,6 +124,8 @@ const char * OpenTxEepromInterface::getName()
|
||||
return "EdgeTX for FlySky NV14";
|
||||
case BOARD_FLYSKY_EL18:
|
||||
return "EdgeTX for FlySky EL18";
|
||||
case BOARD_FLYSKY_PL18:
|
||||
return "EdgeTX for FlySky PL18";
|
||||
case BOARD_BETAFPV_LR3PRO:
|
||||
return "EdgeTx for BETAFPV LR3PRO";
|
||||
case BOARD_IFLIGHT_COMMANDO8:
|
||||
@@ -664,6 +666,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case LcdWidth:
|
||||
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
|
||||
return 320;
|
||||
else if (IS_FLYSKY_PL18(board))
|
||||
return 480;
|
||||
else if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 480;
|
||||
else if (IS_TARANIS_SMALL(board))
|
||||
@@ -675,6 +679,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
case LcdHeight:
|
||||
if (IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board))
|
||||
return 480;
|
||||
else if (IS_FLYSKY_PL18(board))
|
||||
return 320;
|
||||
else if (IS_FAMILY_HORUS_OR_T16(board))
|
||||
return 272;
|
||||
else
|
||||
@@ -777,7 +783,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
IS_JUMPER_TPRO(board) || IS_RADIOMASTER_TX12_MK2(board) || IS_RADIOMASTER_BOXER(board) || IS_RADIOMASTER_POCKET(board);
|
||||
case HasBluetooth:
|
||||
return (IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) ||
|
||||
IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board)) ? true : false;
|
||||
IS_TARANIS_X9DP_2019(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_EL18(board) || IS_FLYSKY_PL18(board)) ? true : false;
|
||||
case HasADCJitterFilter:
|
||||
return IS_HORUS_OR_TARANIS(board);
|
||||
case HasTelemetryBaudrate:
|
||||
@@ -1244,6 +1250,13 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxRfOptions(firmware, FLEX + AFHDS2A + AFHDS3);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FlySky PL18 board */
|
||||
firmware = new OpenTxFirmware(FIRMWAREID("pl18"), Firmware::tr("FlySky PL18"), BOARD_FLYSKY_PL18);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||
addOpenTxRfOptions(firmware, FLEX + AFHDS3);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky Horus X10 board */
|
||||
firmware = new OpenTxFirmware(FIRMWAREID("x10"), Firmware::tr("FrSky Horus X10 / X10S"), BOARD_X10);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
|
||||
@@ -175,7 +175,7 @@ ui(new Ui::GeneralSetup)
|
||||
ui->usbModeCB->hide();
|
||||
}
|
||||
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
ui->hatsModeCB->setModel(new FilteredItemModel(GeneralSettings::hatsModeItemModel()));
|
||||
ui->hatsModeCB->setField(generalSettings.hatsMode, this);
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
@@ -1696,7 +1696,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
||||
|
||||
ui->trimsDisplay->setField(model.trimsDisplay, this);
|
||||
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
ui->cboHatsMode->setModel(panelFilteredModels->getItemModel(FIM_HATSMODE));
|
||||
ui->cboHatsMode->setField(model.hatsMode, this);
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ QString ModelPrinter::printSettingsTrim()
|
||||
str << printLabelValue(tr("Display"), printTrimsDisplayMode());
|
||||
str << printLabelValue(tr("Extended"), printBoolean(model.extendedTrims, BOOLEAN_YESNO));
|
||||
Board::Type board = firmware->getBoard();
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board)) {
|
||||
if (IS_FLYSKY_EL18(board) || IS_FLYSKY_NV14(board) || IS_FLYSKY_PL18(board)) {
|
||||
str << printLabelValue(tr("Hats Mode"), printHatsMode());
|
||||
}
|
||||
return str.join(" ");
|
||||
|
||||
@@ -40,6 +40,7 @@ set(${PROJECT_NAME}_SRCS
|
||||
simulateduiwidgetJumperTPRO.cpp
|
||||
simulateduiwidgetLR3PRO.cpp
|
||||
simulateduiwidgetNV14.cpp
|
||||
simulateduiwidgetPL18.cpp
|
||||
simulateduiwidgetT8.cpp
|
||||
simulateduiwidgetTX12.cpp
|
||||
simulateduiwidgetTX16S.cpp
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace Ui {
|
||||
class SimulatedUIWidgetT8;
|
||||
class SimulatedUIWidgetNV14;
|
||||
class SimulatedUIWidgetEL18;
|
||||
class SimulatedUIWidgetPL18;
|
||||
}
|
||||
|
||||
class SimulatedUIWidget9X: public SimulatedUIWidget
|
||||
@@ -407,4 +408,16 @@ class SimulatedUIWidgetEL18: public SimulatedUIWidget
|
||||
Ui::SimulatedUIWidgetEL18 * ui;
|
||||
};
|
||||
|
||||
class SimulatedUIWidgetPL18: public SimulatedUIWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SimulatedUIWidgetPL18(SimulatorInterface * simulator, QWidget * parent = nullptr);
|
||||
virtual ~SimulatedUIWidgetPL18();
|
||||
|
||||
private:
|
||||
Ui::SimulatedUIWidgetPL18 * ui;
|
||||
};
|
||||
|
||||
#endif // SIMULATEDUIWIDGET_H
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
// NOTE: RadioUiAction(NUMBER,...): NUMBER relates to enum EnumKeys in the specific board.h
|
||||
|
||||
#include "simulateduiwidget.h"
|
||||
#include "ui_simulateduiwidgetPL18.h"
|
||||
|
||||
SimulatedUIWidgetPL18::SimulatedUIWidgetPL18(SimulatorInterface *simulator, QWidget * parent):
|
||||
SimulatedUIWidget(simulator, parent),
|
||||
ui(new Ui::SimulatedUIWidgetPL18)
|
||||
{
|
||||
RadioUiAction * act;
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
// add actions in order of appearance on the help menu
|
||||
|
||||
// Note: the PL18 has no physical buttons though at some point the trim joystick is repurposed
|
||||
// allow for colorlcd key events and see what works
|
||||
// the mouse click areas do not map to visual buttons on the background images
|
||||
|
||||
act = new RadioUiAction(3, QList<int>() << Qt::Key_Up, SIMU_STR_HLP_KEY_UP, SIMU_STR_HLP_ACT_MDL);
|
||||
addRadioWidget(ui->rightbuttons->addArea(QRect(10, 1, 80, 35), "PL18/left.png", act));
|
||||
|
||||
m_mouseMidClickAction = new RadioUiAction(2, QList<int>() << Qt::Key_Enter << Qt::Key_Return, SIMU_STR_HLP_KEYS_ACTIVATE, SIMU_STR_HLP_ACT_ROT_DN);
|
||||
addRadioWidget(ui->rightbuttons->addArea(QRect(10, 40, 80, 35), "PL18/left.png", m_mouseMidClickAction));
|
||||
|
||||
act = new RadioUiAction(6, QList<int>() << Qt::Key_Left, SIMU_STR_HLP_KEY_LFT, SIMU_STR_HLP_ACT_SYS);
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 80, 80, 35), "PL18/left.png", act));
|
||||
|
||||
act = new RadioUiAction(5, QList<int>() << Qt::Key_Right, SIMU_STR_HLP_KEY_RGT, SIMU_STR_HLP_ACT_TELE);
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 120, 80, 35), "PL18/left.png", act));
|
||||
|
||||
act = new RadioUiAction(1, QList<int>() << Qt::Key_PageDown, SIMU_STR_HLP_KEY_PGDN, SIMU_STR_HLP_ACT_PGDN);
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 160, 80, 35), "PL18/left.png", act));
|
||||
|
||||
act = new RadioUiAction(0, QList<int>() << Qt::Key_PageUp, SIMU_STR_HLP_KEY_PGUP, SIMU_STR_HLP_ACT_PGUP);
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 200, 80, 35), "PL18/left.png", act));
|
||||
|
||||
act = new RadioUiAction(4, QList<int>() << Qt::Key_Down << Qt::Key_Delete << Qt::Key_Escape << Qt::Key_Backspace,
|
||||
SIMU_STR_HLP_KEY_DN % "<br>" % SIMU_STR_HLP_KEYS_EXIT, SIMU_STR_HLP_ACT_RTN);
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 240, 80, 35), "PL18/left.png", act));
|
||||
|
||||
m_scrollUpAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Minus, SIMU_STR_HLP_KEY_MIN % "|" % SIMU_STR_HLP_MOUSE_UP, SIMU_STR_HLP_ACT_ROT_LFT);
|
||||
m_scrollDnAction = new RadioUiAction(-1, QList<int>() << Qt::Key_Plus << Qt::Key_Equal, SIMU_STR_HLP_KEY_PLS % "|" % SIMU_STR_HLP_MOUSE_DN, SIMU_STR_HLP_ACT_ROT_RGT);
|
||||
connectScrollActions();
|
||||
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 280, 30, 30), "PL18/left.png", m_screenshotAction));
|
||||
|
||||
m_backlightColors << QColor(47, 123, 227);
|
||||
|
||||
setLcd(ui->lcd);
|
||||
}
|
||||
|
||||
SimulatedUIWidgetPL18::~SimulatedUIWidgetPL18()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SimulatedUIWidgetPL18</class>
|
||||
<widget class="QWidget" name="SimulatedUIWidgetPL18">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>520</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>520</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>520</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</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="0" 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>100</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/PL18/right.png)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" 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>480</width>
|
||||
<height>320</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>480</width>
|
||||
<height>320</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>5</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" 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>100</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>500</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/PL18/left.png);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" 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>320</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>5</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/PL18/top.png)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" 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>320</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>320</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>5</pointsize>
|
||||
<kerning>false</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background:url(:/images/simulator/PL18/bottom.png)</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>
|
||||
@@ -133,6 +133,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
|
||||
case Board::BOARD_FLYSKY_EL18:
|
||||
radioUiWidget = new SimulatedUIWidgetEL18(simulator, this);
|
||||
break;
|
||||
case Board::BOARD_FLYSKY_PL18:
|
||||
radioUiWidget = new SimulatedUIWidgetPL18(simulator, this);
|
||||
break;
|
||||
default:
|
||||
radioUiWidget = new SimulatedUIWidget9X(simulator, this);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user