Initial TX16S (#7344)

* TX16S initial push - Radio booting, navigation keys ok

* TX16S libsimu

* Please Travis

* Do not start radio on charger power

* USB charger led handling

* Revert "USB charger led handling" until we have proper details

* Pseudo sport power pin

* Please Travis

* tx16s serial debug

* Add tx16s calibration picture

* Review anadir for tx16s, needs to be checked on more radios

* Dump raw multi telem on AUX port

* More work on TX16S

* Fixes

* Compilation fix

* Compilation fix

* Fix Aux Serial power

* Various improvement

* USB charger led handling

* Cosmetics

* Cosmetics

* USB charger led handling

* Add charge indicator on GUI
This commit is contained in:
3djc
2020-01-30 17:25:09 +04:00
committed by GitHub
parent 6fec6eef21
commit 0f9114c524
65 changed files with 702 additions and 134 deletions
+2
View File
@@ -351,6 +351,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL EXPRESS)
set(FLAVOUR x10express)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T16)
set(FLAVOUR t16)
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
set(FLAVOUR tx16s)
else()
string(TOLOWER ${PCB} FLAVOUR)
endif()
+1 -1
View File
@@ -541,7 +541,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const Firmware * firmware)
// TODO: Remove once splash replacement supported on Horus
// NOTE: 480x272 image causes issues on screens <800px high, needs a solution like scrolling once reinstated
if (IS_HORUS(baseFw->getBoard())) {
if (IS_FAMILY_HORUS_OR_T16(baseFw->getBoard())) {
ui->widget_splashImage->hide();
ui->SplashFileName->setText("");
}
+11
View File
@@ -190,6 +190,17 @@
<file>images/simulator/JumperT16/left_tele.png</file>
<file>images/simulator/JumperT16/right_ent.png</file>
<file>images/simulator/JumperT16/right_rtn.png</file>
<file>images/simulator/TX16S/left.png</file>
<file>images/simulator/TX16S/right.png</file>
<file>images/simulator/TX16S/top.png</file>
<file>images/simulator/TX16S/bottom.png</file>
<file>images/simulator/TX16S/left_page.png</file>
<file>images/simulator/TX16S/left_page2.png</file>
<file>images/simulator/TX16S/left_rtn.png</file>
<file>images/simulator/TX16S/left_sys.png</file>
<file>images/simulator/TX16S/left_tele.png</file>
<file>images/simulator/TX16S/right_ent.png</file>
<file>images/simulator/TX16S/right_mdl.png</file>
<file>images/wizard/ailerons.png</file>
<file>images/wizard/airbrakes.png</file>
<file>images/wizard/elevons.png</file>
+12 -6
View File
@@ -92,6 +92,8 @@ uint32_t Boards::getFourCC(Type board)
return 0x3D78746F;
case BOARD_JUMPER_T16:
return 0x3F78746F;
case BOARD_RADIOMASTER_TX16S:
return 0x3878746F;
case BOARD_UNKNOWN:
break;
}
@@ -132,6 +134,7 @@ int Boards::getEEpromSize(Board::Type board)
case BOARD_X10:
case BOARD_X10_EXPRESS:
case BOARD_JUMPER_T16:
case BOARD_RADIOMASTER_TX16S:
return 0;
}
@@ -169,6 +172,7 @@ int Boards::getFlashSize(Type board)
case BOARD_X10:
case BOARD_X10_EXPRESS:
case BOARD_JUMPER_T16:
case BOARD_RADIOMASTER_TX16S:
return FSIZE_HORUS;
case BOARD_UNKNOWN:
return FSIZE_MAX;
@@ -284,7 +288,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 2;
else if (IS_TARANIS_X9E(board))
return 4;
else if (IS_HORUS_X10(board) || IS_JUMPER_T16(board))
else if (IS_HORUS_X10(board) || IS_FAMILY_T16(board))
return 5;
else if (IS_HORUS_X12S(board))
return 3;
@@ -300,13 +304,13 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
case Sliders:
if (IS_HORUS_X12S(board) || IS_TARANIS_X9E(board))
return 4;
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_JUMPER_T16(board))
else if (IS_TARANIS_X9D(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board))
return 2;
else
return 0;
case MouseAnalogs:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 2;
else
return 0;
@@ -343,7 +347,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 9;
else if (IS_TARANIS(board))
return 8;
else if (IS_HORUS(board))
else if (IS_FAMILY_HORUS_OR_T16(board))
return 10;
else
return 7;
@@ -363,7 +367,7 @@ int Boards::getCapability(Board::Type board, Board::Capability capability)
return 9;
case NumTrims:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 6;
else
return 4;
@@ -467,7 +471,7 @@ QString Boards::getAnalogInputName(Board::Type board, int index)
if (index < DIM(pots))
return pots[index];
}
else if (IS_HORUS_X10(board) || IS_JUMPER_T16(board)) {
else if (IS_HORUS_X10(board) || IS_FAMILY_T16(board)) {
const QString pots[] = {
"S1",
"6P",
@@ -536,6 +540,8 @@ QString Boards::getBoardName(Board::Type board)
return "Horus X10/X10S Express";
case BOARD_JUMPER_T16:
return "Jumper T16";
case BOARD_RADIOMASTER_TX16S:
return "Radiomaster TX16S";
default:
return tr("Unknown");
}
+23 -7
View File
@@ -54,9 +54,10 @@ namespace Board {
BOARD_TARANIS_X9LITES,
BOARD_JUMPER_T12,
BOARD_JUMPER_T16,
BOARD_RADIOMASTER_TX16S,
};
constexpr int BOARD_TYPE_MAX = BOARD_JUMPER_T16 ;
constexpr int BOARD_TYPE_MAX = BOARD_RADIOMASTER_TX16S ;
enum PotType
{
@@ -230,6 +231,16 @@ inline bool IS_JUMPER_T16(Board::Type board)
return board == Board::BOARD_JUMPER_T16;
}
inline bool IS_RADIOMASTER_TX16S(Board::Type board)
{
return board == Board::BOARD_RADIOMASTER_TX16S;
}
inline bool IS_FAMILY_T16(Board::Type board)
{
return board == Board::BOARD_JUMPER_T16 || board == Board::BOARD_RADIOMASTER_TX16S;
}
inline bool IS_TARANIS_XLITE(Board::Type board)
{
return board == Board::BOARD_TARANIS_XLITE || board == Board::BOARD_TARANIS_XLITES;
@@ -300,19 +311,24 @@ inline bool IS_HORUS_X12S(Board::Type board)
return board == Board::BOARD_HORUS_X12S;
}
inline bool IS_HORUS(Board::Type board)
inline bool IS_FAMILY_HORUS(Board::Type board)
{
return IS_HORUS_X12S(board) || IS_HORUS_X10(board) || IS_JUMPER_T16(board);
return IS_HORUS_X12S(board) || IS_HORUS_X10(board);
}
inline bool IS_FAMILY_HORUS_OR_T16(Board::Type board)
{
return IS_FAMILY_HORUS(board) || IS_FAMILY_T16(board);
}
inline bool IS_HORUS_OR_TARANIS(Board::Type board)
{
return IS_HORUS(board) || IS_TARANIS(board);
return IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS(board);
}
inline bool IS_STM32(Board::Type board)
{
return IS_TARANIS(board) || IS_HORUS(board);
return IS_TARANIS(board) || IS_FAMILY_HORUS_OR_T16(board);
}
inline bool IS_ARM(Board::Type board)
@@ -322,7 +338,7 @@ inline bool IS_ARM(Board::Type board)
inline bool HAS_LARGE_LCD(Board::Type board)
{
return IS_HORUS(board) || IS_TARANIS_X9(board);
return IS_FAMILY_HORUS_OR_T16(board) || IS_TARANIS_X9(board);
}
inline bool HAS_EXTERNAL_ANTENNA(Board::Type board)
@@ -333,7 +349,7 @@ inline bool HAS_EXTERNAL_ANTENNA(Board::Type board)
inline bool IS_ACCESS_RADIO(Board::Type board, QString &id)
{
return (IS_TARANIS_XLITES(board) || IS_TARANIS_X9LITE(board) || board == Board::BOARD_TARANIS_X9DP_2019 || board == Board::BOARD_X10_EXPRESS || IS_TARANIS_X7_ACCESS(board) ||
(IS_HORUS(board) && id.contains("internalaccess")));
(IS_FAMILY_HORUS_OR_T16(board) && id.contains("internalaccess")));
}
#endif // _BOARDS_H_
+10 -10
View File
@@ -88,7 +88,7 @@ GeneralSettings::GeneralSettings()
vBatMin = -5; //8,5V
vBatMax = -5; //11,5V
}
else if (IS_TARANIS_XLITE(board) || IS_HORUS_X10(board) || IS_JUMPER_T16(board)) {
else if (IS_TARANIS_XLITE(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board)) {
// Lipo 2S
vBatWarn = 66;
vBatMin = -23; // 6.7V
@@ -106,7 +106,7 @@ GeneralSettings::GeneralSettings()
backlightMode = 3; // keys and sticks
// backlightBright = 0; // 0 = 100%
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
backlightOffBright = 20;
}
@@ -116,7 +116,7 @@ GeneralSettings::GeneralSettings()
if (IS_JUMPER_T16(board))
strcpy(bluetoothName, "t16");
else if (IS_HORUS(board)) {
else if (IS_FAMILY_HORUS_OR_T16(board)) {
strcpy(bluetoothName, "horus");
}
else if (IS_TARANIS_X9E(board) || IS_TARANIS_SMALL(board)) {
@@ -236,7 +236,7 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
}
// TODO: move to Boards, like with switches
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
potConfig[0] = Board::POT_WITH_DETENT;
potConfig[1] = Board::POT_MULTIPOS_SWITCH;
potConfig[2] = Board::POT_WITH_DETENT;
@@ -269,7 +269,7 @@ void GeneralSettings::setDefaultControlTypes(Board::Type board)
sliderConfig[2] = Board::SLIDER_WITH_DETENT;
sliderConfig[3] = Board::SLIDER_WITH_DETENT;
}
else if (IS_TARANIS_X9(board) || IS_HORUS_X10(board) || IS_JUMPER_T16(board)) {
else if (IS_TARANIS_X9(board) || IS_HORUS_X10(board) || IS_FAMILY_T16(board)) {
sliderConfig[0] = Board::SLIDER_WITH_DETENT;
sliderConfig[1] = Board::SLIDER_WITH_DETENT;
}
@@ -313,27 +313,27 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
// SE and SG are skipped on X7 board
if (IS_TARANIS_X7(cstate.toType)) {
if (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType)) {
if (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType)) {
strncpy(switchName[4], switchName[5], sizeof(switchName[4]));
strncpy(switchName[5], switchName[7], sizeof(switchName[5]));
}
}
else if (IS_TARANIS_X7(cstate.fromType)) {
if (IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) {
if (IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) {
strncpy(switchName[5], switchName[4], sizeof(switchName[5]));
strncpy(switchName[7], switchName[5], sizeof(switchName[7]));
}
}
if (IS_JUMPER_T12(cstate.toType)) {
if (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType)) {
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)) {
if (IS_TARANIS_X9(cstate.toType) || IS_HORUS(cstate.toType)) {
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]));
}
@@ -349,7 +349,7 @@ void GeneralSettings::convert(RadioDataConversionState & cstate)
strncpy(sliderName[3], sliderName[1], sizeof(sliderName[3]));
}
if (IS_HORUS(cstate.toType)) {
if (IS_FAMILY_HORUS_OR_T16(cstate.toType)) {
// 6P switch is only on Horus (by default)
if (cstate.fromBoard.getCapability(Board::FactoryInstalledPots) == 2) {
strncpy(potName[2], potName[1], sizeof(potName[2]));
+35 -35
View File
@@ -36,7 +36,7 @@ inline int MAX_SWITCHES(Board::Type board, int version)
if (version <= 218) {
if (IS_TARANIS_X7(board))
return 6;
if (IS_TARANIS_X9D(board) || IS_HORUS(board))
if (IS_TARANIS_X9D(board) || IS_FAMILY_HORUS_OR_T16(board))
return 8;
if (IS_TARANIS_XLITE(board))
return 4;
@@ -63,7 +63,7 @@ inline int MAX_SWITCHES_POSITION(Board::Type board, int version)
inline int POTS_CONFIG_SIZE(Board::Type board, int version)
{
if (version >= 219 && IS_HORUS(board))
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
return 16;
return 8;
@@ -71,44 +71,44 @@ inline int POTS_CONFIG_SIZE(Board::Type board, int version)
inline int MAX_POTS(Board::Type board, int version)
{
if (version <= 218 && IS_HORUS(board))
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 3;
return Boards::getCapability(board, Board::Pots);
}
inline int MAX_POTS_STORAGE(Board::Type board, int version)
{
if (version <= 218 && IS_HORUS(board))
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 3;
if (version >= 219 && IS_HORUS(board))
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
return 5;
return Boards::getCapability(board, Board::Pots);
}
inline int MAX_POTS_SOURCES(Board::Type board, int version)
{
if (version <= 218 && IS_HORUS(board))
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 5;
return Boards::getCapability(board, Board::Pots);
}
inline int MAX_SLIDERS_STORAGE(Board::Type board, int version)
{
if (version >= 219 && IS_HORUS(board))
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
return 4;
return Boards::getCapability(board, Board::Sliders);
}
inline int MAX_SLIDERS_SOURCES(Board::Type board, int version)
{
if (version <= 218 && IS_HORUS(board))
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board))
return 2;
return Boards::getCapability(board, Board::Sliders);
}
inline int SLIDERS_CONFIG_SIZE(Board::Type board, int version)
{
if (version >= 219 && IS_HORUS(board))
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
return 8;
return 4;
@@ -119,7 +119,7 @@ inline int SWITCHES_CONFIG_SIZE(Board::Type board, int version)
if (IS_TARANIS_X9E(board))
return 64;
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 32;
if (version >= 219 && IS_TARANIS_X9D(board))
@@ -139,11 +139,11 @@ inline int SWITCHES_CONFIG_SIZE(Board::Type board, int version)
#define MAX_CUSTOM_FUNCTIONS(board, version) 64
#define MAX_CURVES(board, version) ((version >= 219 || HAS_LARGE_LCD(board)) ? 32 : 16)
#define MAX_GVARS(board, version) 9
#define MAX_SCRIPTS(board) (IS_HORUS(board) ? 9 : 7)
#define MAX_TELEMETRY_SENSORS(board, version) (version <= 218 ? 32 : ((IS_HORUS(board) || IS_TARANIS_X9(board)) ? 60 : 40))
#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)) ? 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_HORUS(board) ? 2 : 0)
#define MAX_AUX_TRIMS(board) (IS_FAMILY_HORUS_OR_T16(board) ? 2 : 0)
inline int switchIndex(int i, Board::Type board, unsigned int version)
{
@@ -810,7 +810,7 @@ class MixField: public TransformedField {
internalField.Append(new UnsignedField<8>(this, mix.delayDown));
internalField.Append(new UnsignedField<8>(this, mix.speedUp));
internalField.Append(new UnsignedField<8>(this, mix.speedDown));
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new ZCharField<6>(this, mix.name));
else if (HAS_LARGE_LCD(board) && version <= 218)
internalField.Append(new ZCharField<8>(this, mix.name));
@@ -946,7 +946,7 @@ class InputField: public TransformedField {
internalField.Append(new UnsignedField<9>(this, expo.flightModes));
internalField.Append(new SignedField<8>(this, _weight, "Weight"));
internalField.Append(new SpareBitsField<1>(this));
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new ZCharField<6>(this, expo.name));
else if (HAS_LARGE_LCD(board) && version <= 218)
internalField.Append(new ZCharField<8>(this, expo.name));
@@ -1809,7 +1809,7 @@ class Frsky218Field: public StructField {
rssiConversionTable[0] = RSSIConversionTable(0);
rssiConversionTable[1] = RSSIConversionTable(1);
if (!IS_HORUS(board)) {
if (!IS_FAMILY_HORUS_OR_T16(board)) {
Append(new UnsignedField<8>(this, frsky.voltsSource, "Volts Source"));
Append(new UnsignedField<8>(this, frsky.altitudeSource, "Altitude Source"));
@@ -2251,7 +2251,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
qDebug() << QString("OpenTxModelData::OpenTxModelData(name: %1, board: %2, ver: %3, var: %4)").arg(name).arg(board).arg(version).arg(variant);
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new ZCharField<15>(this, modelData.name, "Model name"));
else if (HAS_LARGE_LCD(board))
internalField.Append(new ZCharField<12>(this, modelData.name, "Model name"));
@@ -2262,7 +2262,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new UnsignedField<8>(this, modelData.moduleData[1].modelId));
if (HAS_LARGE_LCD(board)) {
if (version >= 219 && IS_HORUS(board))
if (version >= 219 && IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new CharField<14>(this, modelData.bitmap, true, "Model bitmap"));
else
internalField.Append(new CharField<10>(this, modelData.bitmap, true, "Model bitmap"));
@@ -2330,7 +2330,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new UnsignedField<8>(this, modelData.thrTraceSrc, "Throttle Source"));
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new SwitchesWarningField<32>(this, modelData.switchWarningStates, board, version));
else if (IS_TARANIS_X9E(board))
internalField.Append(new SwitchesWarningField<64>(this, modelData.switchWarningStates, board, version));
@@ -2345,7 +2345,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new UnsignedField<32>(this, modelData.switchWarningEnable));
else if (version >= 219 && IS_TARANIS_X9D(board))
internalField.Append(new UnsignedField<16>(this, modelData.switchWarningEnable));
else if (!IS_HORUS(board))
else if (!IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new UnsignedField<8>(this, modelData.switchWarningEnable));
for (int i=0; i<MAX_GVARS(board, version); i++) {
@@ -2482,7 +2482,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
internalField.Append(new UnsignedField<8>(this, modelData.toplcdTimer));
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
for (int i = 0; i < 5; i++) {
internalField.Append(new CharField<610>(this, modelData.customScreenData[i], false, "Custom screen blob"));
}
@@ -2508,7 +2508,7 @@ void OpenTxModelData::beforeExport()
{
// qDebug() << QString("before export model") << modelData.name;
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
uint32_t newSwitchWarningStates = 0;
for (int i = 0; i < MAX_SWITCHES(board, version); i++) {
uint8_t value = (modelData.switchWarningStates >> (2*i)) & 0x03;
@@ -2524,7 +2524,7 @@ void OpenTxModelData::afterImport()
{
qCDebug(eepromImport) << QString("OpenTxModelData::afterImport()") << modelData.name;
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
uint32_t newSwitchWarningStates = 0;
for (int i = 0; i < MAX_SWITCHES(board, version); i++) {
uint8_t value = (modelData.switchWarningStates >> (3*i)) & 0x07;
@@ -2572,7 +2572,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new UnsignedField<16>(this, chkSum));
if (!IS_HORUS(board)) {
if (!IS_FAMILY_HORUS_OR_T16(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.currModelIndex));
internalField.Append(new UnsignedField<8>(this, generalData.contrast));
}
@@ -2617,7 +2617,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new UnsignedField<8>(this, generalData.inactivityTimer));
internalField.Append(new UnsignedField<3>(this, generalData.telemetryBaudrate));
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
internalField.Append(new SpareBitsField<3>(this));
else if (IS_TARANIS(board))
internalField.Append(new SignedField<3>(this, generalData.splashDuration));
@@ -2632,11 +2632,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_HORUS(board))) {
if (version < 218 || (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board))) {
internalField.Append(new UnsignedField<8>(this, generalData.reNavigation));
}
if (!IS_TARANIS(board) && !IS_HORUS(board)) {
if (!IS_TARANIS(board) && !IS_FAMILY_HORUS_OR_T16(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.stickReverse));
}
@@ -2715,7 +2715,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
if (IS_STM32(board)) {
if (version >= 218) {
internalField.Append(new UnsignedField<4>(this, generalData.auxSerialMode));
if (IS_HORUS(board) && version >= 219) {
if (IS_FAMILY_HORUS_OR_T16(board) && version >= 219) {
internalField.Append(new SpareBitsField<4>(this));
}
else {
@@ -2735,7 +2735,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
}
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
for (int i=0; i<SWITCHES_CONFIG_SIZE(board, version) / 2; i++) {
if (i < MAX_SWITCHES(board, version))
internalField.Append(new UnsignedField<2>(this, generalData.switchConfig[i]));
@@ -2747,7 +2747,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
for (int i=0; i<POTS_CONFIG_SIZE(board, version) / 2; i++) {
int offset = 0;
// 2 new pots for Horus from 219 on
if (version <= 218 && IS_HORUS(board) && (i >= 3))
if (version <= 218 && IS_FAMILY_HORUS_OR_T16(board) && (i >= 3))
offset += 2;
if (i < MAX_POTS_STORAGE(board, version))
@@ -2756,7 +2756,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new SpareBitsField<2>(this));
}
if (IS_HORUS(board) && version >= 219) {
if (IS_FAMILY_HORUS_OR_T16(board) && version >= 219) {
for (int i=0; i<SLIDERS_CONFIG_SIZE(board,version); i++) {
if (i < MAX_SLIDERS_STORAGE(board, version))
internalField.Append(new UnsignedField<1>(this, generalData.sliderConfig[i]));
@@ -2765,7 +2765,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
}
}
if (!IS_HORUS(board)) {
if (!IS_FAMILY_HORUS_OR_T16(board)) {
internalField.Append(new UnsignedField<8>(this, generalData.backlightColor));
}
}
@@ -2793,7 +2793,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
}
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
for (int i=0; i<MAX_SWITCHES(board, version); ++i) {
internalField.Append(new ZCharField<3>(this, generalData.switchName[i], "Switch name"));
}
@@ -2832,7 +2832,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
}
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
internalField.Append(new SpareBitsField<1>(this));
internalField.Append(new UnsignedField<7>(this, generalData.backlightOffBright));
internalField.Append(new ZCharField<10>(this, generalData.bluetoothName, "Bluetooth name"));
@@ -2842,7 +2842,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
internalField.Append(new ZCharField<10>(this, generalData.bluetoothName, "Bluetooth name"));
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
internalField.Append(new CharField<8>(this, generalData.themeName, true, "Theme name"));
for (int i=0; i<5; i++) {
internalField.Append(new CharField<8>(this, (char *)generalData.themeOptionValue[i], true, "Theme blob"));
@@ -70,6 +70,8 @@ const char * OpenTxEepromInterface::getName()
return "OpenTX for Jumper T12";
case BOARD_JUMPER_T16:
return "OpenTX for Jumper T16";
case BOARD_RADIOMASTER_TX16S:
return "OpenTX for Radiomaster TX16S";
case BOARD_TARANIS_X9D:
return "OpenTX for FrSky Taranis X9D";
case BOARD_TARANIS_X9DP:
@@ -175,7 +177,7 @@ bool OpenTxEepromInterface::loadFromByteArray(T & dest, const QByteArray & data)
{
uint32_t fourcc = *((uint32_t*)&data.data()[0]);
if (Boards::getFourCC(board) != fourcc) {
if (IS_HORUS(board) && fourcc == 0x3178396F) {
if (IS_FAMILY_HORUS_OR_T16(board) && fourcc == 0x3178396F) {
qDebug() << QString().sprintf("%s: Deprecated fourcc used %x vs %x", getName(), fourcc, Boards::getFourCC(board));
}
else {
@@ -441,7 +443,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
{
switch (capability) {
case Models:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
else if (IS_ARM(board))
return 60;
@@ -457,7 +459,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
else
return id.contains("imperial") ? 1 : 0;
case ModelImage:
return (board == BOARD_TARANIS_X9D || IS_TARANIS_PLUS(board) || board == BOARD_TARANIS_X9DP_2019 || IS_HORUS(board));
return (board == BOARD_TARANIS_X9D || IS_TARANIS_PLUS(board) || board == BOARD_TARANIS_X9DP_2019 || IS_FAMILY_HORUS_OR_T16(board));
case HasBeeper:
return (!IS_ARM(board));
case HasPxxCountry:
@@ -495,7 +497,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
else
return 0;
case ModelName:
return (IS_HORUS(board) ? 15 : (HAS_LARGE_LCD(board) ? 12 : 10));
return (IS_FAMILY_HORUS_OR_T16(board) ? 15 : (HAS_LARGE_LCD(board) ? 12 : 10));
case FlightModesName:
return (IS_HORUS_OR_TARANIS(board) ? 10 : 6);
case GvarsName:
@@ -562,7 +564,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) || IS_JUMPER_T12(board) || id.contains("haptic"));
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || IS_TARANIS_SMALL(board) || IS_TARANIS_X9E(board) || IS_FAMILY_HORUS_OR_T16(board) || IS_JUMPER_T12(board) || id.contains("haptic"));
case ModelTrainerEnable:
if (IS_HORUS_OR_TARANIS(board) && board!=Board::BOARD_TARANIS_XLITE)
return 1;
@@ -610,7 +612,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case TelemetryBars:
return 1;
case TelemetryCustomScreens:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
else
return IS_ARM(board) ? 4 : 2;
@@ -663,7 +665,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case HasSDLogs:
return ((IS_2560(board) || IS_ARM(board)) ? true : false);
case LcdWidth:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 480;
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
return 128;
@@ -672,12 +674,12 @@ int OpenTxFirmware::getCapability(::Capability capability)
else
return 128;
case LcdHeight:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 272;
else
return 64;
case LcdDepth:
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 16;
else if (IS_TARANIS_SMALL(board) || IS_JUMPER_T12(board))
return 1;
@@ -747,7 +749,7 @@ int OpenTxFirmware::getCapability(::Capability capability)
case DangerousFunctions:
return id.contains("danger") ? 1 : 0;
case HasModelCategories:
return IS_HORUS(board);
return IS_FAMILY_HORUS_OR_T16(board);
case HasSwitchableJack:
return IS_TARANIS_XLITES(board);
case PwrButtonPress:
@@ -782,9 +784,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) && board != BOARD_JUMPER_T16;
return !IS_ACCESS_RADIO(board, id) && !IS_FAMILY_T16(board);
case PULSES_PXX_XJT_D8:
return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && board != BOARD_JUMPER_T16;
return !(IS_ACCESS_RADIO(board, id) || id.contains("eu")) && !IS_FAMILY_T16(board);
case PULSES_PPM:
return id.contains("internalppm");
case PULSES_ACCESS_ISRM:
@@ -814,7 +816,7 @@ bool OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
case PULSES_CROSSFIRE:
return true;
case PULSES_ACCESS_R9M:
return IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || board == BOARD_TARANIS_X9DP_2019 || board == BOARD_X10_EXPRESS || (IS_HORUS(board) && id.contains("internalaccess"));
return IS_TARANIS_XLITE(board) || IS_TARANIS_X9LITE(board) || board == BOARD_TARANIS_X9DP_2019 || board == BOARD_X10_EXPRESS || (IS_FAMILY_HORUS_OR_T16(board) && id.contains("internalaccess"));
case PULSES_PXX_R9M_LITE:
case PULSES_ACCESS_R9M_LITE:
case PULSES_ACCESS_R9M_LITE_PRO:
@@ -1343,6 +1345,12 @@ void registerOpenTxFirmwares()
registerOpenTxFirmware(firmware);
addOpenTxRfOptions(firmware, FLEX);
/* Radiomaster TX16S board */
firmware = new OpenTxFirmware("opentx-tx16s", Firmware::tr("Radiomaster TX16S"), BOARD_RADIOMASTER_TX16S);
addOpenTxFrskyOptions(firmware);
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
registerOpenTxFirmware(firmware);
/* 9XR-Pro */
firmware = new OpenTxFirmware("opentx-9xrpro", Firmware::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
addOpenTxArm9xOptions(firmware, false);
+1 -1
View File
@@ -116,7 +116,7 @@ void RadioData::convert(RadioDataConversionState & cstate)
}
}
if (IS_HORUS(cstate.toType)) {
if (IS_FAMILY_HORUS_OR_T16(cstate.toType)) {
fixModelFilenames();
}
+7 -7
View File
@@ -580,13 +580,13 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
}
}
if (IS_TARANIS(cstate.toType) && IS_HORUS(cstate.fromType)) {
if (IS_TARANIS(cstate.toType) && IS_FAMILY_HORUS_OR_T16(cstate.fromType)) {
if (index == 6)
index = 5; // pot S2 to S2
else if (index == 5)
index = -1; // 6P on Horus doesn't exist on Taranis
}
else if (IS_HORUS(cstate.toType) && IS_TARANIS(cstate.fromType) && index == 5)
else if (IS_FAMILY_HORUS_OR_T16(cstate.toType) && IS_TARANIS(cstate.fromType) && index == 5)
{
index = 6; // pot S2 to S2
}
@@ -602,7 +602,7 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
}
}
if (IS_TARANIS_X7(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType))) {
if (IS_TARANIS_X7(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
// No SE and SG on X7 board
if (index == 4 || index == 6) {
index = 3; // SG and SE to SD
@@ -615,7 +615,7 @@ 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))) {
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
// No SE and SG on T12 board
if (index == 4 || index == 6) {
index = 3; // SG and SE to SD
@@ -629,7 +629,7 @@ RawSource RawSource::convert(RadioDataConversionState & cstate)
}
}
// 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)) {
else if ((IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) && IS_TARANIS_X7(cstate.fromType)) {
if (index == 4) {
index = 5; // SF to SF
}
@@ -637,7 +637,7 @@ 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)) {
else if ((IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
if (index == 4) {
index = 5; // SF to SF
}
@@ -645,7 +645,7 @@ 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)) {
else if ((IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
if (index == 4) {
index = 5; // SF to SF
}
+4 -4
View File
@@ -197,7 +197,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
}
// No SE and SG on X7 board
if (IS_TARANIS_X7(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_HORUS(cstate.fromType))) {
if (IS_TARANIS_X7(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
if (srcIdx == 4 || srcIdx == 5) {
delta = 3; // SE to SD & SF to SF
if (srcIdx == 4)
@@ -211,7 +211,7 @@ 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))) {
else if (IS_JUMPER_T12(cstate.toType) && (IS_TARANIS_X9(cstate.fromType) || IS_FAMILY_HORUS_OR_T16(cstate.fromType))) {
if (srcIdx == 4 || srcIdx == 5) {
delta = 3; // SE to SD & SF to SF
if (srcIdx == 4)
@@ -226,7 +226,7 @@ RawSwitch RawSwitch::convert(RadioDataConversionState & cstate)
}
}
// 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)) {
else if ((IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) && IS_TARANIS_X7(cstate.fromType)) {
if (srcIdx == 4) {
delta = -3; // SF to SF
}
@@ -234,7 +234,7 @@ 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)) {
else if ((IS_TARANIS_X9(cstate.toType) || IS_FAMILY_HORUS_OR_T16(cstate.toType)) && IS_JUMPER_T12(cstate.fromType)) {
if (srcIdx == 4) {
delta = -3; // SF to SF
}
+2 -2
View File
@@ -191,7 +191,7 @@ ui(new Ui::GeneralSetup)
ui->label_BLBright->hide();
}
if (!IS_HORUS(firmware->getBoard())) {
if (!IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
ui->OFFBright_SB->hide();
ui->OFFBright_SB->setDisabled(true);
ui->label_OFFBright->hide();
@@ -241,7 +241,7 @@ ui(new Ui::GeneralSetup)
ui->rssiPowerOffWarnChkB->hide();
}
if (IS_HORUS(firmware->getBoard())) {
if (IS_FAMILY_HORUS_OR_T16(firmware->getBoard())) {
ui->splashScreenChkB->hide();
ui->splashScreenDuration->hide();
ui->splashScreenLabel->hide();
+2 -2
View File
@@ -172,7 +172,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_FAMILY_HORUS_OR_T16(board)) {
ui->bluetoothMode->addItem(tr("OFF"), 0);
if (IS_TARANIS_X9E(board)) {
ui->bluetoothMode->addItem(tr("Enabled"), 1);
@@ -189,7 +189,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
ui->bluetoothWidget->hide();
}
if ((IS_HORUS(board) && board != Board::BOARD_X10_EXPRESS) || (IS_TARANIS_XLITE(board) && !IS_TARANIS_XLITES(board))) {
if ((IS_FAMILY_HORUS_OR_T16(board) && board != Board::BOARD_X10_EXPRESS) || (IS_TARANIS_XLITE(board) && !IS_TARANIS_XLITES(board))) {
ui->antennaMode->addItem(tr("Internal"), -2);
ui->antennaMode->addItem(tr("Ask"), -1);
ui->antennaMode->addItem(tr("Per model"), 0);
Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

+5 -5
View File
@@ -930,7 +930,7 @@ void MainWindow::readEeprom()
{
Board::Type board = getCurrentBoard();
QString tempFile;
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
tempFile = generateProcessUniqueTempFileName("temp.otx");
else if (IS_ARM(board))
tempFile = generateProcessUniqueTempFileName("temp.bin");
@@ -975,7 +975,7 @@ bool MainWindow::readEepromFromRadio(const QString & filename)
void MainWindow::writeBackup()
{
if (IS_HORUS(getCurrentBoard())) {
if (IS_FAMILY_HORUS_OR_T16(getCurrentBoard())) {
QMessageBox::information(this, CPN_STR_APP_NAME, tr("This function is not yet implemented"));
return;
// TODO implementation
@@ -992,7 +992,7 @@ void MainWindow::writeFlash(QString fileToFlash)
void MainWindow::readBackup()
{
if (IS_HORUS(getCurrentBoard())) {
if (IS_FAMILY_HORUS_OR_T16(getCurrentBoard())) {
QMessageBox::information(this, CPN_STR_APP_NAME, tr("This function is not yet implemented"));
return;
// TODO implementation
@@ -1078,7 +1078,7 @@ void MainWindow::updateMenus()
compareAct->setEnabled(activeChild);
writeEepromAct->setEnabled(activeChild);
readEepromAct->setEnabled(true);
if (IS_HORUS(getCurrentBoard())) {
if (IS_FAMILY_HORUS_OR_T16(getCurrentBoard())) {
writeBUToRadioAct->setEnabled(false);
readBUToFileAct->setEnabled(false);
}
@@ -1086,7 +1086,7 @@ void MainWindow::updateMenus()
writeBUToRadioAct->setEnabled(true);
readBUToFileAct->setEnabled(true);
}
editSplashAct->setDisabled(IS_HORUS(getCurrentBoard()));
editSplashAct->setDisabled(IS_FAMILY_HORUS_OR_T16(getCurrentBoard()));
foreach (QAction * act, fileWindowActions) {
if (!act)
+2 -2
View File
@@ -534,7 +534,7 @@ void MdiChild::initModelsList()
connect(modelsListModel, &QAbstractItemModel::dataChanged, this, &MdiChild::onDataChanged);
ui->modelsList->setModel(modelsListModel);
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
ui->modelsList->setIndentation(20);
// ui->modelsList->resetIndentation(); // introduced in next Qt versions ...
}
@@ -1531,7 +1531,7 @@ int MdiChild::askQuestion(const QString & msg, QMessageBox::StandardButtons butt
void MdiChild::writeEeprom() // write to Tx
{
Board::Type board = getCurrentBoard();
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
QString radioPath = findMassstoragePath("RADIO", true);
qDebug() << "Searching for SD card, found" << radioPath;
if (radioPath.isEmpty()) {
+8 -8
View File
@@ -209,7 +209,7 @@ ModulePanel::ModulePanel(QWidget * parent, ModelData & model, ModuleData & modul
ui->trainerMode->setItemData(TRAINER_MODE_SLAVE_BLUETOOTH, 0, Qt::UserRole - 1);
}
if (!IS_JUMPER_T16(firmware->getBoard())) {
if (!IS_FAMILY_T16(firmware->getBoard())) {
ui->trainerMode->setItemData(TRAINER_MODE_MULTI, 0, Qt::UserRole - 1);
}
@@ -1001,7 +1001,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
QDir qd(path);
if (qd.exists()) {
QStringList filters;
if(IS_HORUS(board)) {
if(IS_FAMILY_HORUS_OR_T16(board)) {
filters << "*.bmp" << "*.jpg" << "*.png";
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
QFileInfo fi(file);
@@ -1032,17 +1032,17 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
ui->image->setCurrentIndex(ui->image->count()-1);
QString fileName = path;
fileName.append(model.bitmap);
if (!IS_HORUS(board))
if (!IS_FAMILY_HORUS_OR_T16(board))
fileName.append(".bmp");
QImage image(fileName);
if (image.isNull() && !IS_HORUS(board)) {
if (image.isNull() && !IS_FAMILY_HORUS_OR_T16(board)) {
fileName = path;
fileName.append(model.bitmap);
fileName.append(".BMP");
image.load(fileName);
}
if (!image.isNull()) {
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
ui->imagePreview->setFixedSize(QSize(192, 114));
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled(192, 114)));
}
@@ -1281,17 +1281,17 @@ void SetupPanel::on_image_currentIndexChanged(int index)
if (qd.exists()) {
QString fileName=path;
fileName.append(model->bitmap);
if (!IS_HORUS(board))
if (!IS_FAMILY_HORUS_OR_T16(board))
fileName.append(".bmp");
QImage image(fileName);
if (image.isNull() && !IS_HORUS(board)) {
if (image.isNull() && !IS_FAMILY_HORUS_OR_T16(board)) {
fileName=path;
fileName.append(model->bitmap);
fileName.append(".BMP");
image.load(fileName);
}
if (!image.isNull()) {
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
ui->imagePreview->setFixedSize(QSize(192, 114));
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled(192, 114)));
}
+2 -2
View File
@@ -145,7 +145,7 @@ TreeModel::TreeModel(RadioData * radioData, QObject * parent):
if (!hasCategories)
labels << tr("Index");
labels << tr("Name");
if (!(IS_HORUS(board) || IS_SKY9X(board))) {
if (!(IS_FAMILY_HORUS_OR_T16(board) || IS_SKY9X(board))) {
labels << tr("Size");
}
labels << tr("RX #");
@@ -651,7 +651,7 @@ void TreeModel::refresh()
EEPROMInterface * eepromInterface = getCurrentEEpromInterface();
Board::Type board = eepromInterface->getBoard();
TreeItem * defaultCategoryItem = NULL;
bool hasEepromSizeData = (IS_HORUS(board) ? false : true);
bool hasEepromSizeData = (IS_FAMILY_HORUS_OR_T16(board) ? false : true);
if (hasEepromSizeData) {
availableEEpromSize = Boards::getEEpromSize(board) - 64; // let's consider fat
+1 -1
View File
@@ -314,7 +314,7 @@ bool readEeprom(const QString & filename, ProgressWidget * progress)
return false;
}
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
QString radioPath = findMassstoragePath("RADIO", true);
qDebug() << "Searching for SD card, found" << radioPath;
if (radioPath.isEmpty()) {
+2
View File
@@ -14,6 +14,7 @@ set(simulation_SRCS
simulateduiwidgetX12.cpp
simulateduiwidgetJumperT12.cpp
simulateduiwidgetJumperT16.cpp
simulateduiwidgetTX16S.cpp
simulatorinterface.cpp
simulatormainwindow.cpp
simulatorstartupdialog.cpp
@@ -38,6 +39,7 @@ set(simulation_UIS
simulateduiwidgetX12.ui
simulateduiwidgetJumperT12.ui
simulateduiwidgetJumperT16.ui
simulateduiwidgetTX16S.ui
simulatormainwindow.ui
simulatorstartupdialog.ui
simulatorwidget.ui
@@ -113,6 +113,7 @@ namespace Ui {
class SimulatedUIWidgetX12;
class SimulatedUIWidgetJumperT12;
class SimulatedUIWidgetJumperT16;
class SimulatedUIWidgetTX16S;
}
class SimulatedUIWidget9X: public SimulatedUIWidget
@@ -251,5 +252,17 @@ class SimulatedUIWidgetJumperT16: public SimulatedUIWidget
Ui::SimulatedUIWidgetJumperT16 * ui;
};
class SimulatedUIWidgetTX16S: public SimulatedUIWidget
{
Q_OBJECT
public:
explicit SimulatedUIWidgetTX16S(SimulatorInterface * simulator, QWidget * parent = nullptr);
virtual ~SimulatedUIWidgetTX16S();
private:
Ui::SimulatedUIWidgetTX16S * ui;
};
#endif // SIMULATEDUIWIDGET_H
@@ -0,0 +1,72 @@
/*
* 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_simulateduiwidgetTX16S.h"
SimulatedUIWidgetTX16S::SimulatedUIWidgetTX16S(SimulatorInterface *simulator, QWidget * parent):
SimulatedUIWidget(simulator, parent),
ui(new Ui::SimulatedUIWidgetTX16S)
{
RadioUiAction * act;
ui->setupUi(this);
// add actions in order of appearance on the help menu
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, 0, 80, 35), "TX16S/right_mdl.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(45, 70, 100, 160), "TX16S/right_ent.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(32, 1, 80, 35), "TX16S/left_sys.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(55, 220, 80, 35), "TX16S/left_tele.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(55, 115, 80, 35), "TX16S/left_page.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(55, 160, 80, 35), "TX16S/left_page2.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(55, 55, 80, 35), "TX16S/left_rtn.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, 252, 30, 30), "TX16S/left_scrnsht.png", m_screenshotAction));
m_backlightColors << QColor(47, 123, 227);
setLcd(ui->lcd);
}
SimulatedUIWidgetTX16S::~SimulatedUIWidgetTX16S()
{
delete ui;
}
@@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SimulatedUIWidgetTX16S</class>
<widget class="QWidget" name="SimulatedUIWidgetTX16S">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>825</width>
<height>292</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>825</width>
<height>292</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>825</width>
<height>292</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<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>174</width>
<height>292</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>174</width>
<height>292</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX16S/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>272</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</width>
<height>272</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>174</width>
<height>292</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>174</width>
<height>292</height>
</size>
</property>
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background:url(:/images/simulator/TX16S/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>480</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</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/TX16S/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>480</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>480</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/TX16S/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>
@@ -86,7 +86,7 @@ void SimulatorStartupDialog::changeEvent(QEvent *e)
// FIXME : need a better way to check for this
bool SimulatorStartupDialog::usesCategorizedStorage(const QString & name)
{
return name.contains(QRegExp("(x12|x10|horus|t16)", Qt::CaseInsensitive));
return name.contains(QRegExp("(x12|x10|horus|16)", Qt::CaseInsensitive));
}
bool SimulatorStartupDialog::usesCategorizedStorage()
+4 -1
View File
@@ -94,6 +94,9 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
case Board::BOARD_JUMPER_T16:
radioUiWidget = new SimulatedUIWidgetJumperT16(simulator, this);
break;
case Board::BOARD_RADIOMASTER_TX16S:
radioUiWidget = new SimulatedUIWidgetTX16S(simulator, this);
break;
default:
radioUiWidget = new SimulatedUIWidget9X(simulator, this);
break;
@@ -270,7 +273,7 @@ bool SimulatorWidget::setRadioData(RadioData * radioData)
saveTempRadioData = (flags & SIMULATOR_FLAGS_STANDALONE);
if (IS_HORUS(m_board))
if (IS_FAMILY_HORUS_OR_T16(m_board))
ret = useTempDataPath(true);
if (ret) {
+1 -1
View File
@@ -93,7 +93,7 @@ bool CategorizedStorageFormat::load(RadioData & radioData)
return false;
}
strncpy(radioData.models[modelIndex].filename, qPrintable(fileName), sizeof(radioData.models[modelIndex].filename));
if (IS_HORUS(board) && !strcmp(radioData.generalSettings.currModelFilename, qPrintable(fileName))) {
if (IS_FAMILY_HORUS_OR_T16(board) && !strcmp(radioData.generalSettings.currModelFilename, qPrintable(fileName))) {
radioData.generalSettings.currModelIndex = modelIndex;
qDebug() << "currModelIndex =" << modelIndex;
}
+9 -9
View File
@@ -239,7 +239,7 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
unsigned int RleFile::EeFsGetFree()
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
unsigned int ret = 0;
@@ -261,7 +261,7 @@ unsigned int RleFile::EeFsGetFree()
*/
void RleFile::EeFsFree(unsigned int blk)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return;
unsigned int i = blk;
@@ -281,7 +281,7 @@ void RleFile::EeFsFree(unsigned int blk)
*/
unsigned int RleFile::EeFsAlloc()
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
if (ret) {
@@ -296,7 +296,7 @@ unsigned int RleFile::EeFsAlloc()
unsigned int RleFile::size(unsigned int id)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
else
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
@@ -304,7 +304,7 @@ unsigned int RleFile::size(unsigned int id)
unsigned int RleFile::openRd(unsigned int i_fileId)
{
if (IS_HORUS(board)) {
if (IS_FAMILY_HORUS_OR_T16(board)) {
return 1;
}
else if (IS_SKY9X(board)) {
@@ -341,7 +341,7 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
@@ -364,7 +364,7 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
// G: Read runlength (RLE) compressed bytes into buf.
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
memset(buf, 0, i_len);
@@ -550,7 +550,7 @@ void RleFile::closeTrunc()
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
create(i_fileId, typ);
@@ -599,7 +599,7 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
*/
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
{
if (IS_HORUS(board))
if (IS_FAMILY_HORUS_OR_T16(board))
return 0;
if (IS_SKY9X(board)) {