Merge with latest 2.3
@@ -6,7 +6,7 @@ set(VERSION_REVISION "0")
|
||||
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
|
||||
set(SDCARD_REVISION "0025")
|
||||
set(SDCARD_REVISION "0026")
|
||||
set(SDCARD_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}V${SDCARD_REVISION})
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
@@ -1685,3 +1685,22 @@ Gary Garland
|
||||
Stefano Boggia
|
||||
Jean-Jacques Pointel
|
||||
Ferenc Kunkli
|
||||
Sven Müller
|
||||
Taavi Tuisk
|
||||
Thomas Floyd
|
||||
Matthew LePard
|
||||
Peter Schneider
|
||||
Michel Garbarino
|
||||
Achim Stolze
|
||||
Fernando Rimoldi
|
||||
Bernard Delpy
|
||||
Daniel Dubovsky
|
||||
Jonathan Starch
|
||||
Coolwind
|
||||
Benoit Pichereau
|
||||
Darko Perković
|
||||
Burt Pickard-Richardson
|
||||
Roland Nittby
|
||||
Frank Barbas
|
||||
Scott McCoy
|
||||
Fabrice Debonnet
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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("");
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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]));
|
||||
|
||||
@@ -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:
|
||||
@@ -1170,14 +1172,22 @@ void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
||||
firmware->addOption("nooverridech", Firmware::tr("No OverrideCH functions available"));
|
||||
}
|
||||
|
||||
void addOpenTxRfOptions(OpenTxFirmware * firmware, bool flex = true)
|
||||
enum RfOptions {
|
||||
NONE = 0,
|
||||
EU = 1 << 0,
|
||||
FLEX = 1 << 1
|
||||
};
|
||||
|
||||
void addOpenTxRfOptions(OpenTxFirmware * firmware, uint8_t options)
|
||||
{
|
||||
static const Firmware::Option opt_eu("eu", Firmware::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
|
||||
static const Firmware::Option opt_fl("flexr9m", Firmware::tr("Enable non certified firmwares"));
|
||||
if (flex)
|
||||
if (options == EU + FLEX)
|
||||
firmware->addOptionsGroup({opt_eu, opt_fl});
|
||||
else
|
||||
else if (options == EU)
|
||||
firmware->addOption(opt_eu);
|
||||
else if (options == FLEX)
|
||||
firmware->addOption(opt_fl);
|
||||
}
|
||||
|
||||
void addOpenTxFontOptions(OpenTxFirmware * firmware)
|
||||
@@ -1191,7 +1201,6 @@ void addOpenTxFrskyOptions(OpenTxFirmware * 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"));
|
||||
addOpenTxRfOptions(firmware);
|
||||
}
|
||||
|
||||
void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
|
||||
@@ -1220,7 +1229,7 @@ void addOpenTxArm9xOptions(OpenTxFirmware * firmware, bool dblkeys = true)
|
||||
if (dblkeys)
|
||||
firmware->addOption("dblkeys", Firmware::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
addOpenTxFontOptions(firmware);
|
||||
addOpenTxRfOptions(firmware, true);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
}
|
||||
|
||||
void registerOpenTxFirmwares()
|
||||
@@ -1233,11 +1242,13 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addPPMInternalModuleHack(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky Taranis X9D+ 2019 board */
|
||||
firmware = new OpenTxFirmware("opentx-x9d+2019", Firmware::tr("FrSky Taranis X9D+ 2019"), BOARD_TARANIS_X9DP_2019);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky Taranis X9D board */
|
||||
firmware = new OpenTxFirmware("opentx-x9d", Firmware::tr("FrSky Taranis X9D"), BOARD_TARANIS_X9D);
|
||||
@@ -1245,6 +1256,7 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addPPMInternalModuleHack(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-x9e", Firmware::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
@@ -1253,48 +1265,57 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addPPMInternalModuleHack(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky X9-Lite board */
|
||||
firmware = new OpenTxFirmware("opentx-x9lite", Firmware::tr("FrSky Taranis X9-Lite"), BOARD_TARANIS_X9LITE);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky X9-LiteS board */
|
||||
firmware = new OpenTxFirmware("opentx-x9lites", Firmware::tr("FrSky Taranis X9-Lite S"), BOARD_TARANIS_X9LITES);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky X7 board */
|
||||
firmware = new OpenTxFirmware("opentx-x7", Firmware::tr("FrSky Taranis X7 / X7S"), BOARD_TARANIS_X7);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky X7 Access board */
|
||||
firmware = new OpenTxFirmware("opentx-x7access", Firmware::tr("FrSky Taranis X7 / X7S Access"), BOARD_TARANIS_X7_ACCESS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky X-Lite S/PRO board */
|
||||
firmware = new OpenTxFirmware("opentx-xlites", Firmware::tr("FrSky Taranis X-Lite S/PRO"), BOARD_TARANIS_XLITES);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky X-Lite board */
|
||||
firmware = new OpenTxFirmware("opentx-xlite", Firmware::tr("FrSky Taranis X-Lite"), BOARD_TARANIS_XLITE);
|
||||
// firmware->addOption("stdr9m", Firmware::tr("Use JR-sized R9M module"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky X10 board */
|
||||
firmware = new OpenTxFirmware("opentx-x10", Firmware::tr("FrSky Horus X10 / X10S"), BOARD_X10);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* FrSky X10 Express board */
|
||||
firmware = new OpenTxFirmware("opentx-x10express", Firmware::tr("FrSky Horus X10 Express / X10S Express"), BOARD_X10_EXPRESS);
|
||||
addOpenTxFrskyOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* FrSky X12 (Horus) board */
|
||||
firmware = new OpenTxFirmware("opentx-x12s", Firmware::tr("FrSky Horus X12S"), BOARD_HORUS_X12S);
|
||||
@@ -1302,6 +1323,7 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("internalaccess", Firmware::tr("Support for ACCESS internal module replacement"));
|
||||
firmware->addOption("pcbdev", Firmware::tr("Use ONLY with first DEV pcb version"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, EU + FLEX);
|
||||
|
||||
/* Jumper T12 board */
|
||||
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12 / T12 Pro"), BOARD_JUMPER_T12);
|
||||
@@ -1313,6 +1335,7 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
||||
addOpenTxFontOptions(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
addOpenTxRfOptions(firmware, FLEX);
|
||||
|
||||
/* Jumper T16 board */
|
||||
firmware = new OpenTxFirmware("opentx-t16", Firmware::tr("Jumper T16 / T16+ / T16 Pro"), BOARD_JUMPER_T16);
|
||||
@@ -1320,6 +1343,13 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("internalmulti", Firmware::tr("Support for MULTI internal module"));
|
||||
firmware->addOption("bluetooth", Firmware::tr("Support for bluetooth module"));
|
||||
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);
|
||||
|
||||
@@ -116,7 +116,7 @@ void RadioData::convert(RadioDataConversionState & cstate)
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_HORUS(cstate.toType)) {
|
||||
if (IS_FAMILY_HORUS_OR_T16(cstate.toType)) {
|
||||
fixModelFilenames();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
After Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 439 B |
@@ -761,7 +761,7 @@ void LogsDialog::setFlightSessions()
|
||||
int noSesions = sessions.size()-1;
|
||||
QString label = QString("%1 ").arg(noSesions);
|
||||
label += tr(noSesions > 1 ? "sessions" : "session");
|
||||
label += " <" + tr("total duration ") + generateDuration(getRecordTimeStamp(1), getRecordTimeStamp(n-1)) + ">";
|
||||
label += " <" + tr("time span") + generateDuration(getRecordTimeStamp(1), getRecordTimeStamp(n-1)) + ">";
|
||||
ui->sessions_CB->addItem(label);
|
||||
|
||||
// add individual sessions
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4" rowspan="2">
|
||||
<item row="0" column="6" rowspan="2">
|
||||
<spacer name="spacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -85,24 +85,18 @@
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="trimsLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QSlider" name="trim1Slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QSlider" name="trim2Slider">
|
||||
@@ -136,25 +130,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QSlider" name="trim4Slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
@@ -166,16 +141,6 @@
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="leftTrims_3" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim1Label">
|
||||
<property name="text">
|
||||
<string notr="true">trim1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5c_3">
|
||||
<item>
|
||||
@@ -284,11 +249,59 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim1Label">
|
||||
<property name="text">
|
||||
<string notr="true">trim1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QSlider" name="trim4Slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSlider" name="trim1Slider">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
@@ -299,7 +312,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="righTrims_2" columnstretch="0,1">
|
||||
<layout class="QGridLayout" name="rightTrims_2" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim4Label">
|
||||
<property name="text">
|
||||
@@ -310,65 +323,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="trim3Label">
|
||||
<property name="text">
|
||||
<string notr="true">trim3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7b_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7b_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="trim3Use"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="trim3Value">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-896</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>896</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_8d_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8d_2">
|
||||
<item>
|
||||
@@ -418,23 +372,201 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7b_2">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7b_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="trim3Use"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="trim3Value">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-896</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>896</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_8d_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="trim3Label">
|
||||
<property name="text">
|
||||
<string notr="true">trim3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<spacer name="horizontalSpacer">
|
||||
<item row="3" column="2">
|
||||
<layout class="QGridLayout" name="t6Layout" columnstretch="0,1">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="trim6Label">
|
||||
<property name="text">
|
||||
<string>trim6</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QComboBox" name="trim6Use"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="trim6Value">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-896</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>896</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSlider" name="trim6Slider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSlider" name="trim5Slider">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="tickPosition">
|
||||
<enum>QSlider::TicksBothSides</enum>
|
||||
</property>
|
||||
<property name="tickInterval">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QGridLayout" name="t5Layout" columnstretch="0,1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="trim5Label">
|
||||
<property name="text">
|
||||
<string>trim5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QComboBox" name="trim5Use"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="trim5Value">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="accelerated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-896</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>896</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
@@ -80,20 +80,28 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
}
|
||||
|
||||
// The trims
|
||||
QString labels[CPN_MAX_STICKS];
|
||||
QString labels[CPN_MAX_TRIMS];
|
||||
for(int i=0; i < CPN_MAX_STICKS; i++) {
|
||||
labels[i] = firmware->getAnalogInputName(i);
|
||||
}
|
||||
labels[4] = "T5";
|
||||
labels[5] = "T6";
|
||||
|
||||
|
||||
trimsLabel << ui->trim1Label << ui->trim2Label << ui->trim3Label << ui->trim4Label;
|
||||
trimsUse << ui->trim1Use << ui->trim2Use << ui->trim3Use << ui->trim4Use;
|
||||
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value;
|
||||
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider;
|
||||
trimsLabel << ui->trim1Label << ui->trim2Label << ui->trim3Label << ui->trim4Label << ui->trim5Label << ui->trim6Label;
|
||||
trimsUse << ui->trim1Use << ui->trim2Use << ui->trim3Use << ui->trim4Use << ui->trim5Use << ui->trim6Use;
|
||||
trimsValue << ui->trim1Value << ui->trim2Value << ui->trim3Value << ui->trim4Value << ui->trim5Value << ui->trim6Value;
|
||||
trimsSlider << ui->trim1Slider << ui->trim2Slider << ui->trim3Slider << ui->trim4Slider << ui->trim5Slider << ui->trim6Slider;
|
||||
|
||||
Board::Type board = firmware->getBoard();
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
for (int i = getBoardCapability(board,Board::NumTrims); i < CPN_MAX_TRIMS; i++) {
|
||||
trimsLabel[i]->hide();
|
||||
trimsUse[i]->hide();
|
||||
trimsValue[i]->hide();
|
||||
trimsSlider[i]->hide();
|
||||
}
|
||||
|
||||
for (int i = 0; i < getBoardCapability(board,Board::NumTrims); i++) {
|
||||
trimsLabel[i]->setText(labels[CONVERT_MODE(i+1)-1]);
|
||||
|
||||
QComboBox * cb = trimsUse[i];
|
||||
@@ -293,7 +301,7 @@ void FlightModePanel::update()
|
||||
ui->fadeIn->setValue(float(phase.fadeIn)/scale);
|
||||
ui->fadeOut->setValue(float(phase.fadeOut)/scale);
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
for (int i = 0; i < getBoardCapability(firmware->getBoard(), Board::NumTrims); i++) {
|
||||
int trimsMax = firmware->getCapability(ExtendedTrimsRange);
|
||||
if (trimsMax == 0 || !model->extendedTrims) {
|
||||
trimsMax = firmware->getCapability(TrimsRange);
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -34,27 +34,27 @@ SimulatedUIWidgetJumperT16::SimulatedUIWidgetJumperT16(SimulatorInterface *simul
|
||||
// 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->leftbuttons->addArea(QRect(10, 70, 80, 35), "JumperT16/left_mdl.png", act));
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(50, 70, 80, 35), "JumperT16/left_mdl.png", act));
|
||||
|
||||
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, 10, 80, 35), "JumperT16/left_sys.png", act));
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(25, 10, 95, 35), "JumperT16/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(10, 190, 80, 35), "JumperT16/left_tele.png", act));
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(50, 190, 80, 35), "JumperT16/left_tele.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->rightbuttons->addArea(QRect(35, 10, 80, 35), "JumperT16/right_rtn.png", act));
|
||||
addRadioWidget(ui->rightbuttons->addArea(QRect(50, 10, 95, 35), "JumperT16/right_rtn.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, 131, 80, 35), "JumperT16/left_page.png", act));
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(50, 131, 80, 35), "JumperT16/left_page.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();
|
||||
|
||||
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), "JumperT16/right_ent.png", m_mouseMidClickAction));
|
||||
addRadioWidget(ui->rightbuttons->addArea(QRect(55, 90, 56, 120), "JumperT16/right_ent.png", m_mouseMidClickAction));
|
||||
|
||||
addRadioWidget(ui->leftbuttons->addArea(QRect(10, 252, 30, 30), "JumperT16/left_scrnsht.png", m_screenshotAction));
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -72,7 +72,7 @@ local function incrField(step)
|
||||
end
|
||||
else
|
||||
local min, max = 0, 0
|
||||
if field.type <= 5 then
|
||||
if ((field.type <= 5) or (field.type == 8)) then
|
||||
min = field.min
|
||||
max = field.max
|
||||
step = field.step * step
|
||||
@@ -239,25 +239,21 @@ local function fieldFloatLoad(field, data, offset)
|
||||
field.default = fieldGetValue(data, offset+12, 4)
|
||||
fieldUnsignedToSigned(field, 4)
|
||||
field.prec = data[offset+16]
|
||||
if field.prec > 2 then
|
||||
field.prec = 2
|
||||
if field.prec > 3 then
|
||||
field.prec = 3
|
||||
end
|
||||
field.step = fieldGetValue(data, offset+17, 4)
|
||||
field.unit, offset = fieldGetString(data, offset+21)
|
||||
end
|
||||
|
||||
local function formatFloat(num, decimals)
|
||||
local mult = 10^(decimals or 0)
|
||||
local val = num / mult
|
||||
return string.format("%." .. decimals .. "f", val)
|
||||
end
|
||||
|
||||
local function fieldFloatDisplay(field, y, attr)
|
||||
local attrnum
|
||||
if field.prec == 1 then
|
||||
attrnum = LEFT + attr + PREC1
|
||||
elseif field.prec == 2 then
|
||||
attrnum = LEFT + attr + PREC2
|
||||
else
|
||||
attrnum = LEFT + attr
|
||||
end
|
||||
-- lcd.drawNumber(140, y, field.value, attrnum) -- NOTE: original code getLastPos not available in Horus
|
||||
-- lcd.drawText(lcd.getLastPos(), y, field.unit, attr) -- NOTE: original code getLastPos not available in Horus
|
||||
lcd.drawText(140, y, field.value .. field.unit, attr) -- NOTE: Concenated fields instead of get lastPos
|
||||
lcd.drawText(140, y, formatFloat(field.value, field.prec) .. field.unit, attr)
|
||||
end
|
||||
|
||||
local function fieldFloatSave(field)
|
||||
@@ -423,7 +419,7 @@ end
|
||||
|
||||
-- Main
|
||||
local function runDevicePage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
if edit == true then
|
||||
edit = false
|
||||
local field = getField(lineIndex)
|
||||
@@ -455,9 +451,9 @@ local function runDevicePage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_VIRTUAL_INC then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
incrField(1)
|
||||
elseif event == EVT_VIRTUAL_DEC then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
incrField(-1)
|
||||
end
|
||||
else
|
||||
|
||||
@@ -273,11 +273,6 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST or event == EVT_SHIFT_BREAK then
|
||||
--selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST or event == EVT_SHIFT_LONG then
|
||||
--killEvents(event);
|
||||
--selectPage(-1)
|
||||
end
|
||||
local result = pages[page](event)
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@ end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
if fields[current][5] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -101,15 +101,15 @@ local function runFieldsPage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_PREV then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -465,9 +465,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif (event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST) and page < #pages-1 then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE and page < #pages-1 then
|
||||
selectPage(1)
|
||||
elseif (event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST) and page > 1 then
|
||||
elseif event == EVT_VIRTUAL_PREV_PAGE and page > 1 then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
@@ -91,9 +91,9 @@ end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
if fields[current][5] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -101,15 +101,15 @@ local function runFieldsPage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_PREV then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -465,9 +465,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif (event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST) and page < #pages-1 then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE and page < #pages-1 then
|
||||
selectPage(1)
|
||||
elseif (event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST) and page > 1 then
|
||||
elseif event == EVT_VIRTUAL_PREV_PAGE and page > 1 then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
@@ -237,9 +237,9 @@ end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -247,15 +247,15 @@ local function runFieldsPage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_PREV then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -313,11 +313,11 @@ local function runCalibrationPage(event)
|
||||
lcd.drawBitmap(Bitmap.open("img/done.bmp"),200, 100)
|
||||
lcd.drawText(160, 220, "Press [RTN] when ready", attr)
|
||||
end
|
||||
if calibrationStep > 6 and (event == EVT_ENTER_BREAK or event == EVT_EXIT_BREAK) then
|
||||
if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK then
|
||||
elseif event == EVT_VIRTUAL_ENTER then
|
||||
calibrationState = 1
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
if calibrationStep > 0 then
|
||||
calibrationStep = 0
|
||||
end
|
||||
@@ -341,9 +341,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE then
|
||||
selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST then
|
||||
elseif event == EVT_VIRTUAL_PREV_PAGE then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 121 KiB |
@@ -16,11 +16,16 @@
|
||||
---- # #
|
||||
---- #########################################################################
|
||||
|
||||
-- Horus Widget to display the levels of lipo battery with per cell indication
|
||||
-- 3djc & Offer Shmuely
|
||||
-- Date: 2020
|
||||
-- ver: 0.4
|
||||
|
||||
local _options = {
|
||||
{ "Sensor", SOURCE, 0 },
|
||||
{ "Sensor", SOURCE, 0 }, -- default to 'Cels'
|
||||
{ "Color", COLOR, WHITE },
|
||||
{ "Shadow", BOOL, 0 },
|
||||
{ "LowestCell", BOOL, 1 }
|
||||
{ "LowestCell", BOOL, 1 } -- 0=main voltage display shows all-cell-voltage, 1=main voltage display shows lowest-cell
|
||||
}
|
||||
|
||||
-- This function is run once at the creation of the widget
|
||||
@@ -29,12 +34,12 @@ local function create(zone, options)
|
||||
zone = zone,
|
||||
options = options,
|
||||
counter = 0,
|
||||
|
||||
shadowed = 0,
|
||||
|
||||
no_telem_blink = 0,
|
||||
isDataAvailable = 0,
|
||||
cellDataLive = {0,0,0,0,0,0},
|
||||
cellDataHistoryLowest = {0,0,0,0,0,0},
|
||||
cellDataHistoryLowest = {5,5,5,5,5,5},
|
||||
cellDataHistoryCellLowest = 5,
|
||||
cellMax = 0,
|
||||
cellMin = 0,
|
||||
@@ -112,51 +117,47 @@ local function calculateBatteryData(wgt)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- this is necessary for simu where cell-count can change
|
||||
if #wgt.cellDataHistoryLowest ~= #newCellData then
|
||||
wgt.cellDataHistoryLowest = {}
|
||||
for k, v in pairs(newCellData) do
|
||||
wgt.cellDataHistoryLowest[k] = v
|
||||
end
|
||||
end
|
||||
-- stores the lowest cell values in historical table
|
||||
for k, v in pairs(newCellData) do
|
||||
if v < wgt.cellDataHistoryLowest[k] then
|
||||
wgt.cellDataHistoryLowest[k] = v
|
||||
wgt.cellDataHistoryLowest[k] = 5 -- invalid reading, set high value so the min() will update it soon
|
||||
end
|
||||
end
|
||||
|
||||
--- calc highest of all cels
|
||||
local cellMax = 0
|
||||
local cellMin = 5
|
||||
local cellSum = 0
|
||||
for k, v in pairs(newCellData) do
|
||||
-- stores the lowest cell values in historical table
|
||||
if v > 1 and v < wgt.cellDataHistoryLowest[k] then -- min 1v to consider a valid reading
|
||||
wgt.cellDataHistoryLowest[k] = v
|
||||
|
||||
--- calc history lowest of all cells
|
||||
if v < wgt.cellDataHistoryCellLowest then
|
||||
wgt.cellDataHistoryCellLowest = v
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- calc highest of all cells
|
||||
if v > cellMax then
|
||||
cellMax = v
|
||||
end
|
||||
end
|
||||
wgt.cellMax = cellMax
|
||||
|
||||
--- calc lowest of all cels
|
||||
local cellMin = 5
|
||||
for k, v in pairs(newCellData) do
|
||||
if v < cellMin and v > 1 then -- >1 to ignore invalid values
|
||||
--- calc lowest of all cells
|
||||
if v < cellMin and v > 1 then -- min 1v to consider a valid reading
|
||||
cellMin = v
|
||||
end
|
||||
end
|
||||
wgt.cellMin = cellMin
|
||||
|
||||
--- calc history lowest of all cells
|
||||
if cellMin < wgt.cellDataHistoryCellLowest and cellMin > 1 then -- >1 to ignore invalid values
|
||||
wgt.cellDataHistoryCellLowest = cellMin
|
||||
end
|
||||
|
||||
wgt.cellCount = #newCellData
|
||||
|
||||
--- sum of all cells
|
||||
local cellSum = 0
|
||||
for k, v in pairs(newCellData) do
|
||||
--- sum of all cells
|
||||
cellSum = cellSum + v
|
||||
|
||||
|
||||
end
|
||||
|
||||
wgt.cellMin = cellMin
|
||||
wgt.cellMax = cellMax
|
||||
wgt.cellCount = #newCellData
|
||||
wgt.cellSum = cellSum
|
||||
|
||||
--- average of all cells
|
||||
@@ -328,7 +329,7 @@ local function refreshZoneLarge(wgt)
|
||||
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y, wgt.cellPercent .. "%", RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + 30, string.format("%2.1fV", wgt.mainValue), RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + 70, string.format("%2.1fV %2.1fS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + 70, string.format("%2.1fV %dS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed)
|
||||
-- fill batt
|
||||
lcd.setColor(CUSTOM_COLOR, getPercentColor(wgt.cellPercent))
|
||||
lcd.drawFilledRectangle(wgt.zone.x + myBatt.x, wgt.zone.y + myBatt.y + myBatt.h + myBatt.cath_h - math.floor(wgt.cellPercent / 100 * myBatt.h), myBatt.w, math.floor(wgt.cellPercent / 100 * myBatt.h), CUSTOM_COLOR)
|
||||
@@ -372,7 +373,7 @@ local function refreshZoneXLarge(wgt)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y, wgt.cellPercent .. "%", RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink)
|
||||
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y + 30, string.format("%2.1fV", wgt.mainValue), RIGHT + DBLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y + 105, string.format("%2.1fV %2.1fS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink)
|
||||
lcd.drawText(wgt.zone.x + wgt.zone.w, wgt.zone.y + myBatt.y + 105, string.format("%2.1fV %dS", wgt.secondaryValue, wgt.cellCount), RIGHT + SMLSIZE + CUSTOM_COLOR + wgt.shadowed + wgt.no_telem_blink)
|
||||
|
||||
-- draw cells
|
||||
local pos = { { x = 111, y = 38 }, { x = 164, y = 38 }, { x = 217, y = 38 }, { x = 111, y = 57 }, { x = 164, y = 57 }, { x = 217, y = 57 } }
|
||||
|
||||
@@ -72,7 +72,7 @@ local function incrField(step)
|
||||
end
|
||||
else
|
||||
local min, max = 0, 0
|
||||
if field.type <= 5 then
|
||||
if ((field.type <= 5) or (field.type == 8)) then
|
||||
min = field.min
|
||||
max = field.max
|
||||
step = field.step * step
|
||||
@@ -238,23 +238,21 @@ local function fieldFloatLoad(field, data, offset)
|
||||
field.default = fieldGetValue(data, offset+12, 4)
|
||||
fieldUnsignedToSigned(field, 4)
|
||||
field.prec = data[offset+16]
|
||||
if field.prec > 2 then
|
||||
field.prec = 2
|
||||
if field.prec > 3 then
|
||||
field.prec = 3
|
||||
end
|
||||
field.step = fieldGetValue(data, offset+17, 4)
|
||||
field.unit, offset = fieldGetString(data, offset+21)
|
||||
end
|
||||
|
||||
local function formatFloat(num, decimals)
|
||||
local mult = 10^(decimals or 0)
|
||||
local val = num / mult
|
||||
return string.format("%." .. decimals .. "f", val)
|
||||
end
|
||||
|
||||
local function fieldFloatDisplay(field, y, attr)
|
||||
local attrnum
|
||||
if field.prec == 1 then
|
||||
attrnum = LEFT + attr + PREC1
|
||||
elseif field.prec == 2 then
|
||||
attrnum = LEFT + attr + PREC2
|
||||
else
|
||||
attrnum = LEFT + attr
|
||||
end
|
||||
lcd.drawNumber(89, y, field.value, attrnum)
|
||||
lcd.drawText(89, y, formatFloat(field.value, field.prec), LEFT + attr)
|
||||
lcd.drawText(lcd.getLastPos(), y, field.unit, attr)
|
||||
end
|
||||
|
||||
|
||||
@@ -273,11 +273,6 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST or event == EVT_SHIFT_BREAK then
|
||||
--selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST or event == EVT_SHIFT_LONG then
|
||||
--killEvents(event);
|
||||
--selectPage(-1)
|
||||
end
|
||||
local result = pages[page](event)
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
if event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
elseif event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -66,12 +66,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_ROT_RIGHT or event == EVT_RIGHT_BREAK then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_LEFT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -82,22 +82,22 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
dirty = blinkChanged()
|
||||
end
|
||||
else
|
||||
if event == EVT_PAGE_BREAK or event==EVT_RIGHT_BREAK then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
page = nextPage
|
||||
field = 0
|
||||
dirty = true
|
||||
elseif event == EVT_PAGE_LONG or event==EVT_LEFT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREV then
|
||||
page = prevPage
|
||||
field = 0
|
||||
killEvents(event);
|
||||
@@ -120,7 +120,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event==EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -276,7 +276,7 @@ local function servoMenu(event)
|
||||
limits.revert = fieldIncDec(event, limits.revert, 1)
|
||||
end
|
||||
model.setOutput(servoPage, limits)
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
servoPage = nil
|
||||
dirty = true
|
||||
end
|
||||
@@ -348,9 +348,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, RUDDER_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -58,10 +58,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_INC then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_DEC then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -72,12 +72,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_ROT_RIGHT or event == EVT_RIGHT_FIRST then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_LEFT_FIRST then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -88,11 +88,11 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
@@ -126,7 +126,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event==EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -137,12 +137,12 @@ end
|
||||
|
||||
local function switchValueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_ROT_RIGHT or event == EVT_RIGHT_FIRST then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_LEFT_FIRST then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -153,7 +153,7 @@ local function switchValueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function switchIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event== EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -399,9 +399,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, BEEPER_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -62,10 +62,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -76,12 +76,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_ROT_RIGHT or event == EVT_RIGHT_BREAK then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_LEFT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -92,11 +92,11 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
@@ -130,7 +130,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event==EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -420,7 +420,7 @@ local function servoMenu(event)
|
||||
limits.revert = fieldIncDec(event, limits.revert, 1)
|
||||
end
|
||||
model.setOutput(servoPage, limits)
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
servoPage = nil
|
||||
dirty = true
|
||||
end
|
||||
@@ -544,9 +544,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, TAIL_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -23,9 +23,9 @@ local MODELTYPE_QUAD = 2
|
||||
|
||||
-- Common functions
|
||||
local function fieldIncDec(event, value, max)
|
||||
if event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
elseif event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
end
|
||||
value = (value % (max+1))
|
||||
@@ -53,7 +53,7 @@ end
|
||||
|
||||
local function modelTypeMenu(event)
|
||||
drawModelChoiceMenu()
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
if modelType == MODELTYPE_PLANE then
|
||||
return "plane.lua"
|
||||
elseif modelType == MODELTYPE_DELTA then
|
||||
@@ -73,7 +73,7 @@ local function run(event)
|
||||
error("Cannot be run as a model script!")
|
||||
end
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ local function run(event)
|
||||
raise("Cannot be run as a model script!")
|
||||
end
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@ local function runWarningPage(event)
|
||||
lcd.drawText(0, 30, "power, and a level surface.", SMLSIZE)
|
||||
lcd.drawText(0, 40, "Press [Enter] when ready", SMLSIZE)
|
||||
lcd.drawText(0, 50, "Press [Exit] to cancel", SMLSIZE)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
selectPage(1)
|
||||
return 0
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
return 0
|
||||
@@ -186,9 +186,9 @@ end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -196,15 +196,15 @@ local function runFieldsPage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT or event == EVT_DOWN_BREAK then
|
||||
if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REP then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT or event == EVT_UP_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REP then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REP then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REP then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -260,9 +260,9 @@ local function runCalibrationPage(event)
|
||||
-- lcd.drawText(10, 19, "Done",0)
|
||||
lcd.drawText(0, 56, "Press [Exit] when ready", attr)
|
||||
end
|
||||
if calibrationStep > 6 and (event == EVT_ENTER_BREAK or event == EVT_EXIT_BREAK) then
|
||||
if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK and positionConfirmed then
|
||||
elseif event == EVT_VIRTUAL_ENTER and positionConfirmed then
|
||||
calibrationState = 1
|
||||
positionConfirmed = 0
|
||||
end
|
||||
@@ -284,9 +284,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event==EVT_RIGHT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE then
|
||||
selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event==EVT_LEFT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREV_PAGE then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
@@ -72,7 +72,7 @@ local function incrField(step)
|
||||
end
|
||||
else
|
||||
local min, max = 0, 0
|
||||
if field.type <= 5 then
|
||||
if ((field.type <= 5) or (field.type == 8)) then
|
||||
min = field.min
|
||||
max = field.max
|
||||
step = field.step * step
|
||||
@@ -238,23 +238,21 @@ local function fieldFloatLoad(field, data, offset)
|
||||
field.default = fieldGetValue(data, offset+12, 4)
|
||||
fieldUnsignedToSigned(field, 4)
|
||||
field.prec = data[offset+16]
|
||||
if field.prec > 2 then
|
||||
field.prec = 2
|
||||
if field.prec > 3 then
|
||||
field.prec = 3
|
||||
end
|
||||
field.step = fieldGetValue(data, offset+17, 4)
|
||||
field.unit, offset = fieldGetString(data, offset+21)
|
||||
end
|
||||
|
||||
local function formatFloat(num, decimals)
|
||||
local mult = 10^(decimals or 0)
|
||||
local val = num / mult
|
||||
return string.format("%." .. decimals .. "f", val)
|
||||
end
|
||||
|
||||
local function fieldFloatDisplay(field, y, attr)
|
||||
local attrnum
|
||||
if field.prec == 1 then
|
||||
attrnum = LEFT + attr + PREC1
|
||||
elseif field.prec == 2 then
|
||||
attrnum = LEFT + attr + PREC2
|
||||
else
|
||||
attrnum = LEFT + attr
|
||||
end
|
||||
lcd.drawNumber(140, y, field.value, attrnum)
|
||||
lcd.drawText(140, y, formatFloat(field.value, field.prec), LEFT + attr)
|
||||
lcd.drawText(lcd.getLastPos(), y, field.unit, attr)
|
||||
end
|
||||
|
||||
|
||||
@@ -273,11 +273,6 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST or event == EVT_SHIFT_BREAK then
|
||||
--selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST or event == EVT_SHIFT_LONG then
|
||||
--killEvents(event);
|
||||
--selectPage(-1)
|
||||
end
|
||||
local result = pages[page](event)
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_PLUS_BREAK or event == EVT_ROT_LEFT then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_MINUS_BREAK or event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -66,12 +66,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_PLUS_REPT or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_MINUS_REPT or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -82,11 +82,11 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
@@ -120,7 +120,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event == EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -284,7 +284,7 @@ local function servoMenu(event)
|
||||
limits.revert = fieldIncDec(event, limits.revert, 1)
|
||||
end
|
||||
model.setOutput(servoPage, limits)
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
servoPage = nil
|
||||
dirty = true
|
||||
end
|
||||
@@ -357,9 +357,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, RUDDER_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -57,10 +57,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_PLUS_BREAK or event == EVT_ROT_LEFT then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_MINUS_BREAK or event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -71,12 +71,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_PLUS_REPT or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_MINUS_REPT or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -87,11 +87,11 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
@@ -125,7 +125,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event == EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -136,12 +136,12 @@ end
|
||||
|
||||
local function switchValueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_PLUS_REPT or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_MINUS_REPT or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -152,7 +152,7 @@ local function switchValueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function switchIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event == EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -415,9 +415,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, BEEPER_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -62,10 +62,10 @@ end
|
||||
|
||||
local function fieldIncDec(event, value, max, force)
|
||||
if edit or force==true then
|
||||
if event == EVT_PLUS_BREAK or event == EVT_ROT_LEFT then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_MINUS_BREAK or event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -76,12 +76,12 @@ end
|
||||
|
||||
local function valueIncDec(event, value, min, max)
|
||||
if edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_PLUS_REPT or event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
if value < max then
|
||||
value = (value + 1)
|
||||
dirty = true
|
||||
end
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_MINUS_REPT or event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
if value > min then
|
||||
value = (value - 1)
|
||||
dirty = true
|
||||
@@ -92,11 +92,11 @@ local function valueIncDec(event, value, min, max)
|
||||
end
|
||||
|
||||
local function navigate(event, fieldMax, prevPage, nextPage)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
edit = not edit
|
||||
dirty = true
|
||||
elseif edit then
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
edit = false
|
||||
dirty = true
|
||||
elseif not dirty then
|
||||
@@ -130,7 +130,7 @@ local function getFieldFlags(position)
|
||||
end
|
||||
|
||||
local function channelIncDec(event, value)
|
||||
if not edit and event==EVT_MENU_BREAK then
|
||||
if not edit and event == EVT_VIRTUAL_MENU then
|
||||
servoPage = value
|
||||
dirty = true
|
||||
else
|
||||
@@ -425,7 +425,7 @@ local function servoMenu(event)
|
||||
limits.revert = fieldIncDec(event, limits.revert, 1)
|
||||
end
|
||||
model.setOutput(servoPage, limits)
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
servoPage = nil
|
||||
dirty = true
|
||||
end
|
||||
@@ -550,9 +550,9 @@ local function confirmationMenu(event)
|
||||
|
||||
navigate(event, fieldsMax, TAIL_PAGE, page)
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_LONG then
|
||||
elseif event == EVT_VIRTUAL_ENTER_LONG then
|
||||
killEvents(event)
|
||||
applySettings()
|
||||
return 2
|
||||
|
||||
@@ -25,10 +25,10 @@ local MODELTYPE_QUAD = 2
|
||||
|
||||
-- Common functions
|
||||
local function fieldIncDec(event, value, max)
|
||||
if event == EVT_PLUS_BREAK or event == EVT_ROT_LEFT or event == EVT_PLUS_REPT then
|
||||
if event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REPT then
|
||||
value = (value + max)
|
||||
dirty = true
|
||||
elseif event == EVT_MINUS_BREAK or event == EVT_ROT_RIGHT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REPT then
|
||||
value = (value + max + 2)
|
||||
dirty = true
|
||||
end
|
||||
@@ -56,7 +56,7 @@ local function modelTypeMenu(event)
|
||||
drawModelChoiceMenu()
|
||||
dirty = false
|
||||
end
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
if modelType == MODELTYPE_PLANE then
|
||||
return "plane.lua"
|
||||
elseif modelType == MODELTYPE_DELTA then
|
||||
@@ -77,7 +77,7 @@ local function run(event)
|
||||
error("Cannot be run as a model script!")
|
||||
end
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
return modelTypeMenu(event)
|
||||
|
||||
@@ -127,7 +127,7 @@ local function run(event)
|
||||
raise("Cannot be run as a model script!")
|
||||
end
|
||||
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
|
||||
|
||||
@@ -60,10 +60,10 @@ local function runWarningPage(event)
|
||||
lcd.drawText(0, 30, "power supply and a flat level surface (desk,...)", SMLSIZE)
|
||||
lcd.drawText(0, 40, "Press [Enter] when ready", SMLSIZE)
|
||||
lcd.drawText(0, 50, "Press [Exit] when cancel", SMLSIZE)
|
||||
if event == EVT_ENTER_BREAK then
|
||||
if event == EVT_VIRTUAL_ENTER then
|
||||
selectPage(1)
|
||||
return 0
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
end
|
||||
return 0
|
||||
@@ -184,9 +184,9 @@ end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
if event == EVT_VIRTUAL_EXIT then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -194,15 +194,15 @@ local function runFieldsPage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then
|
||||
if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REP then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_PREV or event == EVT_VIRTUAL_PREV_REP then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT then
|
||||
if event == EVT_VIRTUAL_INC or event == EVT_VIRTUAL_INC_REP then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_DEC or event == EVT_VIRTUAL_DEC_REP then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -235,11 +235,11 @@ local function runCalibrationPage(event)
|
||||
lcd.drawPixmap(10, 19, "bmp/done.bmp")
|
||||
lcd.drawText(0, 56, "Press [Exit] when ready", attr)
|
||||
end
|
||||
if calibrationStep > 6 and (event == EVT_ENTER_BREAK or event == EVT_EXIT_BREAK) then
|
||||
if calibrationStep > 6 and (event == EVT_VIRTUAL_ENTER or event == EVT_VIRTUAL_EXIT) then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK then
|
||||
elseif event == EVT_VIRTUAL_ENTER then
|
||||
calibrationState = 1
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
if calibrationStep > 0 then
|
||||
calibrationStep = 0
|
||||
end
|
||||
@@ -261,9 +261,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE then
|
||||
selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG then
|
||||
elseif event == EVT_VIRTUAL_PREV_PAGE then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
@@ -192,6 +192,8 @@ enum TrainerMode {
|
||||
#if defined(PCBTARANIS)
|
||||
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
|
||||
#endif
|
||||
#if defined(PCBTARANIS) || defined(AUX_SERIAL)
|
||||
TRAINER_MODE_MASTER_BATTERY_COMPARTMENT,
|
||||
#endif
|
||||
TRAINER_MODE_MASTER_BLUETOOTH,
|
||||
@@ -206,7 +208,7 @@ enum TrainerMode {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16) || defined(ALLOW_TRAINER_MULTI)
|
||||
#if defined(RADIO_FAMILY_T16) || defined(ALLOW_TRAINER_MULTI)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MULTI
|
||||
#elif defined(BLUETOOTH)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
|
||||
|
||||
@@ -300,7 +300,7 @@ void showAlertBox(const char * title, const char * text, const char * action , u
|
||||
#define LOAD_MODEL_BITMAP()
|
||||
|
||||
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetryFrsky
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetry
|
||||
#define IS_OTHER_VIEW_DISPLAYED() false
|
||||
|
||||
void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags flags);
|
||||
|
||||
@@ -45,16 +45,16 @@ inline bool isModelMenuDisplayed()
|
||||
void onMainViewMenu(const char * result);
|
||||
void menuFirstCalib(event_t event);
|
||||
void menuMainView(event_t event);
|
||||
void menuViewTelemetryFrsky(event_t event);
|
||||
void menuViewTelemetry(event_t event);
|
||||
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext);
|
||||
|
||||
enum MenuRadioIndexes
|
||||
{
|
||||
MENU_RADIO_SETUP,
|
||||
CASE_SDCARD(MENU_RADIO_SD_MANAGER)
|
||||
#if defined(LUA) || defined(PXX2) || defined(MULTIMODULE)
|
||||
MENU_RADIO_TOOLS,
|
||||
#endif
|
||||
CASE_SDCARD(MENU_RADIO_SD_MANAGER)
|
||||
MENU_RADIO_SETUP,
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
MENU_RADIO_HARDWARE,
|
||||
@@ -76,11 +76,11 @@ void menuRadioPowerMeter(event_t event);
|
||||
void menuRadioCalibration(event_t event);
|
||||
|
||||
static const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
menuRadioSetup,
|
||||
CASE_SDCARD(menuRadioSdManager)
|
||||
#if defined(LUA) || defined(PXX2) || defined(MULTIMODULE)
|
||||
menuRadioTools,
|
||||
#endif
|
||||
CASE_SDCARD(menuRadioSdManager)
|
||||
menuRadioSetup,
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioHardware,
|
||||
|
||||
@@ -113,7 +113,11 @@ void menuModelFlightModeOne(event_t event)
|
||||
lcdDrawTextAlignedLeft(y, STR_TRIMS);
|
||||
for (uint8_t t = 0; t < NUM_STICKS; t++) {
|
||||
drawTrimMode(MIXES_2ND_COLUMN + (t*2*FW), y, s_currIdx, t, menuHorizontalPosition == t ? attr : 0);
|
||||
#if defined(NAVIGATION_9X)
|
||||
if (s_editMode > 0 && attr && menuHorizontalPosition == t) {
|
||||
#else
|
||||
if (s_editMode >= 0 && attr && menuHorizontalPosition == t) {
|
||||
#endif
|
||||
trim_t & v = fm->trim[t];
|
||||
v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, k==0 ? 0 : 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ void menuModelLogicalSwitchOne(event_t event)
|
||||
uint8_t new_cstate = lswFamily(cs->func);
|
||||
if (cstate != new_cstate) {
|
||||
if (new_cstate == LS_FAMILY_TIMER) {
|
||||
cs->v1 = cs->v2 = 0;
|
||||
cs->v1 = cs->v2 = -119;
|
||||
}
|
||||
else if (new_cstate == LS_FAMILY_EDGE) {
|
||||
cs->v1 = 0; cs->v2 = -129; cs->v3 = 0;
|
||||
|
||||
@@ -215,6 +215,9 @@ void onLimitsMenu(const char *result)
|
||||
else if (result == STR_EDIT) {
|
||||
pushMenu(menuModelLimitsOne);
|
||||
}
|
||||
else if (result == STR_COPY_MIN_MAX_TO_OUTPUTS) {
|
||||
copyMinMaxToOutputs(s_currIdx);
|
||||
}
|
||||
}
|
||||
|
||||
void menuModelLimits(event_t event)
|
||||
@@ -240,6 +243,7 @@ void menuModelLimits(event_t event)
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_STICKS_TO_OFS);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_MIN_MAX_TO_OUTPUTS);
|
||||
POPUP_MENU_START(onLimitsMenu);
|
||||
}
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void menuMainView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_GENERAL_MENU:
|
||||
pushMenu(menuRadioSetup);
|
||||
pushMenu(menuRadioTools);
|
||||
killEvents(event);
|
||||
break;
|
||||
#endif
|
||||
@@ -397,7 +397,7 @@ void menuMainView(event_t event)
|
||||
#endif
|
||||
|
||||
case EVT_KEY_TELEMETRY:
|
||||
chainMenu(menuViewTelemetryFrsky);
|
||||
chainMenu(menuViewTelemetry);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
|
||||
@@ -206,79 +206,3 @@ bool displayTelemetryScreen()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
enum NavigationDirection {
|
||||
none,
|
||||
up,
|
||||
down
|
||||
};
|
||||
#define decrTelemetryScreen() direction = up
|
||||
#define incrTelemetryScreen() direction = down
|
||||
|
||||
#if defined(NAVIGATION_XLITE)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_LEFT) && IS_SHIFT_PRESSED())
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_RIGHT) && IS_SHIFT_PRESSED())
|
||||
#elif defined(NAVIGATION_X7)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_PAGE))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGE))
|
||||
#elif defined(NAVIGATION_9X)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_DOWN))
|
||||
#else
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_DOWN))
|
||||
#endif
|
||||
|
||||
void menuViewTelemetryFrsky(event_t event)
|
||||
{
|
||||
enum NavigationDirection direction = none;
|
||||
|
||||
if (event == EVT_KEY_FIRST(KEY_EXIT) && TELEMETRY_SCREEN_TYPE(s_frsky_view) != TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#if defined(LUA)
|
||||
else if (event == EVT_KEY_LONG(KEY_EXIT)) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#endif
|
||||
else if (EVT_KEY_PREVIOUS_VIEW(event)) {
|
||||
killEvents(event);
|
||||
decrTelemetryScreen();
|
||||
}
|
||||
else if (EVT_KEY_NEXT_VIEW(event)) {
|
||||
killEvents(event);
|
||||
incrTelemetryScreen();
|
||||
}
|
||||
else if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
|
||||
for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
|
||||
if (direction == up) {
|
||||
if (s_frsky_view-- == 0)
|
||||
s_frsky_view = TELEMETRY_VIEW_MAX;
|
||||
}
|
||||
else if (direction == down) {
|
||||
if (s_frsky_view++ == TELEMETRY_VIEW_MAX)
|
||||
s_frsky_view = 0;
|
||||
}
|
||||
else {
|
||||
direction = down;
|
||||
}
|
||||
if (displayTelemetryScreen()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
drawTelemetryTopBar();
|
||||
lcdDrawText(2*FW, 3*FH, "No Telemetry Screens");
|
||||
displayRssiLine();
|
||||
}
|
||||
|
||||
#undef EVT_KEY_PREVIOUS_VIEW
|
||||
#undef EVT_KEY_NEXT_VIEW
|
||||
|
||||
@@ -301,7 +301,7 @@ FlightModesType editFlightModes(coord_t x, coord_t y, event_t event, FlightModes
|
||||
#endif
|
||||
|
||||
#define IS_MAIN_VIEW_DISPLAYED() menuHandlers[0] == menuMainView
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetryFrsky
|
||||
#define IS_TELEMETRY_VIEW_DISPLAYED() menuHandlers[0] == menuViewTelemetry
|
||||
#define IS_OTHER_VIEW_DISPLAYED() (menuHandlers[0] == menuMainViewChannelsMonitor || menuHandlers[0] == menuChannelsView)
|
||||
|
||||
#endif // _GUI_H_
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
#include "opentx.h"
|
||||
|
||||
const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
|
||||
menuRadioSetup,
|
||||
menuRadioSdManager,
|
||||
#if defined(LUA) || defined(PXX2)
|
||||
menuRadioTools,
|
||||
#endif
|
||||
menuRadioSdManager,
|
||||
menuRadioSetup,
|
||||
menuRadioSpecialFunctions,
|
||||
menuRadioTrainer,
|
||||
menuRadioHardware,
|
||||
|
||||
@@ -39,7 +39,7 @@ void menuFirstCalib(event_t event);
|
||||
void menuMainViewChannelsMonitor(event_t event);
|
||||
void menuChannelsView(event_t event);
|
||||
void menuMainView(event_t event);
|
||||
void menuViewTelemetryFrsky(event_t event);
|
||||
void menuViewTelemetry(event_t event);
|
||||
void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext);
|
||||
void menuModelNotes(event_t event);
|
||||
void menuStatisticsView(event_t event);
|
||||
@@ -52,11 +52,11 @@ void menuTraceBuffer(event_t event);
|
||||
#endif
|
||||
|
||||
enum MenuRadioIndexes {
|
||||
MENU_RADIO_SETUP,
|
||||
MENU_RADIO_SD_MANAGER,
|
||||
#if defined(LUA) || defined(PXX2) || defined(MULTIMODULE)
|
||||
MENU_RADIO_TOOLS,
|
||||
#endif
|
||||
MENU_RADIO_SD_MANAGER,
|
||||
MENU_RADIO_SETUP,
|
||||
MENU_RADIO_SPECIAL_FUNCTIONS,
|
||||
MENU_RADIO_TRAINER,
|
||||
MENU_RADIO_HARDWARE,
|
||||
|
||||
@@ -86,6 +86,9 @@ void onLimitsMenu(const char *result)
|
||||
copyTrimsToOffset(ch);
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (result == STR_COPY_MIN_MAX_TO_OUTPUTS) {
|
||||
copyMinMaxToOutputs(ch);
|
||||
}
|
||||
}
|
||||
|
||||
void menuModelLimits(event_t event)
|
||||
@@ -142,6 +145,7 @@ void menuModelLimits(event_t event)
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_STICKS_TO_OFS);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_MIN_MAX_TO_OUTPUTS);
|
||||
POPUP_MENU_START(onLimitsMenu);
|
||||
}
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ void menuModelSetup(event_t event)
|
||||
LABEL(InternalModule),
|
||||
INTERNAL_MODULE_TYPE_ROWS,
|
||||
MODULE_CHANNELS_ROWS(INTERNAL_MODULE),
|
||||
IF_NOT_ACCESS_MODULE_RF(INTERNAL_MODULE, IF_INTERNAL_MODULE_ON(isModuleFailsafeAvailable(INTERNAL_MODULE) ? (uint8_t)2 : (uint8_t)1)),
|
||||
IF_NOT_ACCESS_MODULE_RF(INTERNAL_MODULE, IF_INTERNAL_MODULE_ON(isModuleRangeAvailable(INTERNAL_MODULE)? (uint8_t)2 : (uint8_t)1)), // RxNum, Range check and Register buttons
|
||||
IF_ACCESS_MODULE_RF(INTERNAL_MODULE, 0), // RxNum for ACCESS
|
||||
IF_INTERNAL_MODULE_ON(FAILSAFE_ROWS(INTERNAL_MODULE)), // Failsafe
|
||||
IF_ACCESS_MODULE_RF(INTERNAL_MODULE, 1), // Range check and Register buttons
|
||||
|
||||
@@ -455,7 +455,7 @@ void menuMainView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_MENU):
|
||||
pushMenu(menuRadioSetup);
|
||||
pushMenu(menuRadioTools);
|
||||
killEvents(event);
|
||||
break;
|
||||
#endif
|
||||
@@ -470,7 +470,7 @@ void menuMainView(event_t event)
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(menuViewTelemetryFrsky);
|
||||
chainMenu(menuViewTelemetry);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
|
||||
@@ -200,65 +200,3 @@ bool displayTelemetryScreen()
|
||||
return true;
|
||||
}
|
||||
|
||||
enum NavigationDirection {
|
||||
none,
|
||||
up,
|
||||
down
|
||||
};
|
||||
|
||||
#define decrTelemetryScreen() direction = up
|
||||
#define incrTelemetryScreen() direction = down
|
||||
|
||||
void menuViewTelemetryFrsky(event_t event)
|
||||
{
|
||||
enum NavigationDirection direction = none;
|
||||
|
||||
switch (event) {
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
killEvents(event);
|
||||
// no break;
|
||||
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
decrTelemetryScreen();
|
||||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_PAGE):
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
incrTelemetryScreen();
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
|
||||
if (direction == up) {
|
||||
if (s_frsky_view-- == 0)
|
||||
s_frsky_view = TELEMETRY_VIEW_MAX;
|
||||
}
|
||||
else if (direction == down) {
|
||||
if (s_frsky_view++ == TELEMETRY_VIEW_MAX)
|
||||
s_frsky_view = 0;
|
||||
}
|
||||
else {
|
||||
direction = down;
|
||||
}
|
||||
if (displayTelemetryScreen()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
drawTelemetryTopBar();
|
||||
lcdDrawText(8*FW, 3*FH, "No Telemetry Screens");
|
||||
displayRssiLine();
|
||||
}
|
||||
|
||||
@@ -64,6 +64,10 @@ const uint8_t LBM_TOPMENU_TXBATT[] = {
|
||||
#include "mask_txbat.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_TXBATT_CHARGING[] = {
|
||||
#include "mask_txbat_charging.lbm"
|
||||
};
|
||||
|
||||
const uint8_t LBM_TOPMENU_ANTENNA[] = {
|
||||
#include "mask_antenna.lbm"
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@ extern const uint8_t LBM_TOPMENU_VOLUME_3[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_4[];
|
||||
extern const uint8_t LBM_TOPMENU_VOLUME_SCALE[];
|
||||
extern const uint8_t LBM_TOPMENU_TXBATT[];
|
||||
extern const uint8_t LBM_TOPMENU_TXBATT_CHARGING[];
|
||||
extern const uint8_t LBM_HTRIM_FRAME[];
|
||||
extern const uint8_t LBM_VTRIM_FRAME[];
|
||||
extern const uint8_t LBM_TRIM_SHADOW[];
|
||||
|
||||
@@ -56,7 +56,7 @@ bool menuTextView(event_t event)
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_BODY_LINES; i++) {
|
||||
lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + i*FH, reusableBuffer.viewText.lines[i]);
|
||||
lcd->drawTextMaxWidth(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + i * FH, reusableBuffer.viewText.lines[i], 0, LCD_W - 2 * MENUS_MARGIN_LEFT);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@@ -16,6 +16,7 @@ set(GUI_SRC
|
||||
../common/stdlcd/radio_hardware.cpp
|
||||
../common/stdlcd/radio_version.cpp
|
||||
../common/stdlcd/radio_trainer.cpp
|
||||
../common/stdlcd/view_telemetry.cpp
|
||||
model_curve_edit.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -87,23 +87,7 @@ void menuRadioTools(event_t event)
|
||||
|
||||
uint8_t index = 0;
|
||||
|
||||
#if defined(INTERNAL_MODULE_PXX2)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE].information.modelID, MODULE_OPTION_SPECTRUM_ANALYSER))
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_INT, menuRadioSpectrumAnalyser, INTERNAL_MODULE);
|
||||
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE].information.modelID, MODULE_OPTION_POWER_METER))
|
||||
addRadioModuleTool(index++, STR_POWER_METER_INT, menuRadioPowerMeter, INTERNAL_MODULE);
|
||||
#elif defined(INTERNAL_MODULE_MULTI)
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_INT, menuRadioSpectrumAnalyser, INTERNAL_MODULE);
|
||||
#endif
|
||||
#if defined(PXX2)|| defined(MULTIMODULE)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE].information.modelID, MODULE_OPTION_SPECTRUM_ANALYSER) || isModuleMultimodule(EXTERNAL_MODULE))
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_EXT, menuRadioSpectrumAnalyser, EXTERNAL_MODULE);
|
||||
#endif
|
||||
#if defined(PXX2)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE].information.modelID, MODULE_OPTION_POWER_METER))
|
||||
addRadioModuleTool(index++, STR_POWER_METER_EXT, menuRadioPowerMeter, EXTERNAL_MODULE);
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
FILINFO fno;
|
||||
@@ -127,6 +111,24 @@ void menuRadioTools(event_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(INTERNAL_MODULE_PXX2)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE].information.modelID, MODULE_OPTION_SPECTRUM_ANALYSER))
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_INT, menuRadioSpectrumAnalyser, INTERNAL_MODULE);
|
||||
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[INTERNAL_MODULE].information.modelID, MODULE_OPTION_POWER_METER))
|
||||
addRadioModuleTool(index++, STR_POWER_METER_INT, menuRadioPowerMeter, INTERNAL_MODULE);
|
||||
#elif defined(INTERNAL_MODULE_MULTI)
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_INT, menuRadioSpectrumAnalyser, INTERNAL_MODULE);
|
||||
#endif
|
||||
#if defined(PXX2)|| defined(MULTIMODULE)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE].information.modelID, MODULE_OPTION_SPECTRUM_ANALYSER) || isModuleMultimodule(EXTERNAL_MODULE))
|
||||
addRadioModuleTool(index++, STR_SPECTRUM_ANALYSER_EXT, menuRadioSpectrumAnalyser, EXTERNAL_MODULE);
|
||||
#endif
|
||||
#if defined(PXX2)
|
||||
if (isPXX2ModuleOptionAvailable(reusableBuffer.hardwareAndSettings.modules[EXTERNAL_MODULE].information.modelID, MODULE_OPTION_POWER_METER))
|
||||
addRadioModuleTool(index++, STR_POWER_METER_EXT, menuRadioPowerMeter, EXTERNAL_MODULE);
|
||||
#endif
|
||||
|
||||
if (index == 0) {
|
||||
lcdDrawCenteredText(LCD_H/2, STR_NO_TOOLS);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
extern bool displayTelemetryScreen();
|
||||
extern void displayRssiLine();
|
||||
|
||||
enum NavigationDirection {
|
||||
NAVIGATION_DIRECTION_NONE,
|
||||
NAVIGATION_DIRECTION_UP,
|
||||
NAVIGATION_DIRECTION_DOWN
|
||||
};
|
||||
#define decrTelemetryScreen() direction = NAVIGATION_DIRECTION_UP
|
||||
#define incrTelemetryScreen() direction = NAVIGATION_DIRECTION_DOWN
|
||||
|
||||
#if defined(NAVIGATION_XLITE)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_LEFT) && IS_SHIFT_PRESSED())
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_RIGHT) && IS_SHIFT_PRESSED())
|
||||
#elif defined(NAVIGATION_X7) || defined(NAVIGATION_X9D)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_PAGE))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_BREAK(KEY_PAGE))
|
||||
#elif defined(NAVIGATION_9X)
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_LONG(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_LONG(KEY_DOWN))
|
||||
#else
|
||||
#define EVT_KEY_PREVIOUS_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_UP))
|
||||
#define EVT_KEY_NEXT_VIEW(evt) (evt == EVT_KEY_FIRST(KEY_DOWN))
|
||||
#endif
|
||||
|
||||
void menuViewTelemetry(event_t event)
|
||||
{
|
||||
enum NavigationDirection direction = NAVIGATION_DIRECTION_NONE;
|
||||
|
||||
if (event == EVT_KEY_FIRST(KEY_EXIT) && TELEMETRY_SCREEN_TYPE(s_frsky_view) != TELEMETRY_SCREEN_TYPE_SCRIPT) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#if defined(LUA)
|
||||
else if (event == EVT_KEY_LONG(KEY_EXIT)) {
|
||||
killEvents(event);
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
#endif
|
||||
else if (EVT_KEY_PREVIOUS_VIEW(event)) {
|
||||
killEvents(event);
|
||||
decrTelemetryScreen();
|
||||
}
|
||||
else if (EVT_KEY_NEXT_VIEW(event)) {
|
||||
killEvents(event);
|
||||
incrTelemetryScreen();
|
||||
}
|
||||
else if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_TELEMETRY);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET_FLIGHT);
|
||||
POPUP_MENU_START(onMainViewMenu);
|
||||
}
|
||||
|
||||
for (int i=0; i<=TELEMETRY_SCREEN_TYPE_MAX; i++) {
|
||||
if (direction == NAVIGATION_DIRECTION_UP) {
|
||||
if (s_frsky_view-- == 0)
|
||||
s_frsky_view = TELEMETRY_VIEW_MAX;
|
||||
}
|
||||
else if (direction == NAVIGATION_DIRECTION_DOWN) {
|
||||
if (s_frsky_view++ == TELEMETRY_VIEW_MAX)
|
||||
s_frsky_view = 0;
|
||||
}
|
||||
else {
|
||||
direction = NAVIGATION_DIRECTION_DOWN;
|
||||
}
|
||||
if (displayTelemetryScreen()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
drawTelemetryTopBar();
|
||||
lcdDrawText(LCD_W / 2, 3 * FH, "No Telemetry Screens", CENTERED);
|
||||
displayRssiLine();
|
||||
}
|
||||
|
||||
#undef EVT_KEY_PREVIOUS_VIEW
|
||||
#undef EVT_KEY_NEXT_VIEW
|
||||
@@ -528,7 +528,7 @@ bool multiFlashFirmware(uint8_t moduleIdx, const char * filename)
|
||||
|
||||
pausePulses();
|
||||
|
||||
#if defined(INTERNAL_MODULE_MULTI)
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
uint8_t intPwr = IS_INTERNAL_MODULE_ON();
|
||||
INTERNAL_MODULE_OFF();
|
||||
#endif
|
||||
@@ -546,7 +546,7 @@ bool multiFlashFirmware(uint8_t moduleIdx, const char * filename)
|
||||
|
||||
/* wait 2s off */
|
||||
watchdogSuspend(500 /*5s*/);
|
||||
RTOS_WAIT_MS(2000);
|
||||
RTOS_WAIT_MS(3000);
|
||||
|
||||
const char * result = driver->flashFirmware(&file, getBasename(filename));
|
||||
f_close(&file);
|
||||
@@ -575,7 +575,7 @@ bool multiFlashFirmware(uint8_t moduleIdx, const char * filename)
|
||||
// reset telemetry protocol
|
||||
telemetryInit(255);
|
||||
|
||||
#if defined(INTERNAL_MODULE_MULTI)
|
||||
#if defined(HARDWARE_INTERNAL_MODULE)
|
||||
if (intPwr) {
|
||||
INTERNAL_MODULE_ON();
|
||||
setupPulsesInternalModule();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#if defined(PCBX12S)
|
||||
#include "lua/lua_exports_x12s.inc" // this line must be after lua headers
|
||||
#elif defined(RADIO_T16)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#include "lua/lua_exports_t16.inc"
|
||||
#elif defined(PCBX10)
|
||||
#include "lua/lua_exports_x10.inc"
|
||||
@@ -456,6 +456,10 @@ static int luaSportTelemetryPush(lua_State * L)
|
||||
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
|
||||
return 1;
|
||||
}
|
||||
else if (lua_gettop(L) > int(sizeof(SportTelemetryPacket))) {
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint16_t dataId = luaL_checkunsigned(L, 3);
|
||||
|
||||
@@ -653,6 +657,10 @@ static int luaCrossfireTelemetryPush(lua_State * L)
|
||||
if (lua_gettop(L) == 0) {
|
||||
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
|
||||
}
|
||||
else if (lua_gettop(L) > TELEMETRY_OUTPUT_BUFFER_SIZE ) {
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
else if (outputTelemetryBuffer.isAvailable()) {
|
||||
uint8_t command = luaL_checkunsigned(L, 1);
|
||||
luaL_checktype(L, 2, LUA_TTABLE);
|
||||
|
||||
@@ -71,6 +71,8 @@ Draw a single pixel at (x,y) position
|
||||
|
||||
@param y (positive number) y position
|
||||
|
||||
@param flags (optional) lcdflags
|
||||
|
||||
@notice Taranis has an LCD display width of 212 pixels and height of 64 pixels.
|
||||
Position (0,0) is at top left. Y axis is negative, top line is 0,
|
||||
bottom line is 63. Drawing on an existing black pixel produces white pixel (TODO check this!)
|
||||
@@ -82,7 +84,8 @@ static int luaLcdDrawPoint(lua_State *L)
|
||||
if (!luaLcdAllowed) return 0;
|
||||
int x = luaL_checkinteger(L, 1);
|
||||
int y = luaL_checkinteger(L, 2);
|
||||
lcdDrawPoint(x, y);
|
||||
LcdFlags att = luaL_optunsigned(L, 3, 0);
|
||||
lcdDrawPoint(x, y, att);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -95,14 +98,14 @@ Draw a straight line on LCD
|
||||
|
||||
@param x2,y2 (positive numbers) end coordinate
|
||||
|
||||
@param pattern TODO
|
||||
@param pattern SOLID or DOTTED
|
||||
|
||||
@param flags TODO
|
||||
@param flags lcdflags
|
||||
|
||||
@notice If the start or the end of the line is outside the LCD dimensions, then the
|
||||
whole line will not be drawn (starting from OpenTX 2.1.5)
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, flags introduced in 2.3.6
|
||||
*/
|
||||
static int luaLcdDrawLine(lua_State *L)
|
||||
{
|
||||
|
||||
@@ -182,8 +182,9 @@ Get model timer parameters
|
||||
* `countdownBeep` (number) countdown beep (0 = silent, 1 = beeps, 2 = voice)
|
||||
* `minuteBeep` (boolean) minute beep
|
||||
* `persistent` (number) persistent timer
|
||||
* `name` (string) timer name
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, name added in 2.3.6
|
||||
*/
|
||||
static int luaModelGetTimer(lua_State *L)
|
||||
{
|
||||
@@ -197,6 +198,7 @@ static int luaModelGetTimer(lua_State *L)
|
||||
lua_pushtableinteger(L, "countdownBeep", timer.countdownBeep);
|
||||
lua_pushtableboolean(L, "minuteBeep", timer.minuteBeep);
|
||||
lua_pushtableinteger(L, "persistent", timer.persistent);
|
||||
lua_pushtablezstring(L, "name", timer.name);
|
||||
}
|
||||
else {
|
||||
lua_pushnil(L);
|
||||
@@ -216,7 +218,7 @@ Set model timer parameters
|
||||
@notice If a parameter is missing from the value, then
|
||||
that parameter remains unchanged.
|
||||
|
||||
@status current Introduced in 2.0.0
|
||||
@status current Introduced in 2.0.0, name added in 2.3.6
|
||||
*/
|
||||
static int luaModelSetTimer(lua_State *L)
|
||||
{
|
||||
@@ -246,6 +248,10 @@ static int luaModelSetTimer(lua_State *L)
|
||||
else if (!strcmp(key, "persistent")) {
|
||||
timer.persistent = luaL_checkinteger(L, -1);
|
||||
}
|
||||
if (!strcmp(key, "name")) {
|
||||
const char * name = luaL_checkstring(L, -1);
|
||||
str2zchar(timer.name, name, sizeof(timer.name));
|
||||
}
|
||||
}
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
@@ -953,7 +953,7 @@ bool luaDoOneRunPermanentScript(event_t evt, int i, uint32_t scriptType)
|
||||
TelemetryScriptData & script = g_model.screens[sid.reference-SCRIPT_TELEMETRY_FIRST].script;
|
||||
filename = script.file;
|
||||
#endif
|
||||
if ((scriptType & RUN_TELEM_FG_SCRIPT) && (menuHandlers[0]==menuViewTelemetryFrsky && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
|
||||
if ((scriptType & RUN_TELEM_FG_SCRIPT) && (menuHandlers[0]==menuViewTelemetry && sid.reference==SCRIPT_TELEMETRY_FIRST+s_frsky_view)) {
|
||||
lua_rawgeti(lsScripts, LUA_REGISTRYINDEX, sid.run);
|
||||
lua_pushunsigned(lsScripts, evt);
|
||||
inputsCount = 1;
|
||||
|
||||
@@ -1767,6 +1767,25 @@ void copyTrimsToOffset(uint8_t ch)
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
void copyMinMaxToOutputs(uint8_t ch)
|
||||
{
|
||||
LimitData *ld = limitAddress(ch);
|
||||
int16_t min = ld->min;
|
||||
int16_t max = ld->max;
|
||||
int16_t center = ld->ppmCenter;
|
||||
|
||||
pauseMixerCalculations();
|
||||
|
||||
for (uint8_t chan = 0; chan < MAX_OUTPUT_CHANNELS; chan++) {
|
||||
ld = limitAddress(chan);
|
||||
ld->min = min;
|
||||
ld->max = max;
|
||||
ld->ppmCenter = center;
|
||||
}
|
||||
|
||||
resumeMixerCalculations();
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
|
||||
#if defined(STARTUP_ANIMATION)
|
||||
|
||||
|
||||
@@ -563,7 +563,7 @@ bool setTrimValue(uint8_t phase, uint8_t idx, int trim);
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#define ROTARY_ENCODER_GRANULARITY (2 << g_eeGeneral.rotarySteps)
|
||||
#elif defined(RADIO_T16)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#define ROTARY_ENCODER_GRANULARITY (1)
|
||||
#else
|
||||
#define ROTARY_ENCODER_GRANULARITY (2)
|
||||
@@ -851,6 +851,7 @@ void instantTrim();
|
||||
void evalTrims();
|
||||
void copyTrimsToOffset(uint8_t ch);
|
||||
void copySticksToOffset(uint8_t ch);
|
||||
void copyMinMaxToOutputs(uint8_t ch);
|
||||
void moveTrimsToOffsets();
|
||||
|
||||
typedef uint16_t ACTIVE_PHASES_TYPE;
|
||||
@@ -1339,9 +1340,7 @@ extern uint16_t s_anaFilt[NUM_ANALOGS];
|
||||
#if defined(JITTER_MEASURE)
|
||||
extern JitterMeter<uint16_t> rawJitter[NUM_ANALOGS];
|
||||
extern JitterMeter<uint16_t> avgJitter[NUM_ANALOGS];
|
||||
#if defined(PCBHORUS)
|
||||
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuStatsAnalogs)
|
||||
#elif defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS) || defined(PCBTARANIS)
|
||||
#define JITTER_MEASURE_ACTIVE() (menuHandlers[menuLevel] == menuRadioDiagAnalogs)
|
||||
#elif defined(CLI)
|
||||
#define JITTER_MEASURE_ACTIVE() (1)
|
||||
|
||||
@@ -471,6 +471,11 @@ inline bool isModuleBindRangeAvailable(uint8_t moduleIdx)
|
||||
return isModulePXX2(moduleIdx) || isModulePXX1(moduleIdx) || isModuleDSM2(moduleIdx) || isModuleMultimodule(moduleIdx);
|
||||
}
|
||||
|
||||
inline bool isModuleRangeAvailable(uint8_t moduleIdx)
|
||||
{
|
||||
return isModuleXJTD16(moduleIdx) || isModuleXJTLR12(moduleIdx);
|
||||
}
|
||||
|
||||
constexpr uint8_t MAX_RXNUM = 63;
|
||||
|
||||
inline uint8_t getMaxRxNum(uint8_t idx)
|
||||
|
||||
@@ -380,7 +380,7 @@ bool setupPulsesInternalModule(uint8_t protocol)
|
||||
#endif
|
||||
|
||||
default:
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, 50/*ms*/);
|
||||
scheduleNextMixerCalculation(INTERNAL_MODULE, 10 /*ms*/); // used for USB sim for example
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||