Compare commits
240 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d0c696c1bc | |||
| 7b75c04b30 | |||
| 572cfd67af | |||
| c7a07ded12 | |||
| 4e7181fb7e | |||
| fce1cc681a | |||
| a7b62fc2a9 | |||
| 6fcecb5666 | |||
| d837739e4f | |||
| a530bc7a6f | |||
| 32a7c9aee6 | |||
| 5fe10c118d | |||
| 815fef458c | |||
| 20eff3358a | |||
| 98c1503bed | |||
| 7c8093b70f | |||
| edba5bcf89 | |||
| 0a75eb93d3 | |||
| a2c30b1849 | |||
| 386cb2c912 | |||
| 60dc533fe8 | |||
| 6c0a9714fc | |||
| 15469aeaf7 | |||
| a8ff8b524b | |||
| 2378080ae8 | |||
| 23e16b26f1 | |||
| 3353d989bb | |||
| 58659b9b1a | |||
| f4eab9bf58 | |||
| 57f5f68804 | |||
| 5c4b12dfc2 | |||
| 99ff846209 | |||
| 37dd2b0064 | |||
| 9c20658e26 | |||
| 6e6e80bcfc | |||
| 185ad88bc8 | |||
| 54405135c0 | |||
| d7cf14857e | |||
| 5417c426e3 | |||
| 3f6621b087 | |||
| 151fb59e27 | |||
| a2902280b0 | |||
| 10832ad60a | |||
| 121f7780c2 | |||
| 25d233e832 | |||
| 46de8229dd | |||
| 813956721d | |||
| 302bf05f57 | |||
| 977e44d44a | |||
| 105ac6306a | |||
| 3c1734bdb2 | |||
| 9546843bc2 | |||
| bf89c53f33 | |||
| 406e69ab1d | |||
| 753cb4f01c | |||
| 40c34644b8 | |||
| b3b534cd6d | |||
| 491886a5c2 | |||
| 44c096c366 | |||
| 68eafbfba7 | |||
| dd5fd62b41 | |||
| a1bc46e473 | |||
| eedaf1966e | |||
| 3cbbcf18c8 | |||
| 9a70c84179 | |||
| 9546636f0a | |||
| ecd9f1e2cf | |||
| 310321ce0e | |||
| 39c0b79f85 | |||
| 70e93fb493 | |||
| 8a202f0ecc | |||
| 53a77a5bdb | |||
| b83ad1899a | |||
| 80aee0d126 | |||
| df82aeed76 | |||
| 70d67dd7dd | |||
| 922220c748 | |||
| 819509b63a | |||
| db072442c8 | |||
| c1efd39df7 | |||
| f5dca813fb | |||
| 1bc8e0d6c1 | |||
| 0fba4a638d | |||
| 71530f253d | |||
| 274ed3a917 | |||
| ebae27272e | |||
| 3049ff768e | |||
| f6bff9683d | |||
| 013c10e7fb | |||
| af38cb6dff | |||
| 3d461b771f | |||
| cee35869ba | |||
| b6a2e89c17 | |||
| 7cf03bd74e | |||
| 776dec5c74 | |||
| 23b9d77217 | |||
| 06dc5136f7 | |||
| b8b6263c75 | |||
| 8cc98a53f3 | |||
| 67e0ecfa0b | |||
| b7f52f2521 | |||
| c6e9939024 | |||
| dd3cbda0c7 | |||
| 260c7cd0c0 | |||
| ee6b2da037 | |||
| f52c95ed55 | |||
| d2ed8d9287 | |||
| a9c60a45e9 | |||
| 0cfe5b6c76 | |||
| c8115c674d | |||
| b67dfbd086 | |||
| 4e4d0fe883 | |||
| 34c311a562 | |||
| 1da0f157de | |||
| 545f54a89c | |||
| dad815f631 | |||
| 9ca09d0a85 | |||
| 71f8b663cb | |||
| be9a26611f | |||
| d9362d2634 | |||
| 09d6fa833f | |||
| c7ff93fdf4 | |||
| c2e73c74a6 | |||
| d2e38364e6 | |||
| 404eefc3da | |||
| ba1c429554 | |||
| 0df47c19c7 | |||
| 027df32564 | |||
| 21353d2b31 | |||
| f1df8ead68 | |||
| dbac5b773f | |||
| fb1cdeeac1 | |||
| 8a66e883ec | |||
| 1922bc9edd | |||
| cc41d69954 | |||
| 771b7a1821 | |||
| a3fa0bd79d | |||
| 19e68bac4d | |||
| 983e9f2f2b | |||
| 311b5e1d04 | |||
| 9b002b94ca | |||
| 69cbb06470 | |||
| 2b25071e8c | |||
| c9d465ca2a | |||
| e1dfb15ba9 | |||
| 7e44eab63c | |||
| 7e7a762617 | |||
| d5c2d51dea | |||
| 7d2e48a99b | |||
| 4ea9e5c11f | |||
| 8f96f50a84 | |||
| c90bf43d17 | |||
| 2549e2a2de | |||
| 658ca48137 | |||
| c64369e95f | |||
| 6eec7789cc | |||
| 1b6f34069a | |||
| 98b4d26676 | |||
| 62ae7ef2bd | |||
| c9a58e5cfa | |||
| 4d5c4621c7 | |||
| 2af072ea7f | |||
| 2341f5be68 | |||
| a100af81be | |||
| 6f21556b81 | |||
| 8d97235f41 | |||
| 0559abd323 | |||
| d0211c5dc6 | |||
| f42cf4c0f4 | |||
| a8d4ba5758 | |||
| a94d08606f | |||
| 0a213389f4 | |||
| 7041a4dac6 | |||
| 97cc519bcb | |||
| 6fffd7fbae | |||
| d2bd78b366 | |||
| e758d524de | |||
| d967ec0b80 | |||
| 4509b1a2a7 | |||
| 4626550c53 | |||
| 7b469016c1 | |||
| 29e9039176 | |||
| 370728433a | |||
| f6b07ceda8 | |||
| 2c08118d6d | |||
| 7c8deb8a48 | |||
| b427fd1364 | |||
| 611f85113c | |||
| 76791c1961 | |||
| 7b28910cc2 | |||
| 841f11c21a | |||
| f845be683c | |||
| a1e2132c12 | |||
| dec83e2ef5 | |||
| f9897c0191 | |||
| 668fadb737 | |||
| 1f06e7982a | |||
| 7336d92a6d | |||
| 7b490b03d9 | |||
| 7958ff7105 | |||
| 1492d808f3 | |||
| 84fe232b0c | |||
| 51b8d70cc6 | |||
| 576ce4983d | |||
| b1170b2ab9 | |||
| 41d0675886 | |||
| 5048ce5d45 | |||
| 268f168218 | |||
| 08d4cb15aa | |||
| 2e252aacac | |||
| d23a1f5739 | |||
| 863ed513c0 | |||
| 18f28270f0 | |||
| 11ced4eecf | |||
| 44e73bac96 | |||
| 8ba9016580 | |||
| 17171b2166 | |||
| 34731af074 | |||
| 654dac1acc | |||
| 90ebaf2d88 | |||
| 2b804f92b5 | |||
| e1e60b5572 | |||
| 4b9f69a666 | |||
| 1c86a16c84 | |||
| 0cf3aeef57 | |||
| b04295ad44 | |||
| 6147c23c0f | |||
| cad3b7726d | |||
| 895afcc58c | |||
| df6d77289c | |||
| 4ad6ea8190 | |||
| a480c6ce87 | |||
| 17c176084c | |||
| 5fdff961a6 | |||
| 475f1f1b2a | |||
| 1a23b0c8d1 | |||
| 92b5b72350 | |||
| b639466a4f | |||
| 0347883fdd | |||
| 46cc410da7 |
@@ -0,0 +1,3 @@
|
||||
<a href="http://3drobotics.com">3D Robotics</a>
|
||||
They sell the Iris+ with a modified version of OpenTX which doesn't fullfil the GPL requirements.
|
||||
No donations, no thanks, we are just free staff for them...
|
||||
@@ -770,3 +770,23 @@ Ron Powell
|
||||
Alain Labonne
|
||||
Carol Sills
|
||||
Franck Aßmann
|
||||
Larry Anderson
|
||||
Mikael Wallbäck
|
||||
Wes Warner
|
||||
Christoffer H Henni
|
||||
Donna Bayer
|
||||
Garry Ogilvie
|
||||
Karlheinz Sirsch
|
||||
Fred Larssen
|
||||
Rob Coppock
|
||||
Franz Josef Hahn
|
||||
Serge Ribault
|
||||
Tanguy Le Moign
|
||||
Barrett Powell
|
||||
Patrice Lafeuille
|
||||
Martin Blume
|
||||
Marek Kopyto
|
||||
Marco Lange
|
||||
Gary Nix
|
||||
Jack Oliphant
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
##OpenTX Next Branch
|
||||
##OpenTX 2.1 Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
|
||||
|
||||
The stable release code is not here, it is in the master branch.
|
||||
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
|
||||
The ongoing development is not done in this branch. It is performed in the branch called next.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
|
||||
@@ -1,3 +1,34 @@
|
||||
<h2>Version 2.1.1 / 2015-08-06</h2>
|
||||
<ul>
|
||||
<li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li>
|
||||
<li>DSM receiver numbers for external module were not converted from previous version EEPROM (<a href=https://github.com/opentx/opentx/issues/2474>#2474</a>)</li>
|
||||
<li>Precision incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2479>#2479</a>)</li>
|
||||
<li>Unit incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2485>#2485</a>)</li>
|
||||
<li>Fixed import/export of trim values (<a href=https://github.com/opentx/opentx/issues/2484>#2484</a>)</li>
|
||||
<li>Removed constant access to floppy disk (<a href=https://github.com/opentx/opentx/issues/2160>#2160</a>)</li>
|
||||
<li>Telemetry view script combo box list was empty (<a href=https://github.com/opentx/opentx/issues/2465>#2465</a>)</li>
|
||||
<li>Telemetry view bars ranges not transfered to radio (<a href=https://github.com/opentx/opentx/issues/2491>#2491</a>)</li>
|
||||
<li>Fixed Standalone simulator radio selection display problem (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
|
||||
<li>Added missing simulation libraries and enabled side by side installation of Companion 2.0 and 2.1 on Linux (<a href=https://github.com/opentx/opentx/issues/2500>#2500</a>)</li>
|
||||
<li>Standalone simulator now remembers which radio was simulated in previous session (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
|
||||
<li>Radio calibration value were not displayed (<a href=https://github.com/opentx/opentx/issues/2502>#2502</a>)</li>
|
||||
<li>Fixed Vario / Voltage / Current sources export problem</li>
|
||||
<li>Writing model settings to 9XR-PRO did not work (<a href=https://github.com/opentx/opentx/issues/2402>#2402</a>, <a href=https://github.com/opentx/opentx/issues/2517>#2517</a>)</li>
|
||||
<li>Model Print and Model Compare improvements</li>
|
||||
<li>Fixed Companion OSX version (<a href=https://github.com/opentx/opentx/issues/2549>#2549</a>)</li>
|
||||
<li>Firmware nightly builds are now downloadable from nightly builds of Companion (<a href=https://github.com/opentx/opentx/issues/2526>#2526</a>,<a href=https://github.com/opentx/opentx/issues/2634>#2634</a>)</li>
|
||||
<li>Fixed telemetry item lists (<a href=https://github.com/opentx/opentx/issues/2541>#2541</a>)</li>
|
||||
<li>Fixed missing pots P1..P3 for 9X (<a href=https://github.com/opentx/opentx/issues/2543>#2543</a>)</li>
|
||||
<li>Fixed "Invalid model and settings" error message when writing models and settings to the radio (<a href=https://github.com/opentx/opentx/issues/2544>#2544</a>)</li>
|
||||
<li>Global Functions fixes (<a href=https://github.com/opentx/opentx/issues/2558>#2558</a>)</li>
|
||||
<li>Export to Google Earth now working (only) with the new telemetry fields (GPS, GAlt and GSpd) (<a href=https://github.com/opentx/opentx/issues/2546>#2546</a>)</li>
|
||||
<li>Fixed unsuccessful writing of setting to the radio for 9XR PRO (<a href=https://github.com/opentx/opentx/issues/2605>#2605</a>)</li>
|
||||
<li>Fixed missing LUA script outputs in special function "Play Value" (<a href=https://github.com/opentx/opentx/issues/2649>#2649</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.0 / 2015-07-16</h2>
|
||||
<ul>
|
||||
<li>SD card synchronizaton tool</li>
|
||||
|
||||
@@ -1,17 +1,33 @@
|
||||
PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "1" )
|
||||
SET( C9X_VERSION_REVISION "0" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
SET(C9X_VERSION_MAJOR "2")
|
||||
SET(C9X_VERSION_MINOR "1")
|
||||
SET(C9X_VERSION_REVISION "1")
|
||||
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
|
||||
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
|
||||
MESSAGE(STATUS OpenTX Companion ${C9X_VERSION})
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
SET(C9X_NAME_SUFFIX ${C9X_VERSION_MAJOR}${C9X_VERSION_MINOR})
|
||||
SET(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
SET(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
|
||||
SET( SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX} )
|
||||
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
SET(COMPANION_NAME "companion")
|
||||
SET(SIMULATOR_NAME "simulator")
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
OPTION(DEBUG_IMPORT "Turns on debug output for EEPROM import") # Disabled by default
|
||||
OPTION(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
|
||||
IF(ALLOW_NIGHTLY_BUILDS)
|
||||
ADD_DEFINITIONS(-DALLOW_NIGHTLY_BUILDS)
|
||||
ENDIF(ALLOW_NIGHTLY_BUILDS)
|
||||
|
||||
OPTION(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
|
||||
IF(DEBUG_IMPORT)
|
||||
ADD_DEFINITIONS( -DDEBUG_MODEL_IMPORT)
|
||||
MESSAGE( STATUS "EEPROM import debugging enabled" )
|
||||
@@ -156,6 +172,7 @@ set(companion_SRCS
|
||||
flashfirmwaredialog.cpp
|
||||
flasheepromdialog.cpp
|
||||
printdialog.cpp
|
||||
modelprinter.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
@@ -254,6 +271,8 @@ NOW(TIME)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( companion_SRCS ${companion_SRCS} icon.rc )
|
||||
@@ -279,14 +298,14 @@ QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
|
||||
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
ADD_EXECUTABLE( ${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
|
||||
ELSE( )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ADD_EXECUTABLE( ${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ENDIF( )
|
||||
|
||||
target_link_libraries(companion generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -309,33 +328,34 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
|
||||
else()
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
target_link_libraries(${SIMULATOR_NAME} simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( TARGETS simulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES companion.desktop DESTINATION share/applications )
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps )
|
||||
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps )
|
||||
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps )
|
||||
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps )
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
|
||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${QT_BINARY_DIR} )
|
||||
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR} )
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
IF( WIN32 )
|
||||
@@ -357,51 +377,50 @@ IF( WIN32 )
|
||||
"C:/Programs/NSIS"
|
||||
)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion-windows.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS companion.nsi
|
||||
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
COMMENT "Companion Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/simulatorInstall.exe
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/simulator-install.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS simulator.nsi
|
||||
DEPENDS simulator opentx-simulators ${PROJECT_BINARY_DIR}/simulator.nsi
|
||||
COMMENT "Simulator Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_TARGET( installer
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/simulatorInstall.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companion-windows.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/simulator-windows.exe
|
||||
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
SOURCES ${PROJECT_BINARY_DIR}/simulator.nsi
|
||||
)
|
||||
ENDIF( )
|
||||
|
||||
IF( APPLE )
|
||||
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
|
||||
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
|
||||
IF( CMAKE_GENERATOR STREQUAL Xcode )
|
||||
SET( WORK_DIR ${CMAKE_BINARY_DIR}/Debug )
|
||||
ELSE( )
|
||||
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
ADD_CUSTOM_TARGET( addframeworks
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync -r ${XSD_INCLUDE_DIR}/.. companion.app/Contents/Frameworks/
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${PROJECT_NAME} )
|
||||
|
||||
DEPENDS ${COMPANION_NAME} )
|
||||
|
||||
ADD_CUSTOM_TARGET( makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS addframeworks )
|
||||
|
||||
DEPENDS addframeworks opentx-simulators-bundle)
|
||||
ENDIF( )
|
||||
|
||||
ADD_CUSTOM_TARGET( stamp
|
||||
@@ -419,9 +438,10 @@ ELSE()
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "COMPANION")
|
||||
SET(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
|
||||
SET( CPACK_STRIP_FILES TRUE )
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
|
||||
@@ -512,6 +512,7 @@ QString AppData::mcu() { return _mcu; }
|
||||
QString AppData::programmer() { return _programmer; }
|
||||
QString AppData::sambaLocation() { return _sambaLocation; }
|
||||
QString AppData::sambaPort() { return _sambaPort; }
|
||||
QString AppData::lastSimulator() { return _lastSimulator; }
|
||||
|
||||
QString AppData::backupDir() { return _backupDir; }
|
||||
QString AppData::gePath() { return _gePath; }
|
||||
@@ -560,6 +561,7 @@ void AppData::mcu (const QString x) { store(x, _mcu,
|
||||
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
|
||||
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
|
||||
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
|
||||
void AppData::lastSimulator (const QString x) { store(x, _lastSimulator, "last_simulator" );}
|
||||
|
||||
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
|
||||
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
|
||||
@@ -716,6 +718,7 @@ AppData::AppData()
|
||||
getset( _programmer, "programmer" ,"usbasp" );
|
||||
getset( _sambaLocation, "samba_location" ,"" );
|
||||
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
|
||||
getset( _lastSimulator, "last_simulator" ,"" );
|
||||
|
||||
getset( _backupDir, "backupPath" ,"" );
|
||||
getset( _gePath, "gePath" ,"" );
|
||||
@@ -732,6 +735,9 @@ AppData::AppData()
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
|
||||
|
||||
getset( _useCompanionNightlyBuilds, "useCompanionNightlyBuilds" ,false );
|
||||
getset( _useFirmwareNightlyBuilds, "useFirmwareNightlyBuilds" ,false );
|
||||
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
getset( _showSplash, "show_splash" ,true );
|
||||
|
||||
@@ -216,6 +216,8 @@ class AppData: protected CompStoreObj
|
||||
BOOL_PROPERTY(outputDisplayDetails, false)
|
||||
BOOL_PROPERTY(backupOnFlash, true)
|
||||
BOOL_PROPERTY(checkHardwareCompatibility, true)
|
||||
BOOL_PROPERTY(useCompanionNightlyBuilds, false)
|
||||
BOOL_PROPERTY(useFirmwareNightlyBuilds, false)
|
||||
|
||||
// All the global variables
|
||||
public:
|
||||
@@ -240,6 +242,7 @@ class AppData: protected CompStoreObj
|
||||
QString _programmer;
|
||||
QString _sambaLocation;
|
||||
QString _sambaPort;
|
||||
QString _lastSimulator;
|
||||
|
||||
QString _backupDir;
|
||||
QString _gePath;
|
||||
@@ -290,6 +293,7 @@ class AppData: protected CompStoreObj
|
||||
QString programmer();
|
||||
QString sambaLocation();
|
||||
QString sambaPort();
|
||||
QString lastSimulator();
|
||||
|
||||
QString backupDir();
|
||||
QString gePath();
|
||||
@@ -339,6 +343,7 @@ class AppData: protected CompStoreObj
|
||||
void programmer (const QString);
|
||||
void sambaLocation (const QString);
|
||||
void sambaPort (const QString);
|
||||
void lastSimulator (const QString);
|
||||
|
||||
void backupDir (const QString);
|
||||
void gePath (const QString);
|
||||
|
||||
@@ -41,8 +41,10 @@ AppPreferencesDialog::~AppPreferencesDialog()
|
||||
|
||||
void AppPreferencesDialog::writeValues()
|
||||
{
|
||||
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
|
||||
g.autoCheckFw(ui->startupCheck_fw->isChecked());
|
||||
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
|
||||
g.autoCheckApp(ui->autoCheckCompanion->isChecked());
|
||||
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked());
|
||||
g.autoCheckFw(ui->autoCheckFirmware->isChecked());
|
||||
g.showSplash(ui->showSplash->isChecked());
|
||||
g.simuSW(ui->simuSW->isChecked());
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
@@ -107,8 +109,15 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
|
||||
ui->startupCheck_fw->setChecked(g.autoCheckFw());
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
#else
|
||||
ui->useCompanionNightlyBuilds->hide();
|
||||
ui->useFirmwareNightlyBuilds->hide();
|
||||
#endif
|
||||
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
|
||||
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
|
||||
@@ -290,6 +290,9 @@ May be different from firmware language</string>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -645,8 +648,8 @@ Mode 4:
|
||||
<string>Application Settings</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_companion9x">
|
||||
<item row="10" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="autoCheckCompanion">
|
||||
<property name="text">
|
||||
<string>Automatic check for Companion updates</string>
|
||||
</property>
|
||||
@@ -665,7 +668,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="3">
|
||||
<item row="13" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="backupEnable">
|
||||
<property name="text">
|
||||
<string>Enable automatic backup before writing firmware</string>
|
||||
@@ -679,24 +682,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_fw">
|
||||
<property name="text">
|
||||
<string>Automatic check for OpenTX firmware updates</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<item row="18" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -709,7 +695,24 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="11" column="1" colspan="3">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="autoCheckFirmware">
|
||||
<property name="text">
|
||||
<string>Automatic check for OpenTX firmware updates</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -749,7 +752,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -784,14 +787,14 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Automatic Backup Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1" colspan="3">
|
||||
<item row="14" column="1" colspan="3">
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -805,7 +808,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="16" column="1">
|
||||
<widget class="QLineEdit" name="libraryPath">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -815,7 +818,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QComboBox" name="splashincludeCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@@ -835,7 +838,7 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QLineEdit" name="backupPath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -848,7 +851,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<item row="12" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="backupPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
@@ -875,13 +878,33 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2" colspan="2">
|
||||
<item row="16" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="libraryPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="useFirmwareNightlyBuilds">
|
||||
<property name="text">
|
||||
<string>Use OpenTX firmware nightly builds</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="useCompanionNightlyBuilds">
|
||||
<property name="text">
|
||||
<string>Use Companion nightly builds</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="simulatorTab">
|
||||
@@ -1112,8 +1135,8 @@ Mode 4:
|
||||
<tabstop>historySize</tabstop>
|
||||
<tabstop>showSplash</tabstop>
|
||||
<tabstop>modelWizard_CB</tabstop>
|
||||
<tabstop>startupCheck_fw</tabstop>
|
||||
<tabstop>startupCheck_companion9x</tabstop>
|
||||
<tabstop>autoCheckFirmware</tabstop>
|
||||
<tabstop>autoCheckCompanion</tabstop>
|
||||
<tabstop>backupPath</tabstop>
|
||||
<tabstop>backupPathButton</tabstop>
|
||||
<tabstop>backupEnable</tabstop>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Companion
|
||||
Name=Companion @C9X_VERSION@
|
||||
GenericName=Transmitter Companion App
|
||||
Comment=The Ultimate Transmitter Companion
|
||||
Icon=companion
|
||||
Exec='companion'
|
||||
Icon=@COMPANION_NAME@
|
||||
Exec='@COMPANION_NAME@'
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Application
|
||||
@@ -4,6 +4,7 @@
|
||||
<file>icon.png</file>
|
||||
<file>../../CREDITS.txt</file>
|
||||
<file>../../DONATIONS.txt</file>
|
||||
<file>../../BLACKLIST.txt</file>
|
||||
<file>../releasenotes.txt</file>
|
||||
<file>images/9xdb.png</file>
|
||||
<file>images/9xdl.png</file>
|
||||
|
||||
+284
-621
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@
|
||||
#include <QtGui>
|
||||
#include <QDir>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
class CompareDialog;
|
||||
@@ -21,11 +22,10 @@ class CompareDialog : public QDialog
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
ModelData * g_model1;
|
||||
ModelData * g_model2;
|
||||
ModelData * modeltemp;
|
||||
int model1;
|
||||
int model2;
|
||||
ModelData g_model1;
|
||||
ModelData g_model2;
|
||||
bool model1Valid;
|
||||
bool model2Valid;
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
@@ -55,15 +55,20 @@ class CompareDialog : public QDialog
|
||||
return "grey";
|
||||
}
|
||||
|
||||
int ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused);
|
||||
bool ChannelHasExpo(ExpoData * expoArray, uint8_t destCh);
|
||||
int ModelHasMix(MixData * mixArray, MixData mix, bool * mixused);
|
||||
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
|
||||
bool handleDroppedModel(const QMimeData * mimeData, ModelData * model, QLabel * label);
|
||||
void applyDiffFont(QString & v1, QString & v2, const QString & font = "", bool eqGrey = false);
|
||||
void diffAndAssembleTableLines(QStringList & i1, QStringList & i2, QString & o1, QString & o2);
|
||||
|
||||
QTextEdit * te;
|
||||
QString curvefile1;
|
||||
QString curvefile2;
|
||||
QDir *qd;
|
||||
|
||||
ModelPrinter modelPrinter1;
|
||||
ModelPrinter modelPrinter2;
|
||||
GeneralSettings dummySettings;
|
||||
|
||||
private slots:
|
||||
void on_printButton_clicked();
|
||||
@@ -78,13 +83,13 @@ protected:
|
||||
void printSetup();
|
||||
void printPhases();
|
||||
void printLimits();
|
||||
void printExpos();
|
||||
void printInputs();
|
||||
void printMixers();
|
||||
void printCurves();
|
||||
void printGvars();
|
||||
void printSwitches();
|
||||
void printLogicalSwitches();
|
||||
void printSafetySwitches();
|
||||
void printFSwitches();
|
||||
void printCustomFunctions();
|
||||
void printFrSky();
|
||||
};
|
||||
|
||||
|
||||
@@ -59,12 +59,16 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
|
||||
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
|
||||
}
|
||||
|
||||
str.append(" <tr><td class=\"normal\"> </td></tr>" \
|
||||
" <tr><td colspan=3 class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
|
||||
" <tr><td colspan=3 class=\"normal\">" + tr("Thank you all !!!") + "</td></tr>" \
|
||||
str.append("<table><tr><td class=\"normal\"> </td></tr>" \
|
||||
" <tr><td class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
|
||||
"</table>");
|
||||
|
||||
|
||||
QFile blacklist(":/BLACKLIST.txt");
|
||||
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QStringList names;
|
||||
names << blacklist.readAll();
|
||||
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
|
||||
}
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
ui->textEditor->scroll(0, 0);
|
||||
|
||||
+108
-160
@@ -123,23 +123,23 @@ QString SensorData::unitString() const
|
||||
case UNIT_FEET:
|
||||
return QObject::tr("f");
|
||||
case UNIT_CELSIUS:
|
||||
return QObject::tr("°C");
|
||||
return QObject::trUtf8("°C");
|
||||
case UNIT_FAHRENHEIT:
|
||||
return QObject::tr("%F");
|
||||
return QObject::trUtf8("°F");
|
||||
case UNIT_PERCENT:
|
||||
return QObject::tr("%");
|
||||
case UNIT_MAH:
|
||||
return QObject::tr("mAh");
|
||||
case UNIT_WATTS:
|
||||
return QObject::tr("W");
|
||||
case UNIT_DBM:
|
||||
case UNIT_DB:
|
||||
return QObject::tr("dB");
|
||||
case UNIT_RPMS:
|
||||
return QObject::tr("rpms");
|
||||
case UNIT_G:
|
||||
return QObject::tr("g");
|
||||
case UNIT_DEGREE:
|
||||
return QObject::tr("°");
|
||||
return QObject::trUtf8("°");
|
||||
case UNIT_HOURS:
|
||||
return QObject::tr("hours");
|
||||
case UNIT_MINUTES:
|
||||
@@ -161,6 +161,14 @@ bool RawSource::isTimeBased() const
|
||||
return (type==SOURCE_TYPE_TELEMETRY && (index==TELEMETRY_SOURCE_TX_TIME || index==TELEMETRY_SOURCE_TIMER1 || index==TELEMETRY_SOURCE_TIMER2 || index==TELEMETRY_SOURCE_TIMER3));
|
||||
}
|
||||
|
||||
float RawSourceRange::getValue(int value)
|
||||
{
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard()))
|
||||
return float(value) * step;
|
||||
else
|
||||
return min + float(value) * step;
|
||||
}
|
||||
|
||||
RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSettings & settings, unsigned int flags) const
|
||||
{
|
||||
RawSourceRange result;
|
||||
@@ -553,7 +561,7 @@ QString SwitchDn(const char sw)
|
||||
return QString::fromUtf8(result);
|
||||
}
|
||||
|
||||
QString RawSwitch::toString()
|
||||
QString RawSwitch::toString() const
|
||||
{
|
||||
static const QString switches9X[] = {
|
||||
QString("THR"), QString("RUD"), QString("ELE"),
|
||||
@@ -651,7 +659,7 @@ QString RawSwitch::toString()
|
||||
}
|
||||
}
|
||||
|
||||
QString CurveReference::toString()
|
||||
QString CurveReference::toString() const
|
||||
{
|
||||
if (value == 0) {
|
||||
return "----";
|
||||
@@ -670,7 +678,7 @@ QString CurveReference::toString()
|
||||
}
|
||||
}
|
||||
|
||||
CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
CSFunctionFamily LogicalSwitchData::getFunctionFamily() const
|
||||
{
|
||||
if (func == LS_FN_EDGE)
|
||||
return LS_FAMILY_EDGE;
|
||||
@@ -686,7 +694,7 @@ CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
return LS_FAMILY_VCOMP;
|
||||
}
|
||||
|
||||
unsigned int LogicalSwitchData::getRangeFlags()
|
||||
unsigned int LogicalSwitchData::getRangeFlags() const
|
||||
{
|
||||
if (func == LS_FN_DPOS)
|
||||
return RANGE_DELTA_FUNCTION;
|
||||
@@ -696,7 +704,7 @@ unsigned int LogicalSwitchData::getRangeFlags()
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::funcToString()
|
||||
QString LogicalSwitchData::funcToString() const
|
||||
{
|
||||
switch (func) {
|
||||
case LS_FN_OFF:
|
||||
@@ -746,123 +754,6 @@ QString LogicalSwitchData::funcToString()
|
||||
}
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettings & settings)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
if (!func)
|
||||
return result;
|
||||
|
||||
if (andsw!=0) {
|
||||
result +="( ";
|
||||
}
|
||||
switch (getFunctionFamily()) {
|
||||
case LS_FAMILY_EDGE:
|
||||
result += QObject::tr("Edge(%1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3));
|
||||
break;
|
||||
case LS_FAMILY_STICKY:
|
||||
result += QObject::tr("Sticky(%1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString());
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
result += QObject::tr("Timer(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2));
|
||||
break;
|
||||
case LS_FAMILY_VOFS: {
|
||||
RawSource source = RawSource(val1);
|
||||
RawSourceRange range = source.getRange(&model, settings);
|
||||
QString res;
|
||||
if (val1)
|
||||
res += source.toString(&model);
|
||||
else
|
||||
res += "0";
|
||||
res.remove(" ");
|
||||
if (func == LS_FN_APOS || func == LS_FN_ANEG)
|
||||
res = "|" + res + "|";
|
||||
else if (func == LS_FN_DAPOS)
|
||||
res = "|d(" + res + ")|";
|
||||
else if (func == LS_FN_DPOS) result = "d(" + res + ")";
|
||||
result += res;
|
||||
|
||||
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DPOS || func == LS_FN_DAPOS)
|
||||
result += " > ";
|
||||
else if (func == LS_FN_ANEG || func == LS_FN_VNEG)
|
||||
result += " < ";
|
||||
else if (func == LS_FN_VALMOSTEQUAL)
|
||||
result += " ~ ";
|
||||
else
|
||||
result += " missing";
|
||||
result += QString::number(range.step * (val2 /*TODO+ source.getRawOffset(model)*/) + range.offset);
|
||||
break;
|
||||
}
|
||||
case LS_FAMILY_VBOOL:
|
||||
result += RawSwitch(val1).toString();
|
||||
switch (func) {
|
||||
case LS_FN_AND:
|
||||
result += " AND ";
|
||||
break;
|
||||
case LS_FN_OR:
|
||||
result += " OR ";
|
||||
break;
|
||||
case LS_FN_XOR:
|
||||
result += " XOR ";
|
||||
break;
|
||||
default:
|
||||
result += " bar ";
|
||||
break;
|
||||
}
|
||||
result += RawSwitch(val2).toString();
|
||||
break;
|
||||
|
||||
case LS_FAMILY_VCOMP:
|
||||
if (val1)
|
||||
result += RawSource(val1).toString(&model);
|
||||
else
|
||||
result += "0";
|
||||
switch (func) {
|
||||
case LS_FN_EQUAL:
|
||||
case LS_FN_VEQUAL:
|
||||
result += " = ";
|
||||
break;
|
||||
case LS_FN_NEQUAL:
|
||||
result += " != ";
|
||||
break;
|
||||
case LS_FN_GREATER:
|
||||
result += " > ";
|
||||
break;
|
||||
case LS_FN_LESS:
|
||||
result += " < ";
|
||||
break;
|
||||
case LS_FN_EGREATER:
|
||||
result += " >= ";
|
||||
break;
|
||||
case LS_FN_ELESS:
|
||||
result += " <= ";
|
||||
break;
|
||||
default:
|
||||
result += " foo ";
|
||||
break;
|
||||
}
|
||||
if (val2)
|
||||
result += RawSource(val2).toString(&model);
|
||||
else
|
||||
result += "0";
|
||||
break;
|
||||
}
|
||||
|
||||
if (andsw!=0) {
|
||||
result +=" ) AND ";
|
||||
result += RawSwitch(andsw).toString();
|
||||
}
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(LogicalSwitchesExt)) {
|
||||
if (duration)
|
||||
result += QObject::tr(" Duration (%1s)").arg(duration/10.0);
|
||||
if (delay)
|
||||
result += QObject::tr(" Delay (%1s)").arg(delay/10.0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CustomFunctionData::clear()
|
||||
{
|
||||
memset(this, 0, sizeof(CustomFunctionData));
|
||||
@@ -871,7 +762,7 @@ void CustomFunctionData::clear()
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomFunctionData::funcToString()
|
||||
QString CustomFunctionData::funcToString() const
|
||||
{
|
||||
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
|
||||
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString());
|
||||
@@ -890,7 +781,7 @@ QString CustomFunctionData::funcToString()
|
||||
else if (func == FuncPlaySound)
|
||||
return QObject::tr("Play Sound");
|
||||
else if (func == FuncPlayHaptic)
|
||||
return QObject::tr("Play Haptic");
|
||||
return QObject::tr("Haptic");
|
||||
else if (func == FuncReset)
|
||||
return QObject::tr("Reset");
|
||||
else if (func >= FuncSetTimer1 && func <= FuncSetTimer3)
|
||||
@@ -924,36 +815,84 @@ QString CustomFunctionData::funcToString()
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomFunctionData::paramToString()
|
||||
void CustomFunctionData::populateResetParams(ModelData * model, QComboBox * b, unsigned int value = 0)
|
||||
{
|
||||
int val = 0;
|
||||
Firmware * firmware = GetCurrentFirmware();
|
||||
BoardEnum board = GetEepromInterface()->getBoard();
|
||||
|
||||
b->addItem(QObject::tr("Timer1"), val++);
|
||||
b->addItem(QObject::tr("Timer2"), val++);
|
||||
if (IS_ARM(board)) {
|
||||
b->addItem( QObject::tr("Timer3"), val++);
|
||||
}
|
||||
b->addItem(QObject::tr("Flight"), val++);
|
||||
b->addItem(QObject::tr("Telemetry"), val++);
|
||||
int reCount = firmware->getCapability(RotaryEncoders);
|
||||
if (reCount == 1) {
|
||||
b->addItem(QObject::tr("Rotary Encoder"), val++);
|
||||
}
|
||||
else if (reCount == 2) {
|
||||
b->addItem(QObject::tr("REa"), val++);
|
||||
b->addItem(QObject::tr("REb"), val++);
|
||||
}
|
||||
if ((int)value < b->count()) {
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
if (model && IS_ARM(board)) {
|
||||
for (int i=0; i<C9X_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
|
||||
b->addItem(item.toString(model), val+i);
|
||||
if ((int)value == val+i) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionData::populatePlaySoundParams(QStringList & qs)
|
||||
{
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
}
|
||||
|
||||
void CustomFunctionData::populateHapticParams(QStringList & qs)
|
||||
{
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
}
|
||||
|
||||
QString CustomFunctionData::paramToString(ModelData * model) const
|
||||
{
|
||||
QStringList qs;
|
||||
if (func <= FuncInstantTrim) {
|
||||
return QString("%1").arg(param);
|
||||
}
|
||||
else if (func==FuncLogs) {
|
||||
return QString("%1").arg(param/10.0) + QObject::tr("s");
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
CustomFunctionData::populatePlaySoundParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncPlayHaptic) {
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
CustomFunctionData::populateHapticParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
qs.append( QObject::tr("Timer1"));
|
||||
qs.append( QObject::tr("Timer2"));
|
||||
qs.append( QObject::tr("Timer3"));
|
||||
qs.append( QObject::tr("All"));
|
||||
qs.append( QObject::tr("Telemetry"));
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
QComboBox cb;
|
||||
CustomFunctionData::populateResetParams(model, &cb);
|
||||
int pos = cb.findData(param);
|
||||
if (pos >= 0)
|
||||
return cb.itemText(pos);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
@@ -968,43 +907,47 @@ QString CustomFunctionData::paramToString()
|
||||
return paramarm;
|
||||
}
|
||||
}
|
||||
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
|
||||
else if ((func>=FuncAdjustGV1) && (func<FuncCount)) {
|
||||
switch (adjustMode) {
|
||||
case 0:
|
||||
return QObject::tr("Value ")+QString("%1").arg(param);
|
||||
break;
|
||||
case 1:
|
||||
return RawSource(param).toString();
|
||||
break;
|
||||
case 2:
|
||||
return RawSource(param).toString();
|
||||
break;
|
||||
case 3:
|
||||
if (param==0) {
|
||||
return QObject::tr("Decr:")+QString(" -1");
|
||||
}
|
||||
else {
|
||||
return QObject::tr("Incr:")+QString(" +1");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
if (param==0) return QObject::tr("Decr:") + " -1";
|
||||
else return QObject::tr("Incr:") + " +1";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
QString CustomFunctionData::repeatToString()
|
||||
QString CustomFunctionData::repeatToString() const
|
||||
{
|
||||
if (repeatParam==0) {
|
||||
return QObject::tr("No repeat");
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 5 : 10;
|
||||
return QObject::tr("%1 sec").arg(step*repeatParam);
|
||||
unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 1 : 10;
|
||||
return QObject::tr("repeat") + QString("(%1").arg(step*repeatParam) + QObject::tr("s") + ")";
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomFunctionData::enabledToString() const
|
||||
{
|
||||
if ((func>=FuncOverrideCH1 && func<=FuncOverrideCH32) ||
|
||||
(func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) ||
|
||||
(func==FuncReset) ||
|
||||
(func>=FuncSetTimer1 && func<=FuncSetTimer2) ||
|
||||
(func==FuncVolume) ||
|
||||
(func <= FuncInstantTrim)) {
|
||||
if (!enabled) {
|
||||
return QObject::tr("DISABLED");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
QString LimitData::minToString()
|
||||
{
|
||||
return QString::number((qreal)min/10);
|
||||
@@ -1052,13 +995,13 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const
|
||||
|
||||
bool GeneralSettings::isPotAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
if (index<0 || index>GetCurrentFirmware()->getCapability(Pots)) return false;
|
||||
return potConfig[index] != POT_NONE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isSliderAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
if (index<0 || index>GetCurrentFirmware()->getCapability(Sliders)) return false;
|
||||
return sliderConfig[index] != SLIDER_NONE;
|
||||
}
|
||||
|
||||
@@ -1090,6 +1033,11 @@ GeneralSettings::GeneralSettings()
|
||||
switchConfig[6] = SWITCH_3POS;
|
||||
switchConfig[7] = SWITCH_TOGGLE;
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<3; i++) {
|
||||
potConfig[i] = POT_WITHOUT_DETENT;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
speakerVolume = 12;
|
||||
|
||||
@@ -22,17 +22,18 @@
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QtXml>
|
||||
#include <QComboBox>
|
||||
#include <iostream>
|
||||
#include "constants.h"
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
#define EESIZE_STOCK 2048
|
||||
#define EESIZE_M128 4096
|
||||
#define EESIZE_GRUVIN9X 4096
|
||||
#define EESIZE_TARANIS (32*1024)
|
||||
#define EESIZE_SKY9X (128*4096)
|
||||
#define EESIZE_9XRPRO (128*4096)
|
||||
#define EESIZE_RLC_MAX EESIZE_TARANIS
|
||||
#define EESIZE_STOCK 2048
|
||||
#define EESIZE_M128 4096
|
||||
#define EESIZE_GRUVIN9X 4096
|
||||
#define EESIZE_TARANIS (32*1024)
|
||||
#define EESIZE_SKY9X (128*4096)
|
||||
#define EESIZE_9XRPRO (128*4096)
|
||||
#define EESIZE_MAX EESIZE_9XRPRO
|
||||
|
||||
QString getBoardName(BoardEnum board);
|
||||
|
||||
@@ -292,9 +293,7 @@ class RawSourceRange
|
||||
{
|
||||
}
|
||||
|
||||
float getValue(int value) {
|
||||
return min + float(value) * step;
|
||||
}
|
||||
float getValue(int value);
|
||||
|
||||
int decimals;
|
||||
double min;
|
||||
@@ -392,7 +391,7 @@ class RawSwitch {
|
||||
return index >= 0 ? (type * 256 + index) : -(type * 256 - index);
|
||||
}
|
||||
|
||||
QString toString();
|
||||
QString toString() const;
|
||||
|
||||
bool operator== ( const RawSwitch& other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
@@ -428,7 +427,7 @@ class CurveReference {
|
||||
CurveRefType type;
|
||||
int value;
|
||||
|
||||
QString toString();
|
||||
QString toString() const;
|
||||
};
|
||||
|
||||
enum InputMode {
|
||||
@@ -577,10 +576,9 @@ class LogicalSwitchData { // Logical Switches data
|
||||
unsigned int duration;
|
||||
int andsw;
|
||||
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
|
||||
CSFunctionFamily getFunctionFamily();
|
||||
unsigned int getRangeFlags();
|
||||
QString funcToString();
|
||||
QString toString(const ModelData & model, const GeneralSettings & settings);
|
||||
CSFunctionFamily getFunctionFamily() const;
|
||||
unsigned int getRangeFlags() const;
|
||||
QString funcToString() const;
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
@@ -626,10 +624,15 @@ class CustomFunctionData { // Function Switches data
|
||||
unsigned int adjustMode;
|
||||
int repeatParam;
|
||||
void clear();
|
||||
QString funcToString();
|
||||
QString paramToString();
|
||||
QString repeatToString();
|
||||
QStringList toStringList();
|
||||
QString funcToString() const;
|
||||
QString paramToString(ModelData * model) const;
|
||||
QString repeatToString() const;
|
||||
QString enabledToString() const;
|
||||
|
||||
static void populateResetParams(ModelData * model, QComboBox * b, unsigned int value);
|
||||
static void populatePlaySoundParams(QStringList & qs);
|
||||
static void populateHapticParams(QStringList & qs);
|
||||
|
||||
};
|
||||
|
||||
class FlightModeData {
|
||||
@@ -769,6 +772,7 @@ class FrSkyData {
|
||||
FrSkyScreenData screens[4];
|
||||
FrSkyRSSIAlarm rssiAlarms[2];
|
||||
unsigned int varioSource;
|
||||
bool varioCenterSilent;
|
||||
int varioMin;
|
||||
int varioCenterMin; // if increment in 0.2m/s = 3.0m/s max
|
||||
int varioCenterMax;
|
||||
@@ -776,6 +780,7 @@ class FrSkyData {
|
||||
bool mAhPersistent;
|
||||
unsigned int storedMah;
|
||||
int fasOffset;
|
||||
bool ignoreSensorIds;
|
||||
|
||||
void clear();
|
||||
};
|
||||
@@ -914,7 +919,7 @@ class SensorData {
|
||||
UNIT_PERCENT,
|
||||
UNIT_MAH,
|
||||
UNIT_WATTS,
|
||||
UNIT_DBM,
|
||||
UNIT_DB,
|
||||
UNIT_RPMS,
|
||||
UNIT_G,
|
||||
UNIT_DEGREE,
|
||||
@@ -1313,6 +1318,7 @@ enum Capability {
|
||||
LCDWidth,
|
||||
GetThrSwitch,
|
||||
HasDisplayText,
|
||||
GlobalFunctions,
|
||||
VirtualInputs,
|
||||
TrainerInputs,
|
||||
RtcTime,
|
||||
|
||||
@@ -52,7 +52,8 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned in
|
||||
if (IS_SKY9X(board)) {
|
||||
memset(eeprom, 0xFF, size);
|
||||
if (version >= 217) {
|
||||
eepromFatHeader = (EepromHeader *)eeprom;
|
||||
memset(eeprom, 0, EEPROM_FAT_SIZE);
|
||||
eepromFatHeader = (EepromHeader *)(eeprom + EEPROM_FAT_SIZE);
|
||||
eepromFatHeader->mark = EEPROM_MARK;
|
||||
eepromFatHeader->index = 1;
|
||||
for (int i=0; i<EEPROM_MAX_FILES; i++) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "firmwareinterface.h"
|
||||
#include "helpers.h"
|
||||
|
||||
#define FW_MARK "FW"
|
||||
#define VERS_MARK "VERS"
|
||||
#define DATE_MARK "DATE"
|
||||
#define TIME_MARK "TIME"
|
||||
@@ -44,30 +45,34 @@ int getFileType(const QString &fullFileName)
|
||||
|
||||
FirmwareInterface::FirmwareInterface(const QString &filename):
|
||||
flash(MAX_FSIZE, 0),
|
||||
flash_size(0),
|
||||
flashSize(0),
|
||||
versionId(0),
|
||||
splash_offset(0),
|
||||
splash_size(0),
|
||||
splash_width(0),
|
||||
splash_height(0),
|
||||
eepromVersion(0),
|
||||
eepromVariant(0),
|
||||
splashOffset(0),
|
||||
splashSize(0),
|
||||
splashWidth(0),
|
||||
splashHeight(0),
|
||||
isValidFlag(false)
|
||||
{
|
||||
if (!filename.isEmpty()) {
|
||||
QFile file(filename);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
|
||||
QTextStream inputStream(&file);
|
||||
flash_size = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
|
||||
flashSize = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
|
||||
file.close();
|
||||
if (flash_size == 0) {
|
||||
if (flashSize == 0) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
flash_size = file.read((char *)flash.data(), MAX_FSIZE);
|
||||
flashSize = file.read((char *)flash.data(), MAX_FSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flash_size > 0) {
|
||||
if (flashSize > 0) {
|
||||
flavour = seekLabel(FW_MARK);
|
||||
version = seekLabel(VERS_MARK);
|
||||
if (version.startsWith("opentx-")) {
|
||||
// old version format
|
||||
int index = version.lastIndexOf('-');
|
||||
flavour = version.mid(0, index);
|
||||
version = version.mid(index+1);
|
||||
@@ -150,8 +155,8 @@ bool FirmwareInterface::SeekSplash(QByteArray splash)
|
||||
{
|
||||
int start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset = start;
|
||||
splash_size = splash.size();
|
||||
splashOffset = start;
|
||||
splashSize = splash.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -167,8 +172,8 @@ bool FirmwareInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
if (start>0) {
|
||||
int end = start + sps.size() + size;
|
||||
if (end == flash.indexOf(spe, end)) {
|
||||
splash_offset = start + sps.size();
|
||||
splash_size = end - start - sps.size();
|
||||
splashOffset = start + sps.size();
|
||||
splashSize = end - start - sps.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -187,10 +192,10 @@ bool FirmwareInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
|
||||
void FirmwareInterface::SeekSplash(void)
|
||||
{
|
||||
splash_size = 0;
|
||||
splash_offset = 0;
|
||||
splash_width = SPLASH_WIDTH;
|
||||
splash_height = SPLASH_HEIGHT;
|
||||
splashSize = 0;
|
||||
splashOffset = 0;
|
||||
splashWidth = SPLASH_WIDTH;
|
||||
splashHeight = SPLASH_HEIGHT;
|
||||
splash_format = QImage::Format_Mono;
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)gr9x_splash, sizeof(gr9x_splash))) || SeekSplash(QByteArray((const char *)gr9xv4_splash, sizeof(gr9xv4_splash)))) {
|
||||
@@ -206,8 +211,8 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)opentxtaranis_splash, sizeof(opentxtaranis_splash)))) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splashWidth = SPLASHX9D_WIDTH;
|
||||
splashHeight = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
@@ -221,8 +226,8 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 6784)) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splashWidth = SPLASHX9D_WIDTH;
|
||||
splashHeight = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
@@ -232,14 +237,14 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(ERSPLASH_MARKER, sizeof(ERSPLASH_MARKER)))) {
|
||||
splash_offset += sizeof(ERSPLASH_MARKER);
|
||||
splash_size = sizeof(er9x_splash);
|
||||
splashOffset += sizeof(ERSPLASH_MARKER);
|
||||
splashSize = sizeof(er9x_splash);
|
||||
}
|
||||
}
|
||||
|
||||
bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
if (splashOffset == 0 || splashSize == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -247,9 +252,9 @@ bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
QColor color;
|
||||
QByteArray splash;
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
unsigned int idx = (y/2)*splashWidth;
|
||||
for (unsigned int x=0; x<splashWidth; x++, idx++) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y));
|
||||
uint8_t z = ((255-gray)*15)/255;
|
||||
if (y & 1) z <<= 4;
|
||||
@@ -260,27 +265,27 @@ bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
else {
|
||||
QColor black = QColor(0,0,0);
|
||||
QImage blackNwhite = newsplash.convertToFormat(QImage::Format_MonoLSB);
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
for (uint y=0; y<splashHeight; y++) {
|
||||
for (uint x=0; x<splashWidth; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
b[splashWidth*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
splash.clear();
|
||||
splash.append(b, splash_size);
|
||||
flash.replace(splash_offset, splash_size, splash);
|
||||
splash.append(b, splashSize);
|
||||
flash.replace(splashOffset, splashSize, splash);
|
||||
return true;
|
||||
}
|
||||
|
||||
int FirmwareInterface::getSplashWidth()
|
||||
{
|
||||
return splash_width;
|
||||
return splashWidth;
|
||||
}
|
||||
|
||||
uint FirmwareInterface::getSplashHeight()
|
||||
{
|
||||
return splash_height;
|
||||
return splashHeight;
|
||||
}
|
||||
|
||||
QImage::Format FirmwareInterface::getSplashFormat()
|
||||
@@ -290,17 +295,17 @@ QImage::Format FirmwareInterface::getSplashFormat()
|
||||
|
||||
QImage FirmwareInterface::getSplash()
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
if (splashOffset == 0 || splashSize == 0) {
|
||||
return QImage(); // empty image
|
||||
}
|
||||
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
QImage image(splash_width, splash_height, QImage::Format_RGB888);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
uint8_t byte = flash.at(splash_offset+idx);
|
||||
QImage image(splashWidth, splashHeight, QImage::Format_RGB888);
|
||||
if (splashOffset > 0) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
unsigned int idx = (y/2)*splashWidth;
|
||||
for (unsigned int x=0; x<splashWidth; x++, idx++) {
|
||||
uint8_t byte = flash.at(splashOffset+idx);
|
||||
unsigned int z = (y & 1) ? (byte >> 4) : (byte & 0x0F);
|
||||
z = 255-(z*255)/15;
|
||||
QRgb rgb = qRgb(z, z, z);
|
||||
@@ -311,11 +316,11 @@ QImage FirmwareInterface::getSplash()
|
||||
return image;
|
||||
}
|
||||
else {
|
||||
QImage image(splash_width, splash_height, QImage::Format_Mono);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
for(unsigned int x=0; x<splash_width; x++) {
|
||||
image.setPixel(x, y, (flash.at(splash_offset+(splash_width*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
|
||||
QImage image(splashWidth, splashHeight, QImage::Format_Mono);
|
||||
if (splashOffset > 0) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
for(unsigned int x=0; x<splashWidth; x++) {
|
||||
image.setPixel(x, y, (flash.at(splashOffset+(splashWidth*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,7 +330,7 @@ QImage FirmwareInterface::getSplash()
|
||||
|
||||
bool FirmwareInterface::hasSplash()
|
||||
{
|
||||
return (splash_offset > 0 ? true : false);
|
||||
return (splashOffset > 0 ? true : false);
|
||||
}
|
||||
|
||||
bool FirmwareInterface::isValid()
|
||||
@@ -336,7 +341,7 @@ bool FirmwareInterface::isValid()
|
||||
unsigned int FirmwareInterface::save(QString fileName)
|
||||
{
|
||||
uint8_t binflash[MAX_FSIZE];
|
||||
memcpy(&binflash, flash.constData(), flash_size);
|
||||
memcpy(&binflash, flash.constData(), flashSize);
|
||||
QFile file(fileName);
|
||||
|
||||
int fileType = getFileType(fileName);
|
||||
@@ -347,16 +352,16 @@ unsigned int FirmwareInterface::save(QString fileName)
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
HexInterface hex=HexInterface(outputStream);
|
||||
hex.save(binflash, flash_size);
|
||||
hex.save(binflash, flashSize);
|
||||
}
|
||||
else {
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { //reading HEX TEXT file
|
||||
return -1;
|
||||
}
|
||||
file.write((char*)binflash, flash_size);
|
||||
file.write((char*)binflash, flashSize);
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
return flash_size;
|
||||
return flashSize;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class FirmwareInterface
|
||||
FirmwareInterface(const QString &filename);
|
||||
inline QString getDate() { return date; }
|
||||
inline QString getTime() { return time; }
|
||||
int getSize() { return flash_size; }
|
||||
int getSize() { return flashSize; }
|
||||
QString getFlavour() const;
|
||||
bool isHardwareCompatible(const FirmwareInterface &previousFirmware) const;
|
||||
inline QString getVersion() { return version; }
|
||||
@@ -64,7 +64,7 @@ class FirmwareInterface
|
||||
|
||||
private:
|
||||
QByteArray flash;
|
||||
uint flash_size;
|
||||
uint flashSize;
|
||||
QString seekString(const QString & string);
|
||||
QString seekLabel(const QString & label);
|
||||
void SeekSplash();
|
||||
@@ -80,10 +80,10 @@ class FirmwareInterface
|
||||
int eepromVersion;
|
||||
int eepromVariant;
|
||||
QByteArray splash;
|
||||
uint splash_offset;
|
||||
uint splash_size;
|
||||
uint splash_width;
|
||||
uint splash_height;
|
||||
uint splashOffset;
|
||||
uint splashSize;
|
||||
uint splashWidth;
|
||||
uint splashHeight;
|
||||
QImage::Format splash_format;
|
||||
bool isValidFlag;
|
||||
};
|
||||
|
||||
@@ -1360,10 +1360,9 @@ class InputField: public TransformedField {
|
||||
|
||||
class LimitField: public StructField {
|
||||
public:
|
||||
template <int shift>
|
||||
template <int shift, int GV1>
|
||||
static int exportLimitValue(int value)
|
||||
{
|
||||
const int GV1 = 4096;
|
||||
if (value > 10000) {
|
||||
return -GV1 + value - 10001;
|
||||
}
|
||||
@@ -1373,16 +1372,9 @@ class LimitField: public StructField {
|
||||
return value + shift;
|
||||
}
|
||||
|
||||
template <int shift>
|
||||
template <int shift, int GV1>
|
||||
static int importLimitValue(int value)
|
||||
{
|
||||
/* GVARS mapping on radio:
|
||||
GV1 = -4096
|
||||
GV9 = -4088
|
||||
-GV1 = 4095
|
||||
-GV9 = 4087
|
||||
*/
|
||||
const int GV1 = 4096;
|
||||
if (value >= GV1) {
|
||||
return 10001 + value - GV1;
|
||||
}
|
||||
@@ -1402,10 +1394,10 @@ class LimitField: public StructField {
|
||||
StructField("Limit")
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
Append(new ConversionField< SignedField<11> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.min, exportLimitValue<1000, 1024>, importLimitValue<1000, 1024>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.max, exportLimitValue<-1000, 1024>, importLimitValue<-1000, 1024>));
|
||||
Append(new SignedField<10>(limit.ppmCenter));
|
||||
Append(new ConversionField< SignedField<11> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.offset, exportLimitValue<0, 1024>, importLimitValue<0, 1024>));
|
||||
Append(new BoolField<1>(limit.symetrical));
|
||||
Append(new BoolField<1>(limit.revert));
|
||||
Append(new SpareBitsField<3>());
|
||||
@@ -1416,10 +1408,10 @@ class LimitField: public StructField {
|
||||
}
|
||||
else {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000, 4096>, importLimitValue<1000, 4096>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000, 4096>, importLimitValue<-1000, 4096>));
|
||||
Append(new SignedField<8>(limit.ppmCenter));
|
||||
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
|
||||
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0, 4096>, importLimitValue<0, 4096>));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
|
||||
@@ -2708,7 +2700,13 @@ class FrskyField: public StructField {
|
||||
}
|
||||
}
|
||||
|
||||
Append(new ConversionField< UnsignedField<8> >(frsky.varioSource, &telemetryVarioSourceConversionTable, "Vario Source"));
|
||||
if (version >= 217) {
|
||||
Append(new UnsignedField<7>(frsky.varioSource, "Vario Source"));
|
||||
Append(new BoolField<1>(frsky.varioCenterSilent));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< UnsignedField<8> >(frsky.varioSource, &telemetryVarioSourceConversionTable, "Vario Source"));
|
||||
}
|
||||
Append(new SignedField<8>(frsky.varioCenterMax));
|
||||
Append(new SignedField<8>(frsky.varioCenterMin));
|
||||
Append(new SignedField<8>(frsky.varioMin));
|
||||
@@ -2951,7 +2949,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new BoolField<1>(modelData.noGlobalFunctions));
|
||||
internalField.Append(new UnsignedField<2>(modelData.trimsDisplay));
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(modelData.frsky.ignoreSensorIds));
|
||||
}
|
||||
else if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216)) {
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
@@ -3225,10 +3223,6 @@ void OpenTxModelData::afterImport()
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && modelData.moduleData[0].protocol == 0) {
|
||||
modelData.moduleData[0].protocol = PXX_XJT_X16;
|
||||
}
|
||||
|
||||
for (int module=0; module<3; module++) {
|
||||
if (modelData.moduleData[module].protocol == PXX_XJT_X16 || modelData.moduleData[module].protocol == LP45) {
|
||||
if (subprotocols[module] >= 0)
|
||||
@@ -3237,6 +3231,10 @@ void OpenTxModelData::afterImport()
|
||||
modelData.moduleData[module].protocol = OFF;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != OFF) {
|
||||
modelData.moduleData[1].modelId = modelData.moduleData[0].modelId;
|
||||
}
|
||||
}
|
||||
|
||||
OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
|
||||
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/nightly/firmware"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
|
||||
@@ -446,9 +449,8 @@ int OpenTxEepromInterface::getSize(ModelData &model)
|
||||
if (model.isempty())
|
||||
return 0;
|
||||
|
||||
// TODO something better...
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board, 255/*version max*/);
|
||||
QByteArray tmp(EESIZE_MAX, 0);
|
||||
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255/*version max*/);
|
||||
|
||||
OpenTxModelData open9xModel(model, board, 255/*version max*/, GetCurrentFirmware()->getVariantNumber());
|
||||
|
||||
@@ -466,8 +468,8 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
|
||||
if (IS_SKY9X(board))
|
||||
return 0;
|
||||
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board, 255);
|
||||
QByteArray tmp(EESIZE_MAX, 0);
|
||||
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255);
|
||||
|
||||
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmware()->getVariantNumber());
|
||||
// open9xGeneral.Dump();
|
||||
@@ -605,10 +607,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
else
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
if (IS_TARANIS(board))
|
||||
if (IS_ARM(board))
|
||||
return 64;
|
||||
else if (IS_ARM(board))
|
||||
return 60;
|
||||
else if (IS_2560(board) || board==BOARD_M128)
|
||||
return 24;
|
||||
else
|
||||
@@ -732,6 +732,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return (IS_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR) ;
|
||||
case HasDisplayText:
|
||||
return IS_ARM(board) ? 1 : 0;
|
||||
case GlobalFunctions:
|
||||
return IS_ARM(board) ? 64 : 0;
|
||||
case VirtualInputs:
|
||||
return IS_TARANIS(board) ? 32 : 0;
|
||||
case TrainerInputs:
|
||||
@@ -1047,9 +1049,18 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
return true;
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareBaseUrl()
|
||||
{
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
return (g.useFirmwareNightlyBuilds() ? OPENTX_NIGHT_FIRMWARE_DOWNLOADS : OPENTX_FIRMWARE_DOWNLOADS);
|
||||
#else
|
||||
return OPENTX_FIRMWARE_DOWNLOADS;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
@@ -1073,16 +1084,16 @@ QString OpenTxFirmware::getFirmwareUrl()
|
||||
|
||||
QString OpenTxFirmware::getReleaseNotesUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
url.append("/releasenotes.txt");
|
||||
return url;
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getStampUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
url.append("/stamp-opentx.txt");
|
||||
return url;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
url.append("/stamp-opentx.txt");
|
||||
return url;
|
||||
}
|
||||
|
||||
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
||||
@@ -1102,7 +1113,7 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
|
||||
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
firmware->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
|
||||
firmware->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
|
||||
firmware->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use in the EU on radios sold after Jan 1st, 2015"));
|
||||
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
|
||||
}
|
||||
|
||||
@@ -1128,7 +1139,7 @@ void registerOpenTxFirmwares()
|
||||
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
|
||||
|
||||
/* 9x board */
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK);
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1164,7 +1175,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128);
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1194,7 +1205,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK);
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1227,7 +1238,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128);
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1255,7 +1266,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Gruvin9x board */
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X);
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1280,7 +1291,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* MEGA2560 board */
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("OpenTX for MEGA2560 board"), BOARD_MEGA2560);
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560);
|
||||
addOpenTxLcdOptions(firmware);
|
||||
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
|
||||
firmware->addOptions(ext_options);
|
||||
@@ -1310,7 +1321,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), BOARD_SKY9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1330,7 +1341,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1349,20 +1360,20 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis Plus board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("OpenTX for FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
|
||||
|
||||
class RleFile;
|
||||
|
||||
class OpenTxEepromInterface : public EEPROMInterface
|
||||
@@ -101,6 +99,7 @@ class OpenTxFirmware: public Firmware {
|
||||
|
||||
addTTSLanguage("en");
|
||||
addTTSLanguage("cz");
|
||||
addTTSLanguage("de");
|
||||
addTTSLanguage("es");
|
||||
addTTSLanguage("fr");
|
||||
addTTSLanguage("hu");
|
||||
@@ -124,6 +123,10 @@ class OpenTxFirmware: public Firmware {
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
protected:
|
||||
|
||||
QString getFirmwareBaseUrl();
|
||||
|
||||
};
|
||||
|
||||
void registerOpenTxFirmwares();
|
||||
|
||||
@@ -13,11 +13,13 @@ add_custom_target(about_lbm_taranis
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(trans
|
||||
make tra
|
||||
add_custom_target(commondeps
|
||||
make stamp_header tra
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
|
||||
|
||||
add_custom_target(lua_exports
|
||||
make PCB=TARANIS lua_exports.inc
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
@@ -77,17 +79,17 @@ add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_exports)
|
||||
|
||||
set(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
@@ -103,6 +105,10 @@ set(OPENTX_LIBRARIES
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
@@ -158,6 +164,27 @@ target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
ADD_CUSTOM_TARGET(opentx-simulators
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set(SIMULATOR_BUNDLES)
|
||||
foreach(_file ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${_file}-bundle")
|
||||
add_custom_target(${SIMULATOR_BUNDLE}
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND pwd
|
||||
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${_file}
|
||||
)
|
||||
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
|
||||
endforeach()
|
||||
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
|
||||
endif(APPLE)
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace NAMESPACE {
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/trainer_input.cpp"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
|
||||
@@ -102,7 +102,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
return -1;
|
||||
}
|
||||
|
||||
QByteArray eeprom(EESIZE_RLC_MAX, 0);
|
||||
QByteArray eeprom(EESIZE_MAX, 0);
|
||||
int fileType = getFileType(filename);
|
||||
|
||||
#if 0
|
||||
@@ -144,7 +144,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_RLC_MAX);
|
||||
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_MAX);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
eeprom_size = file.size();
|
||||
|
||||
@@ -203,6 +203,7 @@ void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
||||
void FlashFirmwareDialog::on_burnButton_clicked()
|
||||
{
|
||||
g.flashDir(QFileInfo(fwName).dir().absolutePath());
|
||||
g.profile[g.id()].fwName(fwName);
|
||||
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
|
||||
g.backupOnFlash(ui->backupEEprom->isChecked());
|
||||
|
||||
|
||||
@@ -170,6 +170,8 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
setValues();
|
||||
}
|
||||
|
||||
CalibrationPanel::~CalibrationPanel()
|
||||
|
||||
+71
-59
@@ -65,26 +65,6 @@ QString getPhaseName(int val, const char * phasename)
|
||||
}
|
||||
}
|
||||
|
||||
QString getInputStr(ModelData * model, int index)
|
||||
{
|
||||
QString result;
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
|
||||
if (strlen(model->inputNames[index]) > 0) {
|
||||
result = QObject::tr("[I%1]").arg(index+1);
|
||||
result += QString(model->inputNames[index]);
|
||||
}
|
||||
else {
|
||||
result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, index).toString(model);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value)
|
||||
{
|
||||
QString strings[] = { QObject::tr("---"), QObject::tr("Rud Trim"), QObject::tr("Ele Trim"), QObject::tr("Thr Trim"), QObject::tr("Ail Trim"), QObject::tr("Rot Enc"), QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
|
||||
@@ -95,6 +75,37 @@ void populateGvSourceCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current)
|
||||
{
|
||||
b->clear();
|
||||
b->addItem("----");
|
||||
|
||||
bool added = false;
|
||||
// Convert set into list and sort it alphabetically case insensitive
|
||||
QStringList list = QStringList::fromSet(set);
|
||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
foreach (QString entry, list) {
|
||||
b->addItem(entry);
|
||||
if (entry == current) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!added && !current.isEmpty()) {
|
||||
b->addItem(current);
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
|
||||
void getFileComboBoxValue(QComboBox * b, char * dest, int length)
|
||||
{
|
||||
memset(dest, 0, length+1);
|
||||
if (b->currentText() != "----") {
|
||||
strncpy(dest, b->currentText().toAscii(), length);
|
||||
}
|
||||
}
|
||||
|
||||
QString getProtocolStr(const int proto)
|
||||
{
|
||||
static const char *strings[] = { "OFF",
|
||||
@@ -638,7 +649,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
if (model && model->sensorData[i].isAvailable()) { //this conditon must be false if we populate Global Functions where model = 0
|
||||
for (int j=0; j<3; ++j) {
|
||||
item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i+j);
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
@@ -650,8 +661,6 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<(flags & POPULATE_TELEMETRYEXT ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_COUNT); i++) {
|
||||
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(board))
|
||||
continue;
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME && !GetCurrentFirmware()->getCapability(RtcTime))
|
||||
continue;
|
||||
if (i==TELEMETRY_SOURCE_SWR && !GetCurrentFirmware()->getCapability(SportTelemetry))
|
||||
@@ -829,34 +838,6 @@ QString getTrainerMode(const int trainermode, ModuleData & module)
|
||||
return result;
|
||||
}
|
||||
|
||||
QString getPhasesStr(unsigned int phases, ModelData * model)
|
||||
{
|
||||
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
|
||||
|
||||
if (numphases && phases) {
|
||||
QString str;
|
||||
int count = 0;
|
||||
if (phases == (unsigned int)(1<<numphases) - 1) {
|
||||
str = QObject::tr("None");
|
||||
}
|
||||
if (phases) {
|
||||
for (int i=0; i<numphases;i++) {
|
||||
if (!(phases & (1<<i))) {
|
||||
if (count++ > 0) str += QString(", ");
|
||||
str += getPhaseName(i+1, model->flightModeData[i].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count > 1)
|
||||
return QObject::tr("Flight modes(%1)").arg(str);
|
||||
else
|
||||
return QObject::tr("Flight mode(%1)").arg(str);
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
QString getCenterBeepStr(ModelData * g_model)
|
||||
{
|
||||
QStringList strl;
|
||||
@@ -988,22 +969,38 @@ QPixmap makePixMap( QImage image, QString firmwareType )
|
||||
return(QPixmap::fromImage(image));
|
||||
}
|
||||
|
||||
int version2index(QString version)
|
||||
int version2index(const QString & version)
|
||||
{
|
||||
QStringList parts = version.split('.');
|
||||
int result = 0;
|
||||
if (parts.size() > 2)
|
||||
result = parts[2].toInt();
|
||||
int result = 999;
|
||||
QStringList parts = version.split("N");
|
||||
if (parts.size() > 1)
|
||||
result += 100 * parts[1].toInt();
|
||||
result = parts[1].toInt(); // nightly build
|
||||
parts = parts[0].split('.');
|
||||
if (parts.size() > 2)
|
||||
result += 1000 * parts[2].toInt();
|
||||
if (parts.size() > 1)
|
||||
result += 100000 * parts[1].toInt();
|
||||
if (parts.size() > 0)
|
||||
result += 10000 * parts[0].toInt();
|
||||
result += 10000000 * parts[0].toInt();
|
||||
return result;
|
||||
}
|
||||
|
||||
QString index2version(int index)
|
||||
{
|
||||
if (index >= 19900) {
|
||||
if (index >= 19900000) {
|
||||
int nightly = index % 1000;
|
||||
index /= 1000;
|
||||
int revision = index % 100;
|
||||
index /= 100;
|
||||
int minor = index % 100;
|
||||
int major = index / 100;
|
||||
QString result = QString("%1.%2.%3").arg(major).arg(minor).arg(revision);
|
||||
if (nightly > 0 && nightly < 999) {
|
||||
result += QString("N%1").arg(nightly);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else if (index >= 19900) {
|
||||
int revision = index % 100;
|
||||
index /= 100;
|
||||
int minor = index % 100;
|
||||
@@ -1115,3 +1112,18 @@ double toDecimalCoordinate(const QString & value)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList extractLatLon(const QString & position)
|
||||
{
|
||||
QStringList result;
|
||||
QStringList parts = position.split(' ');
|
||||
if (parts.size() != 2) {
|
||||
result.append("");
|
||||
result.append("");
|
||||
}
|
||||
else {
|
||||
result.append(parts.at(1).trimmed());
|
||||
result.append(parts.at(0).trimmed());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ extern const QColor colors[C9X_MAX_CURVES];
|
||||
#define TRIM_MODE_NONE 0x1F // 0b11111
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value);
|
||||
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current);
|
||||
void getFileComboBoxValue(QComboBox * b, char * dest, int length);
|
||||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||
|
||||
QString getTheme();
|
||||
@@ -99,7 +101,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
void populatePhasesCB(QComboBox *b, int value);
|
||||
void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
QString getProtocolStr(const int proto);
|
||||
QString getPhasesStr(unsigned int phases, ModelData * model);
|
||||
|
||||
#define POPULATE_NONE (1<<0)
|
||||
#define POPULATE_SOURCES (1<<1)
|
||||
@@ -118,7 +119,6 @@ QString getPhasesStr(unsigned int phases, ModelData * model);
|
||||
void populateGVCB(QComboBox *b, int value);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
|
||||
QString getPhaseName(int val, const char * phasename=NULL);
|
||||
QString getInputStr(ModelData * model, int index);
|
||||
QString image2qstring(QImage image);
|
||||
int findmult(float value, float base);
|
||||
|
||||
@@ -160,7 +160,7 @@ QVector<T> findWidgets(QObject * object, const QString & name)
|
||||
// Format a pixmap to fit on the radio using a specific firmware
|
||||
QPixmap makePixMap( QImage image, QString firmwareType );
|
||||
|
||||
int version2index(QString version);
|
||||
int version2index(const QString & version);
|
||||
QString index2version(int index);
|
||||
|
||||
class QTimeS : public QTime
|
||||
@@ -207,5 +207,6 @@ private:
|
||||
};
|
||||
|
||||
double toDecimalCoordinate(const QString & value);
|
||||
QStringList extractLatLon(const QString & position);
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
logsDialog::logsDialog(QWidget *parent) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::logsDialog)
|
||||
LogsDialog::LogsDialog(QWidget *parent) :
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
ui(new Ui::LogsDialog)
|
||||
{
|
||||
csvlog.clear();
|
||||
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(CompanionIcon("logs.png"));
|
||||
setWindowIcon(CompanionIcon("logs.png"));
|
||||
|
||||
plotLock=false;
|
||||
|
||||
@@ -36,26 +36,20 @@ logsDialog::logsDialog(QWidget *parent) :
|
||||
// create and prepare a plot title layout element
|
||||
QCPPlotTitle *title = new QCPPlotTitle(ui->customPlot);
|
||||
title->setText(tr("Telemetry logs"));
|
||||
// title->setFont(QFont("sans", 12, QFont::Bold));
|
||||
|
||||
// add it to the main plot layout
|
||||
ui->customPlot->plotLayout()->insertRow(0);
|
||||
ui->customPlot->plotLayout()->addElement(0, 0, title);
|
||||
|
||||
ui->customPlot->setNoAntialiasingOnDrag(true);
|
||||
|
||||
ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom |
|
||||
QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables);
|
||||
ui->customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectAxes | QCP::iSelectLegend | QCP::iSelectPlottables);
|
||||
|
||||
axisRect = ui->customPlot->axisRect();
|
||||
axisRect->axis(QCPAxis::atBottom)->setLabel(tr("Time (hh:mm:ss)"));
|
||||
axisRect->axis(QCPAxis::atBottom)->setTickLabelType(QCPAxis::ltDateTime);
|
||||
axisRect->axis(QCPAxis::atBottom)->setDateTimeFormat("hh:mm:ss");
|
||||
QDateTime now = QDateTime::currentDateTime();
|
||||
axisRect->axis(QCPAxis::atBottom)->setRange(now.addSecs(-60*60*2).toTime_t(),
|
||||
now.toTime_t());
|
||||
|
||||
axisRect->axis(QCPAxis::atBottom)->setRange(now.addSecs(-60*60*2).toTime_t(), now.toTime_t());
|
||||
axisRect->axis(QCPAxis::atLeft)->setTickLabels(false);
|
||||
|
||||
axisRect->addAxis(QCPAxis::atLeft);
|
||||
axisRect->addAxis(QCPAxis::atRight);
|
||||
axisRect->axis(QCPAxis::atLeft, 1)->setVisible(false);
|
||||
@@ -76,8 +70,8 @@ logsDialog::logsDialog(QWidget *parent) :
|
||||
|
||||
ui->customPlot->setAutoAddPlottableToLegend(false);
|
||||
|
||||
QString Path=g.gePath();
|
||||
if (Path.isEmpty() || !QFile(Path).exists()) {
|
||||
QString path = g.gePath();
|
||||
if (path.isEmpty() || !QFile(path).exists()) {
|
||||
ui->mapsButton->hide();
|
||||
}
|
||||
|
||||
@@ -99,57 +93,52 @@ logsDialog::logsDialog(QWidget *parent) :
|
||||
connect(ui->Reset_PB, SIGNAL(clicked()), this, SLOT(plotLogs()));
|
||||
}
|
||||
|
||||
logsDialog::~logsDialog()
|
||||
LogsDialog::~LogsDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void logsDialog::titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title)
|
||||
void LogsDialog::titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title)
|
||||
{
|
||||
// Set the plot title by double clicking on it
|
||||
|
||||
bool ok;
|
||||
QString newTitle = QInputDialog::getText(this, tr("Plot Title Change"),
|
||||
tr("New plot title:"), QLineEdit::Normal, title->text(), &ok);
|
||||
if (ok)
|
||||
{
|
||||
QString newTitle = QInputDialog::getText(this, tr("Plot Title Change"), tr("New plot title:"), QLineEdit::Normal, title->text(), &ok);
|
||||
if (ok) {
|
||||
title->setText(newTitle);
|
||||
ui->customPlot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
void logsDialog::axisLabelDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part)
|
||||
void LogsDialog::axisLabelDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part)
|
||||
{
|
||||
// Set an axis label by double clicking on it
|
||||
if (part == QCPAxis::spAxisLabel) // only react when the actual axis label is clicked, not tick label or axis backbone
|
||||
{
|
||||
if (part == QCPAxis::spAxisLabel) {
|
||||
// only react when the actual axis label is clicked, not tick label or axis backbone
|
||||
bool ok;
|
||||
QString newLabel = QInputDialog::getText(this, tr("Axis Label Change"), tr("New axis label:"), QLineEdit::Normal, axis->label(), &ok);
|
||||
if (ok)
|
||||
{
|
||||
if (ok) {
|
||||
axis->setLabel(newLabel);
|
||||
ui->customPlot->replot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void logsDialog::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item)
|
||||
void LogsDialog::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem *item)
|
||||
{
|
||||
// Rename a graph by double clicking on its legend item
|
||||
if (item) // only react if item was clicked (user could have clicked on border padding of legend where there is no item, then item is 0)
|
||||
{
|
||||
if (item) {
|
||||
// only react if item was clicked (user could have clicked on border padding of legend where there is no item, then item is 0)
|
||||
QCPPlottableLegendItem *plItem = qobject_cast<QCPPlottableLegendItem*>(item);
|
||||
bool ok;
|
||||
QString newName = QInputDialog::getText(this, tr("Graph Name Change"), tr("New graph name:"), QLineEdit::Normal, plItem->plottable()->name(), &ok);
|
||||
if (ok)
|
||||
{
|
||||
if (ok) {
|
||||
plItem->plottable()->setName(newName);
|
||||
ui->customPlot->replot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void logsDialog::selectionChanged()
|
||||
void LogsDialog::selectionChanged()
|
||||
{
|
||||
/*
|
||||
normally, axis base line, axis tick labels and axis labels are selectable separately, but we want
|
||||
@@ -208,20 +197,18 @@ void logsDialog::selectionChanged()
|
||||
}
|
||||
|
||||
// synchronize selection of graphs with selection of corresponding legend items:
|
||||
for (int i=0; i<ui->customPlot->graphCount(); ++i)
|
||||
{
|
||||
for (int i=0; i<ui->customPlot->graphCount(); ++i) {
|
||||
QCPGraph *graph = ui->customPlot->graph(i);
|
||||
QCPPlottableLegendItem *item = ui->customPlot->legend->itemWithPlottable(graph);
|
||||
if (item == NULL) item = rightLegend->itemWithPlottable(graph);
|
||||
if (item->selected() || graph->selected())
|
||||
{
|
||||
if (item->selected() || graph->selected()) {
|
||||
item->setSelected(true);
|
||||
graph->setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QList<QStringList> logsDialog::filterGePoints(const QList<QStringList> & input)
|
||||
QList<QStringList> LogsDialog::filterGePoints(const QList<QStringList> & input)
|
||||
{
|
||||
QList<QStringList> result;
|
||||
|
||||
@@ -230,17 +217,16 @@ QList<QStringList> logsDialog::filterGePoints(const QList<QStringList> & input)
|
||||
return result;
|
||||
}
|
||||
|
||||
int latcol=0, longcol=0;
|
||||
int gpscol = 0;
|
||||
for (int i=1; i<input.at(0).count(); i++) {
|
||||
//Long,Lat,Course,GPS Speed,GPS Alt
|
||||
if (input.at(0).at(i).contains("Long")) {
|
||||
longcol=i;
|
||||
}
|
||||
if (input.at(0).at(i).contains("Lat")) {
|
||||
latcol=i;
|
||||
if (input.at(0).at(i) == "GPS") {
|
||||
gpscol=i;
|
||||
}
|
||||
}
|
||||
if (longcol==0 || latcol==0) {
|
||||
if (gpscol == 0) {
|
||||
QMessageBox::critical(this, tr("Error: no GPS data not found"),
|
||||
tr("The column containing GPS coordinates must be named \"GPS\".\n\n\
|
||||
The columns for altitude \"GAlt\" and for speed \"GSpd\" are optional"));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -253,14 +239,15 @@ QList<QStringList> logsDialog::filterGePoints(const QList<QStringList> & input)
|
||||
for (int i = 1; i < n; i++) {
|
||||
if ((ui->logTable->item(i-1, 1)->isSelected() && rangeSelected) || !rangeSelected) {
|
||||
|
||||
QString latitude = input.at(i).at(latcol).trimmed();
|
||||
QString longitude = input.at(i).at(longcol).trimmed();
|
||||
QStringList latlon = extractLatLon(input.at(i).at(gpscol));
|
||||
QString latitude = latlon[0];
|
||||
QString longitude = latlon[1];
|
||||
double flatitude = toDecimalCoordinate(latitude);
|
||||
double flongitude = toDecimalCoordinate(longitude);
|
||||
|
||||
// glitch filter
|
||||
if ( glitchFilter.isGlitch(flatitude, flongitude) ) {
|
||||
qDebug() << "filterGePoints(): GPS glitch detected at" << i << flatitude << flongitude;
|
||||
// qDebug() << "filterGePoints(): GPS glitch detected at" << i << flatitude << flongitude;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -275,42 +262,39 @@ QList<QStringList> logsDialog::filterGePoints(const QList<QStringList> & input)
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "filterGePoints(): filtered from" << input.count() << "to " << result.count() << "points";
|
||||
// qDebug() << "filterGePoints(): filtered from" << input.count() << "to " << result.count() << "points";
|
||||
return result;
|
||||
}
|
||||
|
||||
void logsDialog::exportToGoogleEarth()
|
||||
void LogsDialog::exportToGoogleEarth()
|
||||
{
|
||||
// filter data points
|
||||
QList<QStringList> dataPoints = filterGePoints(csvlog);
|
||||
int n = dataPoints.count(); // number of points to export
|
||||
if (n==0) return;
|
||||
|
||||
int latcol=0, longcol=0, altcol=0, speedcol=0;
|
||||
int gpscol=0, altcol=0, speedcol=0;
|
||||
QSet<int> nondataCols;
|
||||
for (int i=1; i<dataPoints.at(0).count(); i++) {
|
||||
//Long,Lat,Course,GPS Speed,GPS Alt
|
||||
if (dataPoints.at(0).at(i).contains("Long")) {
|
||||
longcol=i;
|
||||
// Long,Lat,Course,GPS Speed,GPS Alt
|
||||
if (dataPoints.at(0).at(i) == "GPS") {
|
||||
gpscol=i;
|
||||
}
|
||||
if (dataPoints.at(0).at(i).contains("GAlt")) {
|
||||
altcol = i;
|
||||
nondataCols << i;
|
||||
}
|
||||
if (dataPoints.at(0).at(i).contains("Lat")) {
|
||||
latcol=i;
|
||||
nondataCols << i;
|
||||
}
|
||||
if (dataPoints.at(0).at(i).contains("GPS Alt")) {
|
||||
altcol=i;
|
||||
nondataCols << i;
|
||||
}
|
||||
if (dataPoints.at(0).at(i).contains("GPS Speed")) {
|
||||
speedcol=i;
|
||||
if (dataPoints.at(0).at(i).contains("GSpd")) {
|
||||
speedcol = i;
|
||||
nondataCols << i;
|
||||
}
|
||||
}
|
||||
if (longcol==0 || latcol==0 || altcol==0) {
|
||||
|
||||
if (gpscol==0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// qDebug() << "gpscol" << gpscol << "altcol" << altcol << "speedcol" << speedcol;
|
||||
QString geIconFilename = generateProcessUniqueTempFileName("track0.png");
|
||||
if (QFile::exists(geIconFilename)) {
|
||||
QFile::remove(geIconFilename);
|
||||
@@ -375,22 +359,26 @@ void logsDialog::exportToGoogleEarth()
|
||||
|
||||
// coordinate data points
|
||||
for (int i=1; i<n; i++) {
|
||||
QString latitude=dataPoints.at(i).at(latcol).trimmed();
|
||||
QString longitude=dataPoints.at(i).at(longcol).trimmed();
|
||||
QStringList latlon = extractLatLon(dataPoints.at(i).at(gpscol));
|
||||
QString latitude = latlon[0];
|
||||
QString longitude = latlon[1];
|
||||
int altitude = altcol ? dataPoints.at(i).at(altcol).toFloat() : 0;
|
||||
latitude.sprintf("%3.8f", toDecimalCoordinate(latitude));
|
||||
longitude.sprintf("%3.8f", toDecimalCoordinate(longitude));
|
||||
outputStream << "\t\t\t\t\t<gx:coord>" << longitude << " " << latitude << " " << dataPoints.at(i).at(altcol).toFloat() << " </gx:coord>\n" ;
|
||||
outputStream << "\t\t\t\t\t<gx:coord>" << longitude << " " << latitude << " " << altitude << " </gx:coord>\n" ;
|
||||
}
|
||||
|
||||
// additional data for data points
|
||||
outputStream << "\t\t\t\t\t<ExtendedData>\n\t\t\t\t\t\t<SchemaData schemaUrl=\"#schema\">\n";
|
||||
|
||||
// gps speed data points
|
||||
outputStream << "\t\t\t\t\t\t\t<gx:SimpleArrayData name=\"GPSSpeed\">\n";
|
||||
for (int i=1; i<n; i++) {
|
||||
outputStream << "\t\t\t\t\t\t\t\t<gx:value>"<< dataPoints.at(i).at(speedcol) <<"</gx:value>\n";
|
||||
if (speedcol) {
|
||||
// gps speed data points
|
||||
outputStream << "\t\t\t\t\t\t\t<gx:SimpleArrayData name=\"GPSSpeed\">\n";
|
||||
for (int i=1; i<n; i++) {
|
||||
outputStream << "\t\t\t\t\t\t\t\t<gx:value>"<< dataPoints.at(i).at(speedcol) <<"</gx:value>\n";
|
||||
}
|
||||
outputStream << "\t\t\t\t\t\t\t</gx:SimpleArrayData>\n";
|
||||
}
|
||||
outputStream << "\t\t\t\t\t\t\t</gx:SimpleArrayData>\n";
|
||||
|
||||
// add values for additional fields
|
||||
for (int i=0; i<dataPoints.at(0).count()-2; i++) {
|
||||
@@ -420,7 +408,7 @@ void logsDialog::exportToGoogleEarth()
|
||||
process->start(gePath, parameters);
|
||||
}
|
||||
|
||||
void logsDialog::on_mapsButton_clicked()
|
||||
void LogsDialog::on_mapsButton_clicked()
|
||||
{
|
||||
ui->FieldsTW->setDisabled(true);
|
||||
ui->logTable->setDisabled(true);
|
||||
@@ -431,7 +419,7 @@ void logsDialog::on_mapsButton_clicked()
|
||||
ui->logTable->setDisabled(false);
|
||||
}
|
||||
|
||||
void logsDialog::mousePress()
|
||||
void LogsDialog::mousePress()
|
||||
{
|
||||
// if an axis is selected, only allow the direction of that axis to be dragged
|
||||
// if no axis is selected, both directions may be dragged
|
||||
@@ -444,7 +432,7 @@ void logsDialog::mousePress()
|
||||
axisRect->setRangeDrag(Qt::Horizontal | Qt::Vertical);
|
||||
}
|
||||
|
||||
void logsDialog::mouseWheel()
|
||||
void LogsDialog::mouseWheel()
|
||||
{
|
||||
// if an axis is selected, only allow the direction of that axis to be zoomed
|
||||
// if no axis is selected, both directions may be zoomed
|
||||
@@ -462,7 +450,7 @@ void logsDialog::mouseWheel()
|
||||
}
|
||||
}
|
||||
|
||||
void logsDialog::removeAllGraphs()
|
||||
void LogsDialog::removeAllGraphs()
|
||||
{
|
||||
ui->customPlot->clearGraphs();
|
||||
ui->customPlot->legend->setVisible(false);
|
||||
@@ -480,12 +468,11 @@ void logsDialog::removeAllGraphs()
|
||||
ui->customPlot->replot();
|
||||
}
|
||||
|
||||
void logsDialog::on_fileOpen_BT_clicked()
|
||||
void LogsDialog::on_fileOpen_BT_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.logDir());
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Select your log file"), g.logDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
|
||||
g.logDir( fileName );
|
||||
g.logDir(fileName);
|
||||
ui->FileName_LE->setText(fileName);
|
||||
if (cvsFileParse()) {
|
||||
ui->FieldsTW->clear();
|
||||
@@ -525,15 +512,16 @@ void logsDialog::on_fileOpen_BT_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
bool logsDialog::cvsFileParse()
|
||||
bool LogsDialog::cvsFileParse()
|
||||
{
|
||||
QFile file(ui->FileName_LE->text());
|
||||
int errors=0;
|
||||
int lines=-1;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
csvlog.clear();
|
||||
logFilename.clear();
|
||||
QTextStream inputStream(&file);
|
||||
@@ -541,7 +529,8 @@ bool logsDialog::cvsFileParse()
|
||||
|
||||
if (buffer.startsWith("Date,Time")) {
|
||||
file.reset();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -554,29 +543,30 @@ bool logsDialog::cvsFileParse()
|
||||
}
|
||||
if (columns.count()==numfields) {
|
||||
csvlog.append(columns);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
errors++;
|
||||
}
|
||||
lines++;
|
||||
}
|
||||
|
||||
logFilename=QFileInfo(file.fileName()).baseName();
|
||||
logFilename = QFileInfo(file.fileName()).baseName();
|
||||
}
|
||||
|
||||
file.close();
|
||||
if (errors>1) {
|
||||
if (errors > 1) {
|
||||
QMessageBox::warning(this, "Companion", tr("The selected logfile contains %1 invalid lines out of %2 total lines").arg(errors).arg(lines));
|
||||
}
|
||||
|
||||
int n=csvlog.count();
|
||||
if (n==1) {
|
||||
int n = csvlog.count();
|
||||
if (n == 1) {
|
||||
csvlog.clear();
|
||||
return false;
|
||||
}
|
||||
|
||||
plotLock = true;
|
||||
setFlightSessions();
|
||||
plotLock=false;
|
||||
plotLock = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -586,7 +576,7 @@ struct FlightSession {
|
||||
QDateTime end;
|
||||
};
|
||||
|
||||
QDateTime logsDialog::getRecordTimeStamp(int index)
|
||||
QDateTime LogsDialog::getRecordTimeStamp(int index)
|
||||
{
|
||||
QString tstamp = csvlog.at(index).at(0) + " " + csvlog.at(index).at(1);
|
||||
if (csvlog.at(index).at(1).contains("."))
|
||||
@@ -594,7 +584,7 @@ QDateTime logsDialog::getRecordTimeStamp(int index)
|
||||
return QDateTime::fromString(tstamp, "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
QString logsDialog::generateDuration(const QDateTime & start, const QDateTime & end)
|
||||
QString LogsDialog::generateDuration(const QDateTime & start, const QDateTime & end)
|
||||
{
|
||||
int secs = start.secsTo(end);
|
||||
QString durationString;
|
||||
@@ -606,11 +596,11 @@ QString logsDialog::generateDuration(const QDateTime & start, const QDateTime &
|
||||
return durationString;
|
||||
}
|
||||
|
||||
void logsDialog::setFlightSessions()
|
||||
void LogsDialog::setFlightSessions()
|
||||
{
|
||||
ui->sessions_CB->clear();
|
||||
|
||||
int n=csvlog.count();
|
||||
int n = csvlog.count();
|
||||
// qDebug() << "records" << n;
|
||||
|
||||
// find session breaks
|
||||
@@ -646,7 +636,7 @@ void logsDialog::setFlightSessions()
|
||||
}
|
||||
}
|
||||
|
||||
void logsDialog::on_sessions_CB_currentIndexChanged(int index)
|
||||
void LogsDialog::on_sessions_CB_currentIndexChanged(int index)
|
||||
{
|
||||
if (plotLock) return;
|
||||
plotLock = true;
|
||||
@@ -674,7 +664,7 @@ void logsDialog::on_sessions_CB_currentIndexChanged(int index)
|
||||
plotLogs();
|
||||
}
|
||||
|
||||
void logsDialog::plotLogs()
|
||||
void LogsDialog::plotLogs()
|
||||
{
|
||||
if (plotLock) return;
|
||||
|
||||
@@ -920,7 +910,7 @@ void logsDialog::plotLogs()
|
||||
ui->customPlot->replot();
|
||||
}
|
||||
|
||||
void logsDialog::yAxisChangeRanges(QCPRange range)
|
||||
void LogsDialog::yAxisChangeRanges(QCPRange range)
|
||||
{
|
||||
if (axisRect->axis(QCPAxis::atRight)->visible()) {
|
||||
double lowerChange = (range.lower - yAxesRanges[firstLeft].min) *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef LOGSDIALOG_H
|
||||
#define LOGSDIALOG_H
|
||||
#ifndef _LOGSDIALOG_H_
|
||||
#define _LOGSDIALOG_H_
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
@@ -37,16 +37,16 @@ struct plotsCollection {
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class logsDialog;
|
||||
class LogsDialog;
|
||||
}
|
||||
|
||||
class logsDialog : public QDialog
|
||||
class LogsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit logsDialog(QWidget *parent = 0);
|
||||
~logsDialog();
|
||||
explicit LogsDialog(QWidget *parent = 0);
|
||||
~LogsDialog();
|
||||
|
||||
private slots:
|
||||
void titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title);
|
||||
@@ -64,7 +64,7 @@ private slots:
|
||||
|
||||
private:
|
||||
QList<QStringList> csvlog;
|
||||
Ui::logsDialog *ui;
|
||||
Ui::LogsDialog *ui;
|
||||
QCPAxisRect *axisRect;
|
||||
QCPLegend *rightLegend;
|
||||
bool plotLock;
|
||||
@@ -85,4 +85,4 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // LOGSDIALOG_H
|
||||
#endif // _LOGSDIALOG_H_
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>logsDialog</class>
|
||||
<widget class="QDialog" name="logsDialog">
|
||||
<class>LogsDialog</class>
|
||||
<widget class="QDialog" name="LogsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
||||
@@ -70,15 +70,16 @@
|
||||
#include "radiointerface.h"
|
||||
#include "progressdialog.h"
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-21.open-tx.org/companion"
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-21.open-tx.org/companion"
|
||||
#define OPENTX_NIGHT_COMPANION_DOWNLOADS "http://downloads-21.open-tx.org/nightly/companion"
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define C9X_STAMP OPENTX_COMPANION_DOWNLOADS "/companion-macosx.stamp"
|
||||
#define C9X_INSTALLER "/companion-macosx-%1.dmg"
|
||||
#define COMPANION_STAMP "companion-macosx.stamp"
|
||||
#define COMPANION_INSTALLER "companion-macosx-%1.dmg"
|
||||
#else
|
||||
#define C9X_STAMP OPENTX_COMPANION_DOWNLOADS "/companion-windows.stamp"
|
||||
#define C9X_INSTALLER "/companion-windows-%1.exe"
|
||||
#define COMPANION_STAMP "companion-windows.stamp"
|
||||
#define COMPANION_INSTALLER "companion-windows-%1.exe"
|
||||
#endif
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
@@ -123,7 +124,6 @@ MainWindow::MainWindow():
|
||||
}
|
||||
QTimer::singleShot(updateDelay, this, SLOT(doAutoUpdates()));
|
||||
QTimer::singleShot(updateDelay, this, SLOT(displayWarnings()));
|
||||
updateSdsyncAction();
|
||||
|
||||
QStringList strl = QApplication::arguments();
|
||||
QString str;
|
||||
@@ -216,6 +216,15 @@ void MainWindow::dowloadLastFirmwareUpdate()
|
||||
checkForUpdates();
|
||||
}
|
||||
|
||||
QString MainWindow::getCompanionUpdateBaseUrl()
|
||||
{
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
return g.useCompanionNightlyBuilds() ? OPENTX_NIGHT_COMPANION_DOWNLOADS : OPENTX_COMPANION_DOWNLOADS;
|
||||
#else
|
||||
return OPENTX_COMPANION_DOWNLOADS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::checkForUpdates()
|
||||
{
|
||||
if (checkForUpdatesState & SHOW_DIALOG_WAIT) {
|
||||
@@ -229,7 +238,7 @@ void MainWindow::checkForUpdates()
|
||||
// TODO why create each time a network manager?
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
connect(networkManager, SIGNAL(finished(QNetworkReply*)),this, SLOT(checkForCompanionUpdateFinished(QNetworkReply*)));
|
||||
QNetworkRequest request(QUrl(C9X_STAMP));
|
||||
QNetworkRequest request(QUrl(QString("%1/%2").arg(getCompanionUpdateBaseUrl()).arg(COMPANION_STAMP)));
|
||||
request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork);
|
||||
networkManager->get(request);
|
||||
}
|
||||
@@ -290,13 +299,13 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
|
||||
if (ret == QMessageBox::Yes) {
|
||||
#if defined __APPLE__
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version));
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(COMPANION_INSTALLER).arg(version));
|
||||
#else
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version), tr("Executable (*.exe)"));
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(COMPANION_INSTALLER).arg(version), tr("Executable (*.exe)"));
|
||||
#endif
|
||||
if (!fileName.isEmpty()) {
|
||||
g.updatesDir(QFileInfo(fileName).dir().absolutePath());
|
||||
downloadDialog * dd = new downloadDialog(this, QString(OPENTX_COMPANION_DOWNLOADS C9X_INSTALLER).arg(version), fileName);
|
||||
downloadDialog * dd = new downloadDialog(this, QString("%1/%2").arg(getCompanionUpdateBaseUrl()).arg(QString(COMPANION_INSTALLER).arg(version)), fileName);
|
||||
installer_fileName = fileName;
|
||||
connect(dd, SIGNAL(accepted()), this, SLOT(updateDownloaded()));
|
||||
dd->exec();
|
||||
@@ -406,6 +415,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
QString currentVersionString = index2version(currentVersion);
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Companion");
|
||||
QSpacerItem * horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
QGridLayout * layout = (QGridLayout*)msgBox.layout();
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
@@ -413,8 +423,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
if (currentVersion == 0) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setWindowTitle("Companion");
|
||||
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %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(current_firmware_variant->getId()).arg(versionString));
|
||||
msgBox.setText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %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(current_firmware_variant->getId()).arg(versionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
@@ -442,8 +451,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
else if (version > currentVersion) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText("Companion");
|
||||
msgBox.setInformativeText(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(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
|
||||
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(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
@@ -453,8 +461,8 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
msgBox.resize(0,0);
|
||||
msgBox.exec();
|
||||
if( msgBox.clickedButton() == rnButton ) {
|
||||
ContributorsDialog *cd = new ContributorsDialog(this); // , 2, rn);
|
||||
cd->exec();
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
|
||||
dialog->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret2 == QMessageBox::Yes) {
|
||||
@@ -530,37 +538,22 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setLanguage(QString langString)
|
||||
void MainWindow::setLanguage(const QString & langString)
|
||||
{
|
||||
g.locale( langString );
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("The selected language will be used the next time you start Companion."));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
|
||||
msgBox.exec();
|
||||
g.locale(langString);
|
||||
QMessageBox::information(this, tr("Companion"), tr("The selected language will be used the next time you start Companion."));
|
||||
}
|
||||
|
||||
void MainWindow::setTheme(int index)
|
||||
{
|
||||
g.theme( index );
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("The new theme will be loaded the next time you start Companion."));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
|
||||
msgBox.exec();
|
||||
g.theme(index);
|
||||
QMessageBox::information(this, tr("Companion"), tr("The new theme will be loaded the next time you start Companion."));
|
||||
}
|
||||
|
||||
void MainWindow::setIconThemeSize(int index)
|
||||
{
|
||||
g.iconSize( index );
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("The icon size will be used the next time you start Companion."));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
msgBox.addButton(tr("OK"), QMessageBox::AcceptRole);
|
||||
msgBox.exec();
|
||||
g.iconSize(index);
|
||||
QMessageBox::information(this, tr("Companion"), tr("The icon size will be used the next time you start Companion."));
|
||||
}
|
||||
|
||||
void MainWindow::newFile()
|
||||
@@ -783,25 +776,41 @@ void MainWindow::readEeprom()
|
||||
bool MainWindow::readFirmwareFromRadio(const QString &filename)
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("Read Firmware from Radio"), CompanionIcon("read_flash.png"));
|
||||
return readFirmware(filename, progressDialog.progress());
|
||||
bool result = readFirmware(filename, progressDialog.progress());
|
||||
if (!result) {
|
||||
progressDialog.exec();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MainWindow::writeFirmwareToRadio(const QString &filename)
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("Write Firmware to Radio"), CompanionIcon("write_flash.png"));
|
||||
return writeFirmware(filename, progressDialog.progress());
|
||||
bool result = writeFirmware(filename, progressDialog.progress());
|
||||
if (!result) {
|
||||
progressDialog.exec();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MainWindow::readEepromFromRadio(const QString &filename)
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("Read Models and Settings from Radio"), CompanionIcon("read_eeprom.png"));
|
||||
return ::readEeprom(filename, progressDialog.progress());
|
||||
bool result = ::readEeprom(filename, progressDialog.progress());
|
||||
if (!result) {
|
||||
progressDialog.exec();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MainWindow::writeEepromToRadio(const QString &filename)
|
||||
{
|
||||
ProgressDialog progressDialog(this, tr("Write Models and Settings to Radio"), CompanionIcon("write_eeprom.png"));
|
||||
return ::writeEeprom(filename, progressDialog.progress());
|
||||
bool result = ::writeEeprom(filename, progressDialog.progress());
|
||||
if (!result) {
|
||||
progressDialog.exec();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void MainWindow::writeBackup()
|
||||
@@ -872,7 +881,7 @@ void MainWindow::compare()
|
||||
|
||||
void MainWindow::logFile()
|
||||
{
|
||||
logsDialog *fd = new logsDialog(this);
|
||||
LogsDialog *fd = new LogsDialog(this);
|
||||
fd->setWindowFlags(Qt::Window); //to show minimize an maximize buttons
|
||||
fd->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
fd->show();
|
||||
@@ -897,12 +906,6 @@ void MainWindow::about()
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void MainWindow::updateSdsyncAction()
|
||||
{
|
||||
QTimer::singleShot(1000, this, SLOT(updateSdsyncAction()));
|
||||
sdsyncAct->setEnabled(!findMassstoragePath("SOUNDS").isEmpty());
|
||||
}
|
||||
|
||||
void MainWindow::updateMenus()
|
||||
{
|
||||
bool hasMdiChild = (activeMdiChild() != 0);
|
||||
@@ -924,7 +927,7 @@ void MainWindow::updateMenus()
|
||||
updateLanguageActions();
|
||||
updateIconSizeActions();
|
||||
updateIconThemeActions();
|
||||
setWindowTitle(tr("OpenTX Companion 2.1 - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->getName()).arg( g.profile[g.id()].name() ));
|
||||
setWindowTitle(tr("OpenTX Companion %1 - Radio: %2 - Profile: %3").arg(C9X_VERSION).arg(GetCurrentFirmware()->getName()).arg(g.profile[g.id()].name()));
|
||||
}
|
||||
|
||||
MdiChild *MainWindow::createMdiChild()
|
||||
|
||||
+16
-16
@@ -76,30 +76,31 @@ class MainWindow : public QMainWindow
|
||||
MainWindow();
|
||||
|
||||
protected:
|
||||
QString getCompanionUpdateBaseUrl();
|
||||
void dowloadLastFirmwareUpdate();
|
||||
void startFirmwareDownload();
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
void setLanguage(const QString & langString);
|
||||
|
||||
private slots:
|
||||
void openDocURL();
|
||||
|
||||
void setLanguage(QString langString);
|
||||
void setSysLanguage() {setLanguage("");};
|
||||
void setCZLanguage() {setLanguage("cs_CZ");};
|
||||
void setDELanguage() {setLanguage("de_DE");};
|
||||
void setENLanguage() {setLanguage("en");};
|
||||
void setFILanguage() {setLanguage("fi_FI");};
|
||||
void setFRLanguage() {setLanguage("fr_FR");};
|
||||
void setITLanguage() {setLanguage("it_IT");};
|
||||
void setHELanguage() {setLanguage("he_IL");};
|
||||
void setPLLanguage() {setLanguage("pl_PL");};
|
||||
void setESLanguage() {setLanguage("es_ES");};
|
||||
void setPTLanguage() {setLanguage("pt_PT");};
|
||||
void setRULanguage() {setLanguage("ru_RU");};
|
||||
void setSELanguage() {setLanguage("sv_SE");};
|
||||
void setNLLanguage() {setLanguage("nl_NL");};
|
||||
void setSysLanguage() { setLanguage(""); };
|
||||
void setCZLanguage() { setLanguage("cs_CZ"); };
|
||||
void setDELanguage() { setLanguage("de_DE"); };
|
||||
void setENLanguage() { setLanguage("en"); };
|
||||
void setFILanguage() { setLanguage("fi_FI"); };
|
||||
void setFRLanguage() { setLanguage("fr_FR"); };
|
||||
void setITLanguage() { setLanguage("it_IT"); };
|
||||
void setHELanguage() { setLanguage("he_IL"); };
|
||||
void setPLLanguage() { setLanguage("pl_PL"); };
|
||||
void setESLanguage() { setLanguage("es_ES"); };
|
||||
void setPTLanguage() { setLanguage("pt_PT"); };
|
||||
void setRULanguage() { setLanguage("ru_RU"); };
|
||||
void setSELanguage() { setLanguage("sv_SE"); };
|
||||
void setNLLanguage() { setLanguage("nl_NL"); };
|
||||
|
||||
void setTheme(int index);
|
||||
void setClassicTheme() {setTheme(0);};
|
||||
@@ -156,7 +157,6 @@ class MainWindow : public QMainWindow
|
||||
void loadBackup();
|
||||
void appPrefs();
|
||||
void fwPrefs();
|
||||
void updateSdsyncAction();
|
||||
void updateMenus();
|
||||
void createProfile();
|
||||
MdiChild *createMdiChild();
|
||||
|
||||
@@ -282,8 +282,8 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t eeprom[EESIZE_RLC_MAX];
|
||||
int eeprom_size = HexInterface(inputStream).load(eeprom, EESIZE_RLC_MAX);
|
||||
QByteArray eeprom(EESIZE_MAX, 0);
|
||||
int eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_MAX);
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Invalid EEPROM File %1")
|
||||
@@ -294,7 +294,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
|
||||
file.close();
|
||||
|
||||
if (!loadEEprom(radioData, eeprom, eeprom_size)) {
|
||||
if (!loadEEprom(radioData, (uint8_t *)eeprom.data(), eeprom_size)) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Invalid EEPROM File %1")
|
||||
.arg(fileName));
|
||||
|
||||
@@ -61,7 +61,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
addEmptyLabel(gridLayout, 5 );
|
||||
|
||||
lock = true;
|
||||
int num_fsw = firmware->getCapability(CustomFunctions);
|
||||
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||
|
||||
if (!firmware->getCapability(VoicesAsNumbers)) {
|
||||
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
||||
@@ -379,7 +379,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
if (modified) cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
|
||||
if (modified) cfn.param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
|
||||
populateFuncParamCB(fswtchParamT[i], func, cfn.param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
@@ -442,16 +442,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
else {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
|
||||
int vml = firmware->getCapability(VoicesMaxLength);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
|
||||
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
|
||||
}
|
||||
}
|
||||
getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength));
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], cfn.paramarm, tracksSet);
|
||||
populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
}
|
||||
@@ -460,16 +453,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
else if (func==FuncBackgroundMusic) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
|
||||
int vml=firmware->getCapability(VoicesMaxLength);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(),vml); j++) {
|
||||
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
|
||||
}
|
||||
}
|
||||
getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, firmware->getCapability(VoicesMaxLength));
|
||||
}
|
||||
populateFileComboBox(fswtchParamArmT[i], tracksSet, cfn.paramarm);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], cfn.paramarm, tracksSet);
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
if (modified) cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
|
||||
@@ -485,27 +474,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
else if (func==FuncPlayScript) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
|
||||
int vml = 8/*TODO*/;
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
|
||||
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], cfn.paramarm, scriptsSet);
|
||||
}
|
||||
else if (func==FuncPlayScript) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
|
||||
int vml = 8/*TODO*/;
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
|
||||
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
|
||||
}
|
||||
}
|
||||
getFileComboBoxValue(fswtchParamArmT[i], cfn.paramarm, 8);
|
||||
}
|
||||
populateFileComboBox(fswtchParamArmT[i], scriptsSet, cfn.paramarm);
|
||||
}
|
||||
else if (func==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
|
||||
if (modified) cfn.param = (uint8_t)fswtchBLcolor[i]->value();
|
||||
@@ -543,7 +514,8 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
void CustomFunctionsPanel::update()
|
||||
{
|
||||
lock = true;
|
||||
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
|
||||
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
if (!initialized) {
|
||||
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
|
||||
populateFuncCB(fswtchFunc[i], functions[i].func);
|
||||
@@ -659,77 +631,28 @@ void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> ¶msList)
|
||||
{
|
||||
b->clear();
|
||||
b->addItem("----");
|
||||
|
||||
bool added = false;
|
||||
QString currentvalue(value);
|
||||
// Convert set into list and sort it alphabetically case insensitive
|
||||
QStringList list = QStringList::fromSet(paramsList);
|
||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
foreach (QString entry, list) {
|
||||
b->addItem(entry);
|
||||
if (entry==currentvalue) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!added && strlen(value)) {
|
||||
b->addItem(value);
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode)
|
||||
{
|
||||
QStringList qs;
|
||||
b->clear();
|
||||
if (function==FuncPlaySound) {
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
CustomFunctionData::populatePlaySoundParams(qs);
|
||||
b->addItems(qs);
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
else if (function==FuncPlayHaptic) {
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
CustomFunctionData::populateHapticParams(qs);
|
||||
b->addItems(qs);
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
else if (function==FuncReset) {
|
||||
qs.append( QObject::tr("Timer1"));
|
||||
qs.append( QObject::tr("Timer2"));
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
qs.append( QObject::tr("Timer3"));
|
||||
}
|
||||
qs.append( QObject::tr("Flight"));
|
||||
qs.append( QObject::tr("Telemetry"));
|
||||
int reCount = firmware->getCapability(RotaryEncoders);
|
||||
if (reCount == 1) {
|
||||
qs.append( QObject::tr("Rotary Encoder"));
|
||||
}
|
||||
else if (reCount == 2) {
|
||||
qs.append( QObject::tr("REa"));
|
||||
qs.append( QObject::tr("REb"));
|
||||
}
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
for (int i=0; i<C9X_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
|
||||
qs.append(item.toString(model));
|
||||
}
|
||||
}
|
||||
}
|
||||
b->addItems(qs);
|
||||
b->setCurrentIndex(value);
|
||||
CustomFunctionData::populateResetParams(model, b, value);
|
||||
}
|
||||
else if (function==FuncVolume) {
|
||||
populateSourceCB(b, RawSource(value), generalSettings, model, POPULATE_NONE|POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS|POPULATE_SWITCHES);
|
||||
}
|
||||
else if (function==FuncPlayValue) {
|
||||
populateSourceCB(b, RawSource(value), generalSettings, model, POPULATE_NONE|POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRY|POPULATE_TELEMETRYEXT);
|
||||
populateSourceCB(b, RawSource(value), generalSettings, model, POPULATE_NONE|POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRY|POPULATE_TELEMETRYEXT|POPULATE_SCRIPT_OUTPUTS);
|
||||
}
|
||||
else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) {
|
||||
switch (adjustmode) {
|
||||
|
||||
@@ -65,7 +65,6 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
void populateFuncCB(QComboBox *b, unsigned int value);
|
||||
void populateGVmodeCB(QComboBox *b, unsigned int value);
|
||||
void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode=0);
|
||||
void populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> & paramsList);
|
||||
|
||||
bool initialized;
|
||||
QSet<QString> tracksSet;
|
||||
|
||||
@@ -10,13 +10,14 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
generalSettings(generalSettings),
|
||||
firmware(firmware),
|
||||
ed(expoData),
|
||||
inputName(inputName)
|
||||
inputName(inputName),
|
||||
modelPrinter(firmware, &generalSettings, &model)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
|
||||
QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 };
|
||||
|
||||
setWindowTitle(tr("Edit %1").arg(getInputStr(&model, ed->chn)));
|
||||
setWindowTitle(tr("Edit %1").arg(modelPrinter.printInputName(ed->chn)));
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QDialog>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
class GVarGroup;
|
||||
class CurveGroup;
|
||||
@@ -35,6 +36,7 @@ class ExpoDialog : public QDialog {
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
CurveGroup * curveGroup;
|
||||
ModelPrinter modelPrinter;
|
||||
};
|
||||
|
||||
#endif // EXPODIALOG_H
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
InputsPanel::InputsPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
expoInserted(false)
|
||||
expoInserted(false),
|
||||
modelPrinter(firmware, &generalSettings, &model)
|
||||
{
|
||||
inputsCount = firmware->getCapability(VirtualInputs);
|
||||
if (inputsCount == 0)
|
||||
@@ -135,7 +136,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
|
||||
QString str;
|
||||
if (new_ch) *new_ch = 0;
|
||||
if (dest < 0) {
|
||||
str = getInputStr(model, -dest-1);
|
||||
str = modelPrinter.printInputName(-dest-1);
|
||||
if (new_ch) *new_ch = 1;
|
||||
}
|
||||
else {
|
||||
@@ -144,9 +145,9 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
|
||||
if ((dest == 0) || (model->expoData[dest-1].chn != md->chn)) {
|
||||
if (new_ch) *new_ch = 1;
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
str = QString("%1").arg(getInputStr(model, md->chn), -10, ' ');
|
||||
str += QString("%1").arg(modelPrinter.printInputName(md->chn), -10, ' ');
|
||||
else
|
||||
str = getInputStr(model, md->chn);
|
||||
str = modelPrinter.printInputName(md->chn);
|
||||
}
|
||||
else {
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
@@ -154,39 +155,10 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
|
||||
else
|
||||
str = " ";
|
||||
}
|
||||
|
||||
switch (md->mode) {
|
||||
case (1): str += " <-"; break;
|
||||
case (2): str += " ->"; break;
|
||||
default: str += " "; break;
|
||||
}
|
||||
|
||||
str += " " + tr("Weight(%1)").arg(getGVarString(md->weight));
|
||||
if (md->offset) str += " " + tr("Offset(%1)").arg(getGVarString(md->offset));
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
str += " " + tr("Source(%1)").arg(md->srcRaw.toString(model));
|
||||
if (md->carryTrim>0) {
|
||||
str += " " + tr("NoTrim");
|
||||
}
|
||||
else if (md->carryTrim<0) {
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(model);
|
||||
}
|
||||
}
|
||||
|
||||
if (md->curve.value) str += " " + md->curve.toString();
|
||||
|
||||
QString phasesStr = getPhasesStr(md->phases, model);
|
||||
if (!phasesStr.isEmpty()) str += " " + phasesStr;
|
||||
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) str += " " + tr("Switch(%1)").arg(md->swtch.toString());
|
||||
|
||||
if (firmware->getCapability(HasExpoNames)) {
|
||||
QString expoName = md->name;
|
||||
if (!expoName.isEmpty()) str += QString(" [%1]").arg(expoName);
|
||||
}
|
||||
str.replace(" ", " ");
|
||||
str += modelPrinter.printInputLine(md);
|
||||
}
|
||||
return Qt::escape(str).replace(" ", " ");
|
||||
return str;
|
||||
}
|
||||
|
||||
bool InputsPanel::gm_insertExpo(int idx)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "mixerslist.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
class InputsPanel : public ModelPanel
|
||||
{
|
||||
@@ -35,6 +36,7 @@ class InputsPanel : public ModelPanel
|
||||
MixersList *ExposlistWidget;
|
||||
bool firstLine;
|
||||
int inputsCount;
|
||||
ModelPrinter modelPrinter;
|
||||
|
||||
int getExpoIndex(unsigned int dch);
|
||||
bool gm_insertExpo(int idx);
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
mixInserted(false),
|
||||
highlightedSource(0)
|
||||
highlightedSource(0),
|
||||
modelPrinter(firmware, &generalSettings, &model)
|
||||
{
|
||||
QGridLayout * mixesLayout = new QGridLayout(this);
|
||||
|
||||
@@ -43,23 +44,6 @@ MixesPanel::~MixesPanel()
|
||||
{
|
||||
}
|
||||
|
||||
QString MixesPanel::getChannelLabel(int curDest)
|
||||
{
|
||||
QString str;
|
||||
str = QObject::tr("CH%1").arg(curDest);
|
||||
// TODO not nice, Qt brings a function for that, I don't remember right now
|
||||
(str.length() < 4) ? str.append(" ") : str.append(" ");
|
||||
if (firmware->getCapability(HasChNames)) {
|
||||
QString name = model->limitData[curDest-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name = QString("(") + name + QString(")");
|
||||
}
|
||||
name.append(" ");
|
||||
str += name.left(8);
|
||||
}
|
||||
return Qt::escape(str);
|
||||
}
|
||||
|
||||
void MixesPanel::update()
|
||||
{
|
||||
// curDest -> destination channel
|
||||
@@ -141,8 +125,8 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
QString str;
|
||||
if (new_ch) *new_ch = 0;
|
||||
if (dest < 0) {
|
||||
str = getChannelLabel(-dest);
|
||||
//highlight channell if needed
|
||||
str = modelPrinter.printMixerName(-dest);
|
||||
//highlight channel if needed
|
||||
if (-dest == (int)highlightedSource) {
|
||||
str = "<b>" + str + "</b>";
|
||||
}
|
||||
@@ -151,11 +135,11 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
else {
|
||||
MixData *md = &model->mixData[dest];
|
||||
//md->destCh from 1 to 32
|
||||
str = getChannelLabel(md->destCh);
|
||||
str = modelPrinter.printMixerName(md->destCh);
|
||||
|
||||
if ((dest == 0) || (model->mixData[dest-1].destCh != md->destCh)) {
|
||||
if (new_ch) *new_ch = 1;
|
||||
//highlight channell if needed
|
||||
//highlight channel if needed
|
||||
if (md->destCh == highlightedSource) {
|
||||
str = "<b>" + str + "</b>";
|
||||
}
|
||||
@@ -164,53 +148,7 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
str.fill(' ');
|
||||
}
|
||||
|
||||
switch (md->mltpx) {
|
||||
case (1): str += " *"; break;
|
||||
case (2): str += " R"; break;
|
||||
default: str += " "; break;
|
||||
};
|
||||
|
||||
// highlight source if needed
|
||||
if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
str += " <b>" + Qt::escape(md->srcRaw.toString(model)) + "</b>";
|
||||
}
|
||||
else {
|
||||
str += " " + Qt::escape(md->srcRaw.toString(model));
|
||||
}
|
||||
|
||||
str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true)));
|
||||
|
||||
QString phasesStr = getPhasesStr(md->phases, model);
|
||||
if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr);
|
||||
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) {
|
||||
str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString()));
|
||||
}
|
||||
|
||||
if (md->carryTrim > 0)
|
||||
str += " " + Qt::escape(tr("NoTrim"));
|
||||
else if (md->carryTrim<0)
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(model);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && md->noExpo) str += " " + Qt::escape(tr("No DR/Expo"));
|
||||
if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset)));
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (md->delayDown || md->delayUp)
|
||||
str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale));
|
||||
if (md->speedDown || md->speedUp)
|
||||
str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale));
|
||||
if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn));
|
||||
if (firmware->getCapability(HasMixerNames)) {
|
||||
QString MixerName;
|
||||
MixerName.append(md->name);
|
||||
if (!MixerName.isEmpty()) {
|
||||
str += " " + Qt::escape(QString("(%1)").arg(MixerName));
|
||||
}
|
||||
}
|
||||
str += modelPrinter.printMixerLine(md, highlightedSource);
|
||||
}
|
||||
return str.replace(" ", " ");
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "modeledit.h"
|
||||
#include "mixerslist.h"
|
||||
#include "mixerdialog.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
class MixesPanel : public ModelPanel
|
||||
{
|
||||
@@ -44,6 +45,7 @@ class MixesPanel : public ModelPanel
|
||||
bool mixInserted;
|
||||
unsigned int highlightedSource;
|
||||
bool firstLine;
|
||||
ModelPrinter modelPrinter;
|
||||
|
||||
int getMixerIndex(unsigned int dch);
|
||||
bool gm_insertMix(int idx);
|
||||
@@ -53,7 +55,6 @@ class MixesPanel : public ModelPanel
|
||||
void mixersDeleteList(QList<int> list);
|
||||
QList<int> createMixListFromSelected();
|
||||
void setSelectedByMixList(QList<int> list);
|
||||
QString getChannelLabel(int curDest);
|
||||
bool AddMixerLine(int dest);
|
||||
QString getMixerText(int dest, bool * new_ch);
|
||||
};
|
||||
|
||||
@@ -517,6 +517,10 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
if (!firmware->getCapability(HasDisplayText)) {
|
||||
ui->displayText->hide();
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(GlobalFunctions)) {
|
||||
ui->gfEnabled->hide();
|
||||
}
|
||||
|
||||
// Beep Center checkboxes
|
||||
prevFocus = ui->trimsDisplay;
|
||||
@@ -774,6 +778,7 @@ void SetupPanel::update()
|
||||
ui->extendedLimits->setChecked(model->extendedLimits);
|
||||
ui->extendedTrims->setChecked(model->extendedTrims);
|
||||
ui->displayText->setChecked(model->displayChecklist);
|
||||
ui->gfEnabled->setChecked(!model->noGlobalFunctions);
|
||||
|
||||
updateBeepCenter();
|
||||
updateStartupSwitches();
|
||||
@@ -915,6 +920,12 @@ void SetupPanel::on_displayText_toggled(bool checked)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void SetupPanel::on_gfEnabled_toggled(bool checked)
|
||||
{
|
||||
model->noGlobalFunctions = !checked;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void SetupPanel::on_throttleTrim_toggled(bool checked)
|
||||
{
|
||||
model->thrTrim = checked;
|
||||
|
||||
@@ -101,6 +101,7 @@ class SetupPanel : public ModelPanel
|
||||
void on_throttleWarning_toggled(bool checked);
|
||||
void on_throttleReverse_toggled(bool checked);
|
||||
void on_displayText_toggled(bool checked);
|
||||
void on_gfEnabled_toggled(bool checked);
|
||||
void on_image_currentIndexChanged(int index);
|
||||
void on_trimIncrement_currentIndexChanged(int index);
|
||||
void onBeepCenterToggled(bool checked);
|
||||
|
||||
@@ -215,6 +215,13 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="gfEnabled">
|
||||
<property name="text">
|
||||
<string>Global Functions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
|
||||
@@ -340,6 +340,13 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
ui->screenType->setField(screen.type, this);
|
||||
lock = false;
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
QSet<QString> scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/TELEMETRY", QStringList() << "*.lua", 8);
|
||||
populateFileComboBox(ui->scriptName, scriptsSet, screen.body.script.filename);
|
||||
connect(ui->scriptName, SIGNAL(currentIndexChanged(int)), this, SLOT(scriptNameEdited()));
|
||||
connect(ui->scriptName, SIGNAL(editTextChanged ( const QString)), this, SLOT(scriptNameEdited()));
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -362,6 +369,7 @@ void TelemetryCustomScreen::update()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
ui->scriptName->setVisible(screen.type == TELEMETRY_SCREEN_SCRIPT);
|
||||
ui->screenNums->setVisible(screen.type == TELEMETRY_SCREEN_NUMBERS);
|
||||
ui->screenBars->setVisible(screen.type == TELEMETRY_SCREEN_BARS);
|
||||
|
||||
@@ -391,9 +399,12 @@ void TelemetryCustomScreen::updateBar(int line)
|
||||
RawSource source = screen.body.bars[line].source;
|
||||
if (source.type != SOURCE_TYPE_NONE) {
|
||||
RawSourceRange range = source.getRange(model, generalSettings, RANGE_SINGLE_PRECISION);
|
||||
int max = round((range.max - range.min) / range.step);
|
||||
if (int(255-screen.body.bars[line].barMax) > max)
|
||||
screen.body.bars[line].barMax = 255 - max;
|
||||
if (!IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
int max = round((range.max - range.min) / range.step);
|
||||
if (int(255-screen.body.bars[line].barMax) > max) {
|
||||
screen.body.bars[line].barMax = 255 - max;
|
||||
}
|
||||
}
|
||||
minSB[line]->setEnabled(true);
|
||||
minSB[line]->setDecimals(range.decimals);
|
||||
minSB[line]->setMinimum(range.min);
|
||||
@@ -405,7 +416,12 @@ void TelemetryCustomScreen::updateBar(int line)
|
||||
maxSB[line]->setMinimum(range.min);
|
||||
maxSB[line]->setMaximum(range.max);
|
||||
maxSB[line]->setSingleStep(range.step);
|
||||
maxSB[line]->setValue(range.getValue(255 - screen.body.bars[line].barMax));
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
maxSB[line]->setValue(range.getValue(screen.body.bars[line].barMax));
|
||||
}
|
||||
else {
|
||||
maxSB[line]->setValue(range.getValue(255 - screen.body.bars[line].barMax));
|
||||
}
|
||||
}
|
||||
else {
|
||||
minSB[line]->setDisabled(true);
|
||||
@@ -424,6 +440,16 @@ void TelemetryCustomScreen::on_screenType_currentIndexChanged(int index)
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::scriptNameEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
getFileComboBoxValue(ui->scriptName, screen.body.script.filename, 8);
|
||||
emit modified();
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryCustomScreen::customFieldChanged(int value)
|
||||
{
|
||||
if (!lock) {
|
||||
@@ -450,7 +476,10 @@ void TelemetryCustomScreen::barMinChanged(double value)
|
||||
{
|
||||
if (!lock) {
|
||||
int line = sender()->property("index").toInt();
|
||||
screen.body.bars[line].barMin = round((value-minSB[line]->minimum()) / minSB[line]->singleStep());
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard()))
|
||||
screen.body.bars[line].barMin = round(value / minSB[line]->singleStep());
|
||||
else
|
||||
screen.body.bars[line].barMin = round((value-minSB[line]->minimum()) / minSB[line]->singleStep());
|
||||
// TODO set min (maxSB)
|
||||
emit modified();
|
||||
}
|
||||
@@ -460,7 +489,10 @@ void TelemetryCustomScreen::barMaxChanged(double value)
|
||||
{
|
||||
if (!lock) {
|
||||
int line = sender()->property("index").toInt();
|
||||
screen.body.bars[line].barMax = 255 - round((value-minSB[line]->minimum()) / maxSB[line]->singleStep());
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard()))
|
||||
screen.body.bars[line].barMax = round((value) / maxSB[line]->singleStep());
|
||||
else
|
||||
screen.body.bars[line].barMax = 255 - round((value-minSB[line]->minimum()) / maxSB[line]->singleStep());
|
||||
// TODO set max (minSB)
|
||||
emit modified();
|
||||
}
|
||||
@@ -639,6 +671,10 @@ void TelemetrySensorPanel::on_formula_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
sensor.formula = index;
|
||||
if (sensor.formula == SensorData::TELEM_FORMULA_CELL) {
|
||||
sensor.prec = 2;
|
||||
sensor.unit = SensorData::UNIT_VOLTS;
|
||||
}
|
||||
update();
|
||||
emit modified();
|
||||
}
|
||||
@@ -697,6 +733,8 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
ui->voltsSource->setField(model.frsky.voltsSource);
|
||||
ui->altitudeSource->setField(model.frsky.altitudeSource);
|
||||
ui->varioSource->setField(model.frsky.varioSource);
|
||||
ui->varioCenterSilent->setField(model.frsky.varioCenterSilent);
|
||||
}
|
||||
else {
|
||||
ui->topbarGB->hide();
|
||||
@@ -731,6 +769,7 @@ void TelemetryPanel::update()
|
||||
|
||||
populateTelemetrySourcesComboBox(ui->voltsSource, model, false);
|
||||
populateTelemetrySourcesComboBox(ui->altitudeSource, model, false);
|
||||
populateTelemetrySourcesComboBox(ui->varioSource, model, false);
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
@@ -756,10 +795,12 @@ void TelemetryPanel::setup()
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
|
||||
ui->ignoreSensorIds->setField(model->frsky.ignoreSensorIds);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocolLabel->hide();
|
||||
ui->telemetryProtocol->hide();
|
||||
ui->ignoreSensorIds->hide();
|
||||
}
|
||||
|
||||
ui->rssiAlarm1SB->setValue(model->frsky.rssiAlarms[0].value);
|
||||
@@ -794,7 +835,7 @@ void TelemetryPanel::setup()
|
||||
ui->VarioLabel_2->hide();
|
||||
ui->VarioLabel_3->hide();
|
||||
ui->VarioLabel_4->hide();
|
||||
ui->varioSourceCB->hide();
|
||||
ui->varioSource->hide();
|
||||
ui->varioSource_label->hide();
|
||||
}
|
||||
else {
|
||||
@@ -849,29 +890,23 @@ void TelemetryPanel::setup()
|
||||
|
||||
ui->frskyProtoCB->setCurrentIndex(model->frsky.usrProto);
|
||||
ui->bladesCount->setValue(model->frsky.blades);
|
||||
populateVarioSource();
|
||||
populateVoltsSource();
|
||||
populateCurrentSource();
|
||||
}
|
||||
|
||||
populateVoltsSource();
|
||||
populateCurrentSource();
|
||||
populateVarioSource();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void TelemetryPanel::populateVarioSource()
|
||||
{
|
||||
AutoComboBox * cb = ui->varioSourceCB;
|
||||
AutoComboBox * cb = ui->varioSource;
|
||||
cb->setField(model->frsky.varioSource, this);
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
cb->addItem(tr("Alti"), TELEMETRY_VARIO_SOURCE_ALTI);
|
||||
cb->addItem(tr("Alti+"), TELEMETRY_VARIO_SOURCE_ALTI_PLUS);
|
||||
}
|
||||
cb->addItem(tr("Alti"), TELEMETRY_VARIO_SOURCE_ALTI);
|
||||
cb->addItem(tr("Alti+"), TELEMETRY_VARIO_SOURCE_ALTI_PLUS);
|
||||
cb->addItem(tr("VSpeed"), TELEMETRY_VARIO_SOURCE_VSPEED);
|
||||
cb->addItem(tr("A1"), TELEMETRY_VARIO_SOURCE_A1);
|
||||
cb->addItem(tr("A2"), TELEMETRY_VARIO_SOURCE_A2);
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
cb->addItem(tr("dTE"), TELEMETRY_VARIO_SOURCE_DTE);
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::populateVoltsSource()
|
||||
|
||||
@@ -60,6 +60,7 @@ class TelemetryCustomScreen: public ModelPanel
|
||||
|
||||
private slots:
|
||||
void on_screenType_currentIndexChanged(int index);
|
||||
void scriptNameEdited();
|
||||
void customFieldChanged(int index);
|
||||
void barSourceChanged(int index);
|
||||
void barMinChanged(double value);
|
||||
|
||||
@@ -329,7 +329,7 @@
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_66" columnstretch="1,0,0,0">
|
||||
<layout class="QGridLayout" name="gridLayout_66" columnstretch="1,1,1,1,1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="VarioLabel_1">
|
||||
<property name="sizePolicy">
|
||||
@@ -488,6 +488,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QLabel" name="VarioLabel_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Center Silent</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="AutoCheckBox" name="varioCenterSilent">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
@@ -511,7 +537,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="AutoComboBox" name="varioSourceCB">
|
||||
<widget class="AutoComboBox" name="varioSource">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -870,7 +896,7 @@
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="sensorsLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
@@ -883,6 +909,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="AutoCheckBox" name="ignoreSensorIds">
|
||||
<property name="text">
|
||||
<string>Disable multi sensor handling</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -920,6 +953,11 @@
|
||||
<extends>QComboBox</extends>
|
||||
<header>autocombobox.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>AutoCheckBox</class>
|
||||
<extends>QCheckBox</extends>
|
||||
<header>autocheckbox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>telemetryProtocol</tabstop>
|
||||
@@ -927,7 +965,7 @@
|
||||
<tabstop>rssiAlarm1SB</tabstop>
|
||||
<tabstop>rssiAlarm2CB</tabstop>
|
||||
<tabstop>rssiAlarm2SB</tabstop>
|
||||
<tabstop>varioSourceCB</tabstop>
|
||||
<tabstop>varioSource</tabstop>
|
||||
<tabstop>varioLimitMin_DSB</tabstop>
|
||||
<tabstop>varioLimitCenterMin_DSB</tabstop>
|
||||
<tabstop>varioLimitCenterMax_DSB</tabstop>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>283</width>
|
||||
<height>86</height>
|
||||
<width>915</width>
|
||||
<height>305</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -15,7 +15,7 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="screenScript" stretch="0,0,1">
|
||||
<layout class="QHBoxLayout" name="screenScript" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="screenTypeLabel">
|
||||
<property name="sizePolicy">
|
||||
@@ -52,7 +52,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_16">
|
||||
<widget class="QComboBox" name="scriptName">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
@@ -70,7 +77,7 @@
|
||||
<widget class="QGroupBox" name="screenBars">
|
||||
<layout class="QGridLayout" name="screenBarsLayout" columnstretch="1,0,1,0">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="label_266">
|
||||
<widget class="QLabel" name="minLabel">
|
||||
<property name="text">
|
||||
<string>Min</string>
|
||||
</property>
|
||||
@@ -80,7 +87,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_265">
|
||||
<widget class="QLabel" name="sourceLabel">
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
@@ -90,7 +97,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_267">
|
||||
<widget class="QLabel" name="gaugeLabel">
|
||||
<property name="text">
|
||||
<string>Gauge</string>
|
||||
</property>
|
||||
@@ -100,7 +107,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label_268">
|
||||
<widget class="QLabel" name="maxLabel">
|
||||
<property name="text">
|
||||
<string>Max</string>
|
||||
</property>
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Range</string>
|
||||
<string>Ratio</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -0,0 +1,317 @@
|
||||
#include "helpers.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
QString changeColor(const QString & input, const QString & to, const QString & from)
|
||||
{
|
||||
QString result = input;
|
||||
return result.replace("color="+from, "color="+to);
|
||||
}
|
||||
|
||||
ModelPrinter::ModelPrinter(Firmware * firmware,
|
||||
GeneralSettings *gg, ModelData *gm) :
|
||||
firmware(firmware),
|
||||
g_eeGeneral(gg),
|
||||
g_model(gm)
|
||||
{
|
||||
}
|
||||
|
||||
void debugHtml(const QString & html)
|
||||
{
|
||||
QFile file("foo.html");
|
||||
file.open(QIODevice::Truncate | QIODevice::WriteOnly);
|
||||
file.write(html.toUtf8());
|
||||
file.close();
|
||||
}
|
||||
|
||||
QString addFont(const QString & input, const QString & color, const QString & size, const QString & face)
|
||||
{
|
||||
QString colorStr;
|
||||
if (!color.isEmpty()) {
|
||||
colorStr = "color=" + color;
|
||||
}
|
||||
QString sizeStr;
|
||||
if (!size.isEmpty()) {
|
||||
sizeStr = "size=" + size;
|
||||
}
|
||||
QString faceStr;
|
||||
if (!face.isEmpty()) {
|
||||
faceStr = "face='" + face + "'";
|
||||
}
|
||||
return "<font " + sizeStr + " " + faceStr + " " + colorStr + ">" + input + "</font>";
|
||||
}
|
||||
|
||||
QString ModelPrinter::printInputName(int idx)
|
||||
{
|
||||
QString result;
|
||||
if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
|
||||
if (strlen(g_model->inputNames[idx]) > 0) {
|
||||
result = QObject::tr("[I%1]").arg(idx+1);
|
||||
result += QString(g_model->inputNames[idx]);
|
||||
}
|
||||
else {
|
||||
result = QObject::tr("Input%1").arg(idx+1, 2, 10, QChar('0'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, idx).toString(g_model);
|
||||
}
|
||||
return Qt::escape(result);
|
||||
}
|
||||
|
||||
QString ModelPrinter::printInputLine(const ExpoData * ed)
|
||||
{
|
||||
QString str = " ";
|
||||
|
||||
switch (ed->mode) {
|
||||
case (1): str += "<- "; break;
|
||||
case (2): str += "-> "; break;
|
||||
default: str += " "; break;
|
||||
}
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
str += Qt::escape(ed->srcRaw.toString(g_model));
|
||||
}
|
||||
|
||||
str += " " + Qt::escape(QObject::tr("Weight")) + QString("(%1)").arg(getGVarString(ed->weight,true));
|
||||
if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString());
|
||||
|
||||
QString phasesStr = printPhases(ed->phases);
|
||||
if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr);
|
||||
|
||||
if (ed->swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + Qt::escape(QObject::tr("Switch") + QString("(%1)").arg(ed->swtch.toString()));
|
||||
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
if (ed->carryTrim>0) str += " " + Qt::escape(QObject::tr("NoTrim"));
|
||||
else if (ed->carryTrim<0) str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(g_model));
|
||||
}
|
||||
|
||||
if (firmware->getCapability(HasExpoNames) && ed->name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(ed->name));
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerName(int curDest)
|
||||
{
|
||||
QString str;
|
||||
str = QObject::tr("CH%1").arg(curDest);
|
||||
// TODO not nice, Qt brings a function for that, I don't remember right now
|
||||
(str.length() < 4) ? str.append(" ") : str.append(" ");
|
||||
if (firmware->getCapability(HasChNames)) {
|
||||
QString name = g_model->limitData[curDest-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name = QString("(") + name + QString(")");
|
||||
}
|
||||
name.append(" ");
|
||||
str += name.left(8);
|
||||
}
|
||||
return Qt::escape(str);
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerLine(const MixData * md, int highlightedSource)
|
||||
{
|
||||
QString str = " ";
|
||||
|
||||
switch(md->mltpx) {
|
||||
case (1): str += "*"; break;
|
||||
case (2): str += "R"; break;
|
||||
default: str += " "; break;
|
||||
};
|
||||
|
||||
// highlight source if needed
|
||||
QString source = Qt::escape(md->srcRaw.toString(g_model));
|
||||
if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
source = "<b>" + source + "</b>";
|
||||
}
|
||||
str += " " + source;
|
||||
|
||||
str += " " + Qt::escape(QObject::tr("Weight")) + QString("(%1)").arg(getGVarString(md->weight, true));
|
||||
|
||||
QString phasesStr = printPhases(md->phases);
|
||||
if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr);
|
||||
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) {
|
||||
str += " " + Qt::escape(QObject::tr("Switch")) + QString("(%1)").arg(md->swtch.toString());
|
||||
}
|
||||
|
||||
if (md->carryTrim>0) str += " " + Qt::escape(QObject::tr("NoTrim"));
|
||||
else if (md->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(g_model);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && md->noExpo) str += " " + Qt::escape(QObject::tr("No DR/Expo"));
|
||||
if (md->sOffset) str += " " + Qt::escape(QObject::tr("Offset")) + QString("(%1)").arg(getGVarString(md->sOffset));
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (md->delayDown || md->delayUp)
|
||||
str += " " + Qt::escape(QObject::tr("Delay")) + QString("(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp)
|
||||
str += " " + Qt::escape(QObject::tr("Slow")) + QString("(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale);
|
||||
if (md->mixWarn)
|
||||
// str += Qt::escape(QObject::tr(" Warn(%1)").arg(md->mixWarn));
|
||||
str += " " + Qt::escape(QObject::tr("Warn")) + QString("(%1)").arg(md->mixWarn);
|
||||
if (firmware->getCapability(HasMixerNames) && md->name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(md->name));
|
||||
return str;
|
||||
}
|
||||
|
||||
QString ModelPrinter::printPhases(unsigned int phases)
|
||||
{
|
||||
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
|
||||
|
||||
if (numphases && phases) {
|
||||
QString str;
|
||||
int count = 0;
|
||||
if (phases == (unsigned int)(1<<numphases) - 1) {
|
||||
str = " ### " + QObject::tr("DISABLED") + " ### ";
|
||||
}
|
||||
// if (phases) {
|
||||
for (int i=0; i<numphases; i++) {
|
||||
if (!(phases & (1<<i))) {
|
||||
if (count++ > 0) str += QString(", ");
|
||||
str += getPhaseName(i+1, g_model->flightModeData[i].name);
|
||||
}
|
||||
}
|
||||
// }
|
||||
if (count > 1)
|
||||
return QObject::tr("Flight modes") + QString("(%1)").arg(str);
|
||||
else
|
||||
return QObject::tr("Flight mode") + QString("(%1)").arg(str);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
QString ModelPrinter::printLogicalSwitchLine(int idx)
|
||||
{
|
||||
QString result = "";
|
||||
const LogicalSwitchData & ls = g_model->logicalSw[idx];
|
||||
|
||||
if (!ls.func)
|
||||
return result;
|
||||
|
||||
if (ls.andsw!=0) {
|
||||
result +="( ";
|
||||
}
|
||||
switch (ls.getFunctionFamily()) {
|
||||
case LS_FAMILY_EDGE:
|
||||
result += QObject::tr("Edge(%1, [%2:%3])").arg(RawSwitch(ls.val1).toString()).arg(ValToTim(ls.val2)).arg(ValToTim(ls.val2+ls.val3));
|
||||
break;
|
||||
case LS_FAMILY_STICKY:
|
||||
result += QObject::tr("Sticky(%1, %2)").arg(RawSwitch(ls.val1).toString()).arg(RawSwitch(ls.val2).toString());
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
result += QObject::tr("Timer(%1, %2)").arg(ValToTim(ls.val1)).arg(ValToTim(ls.val2));
|
||||
break;
|
||||
case LS_FAMILY_VOFS: {
|
||||
RawSource source = RawSource(ls.val1);
|
||||
RawSourceRange range = source.getRange(g_model, *g_eeGeneral);
|
||||
QString res;
|
||||
if (ls.val1)
|
||||
res += source.toString(g_model);
|
||||
else
|
||||
res += "0";
|
||||
res.remove(" ");
|
||||
if (ls.func == LS_FN_APOS || ls.func == LS_FN_ANEG)
|
||||
res = "|" + res + "|";
|
||||
else if (ls.func == LS_FN_DAPOS)
|
||||
res = "|d(" + res + ")|";
|
||||
else if (ls.func == LS_FN_DPOS) result = "d(" + res + ")";
|
||||
result += res;
|
||||
|
||||
if (ls.func == LS_FN_APOS || ls.func == LS_FN_VPOS || ls.func == LS_FN_DPOS || ls.func == LS_FN_DAPOS)
|
||||
result += " > ";
|
||||
else if (ls.func == LS_FN_ANEG || ls.func == LS_FN_VNEG)
|
||||
result += " < ";
|
||||
else if (ls.func == LS_FN_VALMOSTEQUAL)
|
||||
result += " ~ ";
|
||||
else
|
||||
result += " missing";
|
||||
result += QString::number(range.step * (ls.val2 /*TODO+ source.getRawOffset(model)*/) + range.offset);
|
||||
break;
|
||||
}
|
||||
case LS_FAMILY_VBOOL:
|
||||
result += RawSwitch(ls.val1).toString();
|
||||
switch (ls.func) {
|
||||
case LS_FN_AND:
|
||||
result += " AND ";
|
||||
break;
|
||||
case LS_FN_OR:
|
||||
result += " OR ";
|
||||
break;
|
||||
case LS_FN_XOR:
|
||||
result += " XOR ";
|
||||
break;
|
||||
default:
|
||||
result += " bar ";
|
||||
break;
|
||||
}
|
||||
result += RawSwitch(ls.val2).toString();
|
||||
break;
|
||||
|
||||
case LS_FAMILY_VCOMP:
|
||||
if (ls.val1)
|
||||
result += RawSource(ls.val1).toString(g_model);
|
||||
else
|
||||
result += "0";
|
||||
switch (ls.func) {
|
||||
case LS_FN_EQUAL:
|
||||
case LS_FN_VEQUAL:
|
||||
result += " = ";
|
||||
break;
|
||||
case LS_FN_NEQUAL:
|
||||
result += " != ";
|
||||
break;
|
||||
case LS_FN_GREATER:
|
||||
result += " > ";
|
||||
break;
|
||||
case LS_FN_LESS:
|
||||
result += " < ";
|
||||
break;
|
||||
case LS_FN_EGREATER:
|
||||
result += " >= ";
|
||||
break;
|
||||
case LS_FN_ELESS:
|
||||
result += " <= ";
|
||||
break;
|
||||
default:
|
||||
result += " foo ";
|
||||
break;
|
||||
}
|
||||
if (ls.val2)
|
||||
result += RawSource(ls.val2).toString(g_model);
|
||||
else
|
||||
result += "0";
|
||||
break;
|
||||
}
|
||||
|
||||
if (ls.andsw!=0) {
|
||||
result +=" ) AND ";
|
||||
result += RawSwitch(ls.andsw).toString();
|
||||
}
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(LogicalSwitchesExt)) {
|
||||
if (ls.duration)
|
||||
result += QObject::tr(" Duration (%1s)").arg(ls.duration/10.0);
|
||||
if (ls.delay)
|
||||
result += QObject::tr(" Delay (%1s)").arg(ls.delay/10.0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
QString ModelPrinter::printCustomFunctionLine(int idx)
|
||||
{
|
||||
QString result;
|
||||
const CustomFunctionData & cf = g_model->customFn[idx];
|
||||
if (cf.swtch.type == SWITCH_TYPE_NONE) return result;
|
||||
|
||||
result += cf.swtch.toString() + " - ";
|
||||
result += cf.funcToString() + "(";
|
||||
result += cf.paramToString(g_model) + ")";
|
||||
if (!cf.repeatToString().isEmpty()) result += " " + cf.repeatToString();
|
||||
if (!cf.enabledToString().isEmpty()) result += " " + cf.enabledToString();
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef MODELPRINTER_H
|
||||
#define MODELPRINTER_H
|
||||
|
||||
#include <QString>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
QString changeColor(const QString & input, const QString & to, const QString & from = "grey");
|
||||
|
||||
QString addFont(const QString & input, const QString & color = "", const QString & size = "", const QString & face = "");
|
||||
|
||||
void debugHtml(const QString & html);
|
||||
|
||||
|
||||
class ModelPrinter
|
||||
{
|
||||
public:
|
||||
ModelPrinter(Firmware * firmware, GeneralSettings *gg, ModelData *gm);
|
||||
~ModelPrinter() {};
|
||||
|
||||
QString printInputName(int idx);
|
||||
QString printInputLine(const ExpoData * ed);
|
||||
QString printMixerName(int curDest);
|
||||
QString printMixerLine(const MixData * md, int highlightedSource = 0);
|
||||
QString printLogicalSwitchLine(int idx);
|
||||
QString printCustomFunctionLine(int idx);
|
||||
|
||||
private:
|
||||
Firmware * firmware;
|
||||
GeneralSettings * g_eeGeneral;
|
||||
ModelData * g_model;
|
||||
|
||||
QString printPhases(unsigned int phases);
|
||||
};
|
||||
|
||||
#endif //#ifndef MODELPRINTER_H
|
||||
+72
-193
@@ -3,6 +3,7 @@
|
||||
#include "helpers.h"
|
||||
#include "helpers_html.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
#include <QtGui>
|
||||
#include <QImage>
|
||||
#include <QColor>
|
||||
@@ -22,7 +23,8 @@ PrintDialog::PrintDialog(QWidget *parent, Firmware * firmware, GeneralSettings *
|
||||
g_model(gm),
|
||||
printfilename(filename),
|
||||
ui(new Ui::PrintDialog),
|
||||
gvars(firmware->getCapability(Gvars))
|
||||
gvars(firmware->getCapability(Gvars)),
|
||||
modelPrinter(firmware, gg, gm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("print.png"));
|
||||
@@ -48,8 +50,8 @@ PrintDialog::PrintDialog(QWidget *parent, Firmware * firmware, GeneralSettings *
|
||||
printLimits();
|
||||
printCurves();
|
||||
printGvars();
|
||||
printSwitches();
|
||||
printFSwitches();
|
||||
printLogicalSwitches();
|
||||
printCustomFunctions();
|
||||
printFrSky();
|
||||
|
||||
te->scrollToAnchor("1");
|
||||
@@ -83,8 +85,10 @@ void PrintDialog::printSetup()
|
||||
str.append("<tr><td>");
|
||||
str.append(fv(tr("Name"), g_model->name));
|
||||
str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model))));
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
|
||||
|
||||
for (int i=0; i<firmware->getCapability(Timers); i++) {
|
||||
str.append(fv(tr("Timer%1").arg(i+1), getTimerStr(g_model->timers[i]))); // value, mode, count up/down
|
||||
}
|
||||
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br> "); //proto, numch, delay,
|
||||
@@ -189,161 +193,55 @@ QString PrintDialog::printFlightModes()
|
||||
void PrintDialog::printInputs()
|
||||
{
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td><h2>";
|
||||
str.append(tr("Inputs"));
|
||||
str.append("</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>");
|
||||
str += tr("Inputs");
|
||||
str += "</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>";
|
||||
int ec=0;
|
||||
unsigned int lastCHN = 255;
|
||||
for(int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
ExpoData *ed=&g_model->expoData[i];
|
||||
if(ed->mode==0)
|
||||
continue;
|
||||
if(ed->mode==0) continue;
|
||||
ec++;
|
||||
str.append("<tr><td><font size=+1 face='Courier New'>");
|
||||
|
||||
str += "<tr><td>";
|
||||
if(lastCHN!=ed->chn) {
|
||||
lastCHN=ed->chn;
|
||||
str.append("<b>"+getInputStr(g_model, ed->chn)+"</b>");
|
||||
str += addFont("<b>"+modelPrinter.printInputName(ed->chn)+"</b>", "", "+1", "Courier New");
|
||||
}
|
||||
str.append("</font></td>");
|
||||
str.append("<td><font size=+1 face='Courier New' color=green>");
|
||||
|
||||
switch(ed->mode) {
|
||||
case (1):
|
||||
str += "<-";
|
||||
break;
|
||||
case (2):
|
||||
str += "->";
|
||||
break;
|
||||
default:
|
||||
str += " ";
|
||||
break;
|
||||
};
|
||||
|
||||
str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true));
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString(g_model));
|
||||
if (ed->carryTrim>0) str += " " + tr("NoTrim");
|
||||
else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(g_model);
|
||||
}
|
||||
if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString());
|
||||
|
||||
if (firmware->getCapability(FlightModes)) {
|
||||
if(ed->phases) {
|
||||
if (ed->phases!=(unsigned int)(1<<firmware->getCapability(FlightModes))-1) {
|
||||
unsigned int mask=1;
|
||||
bool first = true;
|
||||
bool multiple = false;
|
||||
QString strModes;
|
||||
for (int j=0; j<firmware->getCapability(FlightModes);j++) {
|
||||
if (!(ed->phases & mask)) {
|
||||
//FlightModeData *pd = &g_model->flightModeData[j];
|
||||
const char * pdName = g_model->flightModeData[j].name;
|
||||
if (first) {
|
||||
strModes += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName)));
|
||||
first = false;
|
||||
} else {
|
||||
strModes += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName)));
|
||||
multiple = true;
|
||||
}
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
if (!strModes.isEmpty()) {
|
||||
str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strModes + ")";
|
||||
}
|
||||
} else {
|
||||
str += tr("DISABLED")+QString(" !!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString());
|
||||
if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name));
|
||||
str += "</font></td></tr>";
|
||||
str += "</td>";
|
||||
|
||||
str += "<td>" + addFont(modelPrinter.printInputLine(ed), "green", "+1", "Courier New") + "</td>";
|
||||
str += "</tr>";
|
||||
}
|
||||
str += "</table></td></tr></table><br>";
|
||||
if (ec>0)
|
||||
te->append(str);
|
||||
if (ec>0) te->append(str);
|
||||
// debugHtml(str);
|
||||
}
|
||||
|
||||
|
||||
void PrintDialog::printMixes()
|
||||
{
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
|
||||
str.append(tr("Mixers"));
|
||||
str.append("</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>");
|
||||
str += tr("Mixers");
|
||||
str += "</h2></td></tr><tr><td><table border=0 cellspacing=0 cellpadding=3>";
|
||||
|
||||
unsigned int lastCHN = 255;
|
||||
for(int i=0; i<firmware->getCapability(Mixes); i++) {
|
||||
MixData *md = &g_model->mixData[i];
|
||||
if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break;
|
||||
str.append("<tr><td><font size=+1 face='Courier New'><b>");
|
||||
|
||||
str += "<tr><td><b>";
|
||||
if(lastCHN!=md->destCh) {
|
||||
lastCHN=md->destCh;
|
||||
|
||||
QString chname = QObject::tr("CH%1").arg(lastCHN);
|
||||
// TODO not nice, Qt brings a function for that, I don't remember right now
|
||||
(chname.length() < 4) ? chname.append(" ") : chname.append(" ");
|
||||
if (firmware->getCapability(HasChNames)) {
|
||||
QString name = g_model->limitData[lastCHN-1].name;
|
||||
if (!name.isEmpty()) {
|
||||
name = QString("(") + name + QString(")");
|
||||
}
|
||||
name.append(" ");
|
||||
chname += name.left(8);
|
||||
}
|
||||
chname = Qt::escape(chname);
|
||||
str.append(chname.replace(" ", " "));
|
||||
str += addFont(modelPrinter.printMixerName(md->destCh).replace(" ", " "), "", "+1", "Courier New");
|
||||
}
|
||||
else {
|
||||
str.append(" ");
|
||||
}
|
||||
str.append("</b></font></td>");
|
||||
str.append("<td><font size=+1 face='Courier New' color=green>");
|
||||
switch(md->mltpx) {
|
||||
case (1): str += " *"; break;
|
||||
case (2): str += " R"; break;
|
||||
default: str += " "; break;
|
||||
};
|
||||
str += "</b></td>";
|
||||
|
||||
str += " " + md->srcRaw.toString(g_model);
|
||||
str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true)));
|
||||
|
||||
QString phasesStr = getPhasesStr(md->phases, g_model);
|
||||
if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr);
|
||||
|
||||
if (md->swtch.type != SWITCH_TYPE_NONE) {
|
||||
str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString()));
|
||||
}
|
||||
|
||||
if (md->carryTrim>0)
|
||||
str += " " + Qt::escape(tr("NoTrim"));
|
||||
else if (md->carryTrim<0)
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(g_model);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && md->noExpo) str += " " + Qt::escape(tr("No DR/Expo"));
|
||||
if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset)));
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (md->delayDown || md->delayUp)
|
||||
str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale));
|
||||
if (md->speedDown || md->speedUp)
|
||||
str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale));
|
||||
if (md->mixWarn)
|
||||
str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn));
|
||||
if (firmware->getCapability(HasMixerNames)) {
|
||||
QString MixerName;
|
||||
MixerName.append(md->name);
|
||||
if (!MixerName.isEmpty()) {
|
||||
str += " " + Qt::escape(QString("(%1)").arg(MixerName));
|
||||
}
|
||||
}
|
||||
str.append("</font></td></tr>");
|
||||
str += "<td>" + addFont(modelPrinter.printMixerLine(md), "green", "+1", "Courier New") + "</td>";
|
||||
str += "</tr>";
|
||||
}
|
||||
str.append("</table></td></tr></table><br>");
|
||||
str += "</table></td></tr></table><br>";
|
||||
te->append(str);
|
||||
// debugHtml(str);
|
||||
}
|
||||
|
||||
void PrintDialog::printLimits()
|
||||
@@ -570,27 +468,25 @@ void PrintDialog::printCurves()
|
||||
}
|
||||
}
|
||||
|
||||
void PrintDialog::printSwitches()
|
||||
void PrintDialog::printLogicalSwitches()
|
||||
{
|
||||
int sc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3>");
|
||||
|
||||
for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
|
||||
if (g_model->logicalSw[i].func) {
|
||||
str.append("<tr>");
|
||||
str.append("<td width=\"60\"><b>"+tr("L")+QString("%1</b></td>").arg(i+1));
|
||||
QString tstr = g_model->logicalSw[i].toString(*g_model, *g_eeGeneral);
|
||||
str.append(doTL(tstr,"green"));
|
||||
str.append("</tr>");
|
||||
sc++;
|
||||
}
|
||||
bool haveOutput = false;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str += "<tr><td><h2>" + tr("Logical Switches") + "</h2></td></tr>";
|
||||
str += "<tr><td><table border=0 cellspacing=0 cellpadding=3>";
|
||||
for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
|
||||
QString sw = modelPrinter.printLogicalSwitchLine(i);
|
||||
if (!sw.isEmpty()) {
|
||||
str += "<tr>";
|
||||
str += "<td width=\"60\"><b>"+ tr("L") + QString("%1</b></td>").arg(i+1);
|
||||
str += "<td align=left>" + addFont(sw, "green") + "</td>";
|
||||
str += "</tr>";
|
||||
haveOutput = true;
|
||||
}
|
||||
str.append("</table></td></tr></table>");
|
||||
str.append("<br>");
|
||||
if (sc!=0)
|
||||
te->append(str);
|
||||
}
|
||||
str += "</table></td></tr></table>";
|
||||
str += "<br>";
|
||||
if (haveOutput) te->append(str);
|
||||
}
|
||||
|
||||
void PrintDialog::printGvars()
|
||||
@@ -617,52 +513,35 @@ void PrintDialog::printGvars()
|
||||
}
|
||||
}
|
||||
|
||||
void PrintDialog::printFSwitches()
|
||||
void PrintDialog::printCustomFunctions()
|
||||
{
|
||||
int sc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Special Functions")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3><tr>");
|
||||
str.append("<td width=\"60\"><b>#</b></td>");
|
||||
str.append(doTL(tr("Switch"), "", true));
|
||||
str.append(doTL(tr("Function"), "", true));
|
||||
str.append(doTL(tr("Parameter"), "", true));
|
||||
str.append(doTL(tr("Repeat"), "", true));
|
||||
str.append(doTL(tr("Enabled"), "", true));
|
||||
str.append("</tr>");
|
||||
for(int i=0; i<firmware->getCapability(CustomFunctions); i++) {
|
||||
if (g_model->customFn[i].swtch.type!=SWITCH_TYPE_NONE) {
|
||||
str.append("<tr>");
|
||||
str.append(doTL(tr("SF%1").arg(i+1),"", true));
|
||||
str.append(doTL(g_model->customFn[i].swtch.toString(),"green"));
|
||||
str.append(doTL(g_model->customFn[i].funcToString(),"green"));
|
||||
str.append(doTL(g_model->customFn[i].paramToString(),"green"));
|
||||
int index=g_model->customFn[i].func;
|
||||
if ((g_model->customFn[i].repeatParam>0) &&
|
||||
(index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) {
|
||||
str.append(doTL(QString("%1").arg(g_model->customFn[i].repeatParam),"green"));
|
||||
} else {
|
||||
str.append(doTL( " ","green"));
|
||||
}
|
||||
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
|
||||
str.append(doTL((g_model->customFn[i].enabled ? "ON" : "OFF"),"green"));
|
||||
} else {
|
||||
str.append(doTL( "---","green"));
|
||||
}
|
||||
str.append("</tr>");
|
||||
sc++;
|
||||
}
|
||||
bool haveOutput = false;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str += "<tr><td><h2>" + tr("Special Functions") + "</h2></td></tr>";
|
||||
str += "<tr><td><table border=0 cellspacing=0 cellpadding=3>";
|
||||
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
|
||||
QString cf = modelPrinter.printCustomFunctionLine(i);
|
||||
if (!cf.isEmpty()) {
|
||||
str += "<tr>";
|
||||
str += "<td width=\"60\"><b>"+ tr("SF") + QString("%1</b></td>").arg(i+1);
|
||||
str += "<td align=left>" + addFont(cf, "green") + "</td>";
|
||||
str += "</tr>";
|
||||
haveOutput = true;
|
||||
}
|
||||
str.append("</table></td></tr></table>");
|
||||
str.append("<br>");
|
||||
if (sc!=0)
|
||||
te->append(str);
|
||||
}
|
||||
str += "</table></td></tr></table>";
|
||||
str += "<br>";
|
||||
if (haveOutput) te->append(str);
|
||||
}
|
||||
|
||||
void PrintDialog::printFrSky()
|
||||
{
|
||||
int tc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
int analog=2;
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
analog=4;
|
||||
}
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
str.append("<tr><td colspan=3><h2>"+tr("Telemetry Settings")+"</h2></td></tr>");
|
||||
@@ -673,7 +552,7 @@ void PrintDialog::printFrSky()
|
||||
str.append("</tr>");
|
||||
|
||||
FrSkyData *fd=&g_model->frsky;
|
||||
for (int i=0; i<2; i++) {
|
||||
for (int i=0; i<analog; i++) {
|
||||
if (fd->channels[i].ratio!=0) {
|
||||
tc++;
|
||||
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
|
||||
@@ -723,7 +602,7 @@ void PrintDialog::printFrSky()
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td>");
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td></tr>");
|
||||
FrSkyData *fd=&g_model->frsky;
|
||||
for (int i=0; i<2; i++) {
|
||||
for (int i=0; i<analog; i++) {
|
||||
if (fd->channels[i].ratio!=0) {
|
||||
tc++;
|
||||
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
|
||||
@@ -747,7 +626,7 @@ void PrintDialog::printFrSky()
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"</b></td><td width=\"40\" align=\"center\"><b><</b></td><td width=\"40\" align=\"center\"><b>"+QString::number(fd->rssiAlarms[1].value,10)+"</b></td></tr>");
|
||||
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Frsky serial protocol")+"</b></td><td colspan=8 align=\"left\">"+getFrSkyProtocol(fd->usrProto)+"</td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+fd->blades+"</td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+QString("%1").arg(fd->blades)+"</td></tr>");
|
||||
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr></table>");
|
||||
}
|
||||
#if 0
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QtGui>
|
||||
#include <QDir>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
class PrintDialog;
|
||||
@@ -37,9 +38,9 @@ private:
|
||||
void printLimits();
|
||||
void printCurves();
|
||||
void printGvars();
|
||||
void printSwitches();
|
||||
void printLogicalSwitches();
|
||||
void printSafetySwitches();
|
||||
void printFSwitches();
|
||||
void printCustomFunctions();
|
||||
void printFrSky();
|
||||
void printToFile();
|
||||
|
||||
@@ -47,6 +48,8 @@ private:
|
||||
QString curvefile5;
|
||||
QString curvefile9;
|
||||
QDir *qd;
|
||||
|
||||
ModelPrinter modelPrinter;
|
||||
|
||||
private slots:
|
||||
void on_printButton_clicked();
|
||||
|
||||
@@ -29,7 +29,7 @@ class AutoCheckBox: public QCheckBox
|
||||
{
|
||||
lock = true;
|
||||
if (field) {
|
||||
setChecked((int)*field);
|
||||
setChecked(*field);
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class AutoComboBox: public QComboBox
|
||||
QComboBox(parent),
|
||||
field(NULL),
|
||||
panel(NULL),
|
||||
next(0),
|
||||
lock(false)
|
||||
{
|
||||
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged(int)));
|
||||
@@ -22,10 +23,23 @@ class AutoComboBox: public QComboBox
|
||||
{
|
||||
lock = true;
|
||||
QComboBox::clear();
|
||||
next = 0;
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void addItem(const QString & item, int value)
|
||||
virtual void insertItems(int index, const QStringList & items)
|
||||
{
|
||||
foreach(QString item, items) {
|
||||
addItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void addItem(const QString & item)
|
||||
{
|
||||
addItem(item, next++);
|
||||
}
|
||||
|
||||
virtual void addItem(const QString & item, int value)
|
||||
{
|
||||
lock = true;
|
||||
QComboBox::addItem(item, value);
|
||||
@@ -78,6 +92,7 @@ class AutoComboBox: public QComboBox
|
||||
protected:
|
||||
int * field;
|
||||
GenericPanel * panel;
|
||||
int next;
|
||||
bool lock;
|
||||
};
|
||||
|
||||
|
||||
@@ -483,8 +483,7 @@ void SimulatorDialog::initUi(T * ui)
|
||||
line = (i-16) % (std::min(16,outputs-16)/2);
|
||||
}
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
ModelData model;
|
||||
label->setText(RawSource(SOURCE_TYPE_CH, i).toString(&model));
|
||||
label->setText(RawSource(SOURCE_TYPE_CH, i).toString());
|
||||
outputTab->addWidget(label, line, column == 0 ? 0 : 5, 1, 1);
|
||||
|
||||
QSlider * slider = new QSlider(tabWidget);
|
||||
@@ -546,7 +545,7 @@ void SimulatorDialog::initUi(T * ui)
|
||||
label->setAutoFillBackground(true);
|
||||
if ((i % 2) ==0 ) {
|
||||
label->setStyleSheet("QLabel { background-color: rgb(220, 220, 220) }");
|
||||
}
|
||||
}
|
||||
ui->gvarsLayout->addWidget(label, i+1, 0);
|
||||
for (int fm=0; fm<fmodes; fm++) {
|
||||
QLabel * value = new QLabel(tabWidget);
|
||||
|
||||
@@ -108,7 +108,7 @@ return main_thread_error;
|
||||
|
||||
#ifdef SETTRAINER_IMPORT
|
||||
#undef SETTRAINER_IMPORT
|
||||
ppmInValid = 100;
|
||||
g_ppmIns[inputNumber] = LIMIT< ::int16_t>(-512, value, 512);
|
||||
ppmInputValidityTimer = 100;
|
||||
ppmInput[inputNumber] = LIMIT< ::int16_t>(-512, value, 512);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QLibrary>
|
||||
#include <QLibraryInfo>
|
||||
#include <QMap>
|
||||
#include <QMessageBox>
|
||||
#include "version.h"
|
||||
|
||||
QMap<QString, SimulatorFactory *> registered_simulators;
|
||||
|
||||
@@ -29,16 +31,35 @@ void registerSimulator(const QString &filename)
|
||||
|
||||
void registerSimulators()
|
||||
{
|
||||
bool simulatorsFound = false;
|
||||
QDir dir(".");
|
||||
QStringList filters;
|
||||
#if (!defined __GNUC__) || (defined __CYGWIN__)
|
||||
#if defined(__APPLE__)
|
||||
filters << "*-simulator.dylib";
|
||||
#elif (!defined __GNUC__) || (defined __CYGWIN__)
|
||||
filters << "*-simulator.dll";
|
||||
#else
|
||||
filters << "*-simulator.so";
|
||||
#endif
|
||||
|
||||
foreach(QString filename, dir.entryList(filters, QDir::Files)) {
|
||||
registerSimulator(filename.prepend("./"));
|
||||
simulatorsFound = true;
|
||||
}
|
||||
|
||||
#if defined(__APPLE__) || !( (!defined __GNUC__) || (defined __CYGWIN__) )
|
||||
if (!simulatorsFound) {
|
||||
#if defined(__APPLE__)
|
||||
dir = QLibraryInfo::location(QLibraryInfo::PrefixPath) + "/Resources";
|
||||
#else
|
||||
dir = SIMULATOR_LIB_SEARCH_PATH;
|
||||
#endif
|
||||
foreach(QString filename, dir.entryList(filters, QDir::Files)) {
|
||||
registerSimulator(filename.prepend(dir.path() + "/"));
|
||||
simulatorsFound = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
SimulatorFactory *getSimulatorFactory(const QString &name)
|
||||
|
||||
+20
-21
@@ -54,6 +54,7 @@
|
||||
#endif
|
||||
#include "simulatordialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
@@ -123,34 +124,29 @@ int main(int argc, char *argv[])
|
||||
registerSimulators();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Radio type");
|
||||
msgBox.setText("Which radio type do you want to simulate?");
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
|
||||
foreach(SimulatorFactory *factory, registered_simulators) {
|
||||
QPushButton *button = msgBox.addButton(factory->name(), QMessageBox::ActionRole);
|
||||
button->adjustSize();
|
||||
button->setProperty("name", factory->name());
|
||||
}
|
||||
msgBox.adjustSize();
|
||||
|
||||
QPushButton *exitButton = msgBox.addButton(QMessageBox::Close);
|
||||
|
||||
eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation));
|
||||
if (!eedir.exists("OpenTX")) {
|
||||
eedir.mkdir("OpenTX");
|
||||
}
|
||||
eedir.cd("OpenTX");
|
||||
|
||||
msgBox.exec();
|
||||
|
||||
QAbstractButton *button = msgBox.clickedButton();
|
||||
if (button == exitButton) {
|
||||
return 0;
|
||||
QStringList firmwareIds;
|
||||
int currentIdx = 0;
|
||||
foreach(SimulatorFactory *factory, registered_simulators) {
|
||||
firmwareIds << factory->name();
|
||||
if (factory->name() == g.lastSimulator()) {
|
||||
currentIdx = firmwareIds.size() - 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
QString firmwareId = button->property("name").toString();
|
||||
|
||||
bool ok;
|
||||
QString firmwareId = QInputDialog::getItem(0, QObject::tr("Radio type"),
|
||||
QObject::tr("Which radio type do you want to simulate?"),
|
||||
firmwareIds, currentIdx, false, &ok);
|
||||
if (ok && !firmwareId.isEmpty()) {
|
||||
if (firmwareId != g.lastSimulator()) {
|
||||
g.lastSimulator(firmwareId);
|
||||
}
|
||||
QString radioId;
|
||||
int pos = firmwareId.indexOf("-");
|
||||
if (pos > 0) {
|
||||
@@ -169,6 +165,9 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
dialog = new SimulatorDialog9X(NULL, factory->create());
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dialog->show();
|
||||
dialog->start(eepromFileName.toAscii().constData());
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Simulator @C9X_VERSION@
|
||||
GenericName=Transmitter Simulator App
|
||||
Comment=The Ultimate Transmitter Simulator
|
||||
Icon=@COMPANION_NAME@
|
||||
Exec='@SIMULATOR_NAME@'
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Application
|
||||
+2098
-1664
File diff suppressed because it is too large
Load Diff
+2751
-2472
File diff suppressed because it is too large
Load Diff
+1926
-1725
File diff suppressed because it is too large
Load Diff
+1958
-1702
File diff suppressed because it is too large
Load Diff
+1545
-1328
File diff suppressed because it is too large
Load Diff
+1873
-1956
File diff suppressed because it is too large
Load Diff
+1922
-1617
File diff suppressed because it is too large
Load Diff
+1856
-1939
File diff suppressed because it is too large
Load Diff
+1637
-3719
File diff suppressed because it is too large
Load Diff
+1882
-1899
File diff suppressed because it is too large
Load Diff
+1884
-1895
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,2 +1,2 @@
|
||||
#define C9X_VERSION "@C9X_VERSION@"
|
||||
|
||||
#define SIMULATOR_LIB_SEARCH_PATH "@SIMULATOR_LIB_PATH@"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
;Name and file
|
||||
Name "OpenTX companion"
|
||||
OutFile "companionInstall_v@C9X_VERSION@.exe"
|
||||
OutFile "companion-windows-v@C9X_VERSION@.exe"
|
||||
|
||||
;Default installation folder
|
||||
InstallDir "$PROGRAMFILES\OpenTX companion"
|
||||
@@ -141,7 +141,7 @@ SectionEnd
|
||||
|
||||
;Language strings
|
||||
LangString DESC_SecDummy ${LANG_ENGLISH} "Models and settings editor for OpenTX"
|
||||
LangString DESC_SecDummy ${LANG_FRENCH} "Editeur de réglages et modèles pour OpenTX"
|
||||
LangString DESC_SecDummy ${LANG_FRENCH} "Editeur de r�glages et mod�les pour OpenTX"
|
||||
|
||||
;Assign language strings to sections
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
;Name and file
|
||||
Name "OpenTX Companion 2.1"
|
||||
OutFile "companionInstall_@C9X_VERSION@.exe"
|
||||
OutFile "companion-windows-@C9X_VERSION@.exe"
|
||||
|
||||
;Default installation folder
|
||||
InstallDir "$PROGRAMFILES\OpenTX\Companion 2.1"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
;Name and file
|
||||
Name "OpenTX Simulator"
|
||||
OutFile "simulatorInstall_@C9X_VERSION@.exe"
|
||||
OutFile "simulator-windows-@C9X_VERSION@.exe"
|
||||
|
||||
;Default installation folder
|
||||
InstallDir "$PROGRAMFILES\OpenTX"
|
||||
|
||||
@@ -1,3 +1,57 @@
|
||||
<h2>Version 2.1.1 / 2015-08-06</h2>
|
||||
|
||||
[ARM Boards]
|
||||
<ul>
|
||||
<li>Fixed broken track selection for Global Functions Play Track (<a href=https://github.com/opentx/opentx/issues/2472>#2472</a>)</li>
|
||||
<li>Added individual input/mixer line output value display</li>
|
||||
<li>Fixed SD logs fields shift when no GPS fix</li>
|
||||
<li>Telemetry Date not logged correctly(<a href=https://github.com/opentx/opentx/issues/2487>#2487</a>)</li>
|
||||
<li>Fixed unwanted interaction between Global and Special Functions play track/music (<a href=https://github.com/opentx/opentx/issues/2478>#2478</a>)</li>
|
||||
<li>Fixed 2-pos switch conversion (<a href=https://github.com/opentx/opentx/issues/2493>#2493</a>)</li>
|
||||
<li>Fixed heli swash-ring problem (<a href=https://github.com/opentx/opentx/issues/2492>#2492</a>)</li>
|
||||
<li>New feature: model name played when model is loaded (plays file "SOUNDS/<language>/<model_name>/name.wav") (<a href=https://github.com/opentx/opentx/issues/2404>#2404</a>)</li>
|
||||
<li>Faster scrolling when setting custom sensor id (<a href=https://github.com/opentx/opentx/issues/2506>#2506</a>)</li>
|
||||
<li>Removed telemetry values from available selection in Global Functions for "Play Value" and "Reset" (<a href=https://github.com/opentx/opentx/issues/2519>#2519</a>)</li>
|
||||
<li>D-type RPM sensor was broken (<a href=https://github.com/opentx/opentx/issues/2509>#2509</a>)</li>
|
||||
<li>Voltage unit symbol changed from "v" to "V" (<a href=https://github.com/opentx/opentx/issues/2509>#2509</a>)</li>
|
||||
<li>Fixed missing option in the sensor setup menu (<a href=https://github.com/opentx/opentx/issues/2533>#2533</a>)</li>
|
||||
<li>Fixed several VFAS issues when using D series sensors (<a href=https://github.com/opentx/opentx/issues/2518>#2518</a>, <a href=https://github.com/opentx/opentx/issues/2531>#2531</a>, <a href=https://github.com/opentx/opentx/issues/2530>#2530</a>)</li>
|
||||
<li>Fixed missing GPS altitude when using D series sensors (<a href=https://github.com/opentx/opentx/issues/2539>#2539</a>)</li>
|
||||
<li>Symbols for renamed physical inputs were not shown (<a href=https://github.com/opentx/opentx/issues/2581>#2581</a>)</li>
|
||||
<li>Allow sensors which have a bad S.PORT implementation (<a href=https://github.com/opentx/opentx/issues/2538>#2538</a>)</li>
|
||||
<li>Fixed "repeated lines" menu problem (<a href=https://github.com/opentx/opentx/issues/2533>#2533</a>)</li>
|
||||
<li>Added symbols to renamed physical inputs (<a href=https://github.com/opentx/opentx/issues/2581>#2581</a>)</li>
|
||||
<li>Fixed: Telemetry values not selectable in model scripts (<a href=https://github.com/opentx/opentx/issues/2589>#2589</a>)</li>
|
||||
<li>SH polarity was wrong in simulator for X9E (<a href=https://github.com/opentx/opentx/issues/2561>#2561</a>)</li>
|
||||
<li>Added support for Trainer input signal alarm (<a href=https://github.com/opentx/opentx/issues/2579>#2579</a>)</li>
|
||||
<li>Fixed: the "Serial port" value could not be changed in Radio hardware menu</li>
|
||||
<li>X9E rotary encoder events were not "visible" in Lua scripts (<a href=https://github.com/opentx/opentx/issues/2609>#2609</a>)</li>
|
||||
<li>Added "Copy telemetry sensor" option (<a href=https://github.com/opentx/opentx/issues/2513>#2513</a>)</li>
|
||||
<li>Added Timer3 to stats screen (<a href=https://github.com/opentx/opentx/issues/2515>#2515</a>)</li>
|
||||
<li>FrSky S.Port Airspeed sensor unit set to kph (<a href=https://github.com/opentx/opentx/issues/2305>#2305</a>)</li>
|
||||
<li>Frsky-D Telemetry protocol bug fixed (0x5D followed by 0x3D)</li>
|
||||
<li>Added support for 0.01V resolution to D series VFAS ID 0x39 (<a href=https://github.com/opentx/opentx/issues/2607>#2607</a>)</li>
|
||||
<li>Set a more reasonable default precision for telemetry values (<a href=https://github.com/opentx/opentx/issues/2631>#2631</a>)</li>
|
||||
<li>Fixed a problem when moving mixer lines on X9E (<a href=https://github.com/opentx/opentx/issues/2643>#2643</a>)</li>
|
||||
<li>Fixed X9E SD log header line (<a href=https://github.com/opentx/opentx/issues/2638>#2638</a>)</li>
|
||||
</ul>
|
||||
|
||||
[Boards with narrow LCD (9X, 9XR, etc)]
|
||||
<ul>
|
||||
<li>Fixed bug in mixer edit menu (<a href=https://github.com/opentx/opentx/issues/2512>#2512</a>)</li>
|
||||
<li>Telemetry setup page was broken (<a href=https://github.com/opentx/opentx/issues/2612>#2612</a>)</li>
|
||||
<li>Fixed 9XR pro resetting when changing from XJT to PPM in setup menu (<a href=https://github.com/opentx/opentx/issues/2592>#2592</a>)</li>
|
||||
<li>Special function choices were broken on small screen ARM platforms (<a href=https://github.com/opentx/opentx/issues/2618>#2618</a>)</li>
|
||||
<li>Fixed reset on 9XR-PRO when user changed module protocol from PXX (<a href=https://github.com/opentx/opentx/issues/2592>#2592</a>)</li>
|
||||
</ul>
|
||||
|
||||
[All]
|
||||
<ul>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.0 / 2015-07-16</h2>
|
||||
|
||||
[ARM Boards]
|
||||
|
||||
+2
-2
@@ -377,7 +377,7 @@ IMG2LBM = -$(PYTHON) ../util/img2lbm.py
|
||||
BIN2LBM = -$(PYTHON) ../util/bin2lbm.py
|
||||
FONT2PNG = -$(PYTHON) ../util/font2png.py
|
||||
TRANSLATE = -$(PYTHON) ../util/translate.py
|
||||
VERSION = 2.1.0
|
||||
VERSION = 2.1.1$(OPENTX_VERSION_SUFFIX)
|
||||
|
||||
THIRDPARTY = thirdparty
|
||||
COOSDIR = $(THIRDPARTY)/CoOS
|
||||
@@ -1058,7 +1058,7 @@ ifeq ($(GUI), YES)
|
||||
CPPDEFS += -DGUI
|
||||
endif
|
||||
|
||||
CPPSRC += opentx.cpp functions.cpp strhelpers.cpp $(PULSESSRC) switches.cpp curves.cpp mixer.cpp stamp.cpp $(GUISRC) $(EEPROMSRC) timers.cpp
|
||||
CPPSRC += opentx.cpp functions.cpp strhelpers.cpp $(PULSESSRC) switches.cpp curves.cpp mixer.cpp stamp.cpp $(GUISRC) $(EEPROMSRC) timers.cpp trainer_input.cpp
|
||||
|
||||
ifeq ($(GUI), YES)
|
||||
GUISRC += gui/$(GUIDIRECTORY)/lcd.cpp gui/$(GUIDIRECTORY)/splash.cpp gui/$(GUIDIRECTORY)/fonts.cpp
|
||||
|
||||
+15
-5
@@ -169,6 +169,8 @@ const char * const audioFilenames[] = {
|
||||
"swr_red",
|
||||
"telemko",
|
||||
"telemok",
|
||||
"trainko",
|
||||
"trainok",
|
||||
#if defined(PCBSKY9X)
|
||||
"highmah",
|
||||
"hightemp",
|
||||
@@ -413,9 +415,7 @@ bool isAudioFileReferenced(uint32_t i, char * filename)
|
||||
uint8_t index = (i >> 16) & 0xFF;
|
||||
uint8_t event = i & 0xFF;
|
||||
|
||||
#if 0
|
||||
TRACE("isAudioFileReferenced(%08x)", i);
|
||||
#endif
|
||||
// TRACE("isAudioFileReferenced(%08x)", i);
|
||||
|
||||
if (category == SYSTEM_AUDIO_CATEGORY) {
|
||||
if (sdAvailableSystemAudioFiles & MASK_SYSTEM_AUDIO_FILE(event)) {
|
||||
@@ -455,11 +455,21 @@ void playModelEvent(uint8_t category, uint8_t index, uint8_t event)
|
||||
audioQueue.playFile(filename);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
|
||||
void playModelName()
|
||||
{
|
||||
char filename[AUDIO_FILENAME_MAXLEN+1];
|
||||
char * str = getModelAudioPath(filename);
|
||||
strcpy(str, "name.wav");
|
||||
audioQueue.playFile(filename);
|
||||
}
|
||||
|
||||
#else // defined(SDCARD)
|
||||
|
||||
#define isAudioFileReferenced(i, f) false
|
||||
|
||||
#endif
|
||||
#endif // defined(SDCARD)
|
||||
|
||||
const int16_t alawTable[256] = { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944, -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136, -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472, -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568, -344, -328, -376, -360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392, -440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200, -248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624, -592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, 344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408, 392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232, 152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720, 560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848 };
|
||||
const int16_t ulawTable[256] = { -32124, -31100, -30076, -29052, -28028, -27004, -25980, -24956, -23932, -22908, -21884, -20860, -19836, -18812, -17788, -16764, -15996, -15484, -14972, -14460, -13948, -13436, -12924, -12412, -11900, -11388, -10876, -10364, -9852, -9340, -8828, -8316, -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, -876, -844, -812, -780, -748, -716, -684, -652, -620, -588, -556, -524, -492, -460, -428, -396, -372, -356, -340, -324, -308, -292, -276, -260, -244, -228, -212, -196, -180, -164, -148, -132, -120, -112, -104, -96, -88, -80, -72, -64, -56, -48, -40, -32, -24, -16, -8, 0, 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, 876, 844, 812, 780, 748, 716, 684, 652, 620, 588, 556, 524, 492, 460, 428, 396, 372, 356, 340, 324, 308, 292, 276, 260, 244, 228, 212, 196, 180, 164, 148, 132, 120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0 };
|
||||
|
||||
@@ -331,6 +331,8 @@ void audioStart();
|
||||
#define AUDIO_RXBATT_RED() audioEvent(AU_RXBATT_RED)
|
||||
#define AUDIO_TELEMETRY_LOST() audioEvent(AU_TELEMETRY_LOST)
|
||||
#define AUDIO_TELEMETRY_BACK() audioEvent(AU_TELEMETRY_BACK)
|
||||
#define AUDIO_TRAINER_LOST() audioEvent(AU_TRAINER_LOST)
|
||||
#define AUDIO_TRAINER_BACK() audioEvent(AU_TRAINER_BACK)
|
||||
|
||||
#define AUDIO_HEARTBEAT()
|
||||
|
||||
@@ -373,6 +375,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
#define PLAY_SWITCH_MOVED(sw) playModelEvent(SWITCH_AUDIO_CATEGORY, sw)
|
||||
#define PLAY_LOGICAL_SWITCH_OFF(sw) playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_OFF)
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw) playModelEvent(LOGICAL_SWITCH_AUDIO_CATEGORY, sw, AUDIO_EVENT_ON)
|
||||
#define PLAY_MODEL_NAME() playModelName()
|
||||
#define START_SILENCE_PERIOD() timeAutomaticPromptsSilence = get_tmr10ms()
|
||||
#define IS_SILENCE_PERIOD_ELAPSED() (get_tmr10ms()-timeAutomaticPromptsSilence > 50)
|
||||
#else
|
||||
@@ -381,6 +384,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
|
||||
#define PLAY_SWITCH_MOVED(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_OFF(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw)
|
||||
#define PLAY_MODEL_NAME()
|
||||
#define START_SILENCE_PERIOD()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@ void audioDefevent(uint8_t e);
|
||||
#define PLAY_SWITCH_MOVED(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_OFF(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw)
|
||||
#define PLAY_MODEL_NAME()
|
||||
#define START_SILENCE_PERIOD()
|
||||
|
||||
#endif
|
||||
|
||||
@@ -145,6 +145,7 @@ void beep(uint8_t val);
|
||||
#define PLAY_SWITCH_MOVED(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_OFF(sw)
|
||||
#define PLAY_LOGICAL_SWITCH_ON(sw)
|
||||
#define PLAY_MODEL_NAME()
|
||||
#define START_SILENCE_PERIOD()
|
||||
#endif /* !AUDIO */
|
||||
|
||||
|
||||
@@ -99,7 +99,8 @@ void eepromEraseBlock(uint32_t address, bool blocking=true)
|
||||
// TRACE("eepromEraseBlock(%d)", address);
|
||||
|
||||
#if defined(SIMU)
|
||||
static uint8_t erasedBlock[EEPROM_BLOCK_SIZE] = { 0xff };
|
||||
static uint8_t erasedBlock[EEPROM_BLOCK_SIZE]; // can't be on the stack!
|
||||
memset(erasedBlock, 0xff, sizeof(erasedBlock));
|
||||
eeprom_pointer = address;
|
||||
eeprom_buffer_data = erasedBlock;
|
||||
eeprom_buffer_size = EEPROM_BLOCK_SIZE;
|
||||
@@ -170,6 +171,7 @@ bool eepromOpen()
|
||||
eepromRead(eepromFatAddr, (uint8_t *)&eepromHeader, sizeof(eepromHeader.mark) + sizeof(eepromHeader.index));
|
||||
if (eepromHeader.mark == EEPROM_MARK && eepromHeader.index >= bestFatIndex) {
|
||||
bestFatAddr = eepromFatAddr;
|
||||
bestFatIndex = eepromHeader.index;
|
||||
}
|
||||
eepromFatAddr += EEPROM_FAT_SIZE;
|
||||
}
|
||||
@@ -380,8 +382,8 @@ void eeLoadModel(uint8_t id)
|
||||
#endif
|
||||
|
||||
LOAD_MODEL_BITMAP();
|
||||
|
||||
SEND_FAILSAFE_1S();
|
||||
PLAY_MODEL_NAME();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,6 +444,8 @@ void eeCheck(bool immediately)
|
||||
eepromWriteWait();
|
||||
}
|
||||
|
||||
assert(eepromWriteState == EEPROM_IDLE);
|
||||
|
||||
if (s_eeDirtyMsk & EE_GENERAL) {
|
||||
TRACE("eeprom write general");
|
||||
s_eeDirtyMsk -= EE_GENERAL;
|
||||
|
||||
@@ -1014,6 +1014,7 @@ void eeLoadModel(uint8_t id)
|
||||
LOAD_MODEL_BITMAP();
|
||||
LUA_LOAD_MODEL_SCRIPTS();
|
||||
SEND_FAILSAFE_1S();
|
||||
PLAY_MODEL_NAME();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-8
@@ -119,7 +119,7 @@ PLAY_FUNCTION(playValue, source_t idx)
|
||||
#if defined(FRSKY)
|
||||
case MIXSRC_FIRST_TELEM+TELEM_RSSI_TX-1:
|
||||
case MIXSRC_FIRST_TELEM+TELEM_RSSI_RX-1:
|
||||
PLAY_NUMBER(val, 1+UNIT_DBM, 0);
|
||||
PLAY_NUMBER(val, 1+UNIT_DB, 0);
|
||||
break;
|
||||
case MIXSRC_FIRST_TELEM+TELEM_MIN_A1-1:
|
||||
case MIXSRC_FIRST_TELEM+TELEM_MIN_A2-1:
|
||||
@@ -260,6 +260,13 @@ void evalFunctions()
|
||||
MASK_FUNC_TYPE newActiveFunctions = 0;
|
||||
MASK_CFN_TYPE newActiveSwitches = 0;
|
||||
|
||||
#if defined(CPUARM)
|
||||
uint8_t playFirstIndex = (functions == g_model.customFn ? 1 : 1+NUM_CFN);
|
||||
#define PLAY_INDEX (i+playFirstIndex)
|
||||
#else
|
||||
#define PLAY_INDEX (i+1)
|
||||
#endif
|
||||
|
||||
#if defined(ROTARY_ENCODERS) && defined(GVARS)
|
||||
static rotenc_t rePreviousValues[ROTARY_ENCODERS];
|
||||
#endif
|
||||
@@ -460,13 +467,13 @@ void evalFunctions()
|
||||
functionsContext.lastFunctionTime[i] = tmr10ms;
|
||||
}
|
||||
if (!functionsContext.lastFunctionTime[i] || (repeatParam && repeatParam!=CFN_PLAY_REPEAT_NOSTART && (signed)(tmr10ms-functionsContext.lastFunctionTime[i])>=100*repeatParam)) {
|
||||
if (!IS_PLAYING(i+1)) {
|
||||
if (!IS_PLAYING(PLAY_INDEX)) {
|
||||
functionsContext.lastFunctionTime[i] = tmr10ms;
|
||||
if (CFN_FUNC(cfn) == FUNC_PLAY_SOUND) {
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+CFN_PARAM(cfn));
|
||||
}
|
||||
else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(CFN_PARAM(cfn), i+1);
|
||||
PLAY_VALUE(CFN_PARAM(cfn), PLAY_INDEX);
|
||||
}
|
||||
#if defined(HAPTIC)
|
||||
else if (CFN_FUNC(cfn) == FUNC_HAPTIC) {
|
||||
@@ -474,7 +481,7 @@ void evalFunctions()
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
playCustomFunctionFile(cfn, i+1);
|
||||
playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -483,8 +490,8 @@ void evalFunctions()
|
||||
|
||||
case FUNC_BACKGND_MUSIC:
|
||||
newActiveFunctions |= (1 << FUNCTION_BACKGND_MUSIC);
|
||||
if (!IS_PLAYING(i+1)) {
|
||||
playCustomFunctionFile(cfn, i+1);
|
||||
if (!IS_PLAYING(PLAY_INDEX)) {
|
||||
playCustomFunctionFile(cfn, PLAY_INDEX);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -507,14 +514,14 @@ void evalFunctions()
|
||||
AUDIO_PLAY(AU_FRSKY_FIRST+param);
|
||||
}
|
||||
else if (CFN_FUNC(cfn) == FUNC_PLAY_VALUE) {
|
||||
PLAY_VALUE(param, i+1);
|
||||
PLAY_VALUE(param, PLAY_INDEX);
|
||||
}
|
||||
else {
|
||||
#if defined(GVARS)
|
||||
if (CFN_FUNC(cfn) == FUNC_PLAY_TRACK && param > 250)
|
||||
param = GVAR_VALUE(param-251, getGVarFlightPhase(mixerCurrentFlightMode, param-251));
|
||||
#endif
|
||||
PUSH_CUSTOM_PROMPT(active ? param : param+1, i+1);
|
||||
PUSH_CUSTOM_PROMPT(active ? param : param+1, PLAY_INDEX);
|
||||
}
|
||||
}
|
||||
if (!active) {
|
||||
|
||||
@@ -86,6 +86,14 @@ bool isSourceAvailable(int source)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isSourceAvailableInGlobalFunctions(int source)
|
||||
{
|
||||
if (source>=MIXSRC_FIRST_TELEM && source<=MIXSRC_LAST_TELEM) {
|
||||
return false;
|
||||
}
|
||||
return isSourceAvailable(source);
|
||||
}
|
||||
|
||||
bool isSourceAvailableInCustomSwitches(int source)
|
||||
{
|
||||
bool result = isSourceAvailable(source);
|
||||
|
||||
@@ -181,7 +181,7 @@ void lcd_putcAtt(coord_t x, coord_t y, const unsigned char c, LcdFlags flags)
|
||||
lcdPutPattern(x, y, q, 5, 6, flags);
|
||||
}
|
||||
else if (fontsize == TINSIZE) {
|
||||
q = &font_3x5[((uint16_t)c-0x2d)*3];
|
||||
q = &font_3x5[((uint16_t)c-0x20)*3];
|
||||
lcdPutPattern(x, y, q, 3, 5, flags);
|
||||
}
|
||||
#if defined(BOLD_FONT)
|
||||
|
||||
@@ -104,6 +104,6 @@ const MenuFuncP_PROGMEM menuTabGeneral[] PROGMEM = {
|
||||
void menuGeneralCustomFunctions(uint8_t event)
|
||||
{
|
||||
MENU(STR_MENUGLOBALFUNCS, menuTabGeneral, e_GeneralCustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|4/*repeated*/});
|
||||
return menuCustomFunctions(event, g_eeGeneral.customFn, globalFunctionsContext);
|
||||
return menuCustomFunctions(event, g_eeGeneral.customFn, &globalFunctionsContext);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -97,15 +97,15 @@ void menuGeneralTrainer(uint8_t event)
|
||||
for (uint8_t i=0; i<4; i++) {
|
||||
uint8_t x = (i*TRAINER_CALIB_POS+16)*FW/2;
|
||||
#if defined (PPM_UNIT_PERCENT_PREC1)
|
||||
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
||||
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])*2, PREC1);
|
||||
#else
|
||||
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (g_ppmIns[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
||||
lcd_outdezAtt(x, MENU_HEADER_HEIGHT+1+6*FH, (ppmInput[i]-g_eeGeneral.trainer.calib[i])/5, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (attr) {
|
||||
if (event==EVT_KEY_LONG(KEY_ENTER)){
|
||||
memcpy(g_eeGeneral.trainer.calib, g_ppmIns, sizeof(g_eeGeneral.trainer.calib));
|
||||
memcpy(g_eeGeneral.trainer.calib, ppmInput, sizeof(g_eeGeneral.trainer.calib));
|
||||
eeDirty(EE_GENERAL);
|
||||
AUDIO_WARNING1();
|
||||
}
|
||||
|
||||
@@ -48,9 +48,20 @@
|
||||
#if defined(CPUARM) && defined(SDCARD)
|
||||
void onCustomFunctionsFileSelectionMenu(const char *result)
|
||||
{
|
||||
int8_t sub = m_posVert - 1;
|
||||
CustomFunctionData * cf = &g_model.customFn[sub];
|
||||
uint8_t func = CFN_FUNC(cf);
|
||||
int sub = m_posVert - 1;
|
||||
CustomFunctionData * cfn;
|
||||
uint8_t eeFlags;
|
||||
|
||||
if (g_menuStack[g_menuStackPtr] == menuModelCustomFunctions) {
|
||||
cfn = &g_model.customFn[sub];
|
||||
eeFlags = EE_MODEL;
|
||||
}
|
||||
else {
|
||||
cfn = &g_eeGeneral.customFn[sub];
|
||||
eeFlags = EE_GENERAL;
|
||||
}
|
||||
|
||||
uint8_t func = CFN_FUNC(cfn);
|
||||
|
||||
if (result == STR_UPDATE_LIST) {
|
||||
char directory[256];
|
||||
@@ -61,22 +72,22 @@ void onCustomFunctionsFileSelectionMenu(const char *result)
|
||||
strcpy(directory, SOUNDS_PATH);
|
||||
strncpy(directory+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2);
|
||||
}
|
||||
if (!listSdFiles(directory, func==FUNC_PLAY_SCRIPT ? SCRIPTS_EXT : SOUNDS_EXT, sizeof(cf->play.name), NULL)) {
|
||||
if (!listSdFiles(directory, func==FUNC_PLAY_SCRIPT ? SCRIPTS_EXT : SOUNDS_EXT, sizeof(cfn->play.name), NULL)) {
|
||||
POPUP_WARNING(func==FUNC_PLAY_SCRIPT ? STR_NO_SCRIPTS_ON_SD : STR_NO_SOUNDS_ON_SD);
|
||||
s_menu_flags = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// The user choosed a file in the list
|
||||
memcpy(cf->play.name, result, sizeof(cf->play.name));
|
||||
eeDirty(EE_MODEL);
|
||||
memcpy(cfn->play.name, result, sizeof(cfn->play.name));
|
||||
eeDirty(eeFlags);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFunctionsContext & functionsContext)
|
||||
void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext)
|
||||
{
|
||||
int8_t sub = m_posVert - 1;
|
||||
int8_t sub = m_posVert - 1;
|
||||
|
||||
#if defined(CPUARM)
|
||||
uint8_t eeFlags = (functions == g_model.customFn) ? EE_MODEL : EE_GENERAL;
|
||||
@@ -95,17 +106,17 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
uint8_t active = (attr && (s_editMode>0 || p1valdiff));
|
||||
switch (j) {
|
||||
case 0:
|
||||
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext.activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
putsSwitches(MODEL_CUSTOM_FUNC_1ST_COLUMN, y, CFN_SWITCH(cfn), attr | ((functionsContext->activeSwitches & ((MASK_CFN_TYPE)1 << k)) ? BOLD : 0));
|
||||
if (active || AUTOSWITCH_ENTER_LONG()) CHECK_INCDEC_SWITCH(event, CFN_SWITCH(cfn), SWSRC_FIRST, SWSRC_LAST, eeFlags, isSwitchAvailableInCustomFunctions);
|
||||
#if defined(CPUARM)
|
||||
if (func == FUNC_OVERRIDE_CHANNEL && functions != g_model.customFn) {
|
||||
func = CFN_FUNC(cfn) = func+1;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (CFN_SWITCH(cfn)) {
|
||||
#if defined(CPUARM)
|
||||
if (func == FUNC_OVERRIDE_CHANNEL) {
|
||||
func = CFN_FUNC(cfn) = checkIncDec(event, CFN_FUNC(cfn), 0, FUNC_MAX-1, eeFlags, isAssignableFunctionAvailable);
|
||||
}
|
||||
#endif
|
||||
lcd_putsiAtt(MODEL_CUSTOM_FUNC_2ND_COLUMN, y, STR_VFSWFUNC, func, attr);
|
||||
if (active) {
|
||||
#if defined(CPUARM)
|
||||
@@ -156,7 +167,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
#if defined(CPUARM)
|
||||
else if (func == FUNC_SET_TIMER) {
|
||||
maxParam = MAX_TIMERS-1;
|
||||
putsStrIdx(lcdNextPos, y, STR_TIMER, CFN_TIMER_INDEX(cfn)+1, attr);
|
||||
lcd_putsiAtt(lcdNextPos, y, STR_VFSWRESET, CFN_TIMER_INDEX(cfn), attr);
|
||||
if (active) CFN_TIMER_INDEX(cfn) = checkIncDec(event, CFN_TIMER_INDEX(cfn), 0, maxParam, eeFlags);
|
||||
break;
|
||||
}
|
||||
@@ -283,7 +294,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
else if (func == FUNC_PLAY_VALUE) {
|
||||
val_max = MIXSRC_FIRST_TELEM + TELEM_DISPLAY_MAX - 1;
|
||||
putsMixerSource(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr);
|
||||
INCDEC_ENABLE_CHECK(isSourceAvailable);
|
||||
INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalFunctions : isSourceAvailable);
|
||||
}
|
||||
#endif
|
||||
#if defined(SDCARD)
|
||||
@@ -382,5 +393,5 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
|
||||
void menuModelCustomFunctions(uint8_t event)
|
||||
{
|
||||
MENU(STR_MENUCUSTOMFUNC, menuTabModel, e_CustomFunctions, NUM_CFN+1, {0, NAVIGATION_LINE_BY_LINE|4/*repeated*/});
|
||||
return menuCustomFunctions(event, g_model.customFn, modelFunctionsContext);
|
||||
return menuCustomFunctions(event, g_model.customFn, &modelFunctionsContext);
|
||||
}
|
||||
|
||||
@@ -814,6 +814,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
if (READ_ONLY()) {
|
||||
if (!s_currCh) {
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -824,6 +825,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
insertExpoMix(expo, s_currIdx);
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
event = 0;
|
||||
@@ -843,6 +845,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
}
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -857,6 +860,7 @@ void menuModelExpoMix(uint8_t expo, uint8_t event)
|
||||
pushMenu(expo ? menuModelExpoOne : menuModelMixOne);
|
||||
s_copyMode = 0;
|
||||
killEvents(event);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
|
||||
@@ -82,8 +82,9 @@ void onModelSelectMenu(const char *result)
|
||||
else {
|
||||
// The user choosed a file on SD to restore
|
||||
POPUP_WARNING(eeRestoreModel(sub, (char *)result));
|
||||
if (!s_warning && g_eeGeneral.currModel == sub)
|
||||
if (!s_warning && g_eeGeneral.currModel == sub) {
|
||||
eeLoadModel(sub);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -100,8 +101,9 @@ void menuModelSelect(uint8_t event)
|
||||
|
||||
uint8_t _event_ = (IS_ROTARY_BREAK(event) || IS_ROTARY_LONG(event) ? 0 : event);
|
||||
|
||||
if ((s_copyMode && EVT_KEY_MASK(event) == KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT))
|
||||
if ((s_copyMode && EVT_KEY_MASK(event) == KEY_EXIT) || event == EVT_KEY_BREAK(KEY_EXIT)) {
|
||||
_event_ -= KEY_EXIT;
|
||||
}
|
||||
|
||||
int8_t oldSub = m_posVert;
|
||||
|
||||
@@ -132,7 +134,9 @@ void menuModelSelect(uint8_t event)
|
||||
s_editMode = EDIT_MODE_INIT;
|
||||
eeCheck(true);
|
||||
break;
|
||||
|
||||
case EVT_KEY_LONG(KEY_EXIT):
|
||||
killEvents(event);
|
||||
if (s_copyMode && s_copyTgtOfs == 0 && g_eeGeneral.currModel != sub && eeModelExists(sub)) {
|
||||
POPUP_CONFIRMATION(STR_DELETEMODEL);
|
||||
#if defined(CPUARM)
|
||||
@@ -142,10 +146,13 @@ void menuModelSelect(uint8_t event)
|
||||
eeLoadModelName(sub, name);
|
||||
SET_WARNING_INFO(name, sizeof(g_model.header.name), ZCHAR);
|
||||
#endif
|
||||
killEvents(event);
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
else {
|
||||
s_copyMode = 0;
|
||||
m_posVert = g_eeGeneral.currModel;
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_LONG:
|
||||
killEvents(event);
|
||||
@@ -160,12 +167,20 @@ void menuModelSelect(uint8_t event)
|
||||
}
|
||||
// no break
|
||||
#endif
|
||||
|
||||
case EVT_KEY_BREAK(KEY_EXIT):
|
||||
if (s_copyMode) {
|
||||
sub = m_posVert = (s_copyMode == MOVE_MODE || s_copySrcRow<0) ? (MAX_MODELS+sub+s_copyTgtOfs) % MAX_MODELS : s_copySrcRow;
|
||||
s_copyMode = 0;
|
||||
}
|
||||
else if (m_posVert != g_eeGeneral.currModel) {
|
||||
m_posVert = g_eeGeneral.currModel;
|
||||
}
|
||||
else {
|
||||
popMenu();
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_BREAK:
|
||||
if (s_editMode == -1) {
|
||||
@@ -174,6 +189,7 @@ void menuModelSelect(uint8_t event)
|
||||
}
|
||||
// no break;
|
||||
#endif
|
||||
|
||||
case EVT_KEY_LONG(KEY_ENTER):
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
s_editMode = 0;
|
||||
|
||||
@@ -168,8 +168,11 @@ void menuModelSetup(uint8_t event)
|
||||
uint8_t k = i+s_pgOfs;
|
||||
#if defined(CPUARM)
|
||||
for (int j=0; j<=k; j++) {
|
||||
if (mstate_tab[j+1] == HIDDEN_ROW)
|
||||
k++;
|
||||
if (mstate_tab[j+1] == HIDDEN_ROW) {
|
||||
if (++k >= (int)DIM(mstate_tab)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -70,7 +70,24 @@ enum menuModelTelemetryItems {
|
||||
ITEM_TELEMETRY_SENSOR14,
|
||||
ITEM_TELEMETRY_SENSOR15,
|
||||
ITEM_TELEMETRY_SENSOR16,
|
||||
ITEM_TELEMETRY_SENSOR17,
|
||||
ITEM_TELEMETRY_SENSOR18,
|
||||
ITEM_TELEMETRY_SENSOR19,
|
||||
ITEM_TELEMETRY_SENSOR20,
|
||||
ITEM_TELEMETRY_SENSOR21,
|
||||
ITEM_TELEMETRY_SENSOR22,
|
||||
ITEM_TELEMETRY_SENSOR23,
|
||||
ITEM_TELEMETRY_SENSOR24,
|
||||
ITEM_TELEMETRY_SENSOR25,
|
||||
ITEM_TELEMETRY_SENSOR26,
|
||||
ITEM_TELEMETRY_SENSOR27,
|
||||
ITEM_TELEMETRY_SENSOR28,
|
||||
ITEM_TELEMETRY_SENSOR29,
|
||||
ITEM_TELEMETRY_SENSOR30,
|
||||
ITEM_TELEMETRY_SENSOR31,
|
||||
ITEM_TELEMETRY_SENSOR32,
|
||||
ITEM_TELEMETRY_NEWSENSOR,
|
||||
ITEM_TELEMETRY_IGNORE_SENSORID,
|
||||
#endif
|
||||
#if !defined(CPUARM)
|
||||
#if defined(FRSKY_HUB) || defined(WS_HOW_HIGH)
|
||||
@@ -130,7 +147,7 @@ enum menuModelTelemetryItems {
|
||||
#if defined(CPUARM)
|
||||
#define CHANNELS_ROWS
|
||||
#define SENSOR_ROWS(x) (isTelemetryFieldAvailable(x) ? (uint8_t)0 : HIDDEN_ROW)
|
||||
#define SENSORS_ROWS LABEL(Sensors), SENSOR_ROWS(0), SENSOR_ROWS(1), SENSOR_ROWS(2), SENSOR_ROWS(3), SENSOR_ROWS(4), SENSOR_ROWS(5), SENSOR_ROWS(6), SENSOR_ROWS(7), SENSOR_ROWS(8), SENSOR_ROWS(9), SENSOR_ROWS(10), SENSOR_ROWS(11), SENSOR_ROWS(12), SENSOR_ROWS(13), SENSOR_ROWS(14), SENSOR_ROWS(15), 0,
|
||||
#define SENSORS_ROWS LABEL(Sensors), SENSOR_ROWS(0), SENSOR_ROWS(1), SENSOR_ROWS(2), SENSOR_ROWS(3), SENSOR_ROWS(4), SENSOR_ROWS(5), SENSOR_ROWS(6), SENSOR_ROWS(7), SENSOR_ROWS(8), SENSOR_ROWS(9), SENSOR_ROWS(10), SENSOR_ROWS(11), SENSOR_ROWS(12), SENSOR_ROWS(13), SENSOR_ROWS(14), SENSOR_ROWS(15), SENSOR_ROWS(16), SENSOR_ROWS(17), SENSOR_ROWS(18), SENSOR_ROWS(19), SENSOR_ROWS(20), SENSOR_ROWS(21), SENSOR_ROWS(22), SENSOR_ROWS(23), SENSOR_ROWS(24), SENSOR_ROWS(25), SENSOR_ROWS(26), SENSOR_ROWS(27), SENSOR_ROWS(28), SENSOR_ROWS(29), SENSOR_ROWS(30), SENSOR_ROWS(31), 0, 0,
|
||||
#else
|
||||
#define CHANNEL_ROWS(x) LABEL(CHANNEL), 1, 0, 2, 2
|
||||
#define CHANNELS_ROWS CHANNEL_ROWS(0), CHANNEL_ROWS(1),
|
||||
@@ -482,6 +499,22 @@ void onSensorMenu(const char *result)
|
||||
else
|
||||
m_posVert = 1+ITEM_TELEMETRY_NEWSENSOR;
|
||||
}
|
||||
else if (result == STR_COPY) {
|
||||
int newIndex = availableTelemetryIndex();
|
||||
|
||||
if (newIndex >= 0) {
|
||||
TelemetrySensor & sourceSensor = g_model.telemetrySensors[index];
|
||||
TelemetrySensor & newSensor = g_model.telemetrySensors[newIndex];
|
||||
newSensor = sourceSensor;
|
||||
TelemetryItem & sourceItem = telemetryItems[index];
|
||||
TelemetryItem & newItem = telemetryItems[newIndex];
|
||||
newItem = sourceItem;
|
||||
eeDirty(EE_MODEL);
|
||||
}
|
||||
else {
|
||||
POPUP_WARNING(STR_TELEMETRYFULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -547,6 +580,7 @@ void menuModelTelemetry(uint8_t event)
|
||||
if (event == EVT_KEY_LONG(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
MENU_ADD_ITEM(STR_EDIT);
|
||||
MENU_ADD_ITEM(STR_COPY);
|
||||
MENU_ADD_ITEM(STR_DELETE);
|
||||
menuHandler = onSensorMenu;
|
||||
}
|
||||
@@ -584,6 +618,10 @@ void menuModelTelemetry(uint8_t event)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_TELEMETRY_IGNORE_SENSORID:
|
||||
ON_OFF_MENU_ITEM(g_model.ignoreSensorIds, TELEM_COL2, y, STR_IGNOREIDS, attr, event);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
|
||||
@@ -102,7 +102,7 @@ void menuTelemetryFrsky(uint8_t event);
|
||||
#endif
|
||||
void menuGeneralSetup(uint8_t event);
|
||||
void menuGeneralCalib(uint8_t event);
|
||||
void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFunctionsContext & functionsContext);
|
||||
void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext);
|
||||
|
||||
void menuModelSelect(uint8_t event);
|
||||
void menuModelCustomFunctions(uint8_t event);
|
||||
@@ -253,6 +253,7 @@ int8_t checkIncDecMovedSwitch(int8_t val);
|
||||
#if defined(CPUARM)
|
||||
bool isInputAvailable(int input);
|
||||
bool isSourceAvailable(int source);
|
||||
bool isSourceAvailableInGlobalFunctions(int source);
|
||||
bool isSourceAvailableInCustomSwitches(int source);
|
||||
bool isInputSourceAvailable(int source);
|
||||
#define CHECK_INCDEC_MODELSOURCE(event, var, min, max) \
|
||||
|
||||
@@ -87,13 +87,22 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
||||
uint8_t in = KEYS_PRESSED();
|
||||
if (!(i_flags & NO_DBLKEYS) && (EVT_KEY_MASK(event))) {
|
||||
bool dblkey = true;
|
||||
if (DBLKEYS_PRESSED_RGT_LFT(in))
|
||||
newval = -val;
|
||||
if (DBLKEYS_PRESSED_RGT_LFT(in)) {
|
||||
if (!isValueAvailable || isValueAvailable(-val)) {
|
||||
newval = -val;
|
||||
}
|
||||
}
|
||||
else if (DBLKEYS_PRESSED_RGT_UP(in)) {
|
||||
newval = (i_max > 100 ? 100 : i_max);
|
||||
newval = (i_max > stops.max() ? stops.max() : i_max);
|
||||
while (isValueAvailable && !isValueAvailable(newval) && newval>i_min) {
|
||||
--newval;
|
||||
}
|
||||
}
|
||||
else if (DBLKEYS_PRESSED_LFT_DWN(in)) {
|
||||
newval = (i_min < -100 ? -100 : i_min);
|
||||
newval = (i_min < stops.min() ? stops.min() : i_min);
|
||||
while (isValueAvailable && !isValueAvailable(newval) && newval<i_max) {
|
||||
++newval;
|
||||
}
|
||||
}
|
||||
else if (DBLKEYS_PRESSED_UP_DWN(in)) {
|
||||
newval = 0;
|
||||
@@ -113,12 +122,37 @@ int checkIncDec(unsigned int event, int val, int i_min, int i_max, unsigned int
|
||||
#endif
|
||||
|
||||
if (event==EVT_KEY_FIRST(KEY_RIGHT) || event==EVT_KEY_REPT(KEY_RIGHT) || (s_editMode>0 && (IS_ROTARY_RIGHT(event) || event==EVT_KEY_FIRST(KEY_UP) || event==EVT_KEY_REPT(KEY_UP)))) {
|
||||
newval++;
|
||||
AUDIO_KEYPAD_UP();
|
||||
do {
|
||||
newval++;
|
||||
} while (isValueAvailable && !isValueAvailable(newval) && newval<=i_max);
|
||||
|
||||
if (newval > i_max) {
|
||||
newval = val;
|
||||
killEvents(event);
|
||||
AUDIO_WARNING2();
|
||||
}
|
||||
else {
|
||||
AUDIO_KEYPAD_UP();
|
||||
}
|
||||
}
|
||||
else if (event==EVT_KEY_FIRST(KEY_LEFT) || event==EVT_KEY_REPT(KEY_LEFT) || (s_editMode>0 && (IS_ROTARY_LEFT(event) || event==EVT_KEY_FIRST(KEY_DOWN) || event==EVT_KEY_REPT(KEY_DOWN)))) {
|
||||
newval--;
|
||||
AUDIO_KEYPAD_DOWN();
|
||||
do {
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval -= min(10, val-i_min);
|
||||
}
|
||||
else {
|
||||
newval--;
|
||||
}
|
||||
} while (isValueAvailable && !isValueAvailable(newval) && newval>=i_min);
|
||||
|
||||
if (newval < i_min) {
|
||||
newval = val;
|
||||
killEvents(event);
|
||||
AUDIO_WARNING2();
|
||||
}
|
||||
else {
|
||||
AUDIO_KEYPAD_DOWN();
|
||||
}
|
||||
}
|
||||
|
||||
if (!READ_ONLY() && i_min==0 && i_max==1 && (event==EVT_KEY_BREAK(KEY_ENTER) || IS_ROTARY_BREAK(event))) {
|
||||
|
||||
@@ -68,10 +68,6 @@ void menuStatisticsView(uint8_t event)
|
||||
|
||||
putsTimer( 12*FW+5*FWNUM+1, FH*0, sessionTimer, 0, 0);
|
||||
|
||||
#if defined(CPUARM)
|
||||
putsTimer(21*FW+5*FWNUM+1, 0*FH, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0);
|
||||
#endif
|
||||
|
||||
#if defined(THRTRACE)
|
||||
coord_t traceRd = (s_traceCnt < 0 ? s_traceWr : 0);
|
||||
const coord_t x = 5;
|
||||
@@ -198,13 +194,13 @@ void menuStatisticsDebug(uint8_t event)
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_MIXMAX, "ms");
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X)
|
||||
#if defined(CPUARM)
|
||||
lcd_putsLeft(MENU_DEBUG_Y_RTOS, STR_FREESTACKMINB);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS, stack_free(0), UNSIGN|LEFT);
|
||||
lcd_outdezAtt(MENU_DEBUG_COL1_OFS, MENU_DEBUG_Y_RTOS+2, stack_free(0), UNSIGN|LEFT|TINSIZE);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(1), UNSIGN|LEFT);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS+2, stack_free(1), UNSIGN|LEFT|TINSIZE);
|
||||
lcd_puts(lcdLastPos, MENU_DEBUG_Y_RTOS, "/");
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS, stack_free(2), UNSIGN|LEFT);
|
||||
lcd_outdezAtt(lcdLastPos, MENU_DEBUG_Y_RTOS+2, stack_free(2), UNSIGN|LEFT|TINSIZE);
|
||||
#endif
|
||||
|
||||
#if !defined(CPUARM)
|
||||
@@ -220,6 +216,6 @@ void menuStatisticsDebug(uint8_t event)
|
||||
lcd_outdezAtt(14*FW, 5*FH, stack_free(), UNSIGN) ;
|
||||
#endif
|
||||
|
||||
lcd_puts(3*FW, 7*FH+1, STR_MENUTORESET);
|
||||
lcd_puts(4*FW, 7*FH+1, STR_MENUTORESET);
|
||||
lcd_status_line();
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ void displayScrollbar(coord_t x, coord_t y, coord_t h, uint16_t offset, uint16_t
|
||||
void displayMenuBar(const MenuItem *menu, int index);
|
||||
void displayProgressBar(const char *label);
|
||||
void updateProgressBar(int num, int den);
|
||||
void drawGauge(coord_t x, coord_t y, coord_t w, coord_t h, int32_t val, int32_t max);
|
||||
|
||||
extern coord_t scrollbar_X;
|
||||
#define SET_SCROLLBAR_X(x) scrollbar_X = (x);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user