@@ -0,0 +1,17 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 180
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 90
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- Bug
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
@@ -40,8 +40,7 @@ Michael Byrne
|
||||
<a href="http://www.craftandtheoryllc.com">Craft & Theory (monthly)</a>
|
||||
<a href="https://alofthobbies.com/taranis-q-x7--opentx-user-manual.html">OpenTX Manuals by Lothar Thole</a>
|
||||
<a href="https://www.team-blacksheep.com">Team BlackSheep</a>
|
||||
<a href="https://www.3dxr.co.uk">Team BlackSheep</a>
|
||||
www.3dxr.co.uk
|
||||
<a href="https://www.3dxr.co.uk">3DXR</a>
|
||||
|
||||
[People who have donated to OpenTX]
|
||||
Mario Sette
|
||||
@@ -1518,3 +1517,19 @@ Jean Gaillard
|
||||
Michel Garbarino
|
||||
For Our Better World
|
||||
Lothar Herrl
|
||||
James Rhodes
|
||||
Edward Glover
|
||||
James Snodgrass
|
||||
Dwayne Carden
|
||||
Gerald Migely
|
||||
Mark Schmidt
|
||||
Hendrik Goessaert
|
||||
Arturas Giedraitis
|
||||
Paul Vernon
|
||||
Rick Smith
|
||||
Marcin Galczynski
|
||||
Tom Knudtson
|
||||
Sascha Heinrich
|
||||
James Snodgrass
|
||||
Alain Labonne
|
||||
Darko Perković
|
||||
|
||||
@@ -404,6 +404,7 @@ elseif(WIN32)
|
||||
set(wdqtopts ${wdqtopts} -dir "\"${INSTALL_DESTINATION}\"" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release/${COMPANION_NAME}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release/${SIMULATOR_NAME}.exe")
|
||||
|
||||
# Add installer command to execute windeployqt
|
||||
message(STATUS "windeployqt command: ${QT_BIN_DIR}/windeployqt.exe ${wdqtopts}")
|
||||
install(CODE "execute_process(COMMAND \"${QT_BIN_DIR}/windeployqt.exe\" ${wdqtopts})")
|
||||
|
||||
# SDL dll
|
||||
|
||||
@@ -26,7 +26,17 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
@@ -35,7 +45,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="profileTab">
|
||||
<attribute name="title">
|
||||
@@ -51,40 +61,22 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="optionsLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="4">
|
||||
<widget class="QWidget" name="widget_splashImage" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
@@ -734,31 +726,6 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="OpenTxBranch">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Use releases (stable)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Use releases and release candidates (testing)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Use nightly builds (unstable)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
@@ -810,7 +777,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<item row="21" column="0">
|
||||
<widget class="QLabel" name="ge_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
@@ -823,7 +790,24 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="11" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="showSplash">
|
||||
<property name="text">
|
||||
<string>Show splash screen when Companion starts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
@@ -836,13 +820,6 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
@@ -856,17 +833,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="showSplash">
|
||||
<property name="text">
|
||||
<string>Show splash screen when Companion starts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="13" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="backupPath">
|
||||
@@ -890,7 +857,14 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="17" column="1">
|
||||
<item row="4" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="libraryPath">
|
||||
@@ -917,7 +891,17 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<item row="10" column="1">
|
||||
<widget class="QCheckBox" name="opt_removeBlankSlots">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option maintains the behaviour from older OpenTx versions where empty model slots are preserved when a model is deleted or moved. </p><p>When this option is de-selected, the other models may be re-arranged to fill the gap left by the removed model.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove empty model slots when deleting models (only applies for radios w/out categories)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<widget class="QLabel" name="lbl_appLogsDir">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
@@ -930,24 +914,20 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="23" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Debug Output Logging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="opt_removeBlankSlots">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option maintains the behaviour from older OpenTx versions where empty model slots are preserved when a model is deleted or moved. </p><p>When this option is de-selected, the other models may be re-arranged to fill the gap left by the removed model.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove empty model slots when deleting models (only applies for radios w/out categories)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="opt_newMdl_useWizard">
|
||||
@@ -981,7 +961,7 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QCheckBox" name="backupEnable">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
@@ -994,27 +974,14 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Debug Output Logging</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0" rowspan="2" colspan="2">
|
||||
<item row="19" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="1">
|
||||
<item row="17" column="1">
|
||||
<widget class="QComboBox" name="splashincludeCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@@ -1034,14 +1001,14 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0" rowspan="2" colspan="2">
|
||||
<item row="15" column="0" rowspan="2" colspan="2">
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="1">
|
||||
<item row="21" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_9">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="ge_lineedit">
|
||||
@@ -1065,7 +1032,7 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="23" column="1">
|
||||
<item row="24" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="appLogsDir">
|
||||
@@ -1086,7 +1053,53 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="22" column="1">
|
||||
<item row="22" column="0" colspan="2">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>User Splash Screens</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Splash Screen Library</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Action on New Model</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="opt_appDebugLog">
|
||||
@@ -1110,50 +1123,36 @@ Mode 4:
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Splash Screen Library</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0" colspan="2">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>User Splash Screens</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<widget class="QLabel" name="label_18">
|
||||
<property name="text">
|
||||
<string>Release channel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="OpenTxBranch">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Action on New Model</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Releases (stable)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Release candidates (testing)</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Nightly builds (unstable)</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -1410,20 +1409,9 @@ Mode 4:
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>profileNameLE</tabstop>
|
||||
<tabstop>boardCB</tabstop>
|
||||
<tabstop>sdPath</tabstop>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define CPN_MAX_MODULES 2
|
||||
#define CPN_MAX_STICKS Board::STICK_AXIS_COUNT
|
||||
#define CPN_MAX_TRIMS Board::TRIM_AXIS_COUNT
|
||||
#define CPN_MAX_KNOBS 4
|
||||
#define CPN_MAX_KNOBS 8
|
||||
#define CPN_MAX_SLIDERS 4
|
||||
#define CPN_MAX_POTS (CPN_MAX_KNOBS + CPN_MAX_SLIDERS)
|
||||
#define CPN_MAX_CYC 3
|
||||
|
||||
@@ -70,6 +70,7 @@ uint32_t Boards::getFourCC(Type board)
|
||||
return 0x3578746F;
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9DP_2019:
|
||||
return 0x3378746F;
|
||||
case BOARD_TARANIS_X9LITE:
|
||||
return 0x3C78746F;
|
||||
@@ -113,6 +114,7 @@ const int Boards::getEEpromSize(Board::Type board)
|
||||
case BOARD_TARANIS_X9LITE:
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9DP_2019:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_JUMPER_T12:
|
||||
return EESIZE_TARANIS;
|
||||
@@ -147,6 +149,7 @@ const int Boards::getFlashSize(Type board)
|
||||
case BOARD_TARANIS_X9LITE:
|
||||
case BOARD_TARANIS_X9D:
|
||||
case BOARD_TARANIS_X9DP:
|
||||
case BOARD_TARANIS_X9DP_2019:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_JUMPER_T12:
|
||||
return FSIZE_TARANIS;
|
||||
@@ -223,7 +226,7 @@ const SwitchInfo Boards::getSwitchInfo(Board::Type board, int index)
|
||||
{SWITCH_2POS, "SF"},
|
||||
{SWITCH_3POS, "SG"},
|
||||
{SWITCH_TOGGLE, "SH"},
|
||||
{SWITCH_3POS, "SI"},
|
||||
{board == Board::BOARD_TARANIS_X9DP_2019 ? SWITCH_TOGGLE : SWITCH_3POS, "SI"},
|
||||
{SWITCH_3POS, "SJ"},
|
||||
{SWITCH_3POS, "SK"},
|
||||
{SWITCH_3POS, "SL"},
|
||||
@@ -267,9 +270,19 @@ const 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))
|
||||
return 5;
|
||||
else if (IS_HORUS_X12S(board))
|
||||
return 3;
|
||||
else
|
||||
return 3;
|
||||
|
||||
case PotsStorage:
|
||||
if (IS_HORUS(board))
|
||||
return 5;
|
||||
else
|
||||
return getCapability(board, Pots);
|
||||
|
||||
case FactoryInstalledPots:
|
||||
if (IS_TARANIS_X9(board))
|
||||
return 2;
|
||||
@@ -284,8 +297,14 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
else
|
||||
return 0;
|
||||
|
||||
case SlidersStorage:
|
||||
if (IS_HORUS_X10(board))
|
||||
return 4;
|
||||
else
|
||||
return getCapability(board, Sliders);
|
||||
|
||||
case MouseAnalogs:
|
||||
if (IS_HORUS_X12S(board))
|
||||
if (IS_HORUS(board))
|
||||
return 2;
|
||||
else
|
||||
return 0;
|
||||
@@ -317,9 +336,13 @@ const int Boards::getCapability(Board::Type board, Board::Capability capability)
|
||||
else if (IS_TARANIS_XLITES(board))
|
||||
return 6;
|
||||
else if (IS_TARANIS_XLITE(board))
|
||||
return 4;
|
||||
else if (IS_HORUS_OR_TARANIS(board))
|
||||
return 6;
|
||||
else if (IS_TARANIS(board))
|
||||
return 8;
|
||||
else if (board == Board::BOARD_TARANIS_X9DP_2019)
|
||||
return 9;
|
||||
else if (IS_HORUS(board))
|
||||
return 10;
|
||||
else
|
||||
return 7;
|
||||
|
||||
@@ -445,6 +468,8 @@ const QString Boards::getAnalogInputName(Board::Type board, int index)
|
||||
"S1",
|
||||
"6P",
|
||||
"S2",
|
||||
"EX1",
|
||||
"EX2",
|
||||
"LS",
|
||||
"RS"
|
||||
};
|
||||
@@ -483,6 +508,8 @@ const QString Boards::getBoardName(Board::Type board)
|
||||
return "Taranis X9D";
|
||||
case BOARD_TARANIS_X9DP:
|
||||
return "Taranis X9D+";
|
||||
case BOARD_TARANIS_X9DP_2019:
|
||||
return "Taranis X9D+ 2019";
|
||||
case BOARD_TARANIS_X9E:
|
||||
return "Taranis X9E";
|
||||
case BOARD_TARANIS_X9LITE:
|
||||
|
||||
@@ -42,13 +42,14 @@ namespace Board {
|
||||
BOARD_TARANIS_X7,
|
||||
BOARD_TARANIS_X9D,
|
||||
BOARD_TARANIS_X9DP,
|
||||
BOARD_TARANIS_X9DP_2019,
|
||||
BOARD_TARANIS_X9E,
|
||||
BOARD_X12S,
|
||||
BOARD_X10,
|
||||
BOARD_TARANIS_XLITE,
|
||||
BOARD_TARANIS_XLITES,
|
||||
BOARD_TARANIS_X9LITE,
|
||||
BOARD_JUMPER_T12
|
||||
BOARD_JUMPER_T12,
|
||||
};
|
||||
|
||||
constexpr int BOARD_TYPE_MAX = BOARD_JUMPER_T12 ;
|
||||
@@ -113,8 +114,10 @@ namespace Board {
|
||||
enum Capability {
|
||||
Sticks,
|
||||
Pots,
|
||||
PotsStorage,
|
||||
FactoryInstalledPots,
|
||||
Sliders,
|
||||
SlidersStorage,
|
||||
MouseAnalogs,
|
||||
GyroAnalogs,
|
||||
MaxAnalogs,
|
||||
@@ -196,8 +199,8 @@ class Boards
|
||||
#define IS_TARANIS_XLITES(board) (board==Board::BOARD_TARANIS_XLITES)
|
||||
#define IS_TARANIS_X7(board) (board==Board::BOARD_TARANIS_X7)
|
||||
#define IS_TARANIS_X9LITE(board) (board==Board::BOARD_TARANIS_X9LITE)
|
||||
#define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP)
|
||||
#define IS_TARANIS_X9(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9DP_2019 || board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9D(board) (board==Board::BOARD_TARANIS_X9D || board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9DP_2019)
|
||||
#define IS_TARANIS_PLUS(board) (board==Board::BOARD_TARANIS_X9DP || board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9E(board) (board==Board::BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS(board) (IS_TARANIS_X9(board) || IS_TARANIS_X7(board) || IS_TARANIS_X9LITE(board) || IS_TARANIS_XLITE(board) || IS_JUMPER_T12(board))
|
||||
|
||||
@@ -148,7 +148,8 @@ enum Capability {
|
||||
HasBatMeterRange,
|
||||
DangerousFunctions,
|
||||
HasModelCategories,
|
||||
HasSwitchableJack
|
||||
HasSwitchableJack,
|
||||
PwrButtonPress
|
||||
};
|
||||
|
||||
class EEPROMInterface
|
||||
|
||||
@@ -59,7 +59,7 @@ t_Er9xTrainerMix::operator TrainerMix()
|
||||
|
||||
t_Er9xTrainerData::t_Er9xTrainerData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xTrainerData));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Er9xTrainerData));
|
||||
}
|
||||
|
||||
t_Er9xTrainerData::operator TrainerData ()
|
||||
@@ -74,7 +74,7 @@ t_Er9xTrainerData::operator TrainerData ()
|
||||
|
||||
t_Er9xGeneral::t_Er9xGeneral()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xGeneral));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Er9xGeneral));
|
||||
}
|
||||
|
||||
Er9xGeneral::operator GeneralSettings ()
|
||||
@@ -334,7 +334,7 @@ t_Er9xFrSkyChannelData::operator FrSkyChannelData ()
|
||||
|
||||
t_Er9xFrSkyData::t_Er9xFrSkyData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Er9xFrSkyData));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Er9xFrSkyData));
|
||||
}
|
||||
|
||||
t_Er9xFrSkyData::operator FrSkyData ()
|
||||
|
||||
@@ -259,7 +259,7 @@ PACK(typedef struct t_Er9xModelData {
|
||||
Er9xFlightModeData flightModeData[ER9X_MAX_MODES] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
|
||||
t_Er9xModelData() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Er9xModelData)); }
|
||||
}) Er9xModelData;
|
||||
|
||||
#endif // _ER9XEEPROM_H_
|
||||
|
||||
@@ -54,7 +54,7 @@ RawSwitch ersky9xToSwitch(int8_t sw)
|
||||
|
||||
t_Ersky9xTrainerMix::t_Ersky9xTrainerMix()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xTrainerMix));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xTrainerMix));
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerMix::operator TrainerMix()
|
||||
@@ -69,7 +69,7 @@ t_Ersky9xTrainerMix::operator TrainerMix()
|
||||
|
||||
t_Ersky9xTrainerData::t_Ersky9xTrainerData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xTrainerData));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xTrainerData));
|
||||
}
|
||||
|
||||
t_Ersky9xTrainerData::operator TrainerData ()
|
||||
@@ -84,7 +84,7 @@ t_Ersky9xTrainerData::operator TrainerData ()
|
||||
|
||||
t_Ersky9xGeneral::t_Ersky9xGeneral()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xGeneral));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xGeneral));
|
||||
}
|
||||
|
||||
Ersky9xGeneral::operator GeneralSettings ()
|
||||
@@ -157,7 +157,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
|
||||
t_Ersky9xLimitData::t_Ersky9xLimitData()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xLimitData));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xLimitData));
|
||||
}
|
||||
|
||||
t_Ersky9xLimitData::operator LimitData ()
|
||||
@@ -172,7 +172,7 @@ t_Ersky9xLimitData::operator LimitData ()
|
||||
|
||||
t_Ersky9xMixData_v10::t_Ersky9xMixData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xMixData_v10));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xMixData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xMixData_v10::operator MixData ()
|
||||
@@ -242,7 +242,7 @@ t_Ersky9xMixData_v10::operator MixData ()
|
||||
|
||||
t_Ersky9xMixData_v11::t_Ersky9xMixData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xMixData_v11));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xMixData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xMixData_v11::operator MixData ()
|
||||
@@ -416,17 +416,17 @@ Ersky9xLogicalSwitchData_v11::operator LogicalSwitchData ()
|
||||
|
||||
t_Ersky9xSafetySwData_v10::t_Ersky9xSafetySwData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v10));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xSafetySwData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xSafetySwData_v11::t_Ersky9xSafetySwData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xSafetySwData_v11));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xSafetySwData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v10::t_Ersky9xFrSkyChannelData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v10));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xFrSkyChannelData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v10::operator FrSkyChannelData ()
|
||||
@@ -450,7 +450,7 @@ t_Ersky9xFrSkyChannelData_v10::operator FrSkyChannelData ()
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v11::t_Ersky9xFrSkyChannelData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyChannelData_v11));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xFrSkyChannelData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyChannelData_v11::operator FrSkyChannelData ()
|
||||
@@ -474,7 +474,7 @@ t_Ersky9xFrSkyChannelData_v11::operator FrSkyChannelData ()
|
||||
|
||||
t_Ersky9xFrSkyData_v10::t_Ersky9xFrSkyData_v10()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v10));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xFrSkyData_v10));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v10::operator FrSkyData ()
|
||||
@@ -487,7 +487,7 @@ t_Ersky9xFrSkyData_v10::operator FrSkyData ()
|
||||
|
||||
t_Ersky9xFrSkyData_v11::t_Ersky9xFrSkyData_v11()
|
||||
{
|
||||
memset(this, 0, sizeof(t_Ersky9xFrSkyData_v11));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xFrSkyData_v11));
|
||||
}
|
||||
|
||||
t_Ersky9xFrSkyData_v11::operator FrSkyData ()
|
||||
|
||||
@@ -129,7 +129,7 @@ PACK(typedef struct t_Ersky9xExpoData {
|
||||
int8_t drSw1;
|
||||
int8_t drSw2;
|
||||
|
||||
t_Ersky9xExpoData() { memset(this, 0, sizeof(t_Ersky9xExpoData)); }
|
||||
t_Ersky9xExpoData() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xExpoData)); }
|
||||
}) Ersky9xExpoData;
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ PACK(typedef struct t_Ersky9xLogicalSwitchData_v10 { // Custom Switches data
|
||||
uint8_t func;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v10() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
|
||||
t_Ersky9xLogicalSwitchData_v10() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
|
||||
}) Ersky9xLogicalSwitchData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
|
||||
@@ -207,7 +207,7 @@ PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
|
||||
uint8_t res ;
|
||||
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v11() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
|
||||
t_Ersky9xLogicalSwitchData_v11() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
|
||||
}) Ersky9xLogicalSwitchData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
|
||||
@@ -372,7 +372,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
|
||||
Ersky9xFrSkyData_v10 frsky;
|
||||
Ersky9xTimerMode_v10 timer[2] ;
|
||||
operator ModelData();
|
||||
t_Ersky9xModelData_v10() { memset(this, 0, sizeof(t_Ersky9xModelData_v10)); }
|
||||
t_Ersky9xModelData_v10() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xModelData_v10)); }
|
||||
}) Ersky9xModelData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
@@ -430,7 +430,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Ersky9xModelData_v11() { memset(this, 0, sizeof(t_Ersky9xModelData_v11)); }
|
||||
t_Ersky9xModelData_v11() { memset(reinterpret_cast<void *>(this), 0, sizeof(t_Ersky9xModelData_v11)); }
|
||||
}) Ersky9xModelData_v11;
|
||||
|
||||
#endif // _ERSKY9XEEPROM_H_
|
||||
|
||||
@@ -65,7 +65,7 @@ bool GeneralSettings::isSliderAvailable(int index) const
|
||||
|
||||
GeneralSettings::GeneralSettings()
|
||||
{
|
||||
memset(this, 0, sizeof(GeneralSettings));
|
||||
memset(reinterpret_cast<void *>(this), 0, sizeof(GeneralSettings));
|
||||
|
||||
contrast = 25;
|
||||
|
||||
|
||||
@@ -130,8 +130,6 @@ class GeneralSettings {
|
||||
unsigned int backlightBright;
|
||||
unsigned int backlightOffBright;
|
||||
int switchesDelay;
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
unsigned int mAhWarn;
|
||||
unsigned int mAhUsed;
|
||||
unsigned int globalTimer;
|
||||
@@ -172,6 +170,9 @@ class GeneralSettings {
|
||||
int gyroMax;
|
||||
int gyroOffset;
|
||||
|
||||
int pwrOnSpeed;
|
||||
int pwrOffSpeed;
|
||||
|
||||
bool switchPositionAllowedTaranis(int index) const;
|
||||
bool switchSourceAllowedTaranis(int index) const;
|
||||
bool isPotAvailable(int index) const;
|
||||
|
||||
@@ -311,7 +311,7 @@ void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
|
||||
return;
|
||||
if (p == phaseIdx || phaseIdx == 0) {
|
||||
trim = value;
|
||||
break;;
|
||||
break;
|
||||
}
|
||||
else if (mode == 0) {
|
||||
phaseIdx = p;
|
||||
|
||||
@@ -185,6 +185,7 @@ class ModelData {
|
||||
MavlinkData mavlink;
|
||||
unsigned int telemetryProtocol;
|
||||
FrSkyData frsky;
|
||||
unsigned int rssiSource;
|
||||
RSSIAlarmData rssiAlarms;
|
||||
|
||||
char bitmap[10+1];
|
||||
@@ -203,6 +204,8 @@ class ModelData {
|
||||
|
||||
TopbarData topbarData;
|
||||
|
||||
char registrationId[8+1];
|
||||
|
||||
void clear();
|
||||
bool isEmpty() const;
|
||||
void setDefaultInputs(const GeneralSettings & settings);
|
||||
|
||||
@@ -104,7 +104,10 @@ enum MultiModuleRFProtocols {
|
||||
MODULE_SUBTYPE_MULTI_V911S,
|
||||
MODULE_SUBTYPE_MULTI_GD00X,
|
||||
MODULE_SUBTYPE_MULTI_V761,
|
||||
MODULE_SUBTYPE_MULTI_LAST = MODULE_SUBTYPE_MULTI_V761
|
||||
MODULE_SUBTYPE_MULTI_KF606,
|
||||
MODULE_SUBTYPE_MULTI_REDPINE,
|
||||
MODULE_SUBTYPE_MULTI_POTENSIC,
|
||||
MODULE_SUBTYPE_MULTI_LAST = MODULE_SUBTYPE_MULTI_POTENSIC
|
||||
};
|
||||
|
||||
enum TrainerProtocol {
|
||||
|
||||
@@ -64,6 +64,8 @@ static const QStringList STR_SUBTYPE_HITEC {"Optima", "Optima Hub Telem", "M
|
||||
static const QStringList STR_SUBTYPE_BUGS_MINI {"Standard", "Bugs 3H"};
|
||||
static const QStringList STR_SUBTYPE_E01X {"E012", "E015", "E016H"};
|
||||
static const QStringList STR_SUBTYPE_GD00X {"GD V1", "GD V2"};
|
||||
static const QStringList STR_SUBTYPE_REDPINE {"Fast", "Slow"};
|
||||
static const QStringList STR_SUBTYPE_POTENSIC {"A20 Firefly", " - "};
|
||||
|
||||
static const QStringList NO_SUBTYPE {STR_MULTI_DEFAULT};
|
||||
|
||||
@@ -100,7 +102,11 @@ const Multiprotocols multiProtocols {
|
||||
{MODULE_SUBTYPE_MULTI_HITEC, 2, false, STR_SUBTYPE_HITEC, STR_MULTI_RFTUNE},
|
||||
{MODULE_SUBTYPE_MULTI_BUGS_MINI, 1, false, STR_SUBTYPE_BUGS_MINI, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_E01X, 2, false, STR_SUBTYPE_E01X, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_V911S, 0, false, NO_SUBTYPE, STR_MULTI_RFTUNE},
|
||||
{MODULE_SUBTYPE_MULTI_GD00X, 1, false, STR_SUBTYPE_GD00X, nullptr},
|
||||
{MODULE_SUBTYPE_MULTI_KF606, 0, false, NO_SUBTYPE, STR_MULTI_RFTUNE},
|
||||
{MODULE_SUBTYPE_MULTI_REDPINE, 1, false, STR_SUBTYPE_REDPINE, STR_MULTI_RFTUNE},
|
||||
{MODULE_SUBTYPE_MULTI_POTENSIC, 1, false, STR_SUBTYPE_POTENSIC, nullptr},
|
||||
{MM_RF_CUSTOM_SELECTED, 7, true, STR_SUBTYPE_CUSTOM, STR_MULTI_OPTION},
|
||||
|
||||
// Sentinel and default for protocols not listed above (MM_RF_CUSTOM is 0xff)
|
||||
@@ -142,7 +148,8 @@ QString Multiprotocols::protocolToString(int protocol, bool custom)
|
||||
"FlySky", "Hubsan", "FrSky", "Hisky", "V2x2", "DSM", "Devo", "YD717", "KN", "SymaX", "SLT", "CX10", "CG023",
|
||||
"Bayang", "ESky", "MT99XX", "MJXQ", "Shenqi", "FY326", "SFHSS", "J6 PRO","FQ777","Assan","Hontai","Open LRS",
|
||||
"FlySky AFHDS2A", "Q2x2", "Walkera", "Q303", "GW008", "DM002", "Cabell", "ESky 150", "H8 3D", "Corona", "CFlie",
|
||||
"Hitec", "Wfly", "Bugs", "Bugs Mini", "Traxxas", "NCC-1701-A", "E01X", "V911S", "GD00X", "V761"
|
||||
"Hitec", "Wfly", "Bugs", "Bugs Mini", "Traxxas", "NCC-1701-A", "E01X", "WL Heli V911S", "GD00X", "Volantex V761",
|
||||
"KFPlan KF606", "Redpine", "Potensic"
|
||||
});
|
||||
|
||||
if (protocol == MM_RF_CUSTOM_SELECTED || custom)
|
||||
|
||||
@@ -18,21 +18,59 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
#include "boards.h"
|
||||
#include "helpers.h"
|
||||
#include "opentxeeprom.h"
|
||||
#include "customdebug.h"
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
#include "opentxinterface.h"
|
||||
|
||||
using namespace Board;
|
||||
|
||||
#define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256)
|
||||
#define MAX_SLIDERS(board) (IS_HORUS_X10(board) ? 4 : (Boards::getCapability(board, Board::Sliders))) //TODO need to be remove when x10 eeprom gets fixed
|
||||
#define MAX_MOUSE_ANALOGS(board) (IS_HORUS_X10(board) ? 2 : (Boards::getCapability(board, Board::MouseAnalogs))) //TODO need to be remove when x10 eeprom gets fixed
|
||||
#define MAX_GYRO_ANALOGS(board, version) (version >= 219 ? Boards::getCapability(board, Board::GyroAnalogs) : 0)
|
||||
#define MAX_SWITCHES(board, version) (version <= 218 && IS_TARANIS_X7(board) ? 6 : Boards::getCapability(board, Board::Switches))
|
||||
#define MAX_SWITCH_SLOTS(board, version) (IS_TARANIS_X9E(board) ? 32 : 8) // bitsize of swconfig_t / 2 (see radio/src/datastructs.h)
|
||||
|
||||
inline int MAX_SWITCHES(Board::Type board, int version)
|
||||
{
|
||||
if (version <= 218 && IS_TARANIS_X7(board))
|
||||
return 6;
|
||||
if (version <= 218 && (IS_TARANIS_X9D(board) || IS_HORUS(board)))
|
||||
return 8;
|
||||
return Boards::getCapability(board, Board::Switches);
|
||||
}
|
||||
|
||||
#define MAX_KNOBS(board, version) (IS_HORUS(board) ? 8 : 4)
|
||||
|
||||
inline int MAX_POTS(Board::Type board, int version)
|
||||
{
|
||||
if (version <= 218 && IS_HORUS(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))
|
||||
return 3;
|
||||
return Boards::getCapability(board, Board::PotsStorage);
|
||||
}
|
||||
|
||||
// bitsize of swconfig_t / 2 (see radio/src/datastructs.h)
|
||||
inline int MAX_SWITCH_SLOTS(Board::Type board, int version)
|
||||
{
|
||||
if (IS_TARANIS_X9E(board))
|
||||
return 32;
|
||||
|
||||
if (IS_HORUS(board))
|
||||
return 16;
|
||||
|
||||
if (version >= 219 && IS_TARANIS_X9D(board))
|
||||
return 16;
|
||||
|
||||
return 8;
|
||||
}
|
||||
|
||||
#define MAX_SWITCHES_POSITION(board, version) (Boards::getCapability(board, Board::SwitchPositions))
|
||||
#define MAX_ROTARY_ENCODERS(board) (IS_SKY9X(board) ? 1 : 0)
|
||||
#define MAX_FLIGHT_MODES(board, version) 9
|
||||
@@ -84,7 +122,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
}
|
||||
|
||||
if (IS_HORUS_OR_TARANIS(board)) {
|
||||
for (int i=1; i<=Boards::getCapability(board, Board::Pots)*6; i++) {
|
||||
for (int i=1; i<=MAX_POTS(board, version)*6; i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++);
|
||||
}
|
||||
@@ -206,7 +244,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<CPN_MAX_STICKS+Boards::getCapability(board, Board::Pots)+MAX_SLIDERS(board)+MAX_MOUSE_ANALOGS(board)+MAX_GYRO_ANALOGS(board, version); i++) {
|
||||
for (int i=0; i<CPN_MAX_STICKS+MAX_POTS(board,version)+Boards::getCapability(board, Board::Sliders)+Boards::getCapability(board, Board::MouseAnalogs)+MAX_GYRO_ANALOGS(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_STICK, i), val++);
|
||||
}
|
||||
|
||||
@@ -248,7 +286,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 2), val++); // Timer1
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 3), val++); // Timer2
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 4), val++); // Timer3
|
||||
for (unsigned i=0; i<MAX_TELEMETRY_SENSORS(board, version)*3; ++i) {
|
||||
for (int i=0; i<MAX_TELEMETRY_SENSORS(board, version)*3; ++i) {
|
||||
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
|
||||
}
|
||||
}
|
||||
@@ -757,7 +795,7 @@ class MixField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
virtual void beforeExport() override
|
||||
{
|
||||
if (mix.destCh && mix.srcRaw.type != SOURCE_TYPE_NONE) {
|
||||
_destCh = mix.destCh - 1;
|
||||
@@ -793,7 +831,7 @@ class MixField: public TransformedField {
|
||||
splitGvarParam(mix.sOffset, _offset, _offsetMode, board, version);
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
void afterImport() override
|
||||
{
|
||||
if (mix.srcRaw.type != SOURCE_TYPE_NONE) {
|
||||
mix.destCh = _destCh + 1;
|
||||
@@ -1049,7 +1087,7 @@ class CurvesField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
void beforeExport() override
|
||||
{
|
||||
memset(_points, 0, sizeof(_points));
|
||||
|
||||
@@ -1084,7 +1122,7 @@ class CurvesField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
void afterImport() override
|
||||
{
|
||||
int * cur = &_points[0];
|
||||
|
||||
@@ -1170,61 +1208,6 @@ class LogicalSwitchesFunctionsTable: public ConversionTable {
|
||||
}
|
||||
};
|
||||
|
||||
class AndSwitchesConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
AndSwitchesConversionTable(Board::Type board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
|
||||
|
||||
if (IS_STM32(board)) {
|
||||
for (int i=1; i<=MAX_SWITCHES_POSITION(board, version); i++) {
|
||||
int s = switchIndex(i, board, version);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
for (int i=1; i<=8; i++) {
|
||||
int s = switchIndex(i, board, version);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i=1; i<=9; i++) {
|
||||
int s = switchIndex(i, board, version);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
for (int i=1; i<=7; i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static ConversionTable * getInstance(Board::Type board, unsigned int version)
|
||||
{
|
||||
return new SwitchesConversionTable(board, version);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void addConversion(const RawSwitch & sw, const int b)
|
||||
{
|
||||
ConversionTable::addConversion(sw.toValue(), b);
|
||||
}
|
||||
};
|
||||
|
||||
class LogicalSwitchField: public TransformedField {
|
||||
public:
|
||||
LogicalSwitchField(DataField * parent, LogicalSwitchData & csw, Board::Type board, unsigned int version, unsigned int variant, ModelData * model=nullptr):
|
||||
@@ -1238,7 +1221,6 @@ class LogicalSwitchField: public TransformedField {
|
||||
functionsConversionTable(board, version),
|
||||
sourcesConversionTable(SourcesConversionTable::getInstance(board, version, variant, 0)),
|
||||
switchesConversionTable(SwitchesConversionTable::getInstance(board, version)),
|
||||
andswitchesConversionTable(AndSwitchesConversionTable::getInstance(board, version)),
|
||||
v1(0),
|
||||
v2(0),
|
||||
v3(0)
|
||||
@@ -1247,7 +1229,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(this, csw.func, &functionsConversionTable, "Function"));
|
||||
internalField.Append(new SignedField<10>(this, v1));
|
||||
internalField.Append(new SignedField<10>(this, v3));
|
||||
internalField.Append(new ConversionField< SignedField<9> >(this, (int &)csw.andsw, andswitchesConversionTable, "AND switch"));
|
||||
internalField.Append(new ConversionField< SignedField<9> >(this, (int &)csw.andsw, switchesConversionTable, "AND switch"));
|
||||
internalField.Append(new SpareBitsField<1>(this)); // TODO extra switch mode
|
||||
internalField.Append(new SpareBitsField<2>(this));
|
||||
internalField.Append(new SignedField<16>(this, v2));
|
||||
@@ -1263,16 +1245,15 @@ class LogicalSwitchField: public TransformedField {
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(this, csw.delay, 0, scale));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(this, csw.duration, 0, scale));
|
||||
if (version == 217) {
|
||||
internalField.Append(new ConversionField< SignedField<8> >(this, (int &)csw.andsw, andswitchesConversionTable, "AND switch"));
|
||||
internalField.Append(new ConversionField< SignedField<8> >(this, (int &)csw.andsw, switchesConversionTable, "AND switch"));
|
||||
}
|
||||
}
|
||||
|
||||
~LogicalSwitchField()
|
||||
{
|
||||
delete andswitchesConversionTable;
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
void beforeExport() override
|
||||
{
|
||||
if (csw.func == LS_FN_TIMER) {
|
||||
v1 = csw.val1;
|
||||
@@ -1297,7 +1278,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
void afterImport() override
|
||||
{
|
||||
if (csw.func == LS_FN_TIMER) {
|
||||
csw.val1 = v1;
|
||||
@@ -1334,7 +1315,6 @@ class LogicalSwitchField: public TransformedField {
|
||||
LogicalSwitchesFunctionsTable functionsConversionTable;
|
||||
SourcesConversionTable * sourcesConversionTable;
|
||||
SwitchesConversionTable * switchesConversionTable;
|
||||
ConversionTable * andswitchesConversionTable;
|
||||
int v1;
|
||||
int v2;
|
||||
int v3;
|
||||
@@ -1408,12 +1388,12 @@ class SwitchesWarningField: public TransformedField {
|
||||
{
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
void beforeExport() override
|
||||
{
|
||||
_sw = sw;
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
void afterImport() override
|
||||
{
|
||||
sw = _sw;
|
||||
qCDebug(eepromImport) << QString("imported %1").arg(internalField.getName());
|
||||
@@ -1593,101 +1573,6 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
unsigned int _mode;
|
||||
};
|
||||
|
||||
class AvrCustomFunctionField: public TransformedField {
|
||||
public:
|
||||
AvrCustomFunctionField(DataField * parent, CustomFunctionData & fn, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(parent, internalField),
|
||||
internalField(this, "CustomFunction"),
|
||||
fn(fn),
|
||||
board(board),
|
||||
version(version),
|
||||
variant(variant),
|
||||
functionsConversionTable(board, version),
|
||||
sourcesConversionTable(SourcesConversionTable::getInstance(board, version, variant, 0)),
|
||||
_param(0),
|
||||
_mode(0),
|
||||
_union_param(0),
|
||||
_active(0)
|
||||
{
|
||||
internalField.Append(new SwitchField<6>(this, fn.swtch, board, version));
|
||||
internalField.Append(new ConversionField< UnsignedField<4> >(this, (unsigned int &)fn.func, &functionsConversionTable, "Function", DataField::tr("OpenTX on this board doesn't accept this function")));
|
||||
internalField.Append(new UnsignedField<5>(this, _union_param));
|
||||
internalField.Append(new UnsignedField<1>(this, _active));
|
||||
internalField.Append(new UnsignedField<8>(this, _param));
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
_param = fn.param;
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
_union_param = fn.func - FuncOverrideCH1;
|
||||
}
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerAIL) {
|
||||
_union_param = fn.func - FuncTrainer;
|
||||
}
|
||||
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
|
||||
_union_param = fn.adjustMode;
|
||||
_union_param += (fn.func - FuncAdjustGV1) << 2;
|
||||
if (fn.adjustMode == 1)
|
||||
sourcesConversionTable->exportValue(fn.param, (int &)_param);
|
||||
else if (fn.adjustMode == 2)
|
||||
_param = RawSource(fn.param).index;
|
||||
}
|
||||
else if (fn.func == FuncPlayValue) {
|
||||
_union_param = fn.repeatParam / 10;
|
||||
sourcesConversionTable->exportValue(fn.param, (int &)_param);
|
||||
}
|
||||
else if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayBoth) {
|
||||
_union_param = fn.repeatParam / 10;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
fn.param = _param;
|
||||
fn.enabled = (_active & 0x01);
|
||||
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
fn.func = AssignFunc(fn.func + _union_param);
|
||||
fn.param = (int8_t)fn.param;
|
||||
}
|
||||
else if (fn.func >= FuncTrainer && fn.func <= FuncTrainerAIL) {
|
||||
fn.func = AssignFunc(fn.func + _union_param);
|
||||
}
|
||||
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
|
||||
fn.func = AssignFunc(fn.func + (_union_param >> 2));
|
||||
fn.adjustMode = (_union_param & 0x03);
|
||||
if (fn.adjustMode == 1)
|
||||
sourcesConversionTable->importValue(_param, (int &)fn.param);
|
||||
else if (fn.adjustMode == 2)
|
||||
fn.param = RawSource(SOURCE_TYPE_GVAR, _param).toValue();
|
||||
}
|
||||
else if (fn.func == FuncPlayValue) {
|
||||
fn.repeatParam = _union_param * 10;
|
||||
sourcesConversionTable->importValue(_param, (int &)fn.param);
|
||||
}
|
||||
else if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayBoth) {
|
||||
fn.repeatParam = _union_param * 10;
|
||||
}
|
||||
qCDebug(eepromImport) << QString("imported %1").arg(internalField.getName());
|
||||
}
|
||||
|
||||
protected:
|
||||
StructField internalField;
|
||||
CustomFunctionData & fn;
|
||||
Board::Type board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
CustomFunctionsConversionTable functionsConversionTable;
|
||||
SourcesConversionTable * sourcesConversionTable;
|
||||
unsigned int _param;
|
||||
unsigned int _mode;
|
||||
unsigned int _union_param;
|
||||
unsigned int _active;
|
||||
};
|
||||
|
||||
class FrskyScreenField: public DataField {
|
||||
public:
|
||||
FrskyScreenField(DataField * parent, FrSkyScreenData & screen, Board::Type board, unsigned int version, unsigned int variant):
|
||||
@@ -1860,9 +1745,9 @@ class TelemetryCurrentSourceConversionTable: public ConversionTable
|
||||
}
|
||||
};
|
||||
|
||||
class FrskyField: public StructField {
|
||||
class Frsky218Field: public StructField {
|
||||
public:
|
||||
FrskyField(DataField * parent, FrSkyData & frsky, RSSIAlarmData & rssiAlarms, Board::Type board, unsigned int version, unsigned int variant):
|
||||
Frsky218Field(DataField * parent, FrSkyData & frsky, RSSIAlarmData & rssiAlarms, Board::Type board, unsigned int version, unsigned int variant):
|
||||
StructField(parent, "FrSky"),
|
||||
telemetryVarioSourceConversionTable(board, version),
|
||||
screenTypesConversionTable(board, version),
|
||||
@@ -1909,6 +1794,20 @@ class FrskyField: public StructField {
|
||||
TelemetryCurrentSourceConversionTable telemetryCurrentSourceConversionTable;
|
||||
};
|
||||
|
||||
class VarioField: public StructField {
|
||||
public:
|
||||
VarioField(DataField * parent, FrSkyData & frsky, Board::Type board, unsigned int version, unsigned int variant):
|
||||
StructField(parent, "Vario")
|
||||
{
|
||||
Append(new UnsignedField<7>(this, frsky.varioSource, "Vario Source"));
|
||||
Append(new BoolField<1>(this, frsky.varioCenterSilent));
|
||||
Append(new SignedField<8>(this, frsky.varioCenterMax));
|
||||
Append(new SignedField<8>(this, frsky.varioCenterMin));
|
||||
Append(new SignedField<8>(this, frsky.varioMin));
|
||||
Append(new SignedField<8>(this, frsky.varioMax));
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO
|
||||
*/
|
||||
@@ -2064,7 +1963,10 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
|
||||
internalField.Append(new UnsignedField<8>(this, modelData.moduleData[1].modelId));
|
||||
|
||||
if (HAS_LARGE_LCD(board)) {
|
||||
internalField.Append(new CharField<10>(this, modelData.bitmap, true, "Model bitmap"));
|
||||
if (version >= 219 && IS_HORUS(board))
|
||||
internalField.Append(new CharField<14>(this, modelData.bitmap, true, "Model bitmap"));
|
||||
else
|
||||
internalField.Append(new CharField<10>(this, modelData.bitmap, true, "Model bitmap"));
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_TIMERS(board, version); i++) {
|
||||
@@ -2161,20 +2063,23 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
|
||||
}
|
||||
}
|
||||
|
||||
// TODO rename to VARIO
|
||||
internalField.Append(new FrskyField(this, modelData.frsky, modelData.rssiAlarms, board, version, variant));
|
||||
|
||||
if (version >= 219) {
|
||||
// TODO RSSI SOURCE
|
||||
internalField.Append(new SpareBitsField<8>(this));
|
||||
if (version <= 218) {
|
||||
internalField.Append(new Frsky218Field(this, modelData.frsky, modelData.rssiAlarms, board, version, variant));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new VarioField(this, modelData.frsky, board, version, variant));
|
||||
internalField.Append(new UnsignedField<8>(this, modelData.rssiSource));
|
||||
|
||||
if (IS_TARANIS_X9(board)) {
|
||||
// TODO TOPBAR
|
||||
internalField.Append(new SpareBitsField<16>(this));
|
||||
}
|
||||
|
||||
// TODO RSSI ALARMS
|
||||
internalField.Append(new SpareBitsField<16>(this));
|
||||
internalField.Append(new BoolField<1>(this, modelData.rssiAlarms.disabled));
|
||||
internalField.Append(new SpareBitsField<1>(this));
|
||||
internalField.Append(new ConversionField<SignedField<6> >(this, modelData.rssiAlarms.warning, -45));
|
||||
internalField.Append(new SpareBitsField<2>(this));
|
||||
internalField.Append(new ConversionField<SignedField<6> >(this, modelData.rssiAlarms.critical, -42));
|
||||
}
|
||||
|
||||
if (IS_STM32(board) && version <= 218) {
|
||||
@@ -2266,13 +2171,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
|
||||
}
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < Boards::getCapability(board, Board::Pots) + MAX_SLIDERS(board))
|
||||
if (i < Boards::getCapability(board, Board::Pots) + Boards::getCapability(board, Board::Sliders))
|
||||
internalField.Append(new BoolField<1>(this, modelData.potsWarningEnabled[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>(this));
|
||||
}
|
||||
|
||||
for (int i=0; i < Boards::getCapability(board, Board::Pots) + MAX_SLIDERS(board); i++) {
|
||||
for (int i=0; i < Boards::getCapability(board, Board::Pots) + Boards::getCapability(board, Board::Sliders); i++) {
|
||||
internalField.Append(new SignedField<8>(this, modelData.potPosition[i]));
|
||||
}
|
||||
|
||||
@@ -2303,6 +2208,11 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, Board::Type board, unsig
|
||||
for (int i = 0; i < 4; i++) {
|
||||
internalField.Append(new FrskyScreenField(this, modelData.frsky.screens[i], board, version, variant));
|
||||
}
|
||||
internalField.Append(new SpareBitsField<8>(this)); // current view
|
||||
}
|
||||
|
||||
if (version >= 219) {
|
||||
internalField.Append(new ZCharField<8>(this, modelData.registrationId, "ACCESS Registration ID"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2371,7 +2281,7 @@ void OpenTxModelData::afterImport()
|
||||
}
|
||||
else if (modelData.moduleData[module].protocol == PULSES_MULTIMODULE) {
|
||||
// Copy data from ppm struct to multi struct
|
||||
unsigned int multiByte = (unsigned int)((modelData.moduleData[module].ppm.delay - 300) / 50);
|
||||
auto multiByte = (unsigned int)((modelData.moduleData[module].ppm.delay - 300) / 50);
|
||||
modelData.moduleData[module].multi.rfProtocol = (subprotocols[module] & 0x0f) | ((multiByte & 0x3) << 4);
|
||||
modelData.moduleData[module].multi.customProto = (multiByte & 0x80) == 0x80;
|
||||
modelData.moduleData[module].multi.optionValue = modelData.moduleData[module].ppm.frameLength;
|
||||
@@ -2382,7 +2292,7 @@ void OpenTxModelData::afterImport()
|
||||
if ((modelData.moduleData[module].protocol >= PULSES_PXX_XJT_X16 && modelData.moduleData[module].protocol <= PULSES_PXX_XJT_LR12) ||
|
||||
modelData.moduleData[module].protocol == PULSES_PXX_R9M) {
|
||||
// Do the same for pxx
|
||||
unsigned int pxxByte = (unsigned int)((modelData.moduleData[module].ppm.delay - 300) / 50);
|
||||
auto pxxByte = (unsigned int)((modelData.moduleData[module].ppm.delay - 300) / 50);
|
||||
modelData.moduleData[module].pxx.power = pxxByte & 0x03;
|
||||
modelData.moduleData[module].pxx.receiver_telem_off = static_cast<bool>(pxxByte & (1 << 4));
|
||||
modelData.moduleData[module].pxx.receiver_channel_9_16 = static_cast<bool>(pxxByte & (1 << 5));
|
||||
@@ -2405,12 +2315,12 @@ void OpenTxModelData::afterImport()
|
||||
}
|
||||
|
||||
OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type board, unsigned int version, unsigned int variant):
|
||||
TransformedField(NULL, internalField),
|
||||
TransformedField(nullptr, internalField),
|
||||
internalField(this, "General Settings"),
|
||||
generalData(generalData),
|
||||
board(board),
|
||||
version(version),
|
||||
inputsCount(CPN_MAX_STICKS + Boards::getCapability(board, Board::Pots) + MAX_SLIDERS(board) + MAX_MOUSE_ANALOGS(board))
|
||||
inputsCount(CPN_MAX_STICKS + Boards::getCapability(board, Board::PotsStorage) + Boards::getCapability(board, Board::SlidersStorage) + Boards::getCapability(board, Board::MouseAnalogs))
|
||||
{
|
||||
qCDebug(eepromImport) << QString("OpenTxGeneralData::OpenTxGeneralData(board: %1, version:%2, variant:%3)").arg(board).arg(version).arg(variant);
|
||||
|
||||
@@ -2421,6 +2331,10 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
internalField.Append(new UnsignedField<16>(this, generalData.variant));
|
||||
|
||||
for (int i=0; i<inputsCount; i++) {
|
||||
if (version <= 218 && IS_HORUS(board) && (i == CPN_MAX_STICKS + 3)) {
|
||||
// skip not yet existing pots (EXT1 / EXT2 for X10)
|
||||
i += 2;
|
||||
}
|
||||
internalField.Append(new SignedField<16>(this, generalData.calibMid[i]));
|
||||
internalField.Append(new SignedField<16>(this, generalData.calibSpanNeg[i]));
|
||||
internalField.Append(new SignedField<16>(this, generalData.calibSpanPos[i]));
|
||||
@@ -2463,7 +2377,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
}
|
||||
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.inactivityTimer));
|
||||
internalField.Append(new SpareBitsField<3>(this));
|
||||
internalField.Append(new SpareBitsField<3>(this)); // telemetryBaudrate
|
||||
if (IS_HORUS(board))
|
||||
internalField.Append(new SpareBitsField<3>(this));
|
||||
else if (IS_TARANIS(board))
|
||||
@@ -2502,11 +2416,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.backlightBright));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(this, generalData.txCurrentCalibration));
|
||||
|
||||
if (version < 218) internalField.Append(new SignedField<8>(this, generalData.temperatureWarn));
|
||||
if (version < 218) internalField.Append(new SpareBitsField<8>(this));
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(this, generalData.mAhWarn));
|
||||
if (version < 218) internalField.Append(new UnsignedField<16>(this, generalData.mAhUsed));
|
||||
internalField.Append(new UnsignedField<32>(this, generalData.globalTimer));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(this, generalData.temperatureCalib));
|
||||
if (version < 218) internalField.Append(new SpareBitsField<8>(this));
|
||||
internalField.Append(new UnsignedField<4>(this, generalData.bluetoothBaudrate));
|
||||
internalField.Append(new UnsignedField<4>(this, generalData.bluetoothMode));
|
||||
if (version < 218) internalField.Append(new BoolField<8>(this, generalData.optrexDisplay));
|
||||
@@ -2514,7 +2428,16 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
|
||||
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(this, generalData.rotarySteps));
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.countryCode));
|
||||
internalField.Append(new UnsignedField<2>(this, generalData.countryCode));
|
||||
|
||||
if (version >= 219 && IS_HORUS_OR_TARANIS(board)) {
|
||||
internalField.Append(new SignedField<3>(this, generalData.pwrOnSpeed, "Power On Speed"));
|
||||
internalField.Append(new SignedField<3>(this, generalData.pwrOffSpeed, "Power Off Speed"));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SpareBitsField<6>(this));
|
||||
}
|
||||
|
||||
internalField.Append(new UnsignedField<1>(this, generalData.imperial));
|
||||
if (version >= 218) {
|
||||
internalField.Append(new BoolField<1>(this, generalData.jitterFilter));
|
||||
@@ -2553,6 +2476,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
if (IS_STM32(board)) {
|
||||
if (version >= 218) {
|
||||
internalField.Append(new UnsignedField<4>(this, generalData.hw_uartMode));
|
||||
// not on Horus...
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
internalField.Append(new UnsignedField<1>(this, generalData.sliderConfig[i]));
|
||||
}
|
||||
@@ -2569,29 +2493,42 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
}
|
||||
|
||||
if (IS_HORUS(board)) {
|
||||
for (int i=0; i<16; i++) {
|
||||
for (int i=0; i<MAX_SWITCH_SLOTS(board, version); i++) { // bits swconfig_t / 2
|
||||
if (i < MAX_SWITCHES(board, version))
|
||||
internalField.Append(new UnsignedField<2>(this, generalData.switchConfig[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<2>(this));
|
||||
}
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
if (i < Boards::getCapability(board, Board::Pots))
|
||||
for (int i=0; i<MAX_KNOBS(board, version); i++) {
|
||||
|
||||
// 2 new pots for Horus from 219 on
|
||||
if (version <= 218 && IS_HORUS(board) && (i == 3))
|
||||
i += 2;
|
||||
|
||||
if (i < Boards::getCapability(board, Board::PotsStorage))
|
||||
internalField.Append(new UnsignedField<2>(this, generalData.potConfig[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<2>(this));
|
||||
}
|
||||
if (IS_HORUS(board)) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < Boards::getCapability(board, Board::SlidersStorage))
|
||||
internalField.Append(new UnsignedField<1>(this, generalData.sliderConfig[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>(this));
|
||||
}
|
||||
}
|
||||
if (!IS_HORUS(board)) {
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.backlightColor));
|
||||
}
|
||||
}
|
||||
else if (IS_SKY9X(board) && version >= 218) {
|
||||
internalField.Append(new SignedField<8>(this, generalData.txCurrentCalibration));
|
||||
internalField.Append(new SignedField<8>(this, generalData.temperatureWarn));
|
||||
internalField.Append(new SpareBitsField<8>(this));
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.mAhWarn));
|
||||
internalField.Append(new UnsignedField<16>(this, generalData.mAhUsed));
|
||||
internalField.Append(new SignedField<8>(this, generalData.temperatureCalib));
|
||||
internalField.Append(new SpareBitsField<8>(this));
|
||||
internalField.Append(new BoolField<8>(this, generalData.optrexDisplay));
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.sticksGain));
|
||||
internalField.Append(new UnsignedField<8>(this, generalData.rotarySteps));
|
||||
@@ -2615,10 +2552,14 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
for (int i=0; i<CPN_MAX_STICKS; ++i) {
|
||||
internalField.Append(new ZCharField<3>(this, generalData.stickName[i], "Stick name"));
|
||||
}
|
||||
for (int i=0; i<Boards::getCapability(board, Board::Pots); ++i) {
|
||||
for (int i=0; i<Boards::getCapability(board, Board::PotsStorage); ++i) {
|
||||
if (version <= 218 && IS_HORUS(board) && (i == 3)) {
|
||||
// skip not yet existing pots (EXT1 / EXT2 for X10)
|
||||
i += 2;
|
||||
}
|
||||
internalField.Append(new ZCharField<3>(this, generalData.potName[i], "Pot name"));
|
||||
}
|
||||
for (int i=0; i<MAX_SLIDERS(board); ++i) {
|
||||
for (int i=0; i<Boards::getCapability(board, Board::SlidersStorage); ++i) {
|
||||
internalField.Append(new ZCharField<3>(this, generalData.sliderName[i], "Slider name"));
|
||||
}
|
||||
internalField.Append(new CharField<17>(this, generalData.currModelFilename, true, "Current model filename"));
|
||||
@@ -2639,7 +2580,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
for (int i=0; i<Boards::getCapability(board, Board::Pots); ++i) {
|
||||
internalField.Append(new ZCharField<3>(this, generalData.potName[i], "Pot name"));
|
||||
}
|
||||
for (int i=0; i<MAX_SLIDERS(board); ++i) {
|
||||
for (int i=0; i<Boards::getCapability(board, Board::Sliders); ++i) {
|
||||
internalField.Append(new ZCharField<3>(this, generalData.sliderName[i], "Slider name"));
|
||||
}
|
||||
}
|
||||
@@ -2662,7 +2603,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, Board::Type
|
||||
}
|
||||
|
||||
if (version >= 219) {
|
||||
internalField.Append(new ZCharField<8>(this, generalData.registrationId, "PXX2 Registration ID"));
|
||||
internalField.Append(new ZCharField<8>(this, generalData.registrationId, "ACCESS Registration ID"));
|
||||
}
|
||||
|
||||
if (version >= 219 && (IS_TARANIS_XLITES(board) || IS_HORUS(board))) {
|
||||
|
||||
@@ -72,6 +72,8 @@ const char * OpenTxEepromInterface::getName()
|
||||
return "OpenTX for FrSky Taranis X9D";
|
||||
case BOARD_TARANIS_X9DP:
|
||||
return "OpenTX for FrSky Taranis X9D+";
|
||||
case BOARD_TARANIS_X9DP_2019:
|
||||
return "OpenTX for FrSky Taranis X9D+ 2019";
|
||||
case BOARD_TARANIS_X9E:
|
||||
return "OpenTX for FrSky Taranis X9E";
|
||||
case BOARD_TARANIS_X7:
|
||||
@@ -305,8 +307,6 @@ int OpenTxEepromInterface::save(uint8_t * eeprom, const RadioData & radioData, u
|
||||
{
|
||||
// TODO QMessageBox::warning should not be called here
|
||||
|
||||
qDebug() << "ICI";
|
||||
|
||||
if (version == 0) {
|
||||
version = getLastDataVersion(board);
|
||||
}
|
||||
@@ -734,6 +734,8 @@ int OpenTxFirmware::getCapability(::Capability capability)
|
||||
return IS_HORUS(board);
|
||||
case HasSwitchableJack:
|
||||
return IS_TARANIS_XLITES(board);
|
||||
case PwrButtonPress:
|
||||
return IS_HORUS_OR_TARANIS(board) && (board!=Board::BOARD_TARANIS_X9D) && (board!=Board::BOARD_TARANIS_X9DP);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -1211,6 +1213,12 @@ void registerOpenTxFirmwares()
|
||||
addPPMInternalModuleHack(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky Taranis X9D+ 2019 board */
|
||||
firmware = new OpenTxFirmware("opentx-x9d+2019", Firmware::tr("FrSky Taranis X9D+ 2019"), BOARD_TARANIS_X9DP_2019);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addPPMInternalModuleHack(firmware);
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky Taranis X9D board */
|
||||
firmware = new OpenTxFirmware("opentx-x9d", Firmware::tr("FrSky Taranis X9D"), BOARD_TARANIS_X9D);
|
||||
firmware->addOption("haptic", Firmware::tr("Haptic module installed"));
|
||||
@@ -1229,6 +1237,7 @@ void registerOpenTxFirmwares()
|
||||
/* FrSky X9-Lite board */
|
||||
firmware = new OpenTxFirmware("opentx-x9lite", Firmware::tr("FrSky Taranis X9-Lite"), BOARD_TARANIS_X9LITE);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X7 board */
|
||||
@@ -1239,7 +1248,7 @@ void registerOpenTxFirmwares()
|
||||
/* FrSky X-Lite S/PRO board */
|
||||
firmware = new OpenTxFirmware("opentx-xlites", Firmware::tr("FrSky Taranis X-Lite S/PRO"), BOARD_TARANIS_XLITES);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
firmware->addOption("internalpxx1", Firmware::tr("Support for PXX1 internal module replacement"));
|
||||
firmware->addOption("autoupdate", Firmware::tr("Support for auto update on boot"));
|
||||
registerOpenTxFirmware(firmware);
|
||||
|
||||
/* FrSky X-Lite board */
|
||||
@@ -1262,6 +1271,7 @@ void registerOpenTxFirmwares()
|
||||
/* Jumper T12 board */
|
||||
firmware = new OpenTxFirmware("opentx-t12", QCoreApplication::translate("Firmware", "Jumper T12"), BOARD_JUMPER_T12);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmware->addOption("multimodule", Firmware::tr("Support for the DIY-Multiprotocol-TX-Module"));
|
||||
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"));
|
||||
@@ -1321,7 +1331,6 @@ OpenTxEepromInterface * loadFromByteArray(T & dest, const QByteArray & data)
|
||||
template <class T, class M>
|
||||
bool saveToByteArray(const T & dest, QByteArray & data)
|
||||
{
|
||||
qDebug() << "ICI SAVE";
|
||||
Board::Type board = getCurrentBoard();
|
||||
foreach(OpenTxEepromInterface * eepromInterface, opentxEEpromInterfaces) {
|
||||
if (eepromInterface->getBoard() == board) {
|
||||
|
||||
@@ -128,13 +128,13 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
|
||||
case TELEMETRY_SOURCE_T2_MAX:
|
||||
result.min = -30;
|
||||
result.max = 225;
|
||||
result.unit = trUtf8("°C");
|
||||
result.unit = tr("°C");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_HDG:
|
||||
result.step = 2;
|
||||
result.max = 360;
|
||||
result.offset = 256;
|
||||
result.unit = trUtf8("°");
|
||||
result.unit = tr("°");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RPM:
|
||||
case TELEMETRY_SOURCE_RPM_MAX:
|
||||
|
||||
@@ -52,9 +52,9 @@ QString SensorData::unitString() const
|
||||
case UNIT_FEET:
|
||||
return tr("f");
|
||||
case UNIT_CELSIUS:
|
||||
return trUtf8("°C");
|
||||
return tr("°C");
|
||||
case UNIT_FAHRENHEIT:
|
||||
return trUtf8("°F");
|
||||
return tr("°F");
|
||||
case UNIT_PERCENT:
|
||||
return tr("%");
|
||||
case UNIT_MAH:
|
||||
@@ -70,9 +70,9 @@ QString SensorData::unitString() const
|
||||
case UNIT_G:
|
||||
return tr("g");
|
||||
case UNIT_DEGREE:
|
||||
return trUtf8("°");
|
||||
return tr("°");
|
||||
case UNIT_RADIANS:
|
||||
return trUtf8("Rad");
|
||||
return tr("Rad");
|
||||
case UNIT_HOURS:
|
||||
return tr("hours");
|
||||
case UNIT_MINUTES:
|
||||
|
||||
@@ -29,10 +29,9 @@
|
||||
#include "splashlibrarydialog.h"
|
||||
|
||||
FlashEEpromDialog::FlashEEpromDialog(QWidget *parent, const QString &filename):
|
||||
QDialog(parent),
|
||||
ui(new Ui::FlashEEpromDialog),
|
||||
eepromFilename(filename),
|
||||
radioData(new RadioData())
|
||||
QDialog(parent),
|
||||
ui(new Ui::FlashEEpromDialog),
|
||||
eepromFilename(filename)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->profileLabel->setText(tr("Current profile: %1").arg(g.profile[g.id()].name()));
|
||||
@@ -42,7 +41,7 @@ radioData(new RadioData())
|
||||
}
|
||||
QString backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
backupPath = g.backupDir();
|
||||
ui->backupBeforeWrite->setChecked(g.enableBackup() || g.profile[g.id()].penableBackup());
|
||||
}
|
||||
if (backupPath.isEmpty() || !QDir(backupPath).exists()) {
|
||||
@@ -123,7 +122,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString & filename)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool FlashEEpromDialog::patchCalibration()
|
||||
bool FlashEEpromDialog::patchCalibration(RadioData * radioData)
|
||||
{
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
@@ -168,7 +167,7 @@ bool FlashEEpromDialog::patchCalibration()
|
||||
}
|
||||
}
|
||||
|
||||
bool FlashEEpromDialog::patchHardwareSettings()
|
||||
bool FlashEEpromDialog::patchHardwareSettings(RadioData * radioData)
|
||||
{
|
||||
QString DisplaySet = g.profile[g.id()].display();
|
||||
QString BeeperSet = g.profile[g.id()].beeper();
|
||||
@@ -215,32 +214,37 @@ bool FlashEEpromDialog::patchHardwareSettings()
|
||||
|
||||
void FlashEEpromDialog::on_burnButton_clicked()
|
||||
{
|
||||
// patch the eeprom if needed
|
||||
bool patch = false;
|
||||
if (ui->patchCalibration->isChecked()) {
|
||||
patch |= patchCalibration();
|
||||
}
|
||||
if (ui->patchHardwareSettings->isChecked()) {
|
||||
patch |= patchHardwareSettings();
|
||||
}
|
||||
QString filename = eepromFilename;
|
||||
if (patch) {
|
||||
QString filename = generateProcessUniqueTempFileName("temp.bin");
|
||||
QFile file(filename);
|
||||
uint8_t *eeprom = (uint8_t*)malloc(Boards::getEEpromSize(getCurrentBoard()));
|
||||
int eeprom_size = getCurrentEEpromInterface()->save(eeprom, *radioData, 0, getCurrentFirmware()->getVariantNumber());
|
||||
if (eeprom_size == 0) {
|
||||
return;
|
||||
bool patch = false;
|
||||
|
||||
if (ui->patchCalibration->isChecked() || ui->patchHardwareSettings->isChecked()) {
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
Storage storage(eepromFilename);
|
||||
if (storage.load(*radioData)) {
|
||||
if (ui->patchCalibration->isChecked())
|
||||
patch |= patchCalibration(radioData.data());
|
||||
if (ui->patchHardwareSettings->isChecked())
|
||||
patch |= patchHardwareSettings(radioData.data());
|
||||
}
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::warning(this, CPN_STR_TTL_ERROR, tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::warning(this, CPN_STR_TTL_ERROR, tr("Error writing file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
|
||||
if (patch) {
|
||||
filename = generateProcessUniqueTempFileName("patched.bin");
|
||||
QFile file(filename);
|
||||
uint8_t *eeprom = (uint8_t*)malloc(Boards::getEEpromSize(getCurrentBoard()));
|
||||
int eeprom_size = getCurrentEEpromInterface()->save(eeprom, *radioData, 0, getCurrentFirmware()->getVariantNumber());
|
||||
if (eeprom_size == 0) {
|
||||
return;
|
||||
}
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
QMessageBox::warning(this, CPN_STR_TTL_ERROR, tr("Cannot write file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::warning(this, CPN_STR_TTL_ERROR, tr("Error writing file %1:\n%2.").arg(filename).arg(file.errorString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,14 +49,13 @@ protected:
|
||||
void updateUI();
|
||||
bool isValidEEprom(const QString &filename);
|
||||
int getEEpromVersion(const QString &filename);
|
||||
bool patchCalibration();
|
||||
bool patchHardwareSettings();
|
||||
bool patchCalibration(RadioData * radioData);
|
||||
bool patchHardwareSettings(RadioData * radioData);
|
||||
virtual void showEvent(QShowEvent *);
|
||||
|
||||
private:
|
||||
Ui::FlashEEpromDialog *ui;
|
||||
QString eepromFilename;
|
||||
RadioData *radioData;
|
||||
};
|
||||
|
||||
#endif // _FLASHEEPROMDIALOG_H_
|
||||
|
||||
@@ -255,6 +255,17 @@ ui(new Ui::GeneralSetup)
|
||||
ui->splashScreenChkB->setChecked(!generalSettings.splashMode);
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(PwrButtonPress)) {
|
||||
ui->pwrOnSpeedLabel->hide();
|
||||
ui->pwrOnSpeed->hide();
|
||||
ui->pwrOffSpeedLabel->hide();
|
||||
ui->pwrOffSpeed->hide();
|
||||
}
|
||||
else if (!IS_TARANIS(firmware->getBoard())) {
|
||||
ui->pwrOnSpeedLabel->hide();
|
||||
ui->pwrOnSpeed->hide();
|
||||
}
|
||||
|
||||
setValues();
|
||||
|
||||
lock = false;
|
||||
@@ -441,6 +452,9 @@ void GeneralSetupPanel::setValues()
|
||||
ui->vBatMinDSB->setValue((double)(generalSettings.vBatMin + 90) / 10);
|
||||
ui->vBatMaxDSB->setValue((double)(generalSettings.vBatMax + 120) / 10);
|
||||
}
|
||||
|
||||
ui->pwrOnSpeed->setValue(generalSettings.pwrOnSpeed);
|
||||
ui->pwrOffSpeed->setValue(generalSettings.pwrOffSpeed);
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_faimode_CB_stateChanged(int)
|
||||
@@ -493,6 +507,17 @@ void GeneralSetupPanel::on_splashScreenDuration_currentIndexChanged(int index)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_pwrOnSpeed_valueChanged()
|
||||
{
|
||||
generalSettings.pwrOnSpeed = ui->pwrOnSpeed->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_pwrOffSpeed_valueChanged()
|
||||
{
|
||||
generalSettings.pwrOffSpeed = ui->pwrOffSpeed->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_beepVolume_SL_valueChanged()
|
||||
{
|
||||
|
||||
@@ -88,6 +88,8 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
void on_vBatMaxDSB_editingFinished();
|
||||
void on_contrastSB_editingFinished();
|
||||
|
||||
void on_pwrOnSpeed_valueChanged();
|
||||
void on_pwrOffSpeed_valueChanged();
|
||||
|
||||
private:
|
||||
Ui::GeneralSetup *ui;
|
||||
|
||||
@@ -126,6 +126,7 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
|
||||
setupPotType(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||
setupPotType(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||
setupPotType(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
|
||||
setupPotType(4, ui->pot5Label, ui->pot5Name, ui->pot5Type);
|
||||
|
||||
setupSliderType(0, ui->lsLabel, ui->lsName, ui->lsType);
|
||||
setupSliderType(1, ui->rsLabel, ui->rsName, ui->rsType);
|
||||
|
||||
@@ -443,7 +443,7 @@ void Helpers::populateFileComboBox(QComboBox * b, const QSet<QString> & set, con
|
||||
bool added = false;
|
||||
// Convert set into list and sort it alphabetically case insensitive
|
||||
QStringList list = QStringList::fromSet(set);
|
||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
std::sort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
foreach (QString entry, list) {
|
||||
b->addItem(entry);
|
||||
if (entry == current) {
|
||||
|
||||
@@ -830,7 +830,7 @@ void LogsDialog::plotLogs()
|
||||
foreach (QModelIndex index, selection) {
|
||||
selectedRows.append(index.row());
|
||||
}
|
||||
qSort(selectedRows.begin(), selectedRows.end());
|
||||
std::sort(selectedRows.begin(), selectedRows.end());
|
||||
} else {
|
||||
hasLogSelection = false;
|
||||
rowCount = ui->logTable->rowCount();
|
||||
|
||||
@@ -323,13 +323,13 @@ QString MainWindow::seekCodeString(const QByteArray & qba, const QString & label
|
||||
{
|
||||
int posLabel = qba.indexOf(label);
|
||||
if (posLabel < 0)
|
||||
return QString::null;
|
||||
return QString();
|
||||
int start = qba.indexOf("\"", posLabel + label.length());
|
||||
if (start < 0)
|
||||
return QString::null;
|
||||
return QString();
|
||||
int end = qba.indexOf("\"", start + 1);
|
||||
if (end < 0)
|
||||
return QString::null;
|
||||
return QString();
|
||||
return qba.mid(start + 1, end - start - 1);
|
||||
}
|
||||
|
||||
@@ -340,6 +340,15 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
closeUpdatesWaitDialog();
|
||||
|
||||
QString version = seekCodeString(qba, "VERSION");
|
||||
const QString errorString = seekCodeString(qba, "ERROR");
|
||||
|
||||
if (errorString == "NO_RC")
|
||||
return onUpdatesError(tr("No Companion release candidates are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_NIGHTLY")
|
||||
return onUpdatesError(tr("No nightly Companion builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_RELEASE")
|
||||
return onUpdatesError(tr("No Companion release builds are currently being served for this version, please switch release channel"));
|
||||
|
||||
if (version.isNull())
|
||||
return onUpdatesError(tr("Companion update check failed, new version information not found."));
|
||||
|
||||
@@ -456,7 +465,45 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
|
||||
const QString versionString = seekCodeString(qba, "VERSION");
|
||||
const QString dateString = seekCodeString(qba, "DATE");
|
||||
const QString errorString = seekCodeString(qba, "ERROR");
|
||||
const QString blockedRadios = seekCodeString(qba, "BLOCK");
|
||||
long version;
|
||||
|
||||
if (errorString == "NO_RC")
|
||||
return onUpdatesError(tr("No firmware release candidates are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_NIGHTLY")
|
||||
return onUpdatesError(tr("No firmware nightly builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "NO_RELEASE")
|
||||
return onUpdatesError(tr("No firmware release builds are currently being served for this version, please switch release channel"));
|
||||
else if (errorString == "MOVE_TO_RC") {
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Question);
|
||||
msgbox.setText(tr("Release candidate builds are now available for this version, would you like to switch to using them?"));
|
||||
msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgbox.setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
if(msgbox.exec() == QMessageBox::Yes) {
|
||||
g.OpenTxBranch(AppData::DownloadBranchType(AppData::BRANCH_RC_TESTING));
|
||||
return onUpdatesError(tr("Channel changed to RC, please restart the download process"));
|
||||
}
|
||||
}
|
||||
else if (errorString == "MOVE_TO_RELEASE") {
|
||||
QMessageBox msgbox;
|
||||
msgbox.setIcon(QMessageBox::Question);
|
||||
msgbox.setText(tr("Official release builds are now available for this version, would you like to switch to using them?"));
|
||||
msgbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
msgbox.setDefaultButton(QMessageBox::Yes);
|
||||
|
||||
if(msgbox.exec() == QMessageBox::Yes) {
|
||||
g.OpenTxBranch(AppData::DownloadBranchType(AppData::BRANCH_RELEASE_STABLE));
|
||||
return onUpdatesError(tr("Channel changed to Release, please restart the download process"));
|
||||
}
|
||||
}
|
||||
|
||||
QString variant = Firmware::getCurrentVariant()->getId();
|
||||
QStringList splitId = variant.split("-");
|
||||
if (blockedRadios.contains(splitId.value(1)))
|
||||
return onUpdatesError(tr("This radio (%1) is not currently available in this firmware release channel").arg(getCurrentFirmware()->getName()));
|
||||
|
||||
if (versionString.isNull() || dateString.isNull() || (version = version2index(versionString)) <= 0)
|
||||
return onUpdatesError(tr("Firmware update check failed, new version information not found or invalid."));
|
||||
@@ -482,10 +529,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
QAbstractButton *rnButton = nullptr;
|
||||
msgBox.setText(tr("Firmware %1 does not seem to have ever been downloaded.\nVersion %2 is available.\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.")
|
||||
.arg(Firmware::getCurrentVariant()->getId()).arg(fullVersionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
QAbstractButton *YesButton = msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(tr("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
rnButton = msgBox.addButton(tr("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0, 0);
|
||||
@@ -511,10 +558,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
QAbstractButton *rnButton = nullptr;
|
||||
msgBox.setText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.")
|
||||
.arg(Firmware::getCurrentVariant()->getId()).arg(currentVersionString).arg(fullVersionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
QAbstractButton *YesButton = msgBox.addButton(tr("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(tr("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
rnButton = msgBox.addButton(tr("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0,0);
|
||||
|
||||
@@ -483,7 +483,7 @@ void InputsPanel::expolistWidget_doubleClicked(QModelIndex index)
|
||||
|
||||
void InputsPanel::exposDeleteList(QList<int> list, bool clearName)
|
||||
{
|
||||
qSort(list.begin(), list.end());
|
||||
std::sort(list.begin(), list.end());
|
||||
|
||||
int iDec = 0;
|
||||
foreach(int idx, list) {
|
||||
|
||||
@@ -222,7 +222,7 @@ void MixesPanel::mixerlistWidget_doubleClicked(QModelIndex index)
|
||||
|
||||
void MixesPanel::mixersDeleteList(QList<int> list)
|
||||
{
|
||||
qSort(list.begin(), list.end());
|
||||
std::sort(list.begin(), list.end());
|
||||
|
||||
int iDec = 0;
|
||||
foreach(int idx, list) {
|
||||
|
||||
@@ -160,11 +160,11 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
||||
if (option->state & QStyle::State_Sunken) {
|
||||
gradient.setCenter(ballHeight, ballHeight);
|
||||
gradient.setFocalPoint(ballHeight, ballHeight);
|
||||
gradient.setColorAt(1, nodecolor.light(180));
|
||||
gradient.setColorAt(0, nodecolor.light(120));
|
||||
gradient.setColorAt(1, nodecolor.lighter(180));
|
||||
gradient.setColorAt(0, nodecolor.lighter(120));
|
||||
} else {
|
||||
gradient.setColorAt(0, nodecolor);
|
||||
gradient.setColorAt(1, nodecolor.dark(120));
|
||||
gradient.setColorAt(1, nodecolor.darker(120));
|
||||
}
|
||||
painter->setBrush(gradient);
|
||||
painter->setPen(QPen(Qt::black, 0));
|
||||
|
||||
@@ -925,7 +925,7 @@ SetupPanel::SetupPanel(QWidget * parent, ModelData & model, GeneralSettings & ge
|
||||
prevFocus = timers[i]->getLastFocus();
|
||||
}
|
||||
else {
|
||||
foreach(QLabel *label, findChildren<QLabel *>(QRegExp(QString("label_timer%1").arg(i+1)))) {
|
||||
foreach(QLabel *label, findChildren<QLabel *>(QRegularExpression(QString("label_timer%1").arg(i+1)))) {
|
||||
label->hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,7 +830,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->varioSource->setField(model.frsky.varioSource, this);
|
||||
ui->varioSource->setField(model.frsky.varioSource, this);
|
||||
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent, this);
|
||||
ui->A1GB->hide();
|
||||
ui->A2GB->hide();
|
||||
@@ -844,7 +844,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
}
|
||||
else {
|
||||
ui->sensorsGB->hide();
|
||||
ui->altimetryGB->hide();
|
||||
ui->altimetryGB->hide();
|
||||
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
|
||||
ui->A1Layout->addWidget(analogs[0]);
|
||||
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
@@ -893,6 +893,7 @@ void TelemetryPanel::update()
|
||||
ui->telemetryProtocol->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
populateTelemetrySourcesComboBox(ui->rssiSourceCB, model, false);
|
||||
populateTelemetrySourcesComboBox(ui->voltsSource, model, false);
|
||||
populateTelemetrySourcesComboBox(ui->altitudeSource, model, false);
|
||||
populateTelemetrySourcesComboBox(ui->varioSource, model, false);
|
||||
@@ -934,10 +935,18 @@ void TelemetryPanel::setup()
|
||||
ui->rssiAlarmWarningSB->setValue(model->rssiAlarms.warning);
|
||||
ui->rssiAlarmCriticalSB->setValue(model->rssiAlarms.critical);
|
||||
if (!IS_ARM(firmware->getBoard())) {
|
||||
ui->rssiSourceLabel->hide();
|
||||
ui->rssiSourceCB->hide();
|
||||
ui->rssiAlarmWarningCB->setCurrentIndex(model->rssiAlarms.level[0]);
|
||||
ui->rssiAlarmCriticalCB->setCurrentIndex(model->rssiAlarms.level[1]);
|
||||
}
|
||||
else {
|
||||
ui->rssiSourceLabel->show();
|
||||
ui->rssiSourceLabel->setText(tr("Source"));
|
||||
ui->rssiSourceCB->setField(model->rssiSource, this);
|
||||
ui->rssiSourceCB->show();
|
||||
populateTelemetrySourcesComboBox(ui->rssiSourceCB, model, false);
|
||||
|
||||
ui->rssiAlarmWarningCB->hide();
|
||||
ui->rssiAlarmCriticalCB->hide();
|
||||
ui->rssiAlarmWarningLabel->setText(tr("Low Alarm"));
|
||||
|
||||
@@ -74,7 +74,167 @@
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="rssiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="rssiAlarmWarningLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 1</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarmWarningSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="rssiAlarmCriticalCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarmCriticalSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="AutoCheckBox" name="disableTelemetryAlarms">
|
||||
<property name="text">
|
||||
<string>Disable telemetry audio warnings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="rssiAlarmCriticalLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="rssiAlarmWarningCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -105,164 +265,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="rssiAlarmWarningLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<widget class="QLabel" name="rssiSourceLabel">
|
||||
<property name="text">
|
||||
<string>Alarm 1</string>
|
||||
<string>Source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="rssiAlarmCriticalCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="rssiAlarmCriticalLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarmCriticalSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QSpinBox" name="rssiAlarmWarningSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>80</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="rssiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="AutoCheckBox" name="disableTelemetryAlarms">
|
||||
<property name="text">
|
||||
<string>Disable telemetry audio warnings</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="2" column="1" colspan="2">
|
||||
<widget class="AutoComboBox" name="rssiSourceCB"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -726,7 +726,7 @@ void TreeModel::refresh()
|
||||
protocol = model.moduleData[j].protocol;
|
||||
// These are the only RXs that allow nominating RX # but changing RX or copying models can leave residual configuration which can cause issues
|
||||
// if (protocol == PULSES_PXX_XJT_X16 || protocol == PULSES_PXX_XJT_LR12 || protocol == PULSES_PXX_R9M || protocol == PULSES_DSMX || protocol == PULSES_MULTIMODULE) {
|
||||
if (!protocol == PULSES_OFF && model.moduleData[j].modelId > 0) {
|
||||
if (protocol != PULSES_OFF && model.moduleData[j].modelId > 0) {
|
||||
if (!rxs.isEmpty()) {
|
||||
rxs.append(", ");
|
||||
}
|
||||
@@ -735,10 +735,6 @@ void TreeModel::refresh()
|
||||
if (!isModelIdUnique(mdlidx)) {
|
||||
current->setHighlightRX(true);
|
||||
}
|
||||
ModelData & mdl = radioData->models[mdlidx-1];
|
||||
if (mdl.isEmpty()) {
|
||||
current->setHighlightRX(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
current->setData(currentColumn++, rxs);
|
||||
|
||||
@@ -45,14 +45,14 @@ joystickDialog::joystickDialog(QWidget *parent, int stick) :
|
||||
};
|
||||
memcpy(jscal, jscaltmp, sizeof (jscal));
|
||||
|
||||
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
|
||||
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegularExpression("jsmapCB_[0-9]+"))) {
|
||||
populateSourceCombo(cb);
|
||||
sticks[cb->property("channel").toUInt()] = cb;
|
||||
}
|
||||
foreach(QCheckBox *ib, findChildren<QCheckBox *>(QRegExp("ChInv_[0-9]+"))) {
|
||||
foreach(QCheckBox *ib, findChildren<QCheckBox *>(QRegularExpression("ChInv_[0-9]+"))) {
|
||||
invert[ib->property("channel").toUInt()] = ib;
|
||||
}
|
||||
foreach(QSlider *sl, findChildren<QSlider *>(QRegExp("Ch_[0-9]+"))) {
|
||||
foreach(QSlider *sl, findChildren<QSlider *>(QRegularExpression("Ch_[0-9]+"))) {
|
||||
sliders[sl->property("channel").toUInt()] = sl;
|
||||
}
|
||||
|
||||
|
||||
@@ -290,7 +290,11 @@ QWidget * RadioOutputsWidget::createLogicalSwitch(QWidget * parent, int switchNo
|
||||
QFont font = swtch->font();
|
||||
font.setBold(true);
|
||||
swtch->setFont(font);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||
swtch->setMinimumWidth(swtch->fontMetrics().width("99") + 10);
|
||||
#else
|
||||
swtch->setMinimumWidth(swtch->fontMetrics().horizontalAdvance("99") + 10);
|
||||
#endif
|
||||
font.setBold(false);
|
||||
swtch->setFont(font);
|
||||
swtch->setText(QString("%1").arg(switchNo+1, 2, 10, QChar('0')));
|
||||
|
||||
@@ -100,7 +100,7 @@ void SimulatorLoader::registerSimulators()
|
||||
path.truncate(path.lastIndexOf('\\'));
|
||||
dir.setPath(path);
|
||||
#else
|
||||
dir = SIMULATOR_LIB_SEARCH_PATH;
|
||||
dir.setPath(SIMULATOR_LIB_SEARCH_PATH);
|
||||
#endif
|
||||
registerSimulators(dir);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ SimulatorWidget::SimulatorWidget(QWidget * parent, SimulatorInterface * simulato
|
||||
break;
|
||||
case Board::BOARD_TARANIS_X9D:
|
||||
case Board::BOARD_TARANIS_X9DP:
|
||||
case Board::BOARD_TARANIS_X9DP_2019:
|
||||
radioUiWidget = new SimulatedUIWidgetX9(simulator, this);
|
||||
break;
|
||||
case Board::BOARD_TARANIS_XLITE:
|
||||
|
||||
@@ -41,6 +41,7 @@ class RadioSwitchWidget : public RadioWidget
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
explicit RadioSwitchWidget(Board::SwitchType type, const QString & labelText, int value = 0, QWidget * parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()) :
|
||||
RadioWidget(labelText, value, parent, f),
|
||||
swType(type)
|
||||
@@ -96,15 +97,24 @@ class RadioSwitchWidget : public RadioWidget
|
||||
setWidget(m_slider);
|
||||
}
|
||||
|
||||
connect(m_slider, &QSlider::valueChanged, this, &RadioWidget::setValue);
|
||||
connect(m_slider, &QSlider::valueChanged, this, &RadioSwitchWidget::setValueFromSlider);
|
||||
connect(this, &RadioWidget::valueChanged, m_slider, &QSlider::setValue);
|
||||
|
||||
}
|
||||
|
||||
int getValue() const
|
||||
int getValue() const override
|
||||
{
|
||||
int val = m_slider->value() - (swType == Board::SWITCH_3POS || m_slider->value() == 1 ? 0 : 1);
|
||||
return val;
|
||||
if (swType == Board::SWITCH_3POS)
|
||||
return m_slider->value();
|
||||
else
|
||||
return m_slider->value() > 0 ? 1 : 0;
|
||||
}
|
||||
|
||||
void setValueFromSlider(const int & value)
|
||||
{
|
||||
if (swType == Board::SWITCH_3POS)
|
||||
RadioWidget::setValue(value);
|
||||
else
|
||||
RadioWidget::setValue(value ? 1 : -1);
|
||||
}
|
||||
|
||||
void setToggleLocked(bool lock)
|
||||
@@ -139,7 +149,4 @@ class RadioSwitchWidget : public RadioWidget
|
||||
QSlider * m_slider;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _RADIOSWITCHWIDGET_H_
|
||||
|
||||
@@ -444,7 +444,11 @@ QLayout *VirtualJoystickWidget::createNodeValueLayout(QChar type, QLabel *& valL
|
||||
val->setObjectName(QString("val_%1").arg(type));
|
||||
val->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
||||
val->setAlignment(Qt::AlignCenter);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
|
||||
val->setMinimumWidth(val->fontMetrics().width("-100 "));
|
||||
#else
|
||||
val->setMinimumWidth(val->fontMetrics().horizontalAdvance("-100 "));
|
||||
#endif
|
||||
QVBoxLayout * layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(2, 2, 2, 2);
|
||||
layout->setSpacing(2);
|
||||
|
||||
@@ -363,7 +363,7 @@ dev_from_mount_options (char const *mount_options)
|
||||
/* GNU/Linux allows file system implementations to define their own
|
||||
meaning for "dev=" mount options, so don't trust the meaning
|
||||
here. */
|
||||
# ifndef __linux__
|
||||
#ifndef __linux__
|
||||
static char const dev_pattern[] = ",dev=";
|
||||
char const *devopt = strstr (mount_options, dev_pattern);
|
||||
|
||||
|
||||
@@ -466,7 +466,7 @@ Může být jiná než verze firmwaru</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -456,7 +456,7 @@ die kann von der Menüsprache abweichen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation>Releases und Release Candidates (testing)</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -382,7 +382,7 @@ Mode 4:
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -456,7 +456,7 @@ Puede ser diferente del lenguaje del firmware</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -459,7 +459,7 @@ Voi olla eri kun firmwaren kieli</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -456,7 +456,7 @@ Può essere differente dalla lingua del firmware</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -404,7 +404,7 @@ Mode 4:
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="752"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation>リリースとRC (Test版) を使用</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -448,7 +448,7 @@ Może być różny od języka firmware</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -452,7 +452,7 @@ Behöver inte vara samma som menyspråk</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -401,7 +401,7 @@ Mode 4:
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../apppreferencesdialog.ui" line="806"/>
|
||||
<source>Use releases and release candidates (testing)</source>
|
||||
<source>Use release candidates (testing)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -44,14 +44,14 @@ WizMix::WizMix(const GeneralSettings & settings, unsigned int modelId, const Mod
|
||||
originalModelData(modelData),
|
||||
vehicle(NOVEHICLE)
|
||||
{
|
||||
strncpy(name, originalModelData.name, WIZ_MODEL_NAME_LENGTH);
|
||||
memset(name, 0, sizeof(name));
|
||||
strncpy(name, originalModelData.name, sizeof(name)-1);
|
||||
}
|
||||
|
||||
|
||||
void WizMix::maxMixSwitch(char *name, MixData &mix, int channel, int sw, int weight)
|
||||
{
|
||||
strncpy(mix.name, name, MIXDATA_NAME_LEN);
|
||||
mix.name[MIXDATA_NAME_LEN] = '\0';
|
||||
memset(mix.name, 0, sizeof(mix.name));
|
||||
strncpy(mix.name, name, sizeof(mix.name)-1);
|
||||
mix.destCh = channel;
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_MAX);
|
||||
mix.swtch = RawSwitch(SWITCH_TYPE_SWITCH, sw);
|
||||
@@ -75,7 +75,7 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int
|
||||
}
|
||||
else if (input==FLAPS_INPUT){
|
||||
// There ought to be some kind of constants for switches somewhere...
|
||||
maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SA0 :-SWITCH_ELE , weight); //Taranis-Horus SA-UP, 9X ELE-UP
|
||||
maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SA0 :-SWITCH_ELE , weight); //Taranis-Horus SA-UP, 9X ELE-UP
|
||||
maxMixSwitch((char *)"Flaps Dn", model.mixData[mixIndex++], channel+1, isHorusOrTaranis ? SWITCH_SA2 : SWITCH_ELE , -weight); //Taranis-Horus SA-DOWN, 9X ELE-DOWN
|
||||
|
||||
}
|
||||
@@ -91,7 +91,6 @@ WizMix::operator ModelData()
|
||||
int throttleChannel = -1;
|
||||
|
||||
ModelData model;
|
||||
//ModelData model(originalModelData);
|
||||
model.category = originalModelData.category;
|
||||
model.used = true;
|
||||
model.moduleData[0].modelId = modelId;
|
||||
@@ -101,8 +100,8 @@ WizMix::operator ModelData()
|
||||
int timerIndex = 0;
|
||||
|
||||
// Safe copy model name
|
||||
strncpy(model.name, name, WIZ_MODEL_NAME_LENGTH);
|
||||
model.name[WIZ_MODEL_NAME_LENGTH] = 0;
|
||||
memset(model.name, 0, sizeof(model.name));
|
||||
strncpy(model.name, name, sizeof(model.name)-1);
|
||||
|
||||
// Add the channel mixes
|
||||
for (int i=0; i<WIZ_MAX_CHANNELS; i++ )
|
||||
@@ -112,29 +111,36 @@ WizMix::operator ModelData()
|
||||
addMix(model, ch.input1, ch.weight1, i, mixIndex);
|
||||
addMix(model, ch.input2, ch.weight2, i, mixIndex);
|
||||
|
||||
if ((ch.input1 == THROTTLE_INPUT || ch.input2 == THROTTLE_INPUT) && options[THROTTLE_CUT_OPTION]) {
|
||||
// Add the Throttle Cut option
|
||||
MixData & mix = model.mixData[mixIndex++];
|
||||
mix.destCh = i+1;
|
||||
mix.srcRaw = SOURCE_TYPE_MAX;
|
||||
mix.weight = -100;
|
||||
mix.swtch.type = SWITCH_TYPE_SWITCH;
|
||||
mix.swtch.index = IS_ARM(getCurrentBoard()) ? SWITCH_SF0 : SWITCH_THR;
|
||||
mix.mltpx = MLTPX_REP;
|
||||
strncpy(mix.name, "Cut", MIXDATA_NAME_LEN);
|
||||
mix.name[MIXDATA_NAME_LEN] = '\0';
|
||||
if (ch.input1 == THROTTLE_INPUT || ch.input2 == THROTTLE_INPUT) {
|
||||
throttleChannel++;
|
||||
if (options[THROTTLE_CUT_OPTION]) {
|
||||
// Add the Throttle Cut option
|
||||
MixData & mix = model.mixData[mixIndex++];
|
||||
mix.destCh = i+1;
|
||||
mix.srcRaw = SOURCE_TYPE_MAX;
|
||||
mix.weight = -100;
|
||||
mix.swtch.type = SWITCH_TYPE_SWITCH;
|
||||
mix.swtch.index = IS_ARM(getCurrentBoard()) ? SWITCH_SF0 : SWITCH_THR;
|
||||
mix.mltpx = MLTPX_REP;
|
||||
memset(mix.name, 0, sizeof(mix.name));
|
||||
strncpy(mix.name, "Cut", MIXDATA_NAME_LEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the Flight Timer option
|
||||
if (options[FLIGHT_TIMER_OPTION] ){
|
||||
if (options[FLIGHT_TIMER_OPTION] && throttleChannel >= 0){
|
||||
memset(model.timers[timerIndex].name, 0, sizeof(model.timers[timerIndex].name));
|
||||
strncpy(model.timers[timerIndex].name, "Flt", sizeof(model.timers[timerIndex].name)-1);
|
||||
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
|
||||
model.timers[timerIndex].mode.index = TMRMODE_THR_TRG;
|
||||
timerIndex++;
|
||||
}
|
||||
|
||||
// Add the Throttle Timer option
|
||||
if (options[THROTTLE_TIMER_OPTION] && throttleChannel >=0){
|
||||
if (options[THROTTLE_TIMER_OPTION] && throttleChannel >= 0){
|
||||
memset(model.timers[timerIndex].name, 0, sizeof(model.timers[timerIndex].name));
|
||||
strncpy(model.timers[timerIndex].name, "Thr", sizeof(model.timers[timerIndex].name)-1);
|
||||
model.timers[timerIndex].mode.type = SWITCH_TYPE_TIMER_MODE;
|
||||
model.timers[timerIndex].mode.index = TMRMODE_THR;
|
||||
timerIndex++;
|
||||
|
||||
@@ -306,8 +306,8 @@ bool ModelSelectionPage::validatePage()
|
||||
QString newName(nameLineEdit->text());
|
||||
newName = (newName.normalized(QString::NormalizationForm_D));
|
||||
newName = newName.replace(QRegExp("[^ A-Za-z0-9_.-,\\s]"), "");
|
||||
strncpy( wizDlg->mix.name, newName.toLatin1(), WIZ_MODEL_NAME_LENGTH);
|
||||
wizDlg->mix.name[WIZ_MODEL_NAME_LENGTH] = 0;
|
||||
memset(wizDlg->mix.name, 0, sizeof(wizDlg->mix.name));
|
||||
strncpy( wizDlg->mix.name, newName.toLatin1(), sizeof(wizDlg->mix.name)-1);
|
||||
|
||||
if (multirotorRB->isChecked())
|
||||
wizDlg->mix.vehicle = MULTICOPTER;
|
||||
@@ -1053,7 +1053,7 @@ QString WizardPrinter::printChannel( Input input1, int weight1, Input input2, in
|
||||
|
||||
QString WizardPrinter::print()
|
||||
{
|
||||
QString str = tr("Model Name: ") + mix->name + "\n";
|
||||
QString str = tr("Model Name: ") + QString::fromUtf8(mix->name) + "\n";
|
||||
str += tr("Model Type: ") + vehicleName(mix->vehicle) + "\n";
|
||||
|
||||
str += tr("Options: ") + "[";
|
||||
@@ -1075,6 +1075,3 @@ QString WizardPrinter::print()
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -87,11 +87,11 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_NEXT then
|
||||
selectDevice(1)
|
||||
elseif event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectDevice(-1)
|
||||
end
|
||||
|
||||
@@ -105,7 +105,7 @@ local function run(event)
|
||||
else
|
||||
for i=1, #devices do
|
||||
local attr = (lineIndex == i and INVERS or 0)
|
||||
if event == EVT_ROT_BREAK and attr == INVERS then
|
||||
if event == EVT_VIRTUAL_ENTER and attr == INVERS then
|
||||
crossfireTelemetryPush(0x28, { devices[i].id, 0xEA })
|
||||
return "device.lua"
|
||||
end
|
||||
|
||||
@@ -435,7 +435,7 @@ local function runDevicePage(event)
|
||||
else
|
||||
return "crossfire.lua"
|
||||
end
|
||||
elseif event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_EXIT then -- toggle editing/selecting current field
|
||||
local field = getField(lineIndex)
|
||||
if field.name then
|
||||
if field.type == 10 then
|
||||
@@ -456,15 +456,15 @@ local function runDevicePage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_ROT_LEFT then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
incrField(1)
|
||||
elseif event == EVT_ROT_RIGHT then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
incrField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_ROT_RIGHT then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_ROT_LEFT then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -1,318 +0,0 @@
|
||||
---- #########################################################################
|
||||
---- # #
|
||||
---- # Copyright (C) OpenTX #
|
||||
-----# #
|
||||
---- # 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. #
|
||||
---- # #
|
||||
---- #########################################################################
|
||||
local VALUE = 0
|
||||
local COMBO = 1
|
||||
|
||||
local COLUMN_2 = 300
|
||||
|
||||
local edit = false
|
||||
local page = 1
|
||||
local current = 1
|
||||
local refreshState = 0
|
||||
local refreshIndex = 0
|
||||
local calibrationState = 0
|
||||
local pageOffset = 0
|
||||
local calibrationStep = 0
|
||||
local pages = {}
|
||||
local fields = {}
|
||||
local modifications = {}
|
||||
local wingBitmaps = {}
|
||||
local mountBitmaps = {}
|
||||
|
||||
local configFields = {
|
||||
{"Wing type:", COMBO, 0x80, nil, { "Normal", "Delta", "VTail" } },
|
||||
{"Mounting type:", COMBO, 0x81, nil, { "Horz", "Horz rev.", "Vert", "Vert rev." } },
|
||||
}
|
||||
local wingBitmapsFile = {"img/plane_b.png", "img/delta_b.png", "img/planev_b.png"}
|
||||
local mountBitmapsFile = {"img/up.png", "img/down.png", "img/vert.png", "img/vert-r.png"}
|
||||
|
||||
local settingsFields = {
|
||||
{"SxR functions:", COMBO, 0x9C, nil, { "Disable", "Enable" } },
|
||||
{"Quick Mode:", COMBO, 0xAA, nil, { "Disable", "Enable" } },
|
||||
{"CH5 mode:", COMBO, 0xA8, nil, { "AIL2", "AUX1" } },
|
||||
{"CH6 mode:", COMBO, 0xA9, nil, { "ELE2", "AUX2" } },
|
||||
{"AIL direction:", COMBO, 0x82, nil, { "Normal", "Invers" }, { 255, 0 } },
|
||||
{"ELE direction:", COMBO, 0x83, nil, { "Normal", "Invers" }, { 255, 0 } },
|
||||
{"RUD direction:", COMBO, 0x84, nil, { "Normal", "Invers" }, { 255, 0 } },
|
||||
{"AIL2 direction:", COMBO, 0x9A, nil, { "Normal", "Invers" }, { 255, 0 } },
|
||||
{"ELE2 direction:", COMBO, 0x9B, nil, { "Normal", "Invers" }, { 255, 0 } },
|
||||
{"AIL stabilize gain:", VALUE, 0x85, nil, 0, 200, "%"},
|
||||
{"ELE stabilize gain:", VALUE, 0x86, nil, 0, 200, "%"},
|
||||
{"RUD stabilize gain:", VALUE, 0x87, nil, 0, 200, "%"},
|
||||
{"AIL auto level gain:", VALUE, 0x88, nil, 0, 200, "%"},
|
||||
{"ELE auto level gain:", VALUE, 0x89, nil, 0, 200, "%"},
|
||||
{"ELE upright gain:", VALUE, 0x8C, nil, 0, 200, "%"},
|
||||
{"RUD upright gain:", VALUE, 0x8D, nil, 0, 200, "%"},
|
||||
{"AIL crab gain:", VALUE, 0x8E, nil, 0, 200, "%"},
|
||||
{"RUD crab gain:", VALUE, 0x90, nil, 0, 200, "%"},
|
||||
{"AIL auto angle offset:", VALUE, 0x91, nil, -20, 20, "%", 0x6C},
|
||||
{"ELE auto angle offset:", VALUE, 0x92, nil, -20, 20, "%", 0x6C},
|
||||
{"ELE upright angle offset:", VALUE, 0x95, nil, -20, 20, "%", 0x6C},
|
||||
{"RUD upright angle offset:", VALUE, 0x96, nil, -20, 20, "%", 0x6C},
|
||||
{"AIL crab angle offset:", VALUE, 0x97, nil, -20, 20, "%", 0x6C},
|
||||
{"RUD crab angle offset:", VALUE, 0x99, nil, -20, 20, "%", 0x6C},
|
||||
}
|
||||
|
||||
local calibrationFields = {
|
||||
{"X:", VALUE, 0x9E, 0, -100, 100, "%"},
|
||||
{"Y:", VALUE, 0x9F, 0, -100, 100, "%"},
|
||||
{"Z:", VALUE, 0xA0, 0, -100, 100, "%"}
|
||||
}
|
||||
|
||||
local function drawScreenTitle(title,page, pages)
|
||||
lcd.drawFilledRectangle(0, 0, LCD_W, 30, TITLE_BGCOLOR)
|
||||
lcd.drawText(1, 5, title, MENU_TITLE_COLOR)
|
||||
lcd.drawText(LCD_W-40, 5, page.."/"..pages, MENU_TITLE_COLOR)
|
||||
end
|
||||
|
||||
-- Change display attribute to current field
|
||||
local function addField(step)
|
||||
local field = fields[current]
|
||||
local min, max
|
||||
if field[2] == VALUE then
|
||||
min = field[5]
|
||||
max = field[6]
|
||||
elseif field[2] == COMBO then
|
||||
min = 0
|
||||
max = #(field[5]) - 1
|
||||
end
|
||||
if (step < 0 and field[4] > min) or (step > 0 and field[4] < max) then
|
||||
field[4] = field[4] + step
|
||||
end
|
||||
end
|
||||
|
||||
-- Select the next or previous page
|
||||
local function selectPage(step)
|
||||
page = 1 + ((page + step - 1 + #pages) % #pages)
|
||||
refreshIndex = 0
|
||||
calibrationStep = 0
|
||||
pageOffset = 0
|
||||
end
|
||||
|
||||
-- Select the next or previous editable field
|
||||
local function selectField(step)
|
||||
current = 1 + ((current + step - 1 + #fields) % #fields)
|
||||
if current > 7 + pageOffset then
|
||||
pageOffset = current - 7
|
||||
elseif current <= pageOffset then
|
||||
pageOffset = current - 1
|
||||
end
|
||||
end
|
||||
|
||||
local function drawProgressBar()
|
||||
local width = (300 * refreshIndex) / #fields
|
||||
lcd.drawRectangle(100, 10, 300, 6)
|
||||
lcd.drawFilledRectangle(102, 13, width, 2);
|
||||
end
|
||||
|
||||
-- Redraw the current page
|
||||
local function redrawFieldsPage(event)
|
||||
lcd.clear()
|
||||
drawScreenTitle("SxR", page, #pages)
|
||||
|
||||
if refreshIndex < #fields then
|
||||
drawProgressBar()
|
||||
end
|
||||
|
||||
for index = 1, 10, 1 do
|
||||
local field = fields[pageOffset+index]
|
||||
if field == nil then
|
||||
break
|
||||
end
|
||||
|
||||
local attr = current == (pageOffset+index) and ((edit == true and BLINK or 0) + INVERS) or 0
|
||||
attr = attr + TEXT_COLOR
|
||||
|
||||
lcd.drawText(1, 30+20*index, field[1], TEXT_COLOR)
|
||||
|
||||
if field[4] == nil then
|
||||
lcd.drawText(COLUMN_2, 30+20*index, "---", attr)
|
||||
else
|
||||
if field[2] == VALUE then
|
||||
lcd.drawNumber(COLUMN_2, 30+20*index, field[4], LEFT + attr)
|
||||
elseif field[2] == COMBO then
|
||||
if field[4] >= 0 and field[4] < #(field[5]) then
|
||||
lcd.drawText(COLUMN_2, 30+20*index, field[5][1+field[4]], attr)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function telemetryRead(field)
|
||||
return sportTelemetryPush(0x17, 0x30, 0x0C30, field)
|
||||
end
|
||||
|
||||
local function telemetryWrite(field, value)
|
||||
return sportTelemetryPush(0x17, 0x31, 0x0C30, field + value*256)
|
||||
end
|
||||
|
||||
local telemetryPopTimeout = 0
|
||||
local function refreshNext()
|
||||
if refreshState == 0 then
|
||||
if calibrationState == 1 then
|
||||
if telemetryWrite(0x9D, calibrationStep) == true then
|
||||
refreshState = 1
|
||||
calibrationState = 2
|
||||
telemetryPopTimeout = getTime() + 120 -- normal delay is 500ms
|
||||
end
|
||||
elseif #modifications > 0 then
|
||||
telemetryWrite(modifications[1][1], modifications[1][2])
|
||||
modifications[1] = nil
|
||||
elseif refreshIndex < #fields then
|
||||
local field = fields[refreshIndex + 1]
|
||||
if telemetryRead(field[3]) == true then
|
||||
refreshState = 1
|
||||
telemetryPopTimeout = getTime() + 80 -- normal delay is 500ms
|
||||
end
|
||||
end
|
||||
elseif refreshState == 1 then
|
||||
local physicalId, primId, dataId, value = sportTelemetryPop()
|
||||
if physicalId == 0x1A and primId == 0x32 and dataId == 0x0C30 then
|
||||
local fieldId = value % 256
|
||||
if calibrationState == 2 then
|
||||
if fieldId == 0x9D then
|
||||
refreshState = 0
|
||||
calibrationState = 0
|
||||
calibrationStep = (calibrationStep + 1) % 7
|
||||
end
|
||||
else
|
||||
local field = fields[refreshIndex + 1]
|
||||
if fieldId == field[3] then
|
||||
local value = math.floor(value / 256)
|
||||
if field[3] == 0xAA then
|
||||
value = bit32.band(value, 0x0001)
|
||||
end
|
||||
if field[3] >= 0x9E and field[3] <= 0xA0 then
|
||||
local b1 = value % 256
|
||||
local b2 = math.floor(value / 256)
|
||||
value = b1*256 + b2
|
||||
value = value - bit32.band(value, 0x8000) * 2
|
||||
end
|
||||
if field[2] == COMBO and #field == 6 then
|
||||
for index = 1, #(field[6]), 1 do
|
||||
if value == field[6][index] then
|
||||
value = index - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
elseif field[2] == VALUE and #field == 8 then
|
||||
value = value - field[8] + field[5]
|
||||
end
|
||||
fields[refreshIndex + 1][4] = value
|
||||
refreshIndex = refreshIndex + 1
|
||||
refreshState = 0
|
||||
end
|
||||
end
|
||||
elseif getTime() > telemetryPopTimeout then
|
||||
fields[refreshIndex + 1][4] = nil
|
||||
refreshIndex = refreshIndex + 1
|
||||
refreshState = 0
|
||||
calibrationState = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function updateField(field)
|
||||
local value = field[4]
|
||||
if field[2] == COMBO and #field == 6 then
|
||||
value = field[6][1+value]
|
||||
elseif field[2] == VALUE and #field == 8 then
|
||||
value = value + field[8] - field[5]
|
||||
end
|
||||
modifications[#modifications+1] = { field[3], value }
|
||||
end
|
||||
|
||||
-- Main
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then -- exit script
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then -- toggle editing/selecting current field
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
updateField(fields[current])
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_PLUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_PLUS_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
redrawFieldsPage(event)
|
||||
return 0
|
||||
end
|
||||
|
||||
local function runConfigPage(event)
|
||||
fields = configFields
|
||||
local result = runFieldsPage(event)
|
||||
if fields[1][4] ~= nil then
|
||||
if wingBitmaps[1 + fields[1][4]] == nil then
|
||||
wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]])
|
||||
end
|
||||
lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90)
|
||||
end
|
||||
if fields[2][4] ~= nil then
|
||||
if mountBitmaps[1 + fields[2][4]] == nil then
|
||||
mountBitmaps[1 + fields[2][4]] = Bitmap.open(mountBitmapsFile[1 + fields[2][4]])
|
||||
end
|
||||
lcd.drawBitmap(mountBitmaps[1 + fields[2][4]], 190, 110)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
local function runSettingsPage(event)
|
||||
fields = settingsFields
|
||||
return runFieldsPage(event)
|
||||
end
|
||||
|
||||
-- Init
|
||||
local function init()
|
||||
current, edit, refreshState, refreshIndex = 1, false, 0, 0
|
||||
pages = {
|
||||
runConfigPage,
|
||||
runSettingsPage,
|
||||
}
|
||||
end
|
||||
|
||||
-- Main
|
||||
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
|
||||
selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
||||
local result = pages[page](event)
|
||||
refreshNext()
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
return { init=init, run=run }
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,3 +1,4 @@
|
||||
local toolName = "TNS|Crossfire setup|TNE"
|
||||
---- #########################################################################
|
||||
---- # #
|
||||
---- # Copyright (C) OpenTX #
|
||||
@@ -85,11 +86,11 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a model script!")
|
||||
return 2
|
||||
elseif event == EVT_EXIT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_DOWN_BREAK then
|
||||
elseif event == EVT_VIRTUAL_NEXT then
|
||||
selectDevice(1)
|
||||
elseif event == EVT_ROT_RIGHT or event == EVT_UP_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectDevice(-1)
|
||||
end
|
||||
|
||||
@@ -100,7 +101,7 @@ local function run(event)
|
||||
else
|
||||
for i=1, #devices do
|
||||
local attr = (lineIndex == i and INVERS or 0)
|
||||
if (event == EVT_ROT_BREAK or event == EVT_RIGHT_BREAK) and attr == INVERS then
|
||||
if event == EVT_VIRTUAL_ENTER and attr == INVERS then
|
||||
crossfireTelemetryPush(0x28, { devices[i].id, 0xEA })
|
||||
return "device.lua"
|
||||
end
|
||||
@@ -419,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)
|
||||
@@ -430,7 +430,7 @@ local function runDevicePage(event)
|
||||
else
|
||||
return "crossfire.lua"
|
||||
end
|
||||
elseif event == EVT_ROT_BREAK or event == EVT_RIGHT_BREAK then -- toggle editing/selecting current field
|
||||
elseif event == EVT_VIRTUAL_ENTER then -- toggle editing/selecting current field
|
||||
local field = getField(lineIndex)
|
||||
if field.name then
|
||||
if field.type == 10 then
|
||||
@@ -451,15 +451,15 @@ local function runDevicePage(event)
|
||||
end
|
||||
end
|
||||
elseif edit then
|
||||
if event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REPT then
|
||||
incrField(1)
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS or event == EVT_VIRTUAL_PREVIOUS_REPT then
|
||||
incrField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_ROT_RIGHT or event == EVT_DOWN_BREAK then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_ROT_LEFT or event == EVT_UP_BREAK then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -322,9 +322,9 @@ end
|
||||
|
||||
-- Main1
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_ENTER then
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -332,15 +332,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_RIGHT_FIRST then
|
||||
if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT or event == EVT_LEFT_FIRST then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS or event == EVT_VIRTUAL_PREVIOUS_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_DOWN_FIRST then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT or event == EVT_UP_FIRST then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -498,9 +498,9 @@ local function run(event)
|
||||
if event == nil then
|
||||
error("Cannot be run as a sensor script!")
|
||||
return 2
|
||||
elseif event == EVT_PAGE_BREAK or event == EVT_PAGEDN_FIRST or event == EVT_SHIFT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_NEXT_PAGE then
|
||||
selectPage(1)
|
||||
elseif event == EVT_PAGE_LONG or event == EVT_PAGEUP_FIRST or event == EVT_SHIFT_LONG then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS_PAGE then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
---- #########################################################################
|
||||
---- # #
|
||||
---- # Copyright (C) OpenTX #
|
||||
@@ -211,10 +210,10 @@ end
|
||||
|
||||
-- Main1
|
||||
local function runFieldsPage(event)
|
||||
if event == EVT_EXIT_BREAK then
|
||||
if event == EVT_VIRTUAL_EXIT then
|
||||
telemetryUnIdle(0x80)
|
||||
return 2
|
||||
elseif event == EVT_ENTER_BREAK or event == EVT_ROT_BREAK then
|
||||
elseif event == EVT_VIRTUAL_ENTER then
|
||||
if fields[current][4] ~= nil then
|
||||
edit = not edit
|
||||
if edit == false then
|
||||
@@ -222,15 +221,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_RIGHT_FIRST then
|
||||
if event == EVT_VIRTUAL_NEXT or event == EVT_VIRTUAL_NEXT_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT or event == EVT_LEFT_FIRST then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS or event == EVT_VIRTUAL_PREVIOUS_REPT then
|
||||
addField(-1)
|
||||
end
|
||||
else
|
||||
if event == EVT_MINUS_FIRST or event == EVT_ROT_RIGHT or event == EVT_DOWN_FIRST then
|
||||
if event == EVT_VIRTUAL_NEXT then
|
||||
selectField(1)
|
||||
elseif event == EVT_PLUS_FIRST or event == EVT_ROT_LEFT or event == EVT_UP_FIRST then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -258,9 +258,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
|
||||
@@ -268,15 +268,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_REPT then
|
||||
addField(1)
|
||||
elseif event == EVT_MINUS_FIRST or event == EVT_ROT_LEFT or event == EVT_MINUS_REPT then
|
||||
elseif event == EVT_VIRTUAL_PREVIOUS or event == EVT_VIRTUAL_PREVIOUS_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_PREVIOUS then
|
||||
selectField(-1)
|
||||
end
|
||||
end
|
||||
@@ -302,7 +302,7 @@ local function runConfigPage(event)
|
||||
if wingBitmaps[1 + fields[1][4]] == nil then
|
||||
wingBitmaps[1 + fields[1][4]] = Bitmap.open(wingBitmapsFile[1 + fields[1][4]])
|
||||
end
|
||||
lcd.drawBitmap(wingBitmapsFile[1 + fields[1][4]], 10, 90)
|
||||
lcd.drawBitmap(wingBitmaps[1 + fields[1][4]], 10, 90)
|
||||
else
|
||||
lcd.drawPixmap(20, 28, wingBitmapsFile[1 + fields[1][4]])
|
||||
end
|
||||
@@ -346,9 +346,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_PREVIOUS_PAGE then
|
||||
killEvents(event);
|
||||
selectPage(-1)
|
||||
end
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 7.7 KiB |