Compare commits
386 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e472700cc | |||
| edbe6fc72e | |||
| 1b728948f4 | |||
| 7434c28820 | |||
| 751027b4ad | |||
| 317890c9f9 | |||
| 65f433438a | |||
| 7167f6a9b7 | |||
| cb47c0fc92 | |||
| 37222c32a4 | |||
| dafb700be2 | |||
| 9d4fbfc3ea | |||
| e96578c857 | |||
| d2ce28f897 | |||
| 7b3e661110 | |||
| 2c6f28e422 | |||
| 1febac7bf9 | |||
| 59b0bca88b | |||
| 9f522beac4 | |||
| 4712383523 | |||
| b8487c90de | |||
| f3bc8cb9a4 | |||
| c0c6a90f65 | |||
| ffd4151029 | |||
| e3b8e91a0a | |||
| 629e09c464 | |||
| 8f36f0e405 | |||
| 7467213bad | |||
| 5b2530ba79 | |||
| d0a7d748c9 | |||
| 790073d4db | |||
| bb9cd3e8f5 | |||
| 83532f84cd | |||
| cfd6d47dfb | |||
| 831cbc0122 | |||
| d0edbacf37 | |||
| 5fcba6e193 | |||
| e5e378b1b0 | |||
| 319b3006f3 | |||
| e14c2e0916 | |||
| 026213fcd5 | |||
| 1116bbb167 | |||
| 99704109eb | |||
| f707035af5 | |||
| 8d6ab5c123 | |||
| 40a391d778 | |||
| 9fe49846c5 | |||
| 88c4c11b56 | |||
| e4b5f98d58 | |||
| 405391033d | |||
| 13fd1f04c0 | |||
| 8d42380abb | |||
| 9e1afe8cb0 | |||
| 90381e369d | |||
| 8fa2c21a47 | |||
| c08b57ad9b | |||
| e31f71f874 | |||
| 206563f433 | |||
| a191543ee3 | |||
| d74af019f8 | |||
| 7ea0c7cb5c | |||
| 38918e157e | |||
| 99d33cbc74 | |||
| a02b0f5d00 | |||
| bd42cbed33 | |||
| 546a680bec | |||
| 7cc411d384 | |||
| 6908509d79 | |||
| b1f44d7101 | |||
| e8e2ff4a94 | |||
| 9d7af18f7b | |||
| 937662eac4 | |||
| 2a277e930c | |||
| c9cc39c139 | |||
| 3623f66927 | |||
| dc58dd4d6f | |||
| 0d5196e8c9 | |||
| 11b18ca760 | |||
| b1fa194a1d | |||
| 3dfe0afd6f | |||
| e82ca116f7 | |||
| 9db563c7c1 | |||
| a9ad37cab9 | |||
| 2d5a5eccd6 | |||
| a5647ed7bc | |||
| 7b1edb58a4 | |||
| ed90015503 | |||
| 6ef4134b2d | |||
| 282a3d00b1 | |||
| 36395862d1 | |||
| 1560fa8bd9 | |||
| 79abc49a6c | |||
| 6c86cada2c | |||
| 3e0135071e | |||
| cdc0147dcb | |||
| 73cd69c63b | |||
| 7e147c71c1 | |||
| c4140f305c | |||
| 07b4be8f45 | |||
| fd9f3ad8be | |||
| b83f95ed1a | |||
| b77d470684 | |||
| ec81b078fe | |||
| 2416dde7bb | |||
| 0af5794cfa | |||
| 1e917da05e | |||
| c82068115f | |||
| 41f14b93df | |||
| df7455e24b | |||
| a5316ef6e3 | |||
| e6391f04c4 | |||
| 571b498a82 | |||
| efc11be7ee | |||
| 19ef43cd7f | |||
| 1861c5e264 | |||
| e040ab9897 | |||
| f2b59df0f6 | |||
| 824059d033 | |||
| 500ca6554d | |||
| b3b35eca5b | |||
| 39118453da | |||
| 9e64801384 | |||
| 6497407788 | |||
| 5a3d2244d8 | |||
| 8115a78df7 | |||
| f597e6412b | |||
| 3df0b12ccb | |||
| f99fc83993 | |||
| bf511767ce | |||
| 9682bf116d | |||
| 6086112cf9 | |||
| 6dacd5a914 | |||
| 2094e87da5 | |||
| 20125474c1 | |||
| 18f327612f | |||
| 6689919a39 | |||
| c7133bb5a0 | |||
| a40dc4c4d2 | |||
| 9840cc7dfc | |||
| 8cd55856e9 | |||
| f4bbaf682c | |||
| db7dd83168 | |||
| 4d71fb31db | |||
| 101293124a | |||
| effcb1610b | |||
| 97b37a5024 | |||
| c79d78664b | |||
| 9c972b0c42 | |||
| 35765394dc | |||
| 219c4e913c | |||
| d3ca801e53 | |||
| 1c2257190a | |||
| f509a7d22b | |||
| 44829cd579 | |||
| 94e749d08e | |||
| 726a03d433 | |||
| d6ef1c011b | |||
| f295f3b888 | |||
| f55e5f862b | |||
| 3c5d9c617a | |||
| 10413bbede | |||
| 91dfb0309e | |||
| 6707f68923 | |||
| 21b80be29a | |||
| c4b19de8eb | |||
| 5351514180 | |||
| 37ec428efc | |||
| 1941d3eb7e | |||
| e3df420f8e | |||
| 87c8b4b153 | |||
| 4149361de8 | |||
| 2fbd68ecb3 | |||
| cedac96cf4 | |||
| 89433127c4 | |||
| c23f1e974a | |||
| 9a83325119 | |||
| a596001338 | |||
| 1127ea412e | |||
| e85242e08d | |||
| 7ea2eb6259 | |||
| 2cd66cbc65 | |||
| 06064b6da2 | |||
| 809cb69b4f | |||
| 6f8e439154 | |||
| 4c81e57134 | |||
| ddd2d19c0c | |||
| eeb9ee8aa2 | |||
| 30b660da17 | |||
| 4cd881d746 | |||
| ea731eae37 | |||
| 5d77b8bf21 | |||
| 621639ad0b | |||
| fdc95bbf23 | |||
| b182d98da0 | |||
| e49a15bf07 | |||
| 3cdb2b549b | |||
| 69276bffcc | |||
| b0afbb692f | |||
| 0ab85725e0 | |||
| e8e025fdb0 | |||
| 7d29fed9a5 | |||
| 78ef42755b | |||
| 2a9429d183 | |||
| 4773ba469f | |||
| 6d1b379f53 | |||
| 54cbc46929 | |||
| 1fd4dbb1a9 | |||
| ecd871fe34 | |||
| 5c4b2ebd90 | |||
| 3fe75fac59 | |||
| 43a7434ae5 | |||
| 134a9c2472 | |||
| 0f495a6fd9 | |||
| 5d037327d4 | |||
| ebbe2635b7 | |||
| cab9615fa8 | |||
| 9b6d45bba3 | |||
| 7ddb29ca74 | |||
| 87e1c4f96d | |||
| 22e625baad | |||
| b37f573226 | |||
| 296264d8b4 | |||
| 2ba86d8cb3 | |||
| 8e5a52879a | |||
| e4d03b8c70 | |||
| 831cd81320 | |||
| b2d8c76fc1 | |||
| 3392879940 | |||
| d767b62d01 | |||
| 2ea687099a | |||
| 81c4b61322 | |||
| 0610c2c79a | |||
| e50d9c0edf | |||
| 72dc022dc9 | |||
| 123d5c1be8 | |||
| 9be2755d91 | |||
| 4305935fd4 | |||
| 3dff1fdac7 | |||
| 0281a5bb22 | |||
| cc0552d1a2 | |||
| f4ee34dcc9 | |||
| 9791509ec1 | |||
| bb71cd35f8 | |||
| d93b63d85c | |||
| 2706a3d81c | |||
| 73b0090840 | |||
| 2b3242f863 | |||
| 9f9a561c82 | |||
| ba10ec68b6 | |||
| 0b5820bdd6 | |||
| bfbe0046ab | |||
| 71ba0328bd | |||
| df80aa00c2 | |||
| 3c181fc474 | |||
| e62a8e8ba7 | |||
| eb69444cbf | |||
| f083b6f45a | |||
| 13de131fe4 | |||
| 4c6c9fdb20 | |||
| 9cb4d5da1f | |||
| ce22ea22b4 | |||
| aa661ced46 | |||
| 1e56c9ba14 | |||
| e65b9d825b | |||
| 2561e53696 | |||
| 2665c2318f | |||
| 5a0f154876 | |||
| 15d89d638c | |||
| 087c9f0202 | |||
| 0ae00dddf8 | |||
| f865bdf785 | |||
| 04897885dd | |||
| 2248c84b8f | |||
| 5f0f5de111 | |||
| b93036c81d | |||
| 6bfc4f7986 | |||
| 34de0aa01a | |||
| b8ca14c921 | |||
| 5ec77c6dae | |||
| f482b895fb | |||
| 73f2e99d7d | |||
| 49b821b04d | |||
| 17bfe1544f | |||
| 7a7b4c047e | |||
| 7912b79d7e | |||
| 83d8834fe4 | |||
| bf9fc6dd98 | |||
| 6edc28b4ba | |||
| e0deb3b665 | |||
| 8f3060f99c | |||
| 9e7a52b952 | |||
| 3b8e64fe64 | |||
| 479c070896 | |||
| 9f75be0dc4 | |||
| d090175b2a | |||
| 93d6788605 | |||
| 5de9f6c4a4 | |||
| 9785720bf6 | |||
| 626f4c5784 | |||
| c1e15d0212 | |||
| a19fff0998 | |||
| 9a502461df | |||
| bc484879a5 | |||
| b070f56838 | |||
| dd874427b8 | |||
| 902a69323a | |||
| a6c39e83b1 | |||
| 6511ae173d | |||
| 3d4d6ba313 | |||
| ce1ff9ea14 | |||
| 38cf9536e1 | |||
| 2683194f64 | |||
| 010d6691b9 | |||
| 3c6e21d945 | |||
| dcde1073b0 | |||
| fd55a40d26 | |||
| a2350c6d92 | |||
| 35e5faa8ad | |||
| 77e9130c37 | |||
| 9cc0b8b608 | |||
| 96953c7987 | |||
| 5b277378c6 | |||
| 2714017fe8 | |||
| b747b03ac0 | |||
| 3ed37c1e79 | |||
| b9b2cb46eb | |||
| 832c891e3e | |||
| 86a8e6a128 | |||
| 30c28645da | |||
| 01c0607aa8 | |||
| 7a14c3592a | |||
| e9b28898d0 | |||
| 001585a194 | |||
| b22dca6be7 | |||
| e46523b08e | |||
| a3f8e92c39 | |||
| 4cdd359405 | |||
| 82aa8cc383 | |||
| 85cb8b3dbd | |||
| 0a5c3f42c5 | |||
| 8267ac2fc2 | |||
| 6bbb416f83 | |||
| 1478b8c9da | |||
| 3dddf353e4 | |||
| ecb1955750 | |||
| c00c9e7e79 | |||
| e9084e4d59 | |||
| 016eafefab | |||
| 7cdc42387b | |||
| f09e1338f6 | |||
| 458e41744b | |||
| f276b8a9eb | |||
| 57d50f05cd | |||
| dd5889c6fc | |||
| a4c400b62a | |||
| e7e6c9b75e | |||
| b54c5c2d2e | |||
| b3d61289e8 | |||
| e0295d08da | |||
| cf7984a3c5 | |||
| 41390af8a4 | |||
| 5385a01b2e | |||
| 54447a45a0 | |||
| b593d871a6 | |||
| d18c6c9985 | |||
| 64e84f1af9 | |||
| 61923a9bec | |||
| c8e0b85e7e | |||
| 2170d2a129 | |||
| 7f4f7cee8b | |||
| f2c9aa9494 | |||
| 79b461eda8 | |||
| becbb8cbb9 | |||
| ac98f6adaf | |||
| fe68ef4cd1 | |||
| 0342ca9172 | |||
| d030561bf3 | |||
| d21fcbf260 | |||
| 19818b6c07 | |||
| 6b7cc60751 | |||
| 00d3d3e20b | |||
| 4a099a7161 | |||
| df30dd9bb9 | |||
| e44e87221f | |||
| d4959dfeb0 | |||
| ffe70d1eaa |
@@ -278,7 +278,7 @@ Josep Clodas Sola
|
||||
Thierry Martin
|
||||
Peter Mauro
|
||||
Mitchell Brenner
|
||||
Ulach Green
|
||||
Yak
|
||||
Lluis Bullich Rañe
|
||||
Steffen Rohr
|
||||
Eric Jacquin
|
||||
@@ -406,3 +406,90 @@ Michael Gregory
|
||||
Robert Russell
|
||||
Gordon Stahl
|
||||
Felix Kaiser
|
||||
Joshua Bardwell
|
||||
Davd Goodall
|
||||
Leonard MacKey
|
||||
Miles Kelly
|
||||
Sergio Robledo
|
||||
Mikael Wallbäck
|
||||
Daniel Malcman
|
||||
Paul Dittman
|
||||
Attilio Rausse
|
||||
Sidney Gates
|
||||
Andrea Montefusco
|
||||
Paul Luby
|
||||
Donald L Webster
|
||||
Kenneth Frehafer
|
||||
Peter McHenry
|
||||
Matthias Hase
|
||||
Markus Wolf
|
||||
Andrew Fazio
|
||||
Stefan Künst
|
||||
Stephen Adams
|
||||
Arold Reinders
|
||||
Tauno Rautakorpi
|
||||
Frank Houvenaghel
|
||||
Aerial Tech Hobbies - www.aerialtechhobbies.com
|
||||
George Neusse
|
||||
Andreja Rusjakovski
|
||||
Axel Stöckle
|
||||
Mike Perkins
|
||||
Erwin Störrle
|
||||
Rodger Hopper
|
||||
Fernando Cesar
|
||||
Jonathan Gillis
|
||||
DK-System
|
||||
Lexington S Morley
|
||||
Bernd Koehler
|
||||
Davis RC
|
||||
Pete Johnson
|
||||
Patricia Martin
|
||||
Florian Tschacher
|
||||
Brian Spearing
|
||||
Craig Hall
|
||||
Joseph Case
|
||||
Harald Klein
|
||||
Robert Crockford
|
||||
Chris Boultinghouse
|
||||
Kitsew
|
||||
Georgios Papadopoulos
|
||||
Fourmost Products
|
||||
Dennis Miller
|
||||
Dave Matison
|
||||
Maximilian Radig
|
||||
Juan Rodriguez
|
||||
Robert Sessler
|
||||
John Murray
|
||||
Martin Sniedze
|
||||
David Poole
|
||||
Manfred Delakowitz
|
||||
Martijn Kruissen
|
||||
Jörgen Norman
|
||||
Nathan Kinney
|
||||
John Godden
|
||||
Larry Roper
|
||||
Mike Frizell
|
||||
Daniel Pospolita
|
||||
Peter Herz
|
||||
Don Mondrik
|
||||
Paul Fram
|
||||
Charles Knight
|
||||
Matthew Adams
|
||||
Kenneth Reed
|
||||
Gary Wild
|
||||
Christof Ramm
|
||||
Bruno Bedard
|
||||
Salih Samim Aydin
|
||||
Alexander Pils
|
||||
Andrew Scerbina
|
||||
Donovan Bodishbaugh
|
||||
Ray Dunn
|
||||
Burt Pickard-Richardson
|
||||
Robert Ferguson
|
||||
CY Enterprise
|
||||
Michel Stathakis Neto
|
||||
Beat Zurflueh
|
||||
Heinrich Illig
|
||||
Portstate Pty Ltd
|
||||
Jens Hoffmann
|
||||
Ricardo Santos
|
||||
|
||||
@@ -1,3 +1,38 @@
|
||||
<h2>Version 2.0.4</h2>
|
||||
<ul>
|
||||
<li>Sound should be ok on all platforms</li>
|
||||
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.3</h2>
|
||||
<ul>
|
||||
<li>EEPROM import bug on AdjustGVAR function</li>
|
||||
<li>Timers correctly displayed in logical switches tab</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.2</h2>
|
||||
<ul>
|
||||
<li>Mouse scroll wheel behaves differently</li>
|
||||
<li>Play Sounds should now work on all platforms</li>
|
||||
<li>A lot of small bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.1</h2>
|
||||
<ul>
|
||||
<li>Fix on recursive GVars</li>
|
||||
<li>Sky9x EEPROM read/write fix</li>
|
||||
<li>Translations updated
|
||||
<li>Wizard fixes
|
||||
<li>Fix on invalid splashes bitmaps
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.0</h2>
|
||||
<ul>
|
||||
<li>Companion now merged into OpenTX</li>
|
||||
<li>Too many changes to list them all!</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 1.52</h2>
|
||||
<ul>
|
||||
<li>Fix crash when writing certain EEPROMS</li>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "0" )
|
||||
SET( C9X_VERSION_REVISION "4" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
@@ -42,18 +42,14 @@ SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
IF ( APPLE )
|
||||
MESSAGE( STATUS "Phonon still not supported on APPLE " )
|
||||
MESSAGE( STATUS "Looking for PHONON " )
|
||||
FIND_PACKAGE(Phonon)
|
||||
IF ( PHONON_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
|
||||
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DPHONON )
|
||||
ELSE()
|
||||
MESSAGE( STATUS "Looking for PHONON " )
|
||||
FIND_PACKAGE(Phonon)
|
||||
IF ( PHONON_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
|
||||
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DPHONON )
|
||||
ELSE()
|
||||
MESSAGE( "PHONON not found!" )
|
||||
ENDIF()
|
||||
MESSAGE( "PHONON not found!" )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
@@ -91,13 +87,6 @@ add_custom_command(
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
COMMAND make stamp_header
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/Makefile
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/../..
|
||||
@@ -121,6 +110,8 @@ set(common_SRCS
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/ersky9x/ersky9xeeprom.cpp
|
||||
firmwares/ersky9x/ersky9xinterface.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
firmwares/opentx/opentxeeprom.cpp
|
||||
firmwares/opentx/open9xStockeeprom.cpp
|
||||
firmwares/opentx/open9xGruvin9xeeprom.cpp
|
||||
@@ -130,24 +121,20 @@ set(common_SRCS
|
||||
firmwares/opentx/opentxSky9xsimulator.cpp
|
||||
firmwares/opentx/opentxGruvin9xsimulator.cpp
|
||||
firmwares/opentx/opentxM128simulator.cpp
|
||||
firmwares/opentx/opentxsimulator.cpp
|
||||
firmwares/opentx/opentxM64simulator.cpp
|
||||
file.cpp
|
||||
googleanalytics.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
|
||||
set(common_MOC_HDRS
|
||||
googleanalytics.h
|
||||
)
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
flashinterface.cpp
|
||||
xmlinterface.cpp
|
||||
${PROJECT_BINARY_DIR}/radio.cxx
|
||||
${RADIO_SRC_DIRECTORY}/stamp-opentx.h
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
${RADIO_SRC_DIRECTORY}/translations/en.h
|
||||
# xmlinterface.cpp
|
||||
# ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
helpers.cpp
|
||||
mdichild.cpp
|
||||
generaledit.cpp
|
||||
@@ -168,7 +155,7 @@ set(companion_SRCS
|
||||
splashlibrary.cpp
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
taranisnotfound.cpp
|
||||
radionotfound.cpp
|
||||
qcustomplot.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
@@ -193,7 +180,7 @@ set(companion_MOC_HDRS
|
||||
modelslist.h
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
taranisnotfound.h
|
||||
radionotfound.h
|
||||
qcustomplot.h
|
||||
qautocombobox.h
|
||||
helpers.h
|
||||
@@ -216,7 +203,7 @@ set(companion_UIS
|
||||
customizesplashdialog.ui
|
||||
splashlibrary.ui
|
||||
burndialog.ui
|
||||
taranisnotfound.ui
|
||||
radionotfound.ui
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
@@ -255,8 +242,6 @@ 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)
|
||||
|
||||
# Subversion_WC_INFO( ${PROJECT_SOURCE_DIR}/../${FIRMWARE} G9X )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
|
||||
IF( WIN32 )
|
||||
@@ -274,9 +259,9 @@ FOREACH( language ${LANGUAGES} )
|
||||
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
|
||||
ENDFOREACH( language )
|
||||
|
||||
set( companion_SRCS ${common_SRCS} ${companion_SRCS} )
|
||||
set( companion_SRCS ${companion_SRCS} )
|
||||
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
|
||||
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} ${common_MOC_HDRS} )
|
||||
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
|
||||
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
|
||||
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
|
||||
|
||||
@@ -284,11 +269,13 @@ ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${PROJECT_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} )
|
||||
ENDIF( )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -334,8 +321,8 @@ set(simu_MOC_HDRS
|
||||
modeledit/node.h
|
||||
)
|
||||
|
||||
set( simu_SRCS ${simu_SRCS} ${common_SRCS} )
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} ${common_MOC_HDRS} )
|
||||
set( simu_SRCS ${simu_SRCS} )
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
|
||||
if(WIN32)
|
||||
@@ -345,9 +332,9 @@ endif()
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
|
||||
if(SDL_FOUND)
|
||||
target_link_libraries(simulator simulation ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
else()
|
||||
target_link_libraries(simulator simulation ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
endif()
|
||||
|
||||
############# Packaging ####################
|
||||
@@ -411,7 +398,7 @@ IF( APPLE )
|
||||
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/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
|
||||
|
||||
@@ -633,6 +633,9 @@ AppData::AppData()
|
||||
settings.remove("startup_check_companion9x");
|
||||
settings.remove("wizardEnable");
|
||||
|
||||
// Delete settings that we do not want to carry over from 1.52
|
||||
settings.remove("dfu_location");
|
||||
|
||||
// Select the new default profile as current profile
|
||||
id( 0 );
|
||||
}
|
||||
|
||||
@@ -19,10 +19,6 @@ AppPreferencesDialog::AppPreferencesDialog(QWidget *parent) :
|
||||
updateLock=false;
|
||||
setWindowIcon(CompanionIcon("apppreferences.png"));
|
||||
|
||||
voice=NULL;
|
||||
connect(ui->langCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
connect(ui->voiceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(firmwareLangChanged()));
|
||||
|
||||
initSettings();
|
||||
connect(ui->downloadVerCB, SIGNAL(currentIndexChanged(int)), this, SLOT(baseFirmwareChanged()));
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeValues()));
|
||||
@@ -80,10 +76,11 @@ void AppPreferencesDialog::writeValues()
|
||||
|
||||
// If a new fw type has been choosen, several things need to reset
|
||||
current_firmware_variant = getFirmwareVariant();
|
||||
if (g.profile[g.id()].fwType() != current_firmware_variant.id) {
|
||||
QString id = current_firmware_variant->getId();
|
||||
if (g.profile[g.id()].fwType() != id) {
|
||||
g.profile[g.id()].fwName("");
|
||||
g.profile[g.id()].initFwVariables();
|
||||
g.profile[g.id()].fwType( current_firmware_variant.id );
|
||||
g.profile[g.id()].fwType(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +100,7 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->burnFirmware->setChecked(g.profile[g.id()].burnFirmware());
|
||||
ui->snapshotPath->setText(g.snapshotDir());
|
||||
ui->snapshotPath->setReadOnly(true);
|
||||
if (ui->snapshotClipboardCKB->isChecked())
|
||||
{
|
||||
if (ui->snapshotClipboardCKB->isChecked()) {
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
@@ -114,8 +110,9 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard()))
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
ui->backLightColor->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->simuSW->setChecked(g.simuSW());
|
||||
ui->modelWizard_CB->setChecked(g.useWizard());
|
||||
@@ -174,14 +171,14 @@ void AppPreferencesDialog::initSettings()
|
||||
|
||||
QString hwSettings;
|
||||
if (g.profile[g.id()].stickPotCalib() == "" ) {
|
||||
hwSettings = QString(tr("EMPTY: No radio settings stored in profile"));
|
||||
hwSettings = tr("EMPTY: No radio settings stored in profile");
|
||||
}
|
||||
else {
|
||||
QString str = g.profile[g.id()].timeStamp();
|
||||
if (str.isEmpty())
|
||||
hwSettings = QString(tr("AVAILABLE: Radio settings of unknown age"));
|
||||
hwSettings = tr("AVAILABLE: Radio settings of unknown age");
|
||||
else
|
||||
hwSettings = QString(tr("AVAILABLE: Radio settings stored %1").arg(str));
|
||||
hwSettings = tr("AVAILABLE: Radio settings stored %1").arg(str);
|
||||
}
|
||||
ui->lblGeneralSettings->setText(hwSettings);
|
||||
|
||||
@@ -189,13 +186,12 @@ void AppPreferencesDialog::initSettings()
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
ui->downloadVerCB->addItem(firmware->getName(), firmware->getId());
|
||||
if (current_firmware == firmware) {
|
||||
if (current_firmware->getFirmwareBase() == firmware) {
|
||||
ui->downloadVerCB->setCurrentIndex(ui->downloadVerCB->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
baseFirmwareChanged();
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_libraryPathButton_clicked()
|
||||
@@ -333,7 +329,8 @@ void AppPreferencesDialog::on_SplashSelect_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_clearImageButton_clicked() {
|
||||
void AppPreferencesDialog::on_clearImageButton_clicked()
|
||||
{
|
||||
ui->imageLabel->clear();
|
||||
ui->SplashFileName->clear();
|
||||
}
|
||||
@@ -341,65 +338,45 @@ void AppPreferencesDialog::on_clearImageButton_clicked() {
|
||||
|
||||
void AppPreferencesDialog::showVoice(bool show)
|
||||
{
|
||||
if (show)
|
||||
showVoice();
|
||||
else
|
||||
hideVoice();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::showVoice()
|
||||
{
|
||||
ui->voiceLabel->show();
|
||||
ui->voiceCombo->show();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::hideVoice()
|
||||
{
|
||||
ui->voiceLabel->hide();
|
||||
ui->voiceCombo->hide();
|
||||
ui->voiceLabel->setVisible(show);
|
||||
ui->voiceCombo->setVisible(show);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
|
||||
void AppPreferencesDialog::baseFirmwareChanged()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
voice=NULL;
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
if (firmware->getId() == selected_firmware) {
|
||||
showVoice(firmware->voice);
|
||||
populateFirmwareOptions(firmware);
|
||||
break;
|
||||
}
|
||||
}
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
|
||||
FirmwareInterface * AppPreferencesDialog::getFirmwareVariant()
|
||||
{
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
bool voice=false;
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
QString id = firmware->getId();
|
||||
if (id == selected_firmware) {
|
||||
foreach(QCheckBox *cb, optionsCheckBoxes) {
|
||||
if (cb->isChecked()) {
|
||||
if (cb->text()=="voice" && cb->isChecked())
|
||||
voice=true;
|
||||
id += QString("-") + cb->text();
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
if (ui->voiceCombo->count() && (voice || firmware->voice))
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
else {
|
||||
hideVoice();
|
||||
}
|
||||
if (ui->langCombo->count())
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
|
||||
return GetFirmwareVariant(id);
|
||||
if (voice && voice->isChecked()) {
|
||||
id += QString("-tts") + ui->voiceCombo->currentText();
|
||||
}
|
||||
|
||||
if (ui->langCombo->count()) {
|
||||
id += QString("-") + ui->langCombo->currentText();
|
||||
}
|
||||
|
||||
return GetFirmware(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +387,9 @@ FirmwareVariant AppPreferencesDialog::getFirmwareVariant()
|
||||
void AppPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
{
|
||||
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
|
||||
if (cb == voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
FirmwareInterface * firmware=NULL;
|
||||
if (cb && state) {
|
||||
QVariant selected_firmware = ui->downloadVerCB->itemData(ui->downloadVerCB->currentIndex());
|
||||
@@ -421,74 +401,37 @@ void AppPreferencesDialog::firmwareOptionChanged(bool state)
|
||||
foreach(Option other, opts) {
|
||||
if (other.name != opt.name) {
|
||||
foreach(QCheckBox *ocb, optionsCheckBoxes) {
|
||||
if (ocb->text() == other.name)
|
||||
if (ocb->text() == other.name) {
|
||||
ocb->setChecked(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
|
||||
return firmwareChanged();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cb && !state) {
|
||||
if (cb->text()=="voice") {
|
||||
hideVoice();
|
||||
}
|
||||
}
|
||||
if (voice) {
|
||||
showVoice(voice->isChecked());
|
||||
}
|
||||
else if (firmware) {
|
||||
if (firmware->voice) {
|
||||
showVoice();
|
||||
}
|
||||
}
|
||||
return firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::firmwareLangChanged()
|
||||
{
|
||||
firmwareChanged();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::firmwareChanged()
|
||||
{
|
||||
if (updateLock)
|
||||
return;
|
||||
|
||||
FirmwareVariant variant = getFirmwareVariant();
|
||||
QString stamp;
|
||||
stamp.append(variant.firmware->getStampUrl());
|
||||
QString url = variant.getFirmwareUrl();
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * firmware)
|
||||
{
|
||||
const FirmwareInterface * parent = /*firmware->parent ? firmware->parent : */ firmware;
|
||||
const FirmwareInterface * parent = firmware->getFirmwareBase();
|
||||
|
||||
updateLock = true;
|
||||
|
||||
QString id = current_firmware_variant->getId();
|
||||
ui->langCombo->clear();
|
||||
foreach(const char *lang, parent->languages) {
|
||||
ui->langCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.endsWith(lang))
|
||||
if (id.endsWith(lang)) {
|
||||
ui->langCombo->setCurrentIndex(ui->langCombo->count() - 1);
|
||||
}
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (current_firmware_variant.id.contains(QString("-tts%1").arg(lang)))
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
showVoice(ui->langCombo->count()!=0);
|
||||
voice = NULL; // we will search for a voice checkbox
|
||||
|
||||
int index = 0;
|
||||
foreach(QList<Option> opts, parent->opts) {
|
||||
@@ -505,21 +448,30 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
cb->show();
|
||||
cb->setText(opt.name);
|
||||
cb->setToolTip(opt.tooltip);
|
||||
cb->setCheckState(current_firmware_variant.id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
if (opt.name==QString("voice")) {
|
||||
voice=cb;
|
||||
showVoice(current_firmware_variant.id.contains(opt.name) ||firmware->voice);
|
||||
cb->setCheckState(id.contains(opt.name) ? Qt::Checked : Qt::Unchecked);
|
||||
if (opt.name == QString("voice")) {
|
||||
voice = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (; index<optionsCheckBoxes.size(); index++) {
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index);
|
||||
cb->hide();
|
||||
cb->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
ui->voiceCombo->clear();
|
||||
foreach(const char *lang, parent->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (id.contains(QString("-tts%1").arg(lang))) {
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
showVoice(voice && voice->isChecked());
|
||||
|
||||
updateLock = false;
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class AppPreferencesDialog : public QDialog
|
||||
void hideVoice();
|
||||
void populateLocale();
|
||||
void populateFirmwareOptions(const FirmwareInterface *);
|
||||
FirmwareVariant getFirmwareVariant();
|
||||
FirmwareInterface * getFirmwareVariant();
|
||||
QCheckBox * voice;
|
||||
|
||||
Ui::AppPreferencesDialog *ui;
|
||||
@@ -39,10 +39,8 @@ class AppPreferencesDialog : public QDialog
|
||||
|
||||
protected slots:
|
||||
void shrink();
|
||||
void firmwareLangChanged();
|
||||
void baseFirmwareChanged();
|
||||
void firmwareOptionChanged(bool state);
|
||||
void firmwareChanged();
|
||||
|
||||
void writeValues();
|
||||
void on_libraryPathButton_clicked();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>685</width>
|
||||
<height>818</height>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -51,22 +51,15 @@
|
||||
<attribute name="title">
|
||||
<string>Radio Profile</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="22" column="5">
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,1,0,0,0,0,0">
|
||||
<item row="21" column="7">
|
||||
<widget class="QPushButton" name="sdPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="downloadVerCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="26" column="0">
|
||||
<item row="25" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
@@ -82,7 +75,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Build Options</string>
|
||||
@@ -92,7 +85,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="langLabel">
|
||||
<property name="text">
|
||||
<string>Menu Language</string>
|
||||
@@ -102,7 +95,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="0">
|
||||
<item row="23" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -115,14 +108,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="5">
|
||||
<item row="14" column="7">
|
||||
<widget class="QPushButton" name="SplashSelect">
|
||||
<property name="text">
|
||||
<string>Select Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="1">
|
||||
<item row="22" column="1">
|
||||
<widget class="QLabel" name="lblGeneralSettings">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -132,37 +125,247 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="3">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="11" column="0" colspan="6">
|
||||
<item row="10" column="0" colspan="8">
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="5">
|
||||
<item row="9" column="1" colspan="7">
|
||||
<layout class="QGridLayout" name="optionsLayout"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="CPU_ID_LABEL">
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Processor ID</string>
|
||||
<string>Splash Screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="24" column="1" colspan="3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Profile Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="7">
|
||||
<widget class="QPushButton" name="clearImageButton">
|
||||
<property name="text">
|
||||
<string>Clear Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="1">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Radio Type</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="0" colspan="8">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="8">
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Other Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>General Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<widget class="QLabel" name="sdPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SD Structure path</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="7">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QComboBox" name="langCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="voiceLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Voice Language</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="voiceCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set voice language.
|
||||
May be different from firmware language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="7">
|
||||
<widget class="QComboBox" name="downloadVerCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1" colspan="6">
|
||||
<widget class="QLineEdit" name="SplashFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="1" colspan="6">
|
||||
<widget class="QLineEdit" name="sdPath">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="1" colspan="6">
|
||||
<widget class="QComboBox" name="stickmodeCB">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -216,26 +419,7 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Splash Screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="26" column="1" colspan="3">
|
||||
<item row="25" column="1" colspan="6">
|
||||
<widget class="QComboBox" name="channelorderCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -383,20 +567,31 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<item row="1" column="1" colspan="6">
|
||||
<widget class="QLineEdit" name="profileNameLE"/>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QPushButton" name="removeProfileButton">
|
||||
<property name="text">
|
||||
<string>Profile Name</string>
|
||||
<string>Remove Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="29" column="1">
|
||||
<item row="26" column="1" colspan="7">
|
||||
<widget class="QCheckBox" name="renameFirmware">
|
||||
<property name="text">
|
||||
<string>Append version number to FW file name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="27" column="1" colspan="7">
|
||||
<widget class="QCheckBox" name="burnFirmware">
|
||||
<property name="text">
|
||||
<string>Offer to write FW to Tx after download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="28" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -409,248 +604,6 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="28" column="5">
|
||||
<widget class="QPushButton" name="removeProfileButton">
|
||||
<property name="text">
|
||||
<string>Remove Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1" colspan="2">
|
||||
<widget class="QLineEdit" name="SplashFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="5">
|
||||
<widget class="QPushButton" name="clearImageButton">
|
||||
<property name="text">
|
||||
<string>Clear Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="profileNameLE">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="18" column="1">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="27" column="1" colspan="4">
|
||||
<widget class="QCheckBox" name="renameFirmware">
|
||||
<property name="text">
|
||||
<string>Append version number to FW file name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="28" column="1" colspan="4">
|
||||
<widget class="QCheckBox" name="burnFirmware">
|
||||
<property name="text">
|
||||
<string>Offer to write FW to Tx after download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QComboBox" name="langCombo">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Radio Type</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="1">
|
||||
<widget class="QLineEdit" name="sdPath">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0" colspan="6">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="6">
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Other Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>General Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QLabel" name="sdPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SD Structure path</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QComboBox" name="voiceCombo">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set voice language.
|
||||
May be different from firmware language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="voiceLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Sans Serif</family>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Voice Language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="applicationTab">
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
#include "flashinterface.h"
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <Windows.h>
|
||||
@@ -94,8 +93,6 @@ avrOutputDialog::avrOutputDialog(QWidget *parent, QString prog, QStringList arg,
|
||||
process->start(prog,arg);
|
||||
}
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " Flash");
|
||||
}
|
||||
|
||||
# if !__GNUC__
|
||||
@@ -142,8 +139,8 @@ void avrOutputDialog::doCopy()
|
||||
if (source.open(QIODevice::ReadOnly)) {
|
||||
QFile dest(destFile);
|
||||
if (dest.open(QIODevice::WriteOnly)) {
|
||||
addText(tr("Writing file: "));
|
||||
for (int i=0; i<blocks; i++) {
|
||||
addText(tr("Writing file: "));
|
||||
int read = source.read(buf, BLKSIZE);
|
||||
if (dest.write(buf, read) == read) {
|
||||
dest.flush();
|
||||
@@ -159,11 +156,11 @@ void avrOutputDialog::doCopy()
|
||||
dest.close();
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination"));
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write destination") + ": " + dest.errorString());
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file"));
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot open source file") + ": " + source.errorString());
|
||||
}
|
||||
|
||||
source.close();
|
||||
@@ -438,7 +435,7 @@ void avrOutputDialog::doFinished(int code=0)
|
||||
if (hasErrors || code) {
|
||||
if (!cmdLine.isEmpty()) {
|
||||
if (getProgrammer()!="AVRDUDE") {
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
|
||||
QMessageBox::critical(this, "Companion", getProgrammer() + " " + tr("did not finish correctly"));
|
||||
}
|
||||
else {
|
||||
int res = QMessageBox::question(this, "Companion",getProgrammer() + " " + tr("did not finish correctly!\nDo you want some help ?"),QMessageBox::Yes | QMessageBox::No);
|
||||
@@ -446,8 +443,9 @@ void avrOutputDialog::doFinished(int code=0)
|
||||
errorWizard();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, "Companion", tr("Copy did not finish correctly"));
|
||||
}
|
||||
// reject();
|
||||
}
|
||||
@@ -467,8 +465,6 @@ void avrOutputDialog::doFinished(int code=0)
|
||||
default: //AVR_DIALOG_KEEP_OPEN
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void avrOutputDialog::doProcessStarted()
|
||||
|
||||
@@ -20,7 +20,7 @@ class avrOutputDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit avrOutputDialog(QWidget *parent, QString prog, QStringList arg, QString wTitle, int closeBehaviour=AVR_DIALOG_CLOSE_IF_SUCCESSFUL, bool displayDetails=false);
|
||||
~avrOutputDialog();
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
void waitForFinish();
|
||||
void addReadFuses();
|
||||
|
||||
protected slots:
|
||||
protected slots:
|
||||
void doAddTextStdOut();
|
||||
void doAddTextStdErr();
|
||||
void doProcessStarted();
|
||||
@@ -41,7 +41,7 @@ protected slots:
|
||||
void killTimerElapsed();
|
||||
void errorWizard();
|
||||
|
||||
private:
|
||||
private:
|
||||
QString getProgrammer();
|
||||
Ui::avrOutputDialog *ui;
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ void burnDialog::checkFw(QString fileName)
|
||||
ui->FramFWInfo->show();
|
||||
ui->DateField->setText(flash.getDate() + " " + flash.getTime());
|
||||
ui->versionField->setText(flash.getVersion());
|
||||
ui->ModField->setText(flash.getEEprom());
|
||||
ui->ModField->setText(flash.getEEpromId());
|
||||
|
||||
ui->SplashFrame->hide();
|
||||
if (flash.hasSplash()) {
|
||||
@@ -221,6 +221,7 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
}
|
||||
burnraw=false;
|
||||
int fileType = getFileType(fileName);
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
@@ -229,7 +230,9 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
@@ -409,7 +412,11 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
if (!fileName.isEmpty()) {
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
if (!ui->useFwImageCB->isChecked()) {
|
||||
QImage image = ui->imageLabel->pixmap()->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
|
||||
const QPixmap * pixmap = ui->imageLabel->pixmap();
|
||||
QImage image;
|
||||
if (pixmap) {
|
||||
image = pixmap->toImage().scaled(ui->imageLabel->width(), ui->imageLabel->height());
|
||||
}
|
||||
if (!image.isNull()) {
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString tempFile;
|
||||
@@ -422,7 +429,8 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
if (flash.saveFlash(tempFile) > 0) {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(tempFile);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Cannot save customized firmware"));
|
||||
}
|
||||
@@ -442,6 +450,7 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
hexfileName->clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (hexType==EEPROM_FILE_TYPE) {
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
@@ -486,7 +495,8 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
radioData.generalSettings.vBatCalib=vBatCalib;
|
||||
radioData.generalSettings.PPM_Multiplier=PPM_Multiplier;
|
||||
patch=true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio calibration data in profile, Settings not patched"));
|
||||
}
|
||||
}
|
||||
@@ -540,20 +550,18 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
if (ok)
|
||||
radioData.generalSettings.speakerVolume=byte8u;
|
||||
patch=true;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
|
||||
}
|
||||
|
||||
QString fileName;
|
||||
if (patch) {
|
||||
QString tempDir = QDir::tempPath();
|
||||
fileName = tempDir + "/temp.bin";
|
||||
QString tempDir = QDir::tempPath();
|
||||
QString fileName = tempDir + "/temp.bin";
|
||||
QFile file(fileName);
|
||||
|
||||
uint8_t *eeprom = (uint8_t*)malloc(GetEepromInterface()->getEEpromSize());
|
||||
int eeprom_size = 0;
|
||||
|
||||
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant());
|
||||
int eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber());
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
@@ -567,17 +575,19 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
QTextStream outputStream(&file);
|
||||
|
||||
long result = file.write((char*)eeprom, eeprom_size);
|
||||
if(result!=eeprom_size) {
|
||||
if (result != eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Error writing file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
hexfileName->clear();
|
||||
}
|
||||
|
||||
hexfileName->clear();
|
||||
hexfileName->append(fileName);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
|
||||
@@ -12,7 +12,11 @@
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
macro(_phonon_find_version)
|
||||
file(READ "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h" _phonon_header LIMIT 5000 OFFSET 1000)
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
|
||||
if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
|
||||
file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
|
||||
string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
|
||||
set(PHONON_VERSION "${CMAKE_MATCH_1}")
|
||||
message(STATUS "Phonon Version: ${PHONON_VERSION}")
|
||||
@@ -31,7 +35,7 @@ else(PHONON_FOUND)
|
||||
# then at the default system locations (CMAKE_SYSTEM_PREFIX_PATH, i.e. /usr etc.)
|
||||
find_library(PHONON_LIBRARY NAMES phonon)
|
||||
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h PATHS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR} NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h)
|
||||
|
||||
if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
|
||||
|
||||
@@ -97,18 +97,23 @@ int main(int argc, char *argv[])
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant.id);
|
||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||
g.profile[g.id()].fwName("");
|
||||
}
|
||||
|
||||
|
||||
QPixmap pixmap = QPixmap(g.profile[g.id()].fwType().contains("taranis") ? ":/images/splasht.png" : ":/images/splash.png");
|
||||
QString splashScreen;
|
||||
if ( g.profile[g.id()].fwType().contains("taranis")) splashScreen = ":/images/splasht.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xrpro")) splashScreen = ":/images/splashp.png";
|
||||
else if ( g.profile[g.id()].fwType().contains("9xr")) splashScreen = ":/images/splashr.png";
|
||||
else splashScreen = ":/images/splash.png";
|
||||
|
||||
QPixmap pixmap = QPixmap(splashScreen);
|
||||
QSplashScreen *splash = new QSplashScreen(pixmap);
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
MainWindow *mainWin = new MainWindow();
|
||||
if (g.showSplash()) {
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
<file>images/9xcursphoto.png</file>
|
||||
<file>images/screenshot.png</file>
|
||||
<file>images/splash.png</file>
|
||||
<file>images/splashp.png</file>
|
||||
<file>images/splashr.png</file>
|
||||
<file>images/splasht.png</file>
|
||||
<file>images/companion-title.png</file>
|
||||
<file>images/maps.png</file>
|
||||
@@ -60,7 +62,7 @@
|
||||
<file>images/taranison.png</file>
|
||||
<file>images/wizard/ailerons.png</file>
|
||||
<file>images/wizard/airbrakes.png</file>
|
||||
<file>images/wizard/bank.png</file>
|
||||
<file>images/wizard/elevons.png</file>
|
||||
<file>images/wizard/conclusion.png</file>
|
||||
<file>images/wizard/cyclic.png</file>
|
||||
<file>images/wizard/fblheli.png</file>
|
||||
|
||||
@@ -310,8 +310,8 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color));
|
||||
@@ -333,32 +333,19 @@ void CompareDialog::printPhases()
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table>");
|
||||
int gvars=0;
|
||||
int gvarnum=0;
|
||||
if (GetCurrentFirmware()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars=1;
|
||||
}
|
||||
if (gvars==1) {
|
||||
gvarnum=GetCurrentFirmware()->getCapability(Gvars);
|
||||
}
|
||||
if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
int gvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
if ((gvars && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
str.append("<tr><td style=\"border-style:none;\"> </td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvars)+tr("Gvars")+"</td>");
|
||||
}
|
||||
if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
|
||||
}
|
||||
str.append("</tr><tr><td align=center><b>"+tr("Flight mode name")+"</b></td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (i=0; i<gvarnum; i++) {
|
||||
for (i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model1->gvars_names[i]));
|
||||
}
|
||||
}
|
||||
@@ -367,13 +354,13 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd1->name).arg(color));
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (k=0; k<gvarnum; k++) {
|
||||
for (k=0; k<gvars; k++) {
|
||||
color=getColor1(pd1->gvars[k],pd2->gvars[k]);
|
||||
if (pd1->gvars[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\" width=\"40\"><font size=+1 face='Courier New' color=%2>%1").arg(pd1->gvars[k]).arg(color)+"</font></td>");
|
||||
@@ -412,8 +399,8 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor2(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color));
|
||||
@@ -436,18 +423,18 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</table>");
|
||||
|
||||
if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
if ((gvars && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append("<br><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
str.append("<tr><td style=\"border-style:none;\"> </td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvarnum)+tr("Gvars")+"</td>");
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(gvars)+tr("Gvars")+"</td>");
|
||||
}
|
||||
if (GetCurrentFirmware()->getCapability(RotaryEncoders)) {
|
||||
str.append(QString("<td colspan=%1 align=center><b>").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"</td>");
|
||||
}
|
||||
str.append("</tr><tr><td align=center ><b>"+tr("Flight mode name")+"</b></td>");
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (i=0; i<gvarnum; i++) {
|
||||
for (i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"40\" align=\"center\"><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model2->gvars_names[i]));
|
||||
}
|
||||
}
|
||||
@@ -456,13 +443,13 @@ void CompareDialog::printPhases()
|
||||
}
|
||||
str.append("</tr>");
|
||||
for (i=0; i<GetCurrentFirmware()->getCapability(FlightModes); i++) {
|
||||
PhaseData *pd1=&g_model1->phaseData[i];
|
||||
PhaseData *pd2=&g_model2->phaseData[i];
|
||||
FlightModeData *pd1=&g_model1->flightModeData[i];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> ").arg(i));
|
||||
color=getColor1(pd1->name,pd2->name);
|
||||
str.append(QString("<font size=+1 face='Courier New' color=%2>%1</font></td>").arg(pd2->name).arg(color));
|
||||
if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) {
|
||||
for (k=0; k<gvarnum; k++) {
|
||||
for (k=0; k<gvars; k++) {
|
||||
color=getColor1(pd1->gvars[k],pd2->gvars[k]);
|
||||
if (pd2->gvars[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\" width=\"40\"><font size=+1 face='Courier New' color=%2>%1").arg(pd2->gvars[k]).arg(color)+"</font></td>");
|
||||
@@ -562,28 +549,23 @@ void CompareDialog::printLimits()
|
||||
void CompareDialog::printGvars()
|
||||
{
|
||||
QString color;
|
||||
int gvars=0;
|
||||
int gvarnum=0;
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!GetCurrentFirmware()->getCapability(HasVariants) && GetCurrentFirmware()->getCapability(Gvars))) {
|
||||
gvars=1;
|
||||
gvarnum=GetCurrentFirmware()->getCapability(Gvars);
|
||||
}
|
||||
int gvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
|
||||
if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) {
|
||||
if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && gvars) {
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td colspan=2><h2>"+tr("Global Variables")+"</h2></td></tr>");
|
||||
str.append("<tr><td width=50%>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=100>");
|
||||
PhaseData *pd1=&g_model1->phaseData[0];
|
||||
PhaseData *pd2=&g_model2->phaseData[0];
|
||||
int width=100/gvarnum;
|
||||
FlightModeData *pd1=&g_model1->flightModeData[0];
|
||||
FlightModeData *pd2=&g_model2->flightModeData[0];
|
||||
int width = 100 / gvars;
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><b>").arg(width)+tr("GV")+QString("%1</b></td>").arg(i+1));
|
||||
}
|
||||
str.append("</tr>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
color=getColor1(pd1->gvars[i],pd2->gvars[i]);
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><font color=%2>").arg(width).arg(color)+QString("%1</font></td>").arg(pd1->gvars[i]));
|
||||
}
|
||||
@@ -591,12 +573,12 @@ void CompareDialog::printGvars()
|
||||
str.append("</table></td><td width=50%>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=100>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><b>").arg(width)+tr("GV")+QString("%1</b></td>").arg(i+1));
|
||||
}
|
||||
str.append("</tr>");
|
||||
str.append("<tr>");
|
||||
for(int i=0; i<gvarnum; i++) {
|
||||
for (int i=0; i<gvars; i++) {
|
||||
color=getColor2(pd1->gvars[i],pd2->gvars[i]);
|
||||
str.append(QString("<td width=\"%1%\" align=\"center\"><font color=%2>").arg(width).arg(color)+QString("%1</font></td>").arg(pd2->gvars[i]));
|
||||
}
|
||||
@@ -673,7 +655,7 @@ void CompareDialog::printExpos()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(ed->phases & mask)) {
|
||||
PhaseData *pd = &g_model1->phaseData[j];
|
||||
FlightModeData *pd = &g_model1->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -751,7 +733,7 @@ void CompareDialog::printExpos()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(ed->phases & mask)) {
|
||||
PhaseData *pd = &g_model2->phaseData[j];
|
||||
FlightModeData *pd = &g_model2->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -821,7 +803,7 @@ void CompareDialog::printMixers()
|
||||
break;
|
||||
};
|
||||
str += QString(" %1").arg(getGVarString(md->weight)).rightJustified(6, ' ');
|
||||
str += md->srcRaw.toString();
|
||||
str += md->srcRaw.toString(*g_model1);
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
@@ -849,7 +831,7 @@ void CompareDialog::printMixers()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(md->phases & mask)) {
|
||||
PhaseData *pd = &g_model1->phaseData[j];
|
||||
FlightModeData *pd = &g_model1->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -899,7 +881,7 @@ void CompareDialog::printMixers()
|
||||
break;
|
||||
};
|
||||
str += QString(" %1").arg(getGVarString(md->weight)).rightJustified(6, ' ');
|
||||
str += md->srcRaw.toString();
|
||||
str += md->srcRaw.toString(*g_model2);
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
@@ -928,7 +910,7 @@ void CompareDialog::printMixers()
|
||||
first=1;
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(FlightModes);j++) {
|
||||
if (!(md->phases & mask)) {
|
||||
PhaseData *pd = &g_model2->phaseData[j];
|
||||
FlightModeData *pd = &g_model2->flightModeData[j];
|
||||
if (!first) {
|
||||
str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name));
|
||||
} else {
|
||||
@@ -1043,8 +1025,9 @@ void CompareDialog::printSwitches()
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
|
||||
QString sw1 = g_model1->customSw[i].toString(*g_model1);
|
||||
QString sw2 = g_model2->customSw[i].toString(*g_model2);
|
||||
GeneralSettings settings;
|
||||
QString sw1 = g_model1->customSw[i].toString(*g_model1, settings);
|
||||
QString sw2 = g_model2->customSw[i].toString(*g_model2, settings);
|
||||
if (!(sw1.isEmpty() && sw2.isEmpty())) {
|
||||
str.append("<tr>");
|
||||
color=getColor1(sw1,sw2);
|
||||
|
||||
@@ -19,6 +19,7 @@ class CompareDialog : public QDialog
|
||||
~CompareDialog();
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
ModelData * g_model1;
|
||||
ModelData * g_model2;
|
||||
ModelData * modeltemp;
|
||||
|
||||
@@ -15,7 +15,11 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="textEditor"/>
|
||||
<widget class="QTextEdit" name="textEditor">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <list>
|
||||
#include <float.h>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
#include "firmwares/th9x/th9xinterface.h"
|
||||
@@ -91,11 +92,13 @@ QString getGVarString(int16_t val, bool sign)
|
||||
}
|
||||
}
|
||||
|
||||
RawSourceRange RawSource::getRange(bool singleprec)
|
||||
RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags) const
|
||||
{
|
||||
RawSourceRange result;
|
||||
|
||||
int board = GetEepromInterface()->getBoard();
|
||||
FirmwareInterface * firmware = GetCurrentFirmware();
|
||||
int board = firmware->getBoard();
|
||||
bool singleprec = (flags & RANGE_SINGLE_PRECISION);
|
||||
|
||||
if (!singleprec && !IS_ARM(board)) {
|
||||
singleprec = true;
|
||||
@@ -103,11 +106,16 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
||||
|
||||
switch (type) {
|
||||
case SOURCE_TYPE_TELEMETRY:
|
||||
if (singleprec) {
|
||||
result.offset = -DBL_MAX;
|
||||
}
|
||||
|
||||
switch (index) {
|
||||
case TELEMETRY_SOURCE_TX_BATT:
|
||||
result.step = 0.1;
|
||||
result.decimals = 1;
|
||||
result.max = 25.5;
|
||||
result.unit = QObject::tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_TX_TIME:
|
||||
result.step = 1;
|
||||
@@ -116,32 +124,42 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
||||
case TELEMETRY_SOURCE_TIMER1:
|
||||
case TELEMETRY_SOURCE_TIMER2:
|
||||
result.step = singleprec ? 5 : 1;
|
||||
result.max = singleprec ? 255*5 : 7200;
|
||||
result.max = singleprec ? 255*5 : 60*60;
|
||||
result.unit = QObject::tr("s");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RSSI_TX:
|
||||
case TELEMETRY_SOURCE_RSSI_RX:
|
||||
result.max = 100;
|
||||
if (singleprec) result.offset = 128;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_A1_MIN:
|
||||
case TELEMETRY_SOURCE_A2_MIN:
|
||||
case TELEMETRY_SOURCE_A3_MIN:
|
||||
case TELEMETRY_SOURCE_A4_MIN:
|
||||
result = model.frsky.channels[index-TELEMETRY_SOURCE_A1_MIN].getRange();
|
||||
break;
|
||||
case TELEMETRY_SOURCE_A1:
|
||||
case TELEMETRY_SOURCE_A2:
|
||||
if (model) {
|
||||
const FrSkyChannelData & channel = model->frsky.channels[index-TELEMETRY_SOURCE_A1];
|
||||
float ratio = channel.getRatio();
|
||||
if (channel.type==0 || channel.type==1 || channel.type==2)
|
||||
result.decimals = 2;
|
||||
else
|
||||
result.decimals = 0;
|
||||
result.step = ratio / 255;
|
||||
result.min = channel.offset * result.step;
|
||||
result.max = ratio + result.min;
|
||||
}
|
||||
case TELEMETRY_SOURCE_A3:
|
||||
case TELEMETRY_SOURCE_A4:
|
||||
result = model.frsky.channels[index-TELEMETRY_SOURCE_A1].getRange();
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ALT:
|
||||
case TELEMETRY_SOURCE_ALT_MIN:
|
||||
case TELEMETRY_SOURCE_ALT_MAX:
|
||||
case TELEMETRY_SOURCE_GPS_ALT:
|
||||
result.step = singleprec ? 8 : 1;
|
||||
result.min = -500;
|
||||
result.max = singleprec ? 1540 : 3000;
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step = (result.step * 105) / 32;
|
||||
result.min = (result.min * 105) / 32;
|
||||
result.max = (result.max * 105) / 32;
|
||||
result.unit = QObject::tr("ft");
|
||||
}
|
||||
else {
|
||||
result.unit = QObject::tr("m");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_T1:
|
||||
case TELEMETRY_SOURCE_T1_MAX:
|
||||
@@ -149,89 +167,133 @@ RawSourceRange RawSource::getRange(bool singleprec)
|
||||
case TELEMETRY_SOURCE_T2_MAX:
|
||||
result.min = -30;
|
||||
result.max = 225;
|
||||
result.unit = QObject::trUtf8("°C");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_HDG:
|
||||
result.step = singleprec ? 2 : 1;
|
||||
result.max = 360;
|
||||
if (singleprec) result.offset = 256;
|
||||
result.unit = QObject::trUtf8("°");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_RPM:
|
||||
case TELEMETRY_SOURCE_RPM_MAX:
|
||||
result.step = singleprec ? 50 : 1;
|
||||
result.max = singleprec ? 12750 : 20000;
|
||||
result.max = singleprec ? 12750 : 30000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_FUEL:
|
||||
result.max = 100;
|
||||
result.unit = QObject::tr("%");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ASPEED:
|
||||
case TELEMETRY_SOURCE_ASPEED_MAX:
|
||||
case TELEMETRY_SOURCE_SPEED:
|
||||
case TELEMETRY_SOURCE_SPEED_MAX:
|
||||
result.step = singleprec ? 4 : 1;
|
||||
result.max = singleprec ? (4*236) : 2000;
|
||||
if (model && !model->frsky.imperial) {
|
||||
result.step = singleprec ? 2 : 1;
|
||||
result.max = singleprec ? (2*255) : 2000;
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step *= 1.150779;
|
||||
result.max *= 1.150779;
|
||||
result.unit = QObject::tr("mph");
|
||||
}
|
||||
else {
|
||||
result.step *= 1.852;
|
||||
result.max *= 1.852;
|
||||
result.unit = QObject::tr("km/h");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_VERTICAL_SPEED:
|
||||
result.step = 0.1;
|
||||
result.min = -12.5;
|
||||
result.max = 13.0;
|
||||
result.min = singleprec ? -12.5 : -300.0;
|
||||
result.max = singleprec ? 13.0 : 300.0;
|
||||
result.decimals = 1;
|
||||
result.unit = QObject::tr("m/s");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_DTE:
|
||||
result.max = 30000;
|
||||
break;
|
||||
case TELEMETRY_SOURCE_DIST:
|
||||
case TELEMETRY_SOURCE_DIST_MAX:
|
||||
result.step = singleprec ? 8 : 1;
|
||||
result.max = singleprec ? 2040 : 10000;
|
||||
result.unit = QObject::tr("m");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELL:
|
||||
case TELEMETRY_SOURCE_CELL_MIN:
|
||||
result.step = singleprec ? 0.02 : 0.01;
|
||||
result.max = 5.1;
|
||||
result.decimals = 2;
|
||||
result.unit = QObject::tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELLS_SUM:
|
||||
case TELEMETRY_SOURCE_CELLS_MIN:
|
||||
case TELEMETRY_SOURCE_VFAS:
|
||||
case TELEMETRY_SOURCE_VFAS_MIN:
|
||||
result.step = 0.1;
|
||||
result.max = 25.5;
|
||||
result.max = singleprec ? 25.5 : 100.0;
|
||||
result.decimals = 1;
|
||||
result.unit = QObject::tr("V");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CURRENT:
|
||||
case TELEMETRY_SOURCE_CURRENT_MAX:
|
||||
result.step = singleprec ? 0.5 : 0.1;
|
||||
result.max = singleprec ? 127.5 : 200.0;
|
||||
result.decimals = 1;
|
||||
result.unit = QObject::tr("A");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CONSUMPTION:
|
||||
result.step = singleprec ? 100 : 1;
|
||||
result.max = singleprec ? 25500 : 10000;
|
||||
result.unit = QObject::tr("mAh");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_POWER:
|
||||
case TELEMETRY_SOURCE_POWER_MAX:
|
||||
result.step = singleprec ? 5 : 1;
|
||||
result.max = singleprec ? 1275 : 2000;
|
||||
result.unit = QObject::tr("W");
|
||||
break;
|
||||
case TELEMETRY_SOURCE_ACCX:
|
||||
case TELEMETRY_SOURCE_ACCY:
|
||||
case TELEMETRY_SOURCE_ACCZ:
|
||||
result.step = 0.01;
|
||||
result.decimals = 2;
|
||||
result.max = 2.55;
|
||||
result.max = singleprec ? 2.55 : 10.00;
|
||||
result.min = singleprec ? 0 : -10.00;
|
||||
result.unit = QObject::tr("g");
|
||||
break;
|
||||
default:
|
||||
result.max = 125;
|
||||
break;
|
||||
}
|
||||
if (singleprec && !result.offset) {
|
||||
|
||||
if (singleprec && result.offset==-DBL_MAX) {
|
||||
result.offset = result.max - (127*result.step);
|
||||
}
|
||||
|
||||
if (flags & (RANGE_DELTA_FUNCTION|RANGE_DELTA_ABS_FUNCTION)) {
|
||||
if (singleprec) {
|
||||
result.offset = 0;
|
||||
result.min = result.step * -127;
|
||||
result.max = result.step * 127;
|
||||
}
|
||||
else {
|
||||
result.min = -result.max;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
result.max = (model && model->extendedLimits ? 125 : 100);
|
||||
result.min = - result.max;
|
||||
case SOURCE_TYPE_GVAR:
|
||||
result.max = 1024;
|
||||
result.min = -result.max;
|
||||
break;
|
||||
|
||||
default:
|
||||
result.max = (model.extendedLimits ? 125 : 100);
|
||||
result.min = -result.max;
|
||||
break;
|
||||
}
|
||||
|
||||
if (flags & RANGE_DELTA_ABS_FUNCTION) {
|
||||
result.min = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -255,7 +317,7 @@ QString RotaryEncoderString(int index)
|
||||
return CHECK_IN_ARRAY(rotary, index);
|
||||
}
|
||||
|
||||
QString RawSource::toString()
|
||||
QString RawSource::toString(const ModelData & model)
|
||||
{
|
||||
static const QString trims[] = {
|
||||
QObject::tr("TrmR"), QObject::tr("TrmE"), QObject::tr("TrmT"), QObject::tr("TrmA")
|
||||
@@ -263,7 +325,7 @@ QString RawSource::toString()
|
||||
|
||||
static const QString telemetry[] = {
|
||||
QObject::tr("Batt"), QObject::tr("Time"), QObject::tr("Timer1"), QObject::tr("Timer2"),
|
||||
QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"), QObject::tr("Rx Batt"),
|
||||
QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"),
|
||||
QObject::tr("A1"), QObject::tr("A2"), QObject::tr("A3"), QObject::tr("A4"),
|
||||
QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"), QObject::tr("T2"),
|
||||
QObject::tr("Speed"), QObject::tr("Dist"), QObject::tr("GPS Alt"),
|
||||
@@ -290,11 +352,13 @@ QString RawSource::toString()
|
||||
case SOURCE_TYPE_VIRTUAL_INPUT:
|
||||
{
|
||||
QString result = QObject::tr("[I%1]").arg(index+1);
|
||||
if (model && strlen(model->inputNames[index]) > 0) {
|
||||
result += QString(model->inputNames[index]);
|
||||
if (strlen(model.inputNames[index]) > 0) {
|
||||
result += QString(model.inputNames[index]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
case SOURCE_TYPE_LUA_OUTPUT:
|
||||
return QObject::tr("LUA%1%2").arg(index/16+1).arg(QChar('a'+index%16));
|
||||
case SOURCE_TYPE_STICK:
|
||||
return AnalogString(index);
|
||||
case SOURCE_TYPE_TRIM:
|
||||
@@ -457,6 +521,16 @@ CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
return LS_FAMILY_VCOMP;
|
||||
}
|
||||
|
||||
unsigned int LogicalSwitchData::getRangeFlags()
|
||||
{
|
||||
if (func == LS_FN_DPOS)
|
||||
return RANGE_DELTA_FUNCTION;
|
||||
else if (func == LS_FN_DAPOS)
|
||||
return RANGE_DELTA_ABS_FUNCTION;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::funcToString()
|
||||
{
|
||||
switch (func) {
|
||||
@@ -507,7 +581,7 @@ QString LogicalSwitchData::funcToString()
|
||||
}
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::toString(const ModelData & model)
|
||||
QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettings & settings)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
@@ -528,11 +602,11 @@ QString LogicalSwitchData::toString(const ModelData & model)
|
||||
result += QObject::tr("Timer(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2));
|
||||
break;
|
||||
case LS_FAMILY_VOFS: {
|
||||
RawSource source = RawSource(val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
RawSource source = RawSource(val1);
|
||||
RawSourceRange range = source.getRange(model, settings);
|
||||
QString res;
|
||||
if (val1)
|
||||
res += source.toString();
|
||||
res += source.toString(model);
|
||||
else
|
||||
res += "0";
|
||||
res.remove(" ");
|
||||
@@ -543,7 +617,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
|
||||
else if (func == LS_FN_DPOS) result = "d(" + res + ")";
|
||||
result += res;
|
||||
|
||||
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DAPOS || func == LS_FN_DPOS)
|
||||
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 += " < ";
|
||||
@@ -575,7 +649,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
|
||||
|
||||
case LS_FAMILY_VCOMP:
|
||||
if (val1)
|
||||
result += RawSource(val1).toString();
|
||||
result += RawSource(val1).toString(model);
|
||||
else
|
||||
result += "0";
|
||||
switch (func) {
|
||||
@@ -603,7 +677,7 @@ QString LogicalSwitchData::toString(const ModelData & model)
|
||||
break;
|
||||
}
|
||||
if (val2)
|
||||
result += RawSource(val2).toString();
|
||||
result += RawSource(val2).toString(model);
|
||||
else
|
||||
result += "0";
|
||||
break;
|
||||
@@ -713,8 +787,9 @@ QStringList FuncSwData::toStringList()
|
||||
|
||||
QString FuncSwData::funcToString()
|
||||
{
|
||||
ModelData model;
|
||||
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
|
||||
return QObject::tr("Safety %1").arg(RawSource(SOURCE_TYPE_CH, func).toString());
|
||||
return QObject::tr("Safety %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
|
||||
else if (func == FuncTrainer)
|
||||
return QObject::tr("Trainer");
|
||||
else if (func == FuncTrainerRUD)
|
||||
@@ -793,7 +868,8 @@ QString FuncSwData::paramToString()
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
RawSource item(param);
|
||||
return item.toString();
|
||||
ModelData model;
|
||||
return item.toString(model);
|
||||
}
|
||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
||||
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||
@@ -803,15 +879,16 @@ QString FuncSwData::paramToString()
|
||||
}
|
||||
}
|
||||
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
|
||||
ModelData model;
|
||||
switch (adjustMode) {
|
||||
case 0:
|
||||
return QObject::tr("Value ")+QString("%1").arg(param);
|
||||
break;
|
||||
case 1:
|
||||
return RawSource(param).toString();
|
||||
return RawSource(param).toString(model);
|
||||
break;
|
||||
case 2:
|
||||
return RawSource(param).toString();
|
||||
return RawSource(param).toString(model);
|
||||
break;
|
||||
case 3:
|
||||
if (param==0) {
|
||||
@@ -852,11 +929,16 @@ GeneralSettings::GeneralSettings()
|
||||
calibSpanPos[i] = 0x180;
|
||||
}
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
BoardEnum board = GetEepromInterface()->getBoard();
|
||||
if (IS_TARANIS(board)) {
|
||||
potsType[0] = 1;
|
||||
potsType[1] = 1;
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
speakerVolume = 12;
|
||||
}
|
||||
|
||||
templateSetup = g.profile[g.id()].channelOrder();
|
||||
stickMode = g.profile[g.id()].defaultMode();
|
||||
|
||||
@@ -986,12 +1068,34 @@ int GeneralSettings::getDefaultChannel(unsigned int stick) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
float FrSkyChannelData::getRatio() const
|
||||
{
|
||||
if (type==0 || type==1 || type==2)
|
||||
return float(ratio << multiplier) / 10.0;
|
||||
else
|
||||
return ratio << multiplier;
|
||||
}
|
||||
|
||||
RawSourceRange FrSkyChannelData::getRange() const
|
||||
{
|
||||
RawSourceRange result;
|
||||
float ratio = getRatio();
|
||||
if (type==0 || type==1 || type==2)
|
||||
result.decimals = 2;
|
||||
else
|
||||
result.decimals = 0;
|
||||
result.step = ratio / 255;
|
||||
result.min = offset * result.step;
|
||||
result.max = ratio + result.min;
|
||||
result.unit = QObject::tr("V");
|
||||
return result;
|
||||
}
|
||||
|
||||
void FrSkyData::clear()
|
||||
{
|
||||
memset(this, 0, sizeof(FrSkyData));
|
||||
rssiAlarms[0].clear(2, 45);
|
||||
rssiAlarms[1].clear(3, 42);
|
||||
rxBattAlarms[1] = round(43.0*255/132);
|
||||
varioSource = 2/*VARIO*/;
|
||||
blades = 2;
|
||||
}
|
||||
@@ -1009,13 +1113,6 @@ ModelData::ModelData(const ModelData & src)
|
||||
ModelData & ModelData::operator = (const ModelData & src)
|
||||
{
|
||||
memcpy(this, &src, sizeof(ModelData));
|
||||
|
||||
for (int i=0; i<C9X_MAX_MIXERS; i++)
|
||||
mixData[i].srcRaw.model = this;
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++)
|
||||
expoData[i].srcRaw.model = this;
|
||||
swashRingData.collectiveSource.model = this;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -1039,14 +1136,34 @@ bool ModelData::isInputValid(const unsigned int idx) const
|
||||
|
||||
void ModelData::removeInput(const int idx)
|
||||
{
|
||||
unsigned int chn = expoData[idx].chn;
|
||||
|
||||
memmove(&expoData[idx], &expoData[idx+1], (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData));
|
||||
expoData[C9X_MAX_EXPOS-1].clear();
|
||||
|
||||
//also remove input name if removing last line for this input
|
||||
bool found = false;
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
if (expoData[i].mode==0) continue;
|
||||
if (expoData[i].chn==chn) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) inputNames[chn][0] = 0;
|
||||
}
|
||||
|
||||
void ModelData::clearInputs()
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++)
|
||||
expoData[i].clear();
|
||||
|
||||
//clear all input names
|
||||
if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
|
||||
for (int i=0; i<C9X_MAX_INPUTS; i++) {
|
||||
inputNames[i][0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ModelData::clearMixes()
|
||||
@@ -1073,11 +1190,11 @@ void ModelData::clear()
|
||||
moduleData[0].protocol=PPM;
|
||||
moduleData[1].protocol=OFF;
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++)
|
||||
phaseData[i].clear();
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
flightModeData[i].clear();
|
||||
}
|
||||
clearInputs();
|
||||
clearMixes();
|
||||
|
||||
for (int i=0; i<C9X_NUM_CHNOUT; i++)
|
||||
limitData[i].clear();
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
@@ -1088,7 +1205,6 @@ void ModelData::clear()
|
||||
curves[i].clear(5);
|
||||
for (int i=0; i<2; i++)
|
||||
timers[i].clear();
|
||||
|
||||
swashRingData.clear();
|
||||
frsky.clear();
|
||||
}
|
||||
@@ -1107,7 +1223,7 @@ void ModelData::setDefaultInputs(const GeneralSettings & settings)
|
||||
expo->mode = INPUT_MODE_BOTH;
|
||||
expo->srcRaw = settings.getDefaultSource(i);
|
||||
expo->weight = 100;
|
||||
strncpy(inputNames[i], expo->srcRaw.toString().toLatin1().constData(), sizeof(inputNames[i])-1);
|
||||
strncpy(inputNames[i], expo->srcRaw.toString(*this).toLatin1().constData(), sizeof(inputNames[i])-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1123,7 +1239,7 @@ void ModelData::setDefaultMixes(const GeneralSettings & settings)
|
||||
mix->destCh = i+1;
|
||||
mix->weight = 100;
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, this);
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
|
||||
}
|
||||
else {
|
||||
mix->srcRaw = RawSource(SOURCE_TYPE_STICK, i);
|
||||
@@ -1144,7 +1260,7 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
|
||||
{
|
||||
int result = 0;
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
PhaseData & phase = phaseData[phaseIdx];
|
||||
FlightModeData & phase = flightModeData[phaseIdx];
|
||||
if (phase.trimMode[trimIdx] < 0) {
|
||||
return result;
|
||||
}
|
||||
@@ -1164,10 +1280,27 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
|
||||
{
|
||||
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
|
||||
}
|
||||
|
||||
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
|
||||
{
|
||||
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
int nextPhase = idx - 1025;
|
||||
if (nextPhase >= phaseIdx) nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
idx = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
|
||||
{
|
||||
for (uint8_t i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
PhaseData & phase = phaseData[phaseIdx];
|
||||
FlightModeData & phase = flightModeData[phaseIdx];
|
||||
int mode = phase.trimMode[trimIdx];
|
||||
int p = phase.trimRef[trimIdx];
|
||||
int & trim = phase.trim[trimIdx];
|
||||
@@ -1194,9 +1327,9 @@ void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
|
||||
void ModelData::removeGlobalVar(int & var)
|
||||
{
|
||||
if (var >= 126 && var <= 130)
|
||||
var = phaseData[0].gvars[var-126];
|
||||
var = flightModeData[0].gvars[var-126];
|
||||
else if (var <= -126 && var >= -130)
|
||||
var = - phaseData[0].gvars[-126-var];
|
||||
var = - flightModeData[0].gvars[-126-var];
|
||||
}
|
||||
|
||||
ModelData ModelData::removeGlobalVars()
|
||||
@@ -1217,6 +1350,14 @@ ModelData ModelData::removeGlobalVars()
|
||||
return result;
|
||||
}
|
||||
|
||||
int ModelData::getChannelsMax()
|
||||
{
|
||||
if (extendedLimits)
|
||||
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
|
||||
else
|
||||
return 100;
|
||||
}
|
||||
|
||||
QList<EEPROMInterface *> eepromInterfaces;
|
||||
void RegisterEepromInterfaces()
|
||||
{
|
||||
@@ -1244,8 +1385,8 @@ void UnregisterEepromInterfaces()
|
||||
}
|
||||
|
||||
QList<FirmwareInterface *> firmwares;
|
||||
FirmwareVariant default_firmware_variant;
|
||||
FirmwareVariant current_firmware_variant;
|
||||
FirmwareInterface * default_firmware_variant;
|
||||
FirmwareInterface * current_firmware_variant;
|
||||
|
||||
void UnregisterFirmwares()
|
||||
{
|
||||
@@ -1309,15 +1450,11 @@ QString getBoardName(BoardEnum board)
|
||||
}
|
||||
}
|
||||
|
||||
FirmwareVariant GetFirmwareVariant(QString id)
|
||||
FirmwareInterface * GetFirmware(QString id)
|
||||
{
|
||||
FirmwareVariant result;
|
||||
|
||||
foreach(FirmwareInterface * firmware, firmwares) {
|
||||
if (id.contains(firmware->getId()+"-") || (!id.contains("-") && id.contains(firmware->getId()))) {
|
||||
result.id = id;
|
||||
result.firmware = firmware;
|
||||
result.variant = firmware->getVariant(id);
|
||||
FirmwareInterface * result = firmware->getFirmwareVariant(id);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -1331,20 +1468,21 @@ void FirmwareInterface::addOption(const char *option, QString tooltip, uint32_t
|
||||
addOptions(options);
|
||||
}
|
||||
|
||||
unsigned int FirmwareInterface::getVariant(const QString & variantId)
|
||||
unsigned int FirmwareInterface::getVariantNumber()
|
||||
{
|
||||
unsigned int variant = variantBase;
|
||||
QStringList options = variantId.mid(id.length()+1).split("-", QString::SkipEmptyParts);
|
||||
unsigned int result = 0;
|
||||
const FirmwareInterface * base = getFirmwareBase();
|
||||
QStringList options = id.mid(base->getId().length()+1).split("-", QString::SkipEmptyParts);
|
||||
foreach(QString option, options) {
|
||||
foreach(QList<Option> group, opts) {
|
||||
foreach(QList<Option> group, base->opts) {
|
||||
foreach(Option opt, group) {
|
||||
if (opt.name == option) {
|
||||
variant += opt.variant;
|
||||
result += opt.variant;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return variant;
|
||||
return result;
|
||||
}
|
||||
|
||||
void FirmwareInterface::addLanguage(const char *lang)
|
||||
|
||||
@@ -229,7 +229,6 @@ enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_SWR,
|
||||
TELEMETRY_SOURCE_RSSI_TX,
|
||||
TELEMETRY_SOURCE_RSSI_RX,
|
||||
TELEMETRY_SOURCE_RX_BATT,
|
||||
TELEMETRY_SOURCE_A1,
|
||||
TELEMETRY_SOURCE_A2,
|
||||
TELEMETRY_SOURCE_A3,
|
||||
@@ -253,7 +252,7 @@ enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_ACCZ,
|
||||
TELEMETRY_SOURCE_HDG,
|
||||
TELEMETRY_SOURCE_VERTICAL_SPEED,
|
||||
TELEMETRY_SOURCE_ASPD,
|
||||
TELEMETRY_SOURCE_ASPEED,
|
||||
TELEMETRY_SOURCE_DTE,
|
||||
TELEMETRY_SOURCE_A1_MIN,
|
||||
TELEMETRY_SOURCE_A2_MIN,
|
||||
@@ -287,7 +286,7 @@ enum TelemetrySource {
|
||||
enum RawSourceType {
|
||||
SOURCE_TYPE_NONE,
|
||||
SOURCE_TYPE_VIRTUAL_INPUT,
|
||||
SOURCE_TYPE_LUA_INPUT,
|
||||
SOURCE_TYPE_LUA_OUTPUT,
|
||||
SOURCE_TYPE_STICK, // and POTS
|
||||
SOURCE_TYPE_ROTARY_ENCODER,
|
||||
SOURCE_TYPE_TRIM,
|
||||
@@ -328,29 +327,31 @@ class RawSourceRange
|
||||
double max;
|
||||
double step;
|
||||
double offset;
|
||||
|
||||
QString unit;
|
||||
};
|
||||
|
||||
#define RANGE_SINGLE_PRECISION 1
|
||||
#define RANGE_DELTA_FUNCTION 2
|
||||
#define RANGE_DELTA_ABS_FUNCTION 4
|
||||
|
||||
class GeneralSettings;
|
||||
class RawSource {
|
||||
public:
|
||||
RawSource():
|
||||
type(SOURCE_TYPE_NONE),
|
||||
index(0),
|
||||
model(NULL)
|
||||
index(0)
|
||||
{
|
||||
}
|
||||
|
||||
RawSource(int value, const ModelData * model=NULL):
|
||||
RawSource(int value):
|
||||
type(RawSourceType(abs(value)/65536)),
|
||||
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536)),
|
||||
model(model)
|
||||
index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536))
|
||||
{
|
||||
}
|
||||
|
||||
RawSource(RawSourceType type, int index=0, const ModelData * model=NULL):
|
||||
RawSource(RawSourceType type, int index=0):
|
||||
type(type),
|
||||
index(index),
|
||||
model(model)
|
||||
index(index)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -359,9 +360,9 @@ class RawSource {
|
||||
return index >= 0 ? (type * 65536 + index) : -(type * 65536 - index);
|
||||
}
|
||||
|
||||
QString toString();
|
||||
QString toString(const ModelData & model);
|
||||
|
||||
RawSourceRange getRange(bool singleprec=false);
|
||||
RawSourceRange getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags=0) const;
|
||||
|
||||
bool operator == ( const RawSource & other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
@@ -371,9 +372,13 @@ class RawSource {
|
||||
return (this->type != other.type) || (this->index != other.index);
|
||||
}
|
||||
|
||||
bool isTimeBased() const
|
||||
{
|
||||
return (type==SOURCE_TYPE_TELEMETRY && (index==TELEMETRY_SOURCE_TX_TIME || index==TELEMETRY_SOURCE_TIMER1 || index==TELEMETRY_SOURCE_TIMER2));
|
||||
}
|
||||
|
||||
RawSourceType type;
|
||||
int index;
|
||||
const ModelData * model;
|
||||
};
|
||||
|
||||
enum RawSwitchType {
|
||||
@@ -496,7 +501,6 @@ class GeneralSettings {
|
||||
bool disableBG;
|
||||
unsigned int splashMode;
|
||||
int splashDuration;
|
||||
uint8_t filterInput; // TODO enum
|
||||
unsigned int backlightDelay;
|
||||
bool blightinv;
|
||||
bool stickScroll;
|
||||
@@ -517,6 +521,7 @@ class GeneralSettings {
|
||||
unsigned int gpsFormat;
|
||||
int speakerVolume;
|
||||
unsigned int backlightBright;
|
||||
int switchesDelay;
|
||||
int currentCalib;
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
@@ -635,6 +640,8 @@ enum MltpxValue {
|
||||
MLTPX_REP=2
|
||||
};
|
||||
|
||||
#define MIXDATA_NAME_LEN 10
|
||||
|
||||
class MixData {
|
||||
public:
|
||||
MixData() { clear(); }
|
||||
@@ -653,7 +660,7 @@ class MixData {
|
||||
unsigned int mixWarn; // mixer warning
|
||||
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
|
||||
int sOffset;
|
||||
char name[10+1];
|
||||
char name[MIXDATA_NAME_LEN+1];
|
||||
|
||||
void clear() { memset(this, 0, sizeof(MixData)); }
|
||||
};
|
||||
@@ -709,8 +716,9 @@ class LogicalSwitchData { // Logical Switches data
|
||||
int andsw;
|
||||
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
|
||||
CSFunctionFamily getFunctionFamily();
|
||||
unsigned int getRangeFlags();
|
||||
QString funcToString();
|
||||
QString toString(const ModelData & model);
|
||||
QString toString(const ModelData & model, const GeneralSettings & settings);
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
@@ -759,9 +767,9 @@ class FuncSwData { // Function Switches data
|
||||
QStringList toStringList();
|
||||
};
|
||||
|
||||
class PhaseData {
|
||||
class FlightModeData {
|
||||
public:
|
||||
PhaseData() { clear(); }
|
||||
FlightModeData() { clear(); }
|
||||
int trimMode[NUM_STICKS];
|
||||
int trimRef[NUM_STICKS];
|
||||
int trim[NUM_STICKS];
|
||||
@@ -771,7 +779,7 @@ class PhaseData {
|
||||
unsigned int fadeOut;
|
||||
int rotaryEncoders[2];
|
||||
int gvars[C9X_MAX_GVARS];
|
||||
void clear() { memset(this, 0, sizeof(PhaseData)); }
|
||||
void clear() { memset(this, 0, sizeof(FlightModeData)); }
|
||||
};
|
||||
|
||||
class SwashRingData { // Swash Ring data
|
||||
@@ -796,15 +804,6 @@ class FrSkyAlarmData {
|
||||
void clear() { memset(this, 0, sizeof(FrSkyAlarmData)); }
|
||||
};
|
||||
|
||||
class FrSkyErAlarmData {
|
||||
public:
|
||||
FrSkyErAlarmData() { clear(); }
|
||||
uint8_t frskyAlarmType ;
|
||||
uint8_t frskyAlarmLimit ;
|
||||
uint8_t frskyAlarmSound ;
|
||||
void clear() { memset(this, 0, sizeof(FrSkyErAlarmData)); }
|
||||
};
|
||||
|
||||
class FrSkyRSSIAlarm {
|
||||
public:
|
||||
FrSkyRSSIAlarm() { clear(0, 50); }
|
||||
@@ -822,14 +821,8 @@ class FrSkyChannelData {
|
||||
unsigned int multiplier;
|
||||
FrSkyAlarmData alarms[2];
|
||||
|
||||
float getRatio() const
|
||||
{
|
||||
if (type==0 || type==1 || type==2)
|
||||
return float(ratio << multiplier) / 10.0;
|
||||
else
|
||||
return ratio << multiplier;
|
||||
}
|
||||
|
||||
float getRatio() const;
|
||||
RawSourceRange getRange() const;
|
||||
void clear() { memset(this, 0, sizeof(FrSkyChannelData)); }
|
||||
};
|
||||
|
||||
@@ -868,7 +861,6 @@ enum TelemetryVarioSources {
|
||||
};
|
||||
|
||||
enum TelemetryVoltsSources {
|
||||
TELEMETRY_VOLTS_SOURCE_RXBATT,
|
||||
TELEMETRY_VOLTS_SOURCE_A1,
|
||||
TELEMETRY_VOLTS_SOURCE_A2,
|
||||
TELEMETRY_VOLTS_SOURCE_A3,
|
||||
@@ -891,7 +883,6 @@ class FrSkyData {
|
||||
FrSkyData() { clear(); }
|
||||
FrSkyChannelData channels[4];
|
||||
unsigned int usrProto;
|
||||
unsigned int imperial;
|
||||
int blades;
|
||||
unsigned int voltsSource;
|
||||
bool altitudeDisplayed;
|
||||
@@ -907,7 +898,6 @@ class FrSkyData {
|
||||
bool mAhPersistent;
|
||||
unsigned int storedMah;
|
||||
int fasOffset;
|
||||
unsigned int rxBattAlarms[2];
|
||||
|
||||
void clear();
|
||||
};
|
||||
@@ -990,7 +980,6 @@ class ModelData {
|
||||
|
||||
bool used;
|
||||
char name[12+1];
|
||||
uint8_t modelVoice;
|
||||
TimerData timers[2];
|
||||
bool thrTrim; // Enable Throttle Trim
|
||||
bool thrExpo; // Enable Throttle Expo
|
||||
@@ -1002,7 +991,7 @@ class ModelData {
|
||||
bool extendedLimits; // TODO xml
|
||||
bool extendedTrims;
|
||||
bool throttleReversed;
|
||||
PhaseData phaseData[C9X_MAX_FLIGHT_MODES];
|
||||
FlightModeData flightModeData[C9X_MAX_FLIGHT_MODES];
|
||||
MixData mixData[C9X_MAX_MIXERS];
|
||||
LimitData limitData[C9X_NUM_CHNOUT];
|
||||
|
||||
@@ -1013,8 +1002,7 @@ class ModelData {
|
||||
LogicalSwitchData customSw[C9X_NUM_CSW];
|
||||
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
SwashRingData swashRingData;
|
||||
unsigned int thrTraceSrc;
|
||||
int8_t traineron; // 0 disable trainer, 1 allow trainer
|
||||
unsigned int thrTraceSrc;
|
||||
unsigned int modelId;
|
||||
unsigned int switchWarningStates;
|
||||
unsigned int nSwToWarn;
|
||||
@@ -1024,10 +1012,8 @@ class ModelData {
|
||||
// TODO structure
|
||||
char gvars_names[C9X_MAX_GVARS][6+1];
|
||||
bool gvars_popups[C9X_MAX_GVARS];
|
||||
uint8_t gvsource[5];
|
||||
uint8_t bt_telemetry;
|
||||
uint8_t numVoice;
|
||||
MavlinkData mavlink;
|
||||
unsigned int telemetryProtocol;
|
||||
FrSkyData frsky;
|
||||
|
||||
char bitmap[10+1];
|
||||
@@ -1046,11 +1032,17 @@ class ModelData {
|
||||
|
||||
int getTrimValue(int phaseIdx, int trimIdx);
|
||||
void setTrimValue(int phaseIdx, int trimIdx, int value);
|
||||
|
||||
bool isGVarLinked(int phaseIdx, int gvarIdx);
|
||||
int getGVarValue(int phaseIdx, int gvarIdx);
|
||||
|
||||
ModelData removeGlobalVars();
|
||||
|
||||
void clearMixes();
|
||||
void clearInputs();
|
||||
|
||||
int getChannelsMax();
|
||||
|
||||
protected:
|
||||
void removeGlobalVar(int & var);
|
||||
};
|
||||
@@ -1063,102 +1055,103 @@ class RadioData {
|
||||
|
||||
// TODO rename FlightPhase to FlightMode
|
||||
enum Capability {
|
||||
FlightModes,
|
||||
FlightModesName,
|
||||
FlightModesHaveFades,
|
||||
Mixes,
|
||||
Timers,
|
||||
TimeDivisions,
|
||||
CustomFunctions,
|
||||
VoicesAsNumbers,
|
||||
VoicesMaxLength,
|
||||
ModelVoice,
|
||||
MultiLangVoice,
|
||||
ModelImage,
|
||||
Pots,
|
||||
Switches,
|
||||
SwitchesPositions,
|
||||
LogicalSwitches,
|
||||
CustomAndSwitches,
|
||||
HasNegAndSwitches,
|
||||
LogicalSwitchesExt,
|
||||
RotaryEncoders,
|
||||
Outputs,
|
||||
ChannelsName,
|
||||
ExtraInputs,
|
||||
ExtendedTrims,
|
||||
NumCurves,
|
||||
NumCurvePoints,
|
||||
OffsetWeight,
|
||||
Simulation,
|
||||
SoundMod,
|
||||
SoundPitch,
|
||||
MaxVolume,
|
||||
Beeperlen,
|
||||
EepromBackup,
|
||||
Haptic,
|
||||
HasBeeper,
|
||||
ModelTrainerEnable,
|
||||
Timer2ThrTrig,
|
||||
HasExpoNames,
|
||||
HasNoExpo,
|
||||
HasMixerNames,
|
||||
HasChNames,
|
||||
HasCvNames,
|
||||
HasFuncRepeat,
|
||||
HasPxxCountry,
|
||||
HasPPMStart,
|
||||
HasGeneralUnits,
|
||||
HasFAIMode,
|
||||
OptrexDisplay,
|
||||
PPMExtCtrl,
|
||||
PPMFrameLength,
|
||||
DSM2Indexes,
|
||||
Telemetry,
|
||||
TelemetryUnits,
|
||||
TelemetryBars,
|
||||
Gvars,
|
||||
GvarsInCS,
|
||||
GvarsAreNamed,
|
||||
GvarsFlightModes,
|
||||
GvarsName,
|
||||
NoTelemetryProtocol,
|
||||
TelemetryCustomScreens,
|
||||
TelemetryCustomScreensFieldsPerLine,
|
||||
TelemetryTimeshift,
|
||||
TelemetryMaxMultiplier,
|
||||
HasAltitudeSel,
|
||||
HasVario,
|
||||
HasVarioSink,
|
||||
HasVariants,
|
||||
HasFailsafe,
|
||||
HasSoundMixer,
|
||||
NumModules,
|
||||
PPMCenter,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
HasVolume,
|
||||
HasBrightness,
|
||||
HasContrast,
|
||||
PerModelTimers,
|
||||
SlowScale,
|
||||
SlowRange,
|
||||
PermTimers,
|
||||
HasSDLogs,
|
||||
CSFunc,
|
||||
LCDWidth,
|
||||
GetThrSwitch,
|
||||
HasDisplayText,
|
||||
VirtualInputs,
|
||||
TrainerInputs,
|
||||
LuaInputs,
|
||||
LimitsPer1000,
|
||||
EnhancedCurves,
|
||||
HasFasOffset,
|
||||
HasMahPersistent,
|
||||
MultiposPots,
|
||||
MultiposPotsPositions,
|
||||
SimulatorVariant,
|
||||
FlightModes,
|
||||
FlightModesName,
|
||||
FlightModesHaveFades,
|
||||
Imperial,
|
||||
Mixes,
|
||||
Timers,
|
||||
TimeDivisions,
|
||||
CustomFunctions,
|
||||
VoicesAsNumbers,
|
||||
VoicesMaxLength,
|
||||
ModelVoice,
|
||||
MultiLangVoice,
|
||||
ModelImage,
|
||||
Pots,
|
||||
Switches,
|
||||
SwitchesPositions,
|
||||
LogicalSwitches,
|
||||
CustomAndSwitches,
|
||||
HasNegAndSwitches,
|
||||
LogicalSwitchesExt,
|
||||
RotaryEncoders,
|
||||
Outputs,
|
||||
ChannelsName,
|
||||
ExtraInputs,
|
||||
ExtendedTrims,
|
||||
NumCurves,
|
||||
NumCurvePoints,
|
||||
OffsetWeight,
|
||||
Simulation,
|
||||
SoundMod,
|
||||
SoundPitch,
|
||||
MaxVolume,
|
||||
EepromBackup,
|
||||
Haptic,
|
||||
HasBeeper,
|
||||
ModelTrainerEnable,
|
||||
Timer2ThrTrig,
|
||||
HasExpoNames,
|
||||
HasNoExpo,
|
||||
HasMixerNames,
|
||||
HasChNames,
|
||||
HasCvNames,
|
||||
HasPxxCountry,
|
||||
HasPPMStart,
|
||||
HasGeneralUnits,
|
||||
HasFAIMode,
|
||||
OptrexDisplay,
|
||||
PPMExtCtrl,
|
||||
PPMFrameLength,
|
||||
DSM2Indexes,
|
||||
Telemetry,
|
||||
TelemetryUnits,
|
||||
TelemetryBars,
|
||||
Heli,
|
||||
Gvars,
|
||||
GvarsInCS,
|
||||
GvarsAreNamed,
|
||||
GvarsFlightModes,
|
||||
GvarsName,
|
||||
NoTelemetryProtocol,
|
||||
TelemetryCustomScreens,
|
||||
TelemetryCustomScreensFieldsPerLine,
|
||||
TelemetryTimeshift,
|
||||
TelemetryMaxMultiplier,
|
||||
HasAltitudeSel,
|
||||
HasVario,
|
||||
HasVarioSink,
|
||||
HasFailsafe,
|
||||
HasSoundMixer,
|
||||
NumModules,
|
||||
PPMCenter,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
HasVolume,
|
||||
HasBrightness,
|
||||
PerModelTimers,
|
||||
SlowScale,
|
||||
SlowRange,
|
||||
PermTimers,
|
||||
HasSDLogs,
|
||||
CSFunc,
|
||||
LCDWidth,
|
||||
GetThrSwitch,
|
||||
HasDisplayText,
|
||||
VirtualInputs,
|
||||
TrainerInputs,
|
||||
LuaScripts,
|
||||
LuaInputsPerScript,
|
||||
LuaOutputsPerScript,
|
||||
LimitsPer1000,
|
||||
EnhancedCurves,
|
||||
HasFasOffset,
|
||||
HasMahPersistent,
|
||||
MultiposPots,
|
||||
MultiposPotsPositions,
|
||||
SimulatorVariant,
|
||||
MavlinkTelemetry,
|
||||
};
|
||||
|
||||
class SimulatorInterface;
|
||||
@@ -1242,12 +1235,12 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
|
||||
for (int p=0; p<C9X_MAX_FLIGHT_MODES; p++) {
|
||||
for (int i=0; i<NUM_STICKS/2; i++) {
|
||||
int converted_stick = applyStickMode(i+1, mode) - 1;
|
||||
int tmp = model.phaseData[p].trim[i];
|
||||
model.phaseData[p].trim[i] = model.phaseData[p].trim[converted_stick];
|
||||
model.phaseData[p].trim[converted_stick] = tmp;
|
||||
tmp = model.phaseData[p].trimRef[i];
|
||||
model.phaseData[p].trimRef[i] = model.phaseData[p].trimRef[converted_stick];
|
||||
model.phaseData[p].trimRef[converted_stick] = tmp;
|
||||
int tmp = model.flightModeData[p].trim[i];
|
||||
model.flightModeData[p].trim[i] = model.flightModeData[p].trim[converted_stick];
|
||||
model.flightModeData[p].trim[converted_stick] = tmp;
|
||||
tmp = model.flightModeData[p].trimRef[i];
|
||||
model.flightModeData[p].trimRef[i] = model.flightModeData[p].trimRef[converted_stick];
|
||||
model.flightModeData[p].trimRef[converted_stick] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1314,27 +1307,45 @@ struct Option {
|
||||
class FirmwareInterface {
|
||||
|
||||
public:
|
||||
FirmwareInterface(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
|
||||
id(id),
|
||||
name(name),
|
||||
board(board),
|
||||
eepromInterface(eepromInterface),
|
||||
variantBase(0),
|
||||
base(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
FirmwareInterface(FirmwareInterface * base, const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface):
|
||||
id(id),
|
||||
name(name),
|
||||
board(board),
|
||||
eepromInterface(eepromInterface),
|
||||
variantBase(0),
|
||||
base(base)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~FirmwareInterface()
|
||||
{
|
||||
delete eepromInterface;
|
||||
}
|
||||
|
||||
FirmwareInterface(const QString & id, const QString & name, const BoardEnum board, EEPROMInterface * eepromInterface, bool voice = false):
|
||||
id(id),
|
||||
name(name),
|
||||
board(board),
|
||||
eepromInterface(eepromInterface),
|
||||
voice(voice),
|
||||
variantBase(0)
|
||||
inline const FirmwareInterface * getFirmwareBase() const
|
||||
{
|
||||
return base ? base : this;
|
||||
}
|
||||
|
||||
// TODO needed?
|
||||
inline void setVariantBase(unsigned int variant)
|
||||
{
|
||||
variantBase = variant;
|
||||
}
|
||||
|
||||
unsigned int getVariant(const QString & id);
|
||||
virtual FirmwareInterface * getFirmwareVariant(const QString & id) { return NULL; }
|
||||
|
||||
unsigned int getVariantNumber();
|
||||
|
||||
virtual void addLanguage(const char *lang);
|
||||
|
||||
@@ -1353,19 +1364,19 @@ class FirmwareInterface {
|
||||
|
||||
virtual QString getReleaseNotesUrl() = 0;
|
||||
|
||||
virtual QString getFirmwareUrl(QString & id) = 0;
|
||||
virtual QString getFirmwareUrl() = 0;
|
||||
|
||||
inline BoardEnum getBoard()
|
||||
inline BoardEnum getBoard() const
|
||||
{
|
||||
return board;
|
||||
}
|
||||
|
||||
inline QString getName()
|
||||
inline QString getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
inline QString getId()
|
||||
inline QString getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
@@ -1377,6 +1388,8 @@ class FirmwareInterface {
|
||||
|
||||
virtual int getCapability(const Capability) = 0;
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||
|
||||
virtual SimulatorInterface * getSimulator()
|
||||
{
|
||||
return NULL;
|
||||
@@ -1392,61 +1405,23 @@ class FirmwareInterface {
|
||||
QString name;
|
||||
BoardEnum board;
|
||||
EEPROMInterface * eepromInterface;
|
||||
|
||||
public:
|
||||
bool voice;
|
||||
|
||||
protected:
|
||||
unsigned int variantBase;
|
||||
FirmwareInterface * base;
|
||||
|
||||
private:
|
||||
FirmwareInterface();
|
||||
|
||||
};
|
||||
|
||||
class FirmwareVariant
|
||||
{
|
||||
public:
|
||||
FirmwareVariant():
|
||||
firmware(NULL),
|
||||
variant(0)
|
||||
{
|
||||
}
|
||||
|
||||
FirmwareVariant(QString & id, FirmwareInterface * firmware, unsigned int variant):
|
||||
id(id),
|
||||
firmware(firmware),
|
||||
variant(variant)
|
||||
{
|
||||
}
|
||||
|
||||
QString getFirmwareUrl()
|
||||
{
|
||||
if (firmware)
|
||||
return firmware->getFirmwareUrl(id);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
QString id;
|
||||
FirmwareInterface * firmware;
|
||||
unsigned int variant;
|
||||
};
|
||||
|
||||
extern QList<FirmwareInterface *> firmwares;
|
||||
extern FirmwareVariant default_firmware_variant;
|
||||
extern FirmwareVariant current_firmware_variant;
|
||||
extern FirmwareInterface * default_firmware_variant;
|
||||
extern FirmwareInterface * current_firmware_variant;
|
||||
|
||||
FirmwareVariant GetFirmwareVariant(QString id);
|
||||
|
||||
inline FirmwareInterface * GetFirmware(QString id)
|
||||
{
|
||||
return GetFirmwareVariant(id).firmware;
|
||||
}
|
||||
FirmwareInterface * GetFirmware(QString id);
|
||||
|
||||
inline FirmwareInterface * GetCurrentFirmware()
|
||||
{
|
||||
return current_firmware_variant.firmware;
|
||||
return current_firmware_variant;
|
||||
}
|
||||
|
||||
inline EEPROMInterface * GetEepromInterface()
|
||||
@@ -1454,11 +1429,6 @@ inline EEPROMInterface * GetEepromInterface()
|
||||
return GetCurrentFirmware()->getEepromInterface();
|
||||
}
|
||||
|
||||
inline unsigned int GetCurrentFirmwareVariant()
|
||||
{
|
||||
return current_firmware_variant.variant;
|
||||
}
|
||||
|
||||
void UnregisterEepromInterfaces();
|
||||
|
||||
inline int divRoundClosest(const int n, const int d)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <algorithm>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
EFile::EFile():
|
||||
RleFile::RleFile():
|
||||
eeprom(NULL),
|
||||
eeprom_size(0),
|
||||
eeFs(NULL),
|
||||
@@ -31,7 +31,7 @@ eeFsArm(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
void EFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
@@ -92,7 +92,7 @@ void EFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board)
|
||||
}
|
||||
}
|
||||
|
||||
bool EFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
{
|
||||
this->eeprom = eeprom;
|
||||
this->eeprom_size = size;
|
||||
@@ -137,29 +137,29 @@ bool EFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
}
|
||||
}
|
||||
|
||||
void EFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
void RleFile::eeprom_read_block (void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
{
|
||||
memcpy(pointer_ram, &eeprom[pointer_eeprom], size);
|
||||
}
|
||||
|
||||
void EFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
void RleFile::eeprom_write_block(const void *pointer_ram, unsigned int pointer_eeprom, size_t size)
|
||||
{
|
||||
memcpy(&eeprom[pointer_eeprom], pointer_ram, size);
|
||||
}
|
||||
|
||||
uint8_t EFile::EeFsRead(unsigned int blk, unsigned int ofs)
|
||||
uint8_t RleFile::EeFsRead(unsigned int blk, unsigned int ofs)
|
||||
{
|
||||
uint8_t ret;
|
||||
eeprom_read_block(&ret, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void EFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
|
||||
void RleFile::EeFsWrite(unsigned int blk, unsigned int ofs, uint8_t val)
|
||||
{
|
||||
eeprom_write_block(&val, blk*eeFsBlockSize+ofs+eeFsBlocksOffset, 1);
|
||||
}
|
||||
|
||||
unsigned int EFile::EeFsGetLink(unsigned int blk)
|
||||
unsigned int RleFile::EeFsGetLink(unsigned int blk)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t ret;
|
||||
@@ -171,7 +171,7 @@ unsigned int EFile::EeFsGetLink(unsigned int blk)
|
||||
}
|
||||
}
|
||||
|
||||
void EFile::EeFsSetLink(unsigned int blk, unsigned int val)
|
||||
void RleFile::EeFsSetLink(unsigned int blk, unsigned int val)
|
||||
{
|
||||
if (IS_ARM(board)) {
|
||||
int16_t s_link = val;
|
||||
@@ -182,17 +182,17 @@ void EFile::EeFsSetLink(unsigned int blk, unsigned int val)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t EFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
|
||||
uint8_t RleFile::EeFsGetDat(unsigned int blk, unsigned int ofs)
|
||||
{
|
||||
return EeFsRead(blk, ofs+eeFsLinkSize);
|
||||
}
|
||||
|
||||
void EFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
|
||||
void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf, unsigned int len)
|
||||
{
|
||||
eeprom_write_block(buf, blk*eeFsBlockSize+ofs+eeFsLinkSize+eeFsBlocksOffset, len);
|
||||
}
|
||||
|
||||
unsigned int EFile::EeFsGetFree()
|
||||
unsigned int RleFile::EeFsGetFree()
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
unsigned int i;
|
||||
@@ -211,7 +211,7 @@ unsigned int EFile::EeFsGetFree()
|
||||
/*
|
||||
* free one or more blocks
|
||||
*/
|
||||
void EFile::EeFsFree(unsigned int blk)
|
||||
void RleFile::EeFsFree(unsigned int blk)
|
||||
{
|
||||
unsigned int i = blk;
|
||||
while (EeFsGetLink(i)) i = EeFsGetLink(i);
|
||||
@@ -228,7 +228,7 @@ void EFile::EeFsFree(unsigned int blk)
|
||||
/*
|
||||
* alloc one block from freelist
|
||||
*/
|
||||
unsigned int EFile::EeFsAlloc()
|
||||
unsigned int RleFile::EeFsAlloc()
|
||||
{
|
||||
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
|
||||
if (ret) {
|
||||
@@ -241,12 +241,12 @@ unsigned int EFile::EeFsAlloc()
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned int EFile::size(unsigned int id)
|
||||
unsigned int RleFile::size(unsigned int id)
|
||||
{
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
}
|
||||
|
||||
unsigned int EFile::openRd(unsigned int i_fileId)
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
m_fileId = get_current_block_number(i_fileId * 2, &m_size);
|
||||
@@ -268,7 +268,7 @@ unsigned int EFile::openRd(unsigned int i_fileId)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int EFile::read(uint8_t *buf, unsigned int i_len)
|
||||
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
|
||||
len -= m_pos;
|
||||
@@ -288,7 +288,7 @@ unsigned int EFile::read(uint8_t *buf, unsigned int i_len)
|
||||
}
|
||||
|
||||
// G: Read runlength (RLE) compressed bytes into buf.
|
||||
unsigned int EFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
{
|
||||
memset(buf, 0, i_len);
|
||||
|
||||
@@ -344,12 +344,12 @@ unsigned int EFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int EFile::write1(uint8_t b)
|
||||
unsigned int RleFile::write1(uint8_t b)
|
||||
{
|
||||
return write(&b, 1);
|
||||
}
|
||||
|
||||
unsigned int EFile::write(const uint8_t *buf, unsigned int i_len)
|
||||
unsigned int RleFile::write(const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
unsigned int len = i_len;
|
||||
if (!m_currBlk && m_pos==0)
|
||||
@@ -386,7 +386,7 @@ unsigned int EFile::write(const uint8_t *buf, unsigned int i_len)
|
||||
return i_len - len;
|
||||
}
|
||||
|
||||
void EFile::create(unsigned int i_fileId, unsigned int typ)
|
||||
void RleFile::create(unsigned int i_fileId, unsigned int typ)
|
||||
{
|
||||
openRd(i_fileId); //internal use
|
||||
if (IS_ARM(board)) {
|
||||
@@ -399,7 +399,7 @@ void EFile::create(unsigned int i_fileId, unsigned int typ)
|
||||
}
|
||||
}
|
||||
|
||||
void EFile::closeTrunc()
|
||||
void RleFile::closeTrunc()
|
||||
{
|
||||
unsigned int fri=0;
|
||||
if (IS_ARM(board))
|
||||
@@ -410,7 +410,7 @@ void EFile::closeTrunc()
|
||||
if(fri) EeFsFree( fri ); //chain in
|
||||
}
|
||||
|
||||
unsigned int EFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
create(i_fileId, typ);
|
||||
bool state0 = true;
|
||||
@@ -456,7 +456,7 @@ unsigned int EFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uin
|
||||
/*
|
||||
* Write runlength (RLE) compressed bytes
|
||||
*/
|
||||
unsigned int EFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
openRd(i_fileId);
|
||||
@@ -520,7 +520,7 @@ unsigned int EFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uin
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t EFile::byte_checksum( uint8_t *p, unsigned int size )
|
||||
uint8_t RleFile::byte_checksum( uint8_t *p, unsigned int size )
|
||||
{
|
||||
uint32_t csum ;
|
||||
|
||||
@@ -533,7 +533,7 @@ uint8_t EFile::byte_checksum( uint8_t *p, unsigned int size )
|
||||
return csum ;
|
||||
}
|
||||
|
||||
uint32_t EFile::ee32_check_header( struct t_eeprom_header *hptr )
|
||||
uint32_t RleFile::ee32_check_header( struct t_eeprom_header *hptr )
|
||||
{
|
||||
uint8_t csum ;
|
||||
|
||||
@@ -549,7 +549,7 @@ uint32_t EFile::ee32_check_header( struct t_eeprom_header *hptr )
|
||||
// to see which is the most recent, the block_no of the most recent
|
||||
// is returned, with the corresponding data size if required
|
||||
// and the sequence number if required
|
||||
uint32_t EFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
|
||||
uint32_t RleFile::get_current_block_number( uint32_t block_no, uint16_t *p_size)
|
||||
{
|
||||
struct t_eeprom_header b0 ;
|
||||
struct t_eeprom_header b1 ;
|
||||
|
||||
@@ -61,7 +61,7 @@ struct t_eeprom_header
|
||||
uint8_t hcsum ;
|
||||
};
|
||||
|
||||
class EFile
|
||||
class RleFile
|
||||
{
|
||||
uint8_t m_fileId; //index of file in directory = filename
|
||||
unsigned int m_pos; //over all filepos
|
||||
@@ -101,7 +101,7 @@ class EFile
|
||||
|
||||
public:
|
||||
|
||||
EFile();
|
||||
RleFile();
|
||||
|
||||
void EeFsCreate(uint8_t *eeprom, int size, BoardEnum board);
|
||||
|
||||
|
||||
@@ -356,7 +356,6 @@ t_Er9xModelData::operator ModelData ()
|
||||
{
|
||||
ModelData c9x;
|
||||
c9x.used = true;
|
||||
c9x.modelVoice = modelVoice;
|
||||
getEEPROMString(c9x.name, name, sizeof(name));
|
||||
c9x.timers[0].mode = getEr9xTimerMode(tmrMode);
|
||||
c9x.timers[0].dir = tmrDir;
|
||||
@@ -375,8 +374,6 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.traineron= traineron;
|
||||
// c9x.t2throttle = t2throttle;
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
@@ -446,7 +443,7 @@ t_Er9xModelData::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ER9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -471,7 +468,6 @@ t_Er9xModelData::operator ModelData ()
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -195,13 +195,13 @@ PACK(typedef struct t_gvar {
|
||||
// int8_t gvswitch ;
|
||||
}) Er9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_PhaseData {
|
||||
PACK(typedef struct t_FlightModeData {
|
||||
// Trim store as -1001 to -1, trim value-501, 0-5 use trim of phase 0-5
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of modes 1|2|3|4 instead
|
||||
int8_t swtch; // Try 0-5 use trim of phase 0-5, 1000-2000, trim + 1500 ???
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
}) Er9xPhaseData;
|
||||
}) Er9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Er9xModelData {
|
||||
char name[10]; // 10 must be first for eeLoadModelName
|
||||
@@ -251,7 +251,7 @@ PACK(typedef struct t_Er9xModelData {
|
||||
uint8_t unused1[8] ;
|
||||
uint8_t CustomDisplayIndex[6] ;
|
||||
Er9xGvarData gvars[ER9X_MAX_GVARS] ;
|
||||
Er9xPhaseData phaseData[ER9X_MAX_MODES] ;
|
||||
Er9xFlightModeData flightModeData[ER9X_MAX_MODES] ;
|
||||
|
||||
operator ModelData();
|
||||
t_Er9xModelData() { memset(this, 0, sizeof(t_Er9xModelData)); }
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
Er9xInterface::Er9xInterface():
|
||||
EEPROMInterface(BOARD_STOCK),
|
||||
efile(new EFile())
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <QtXml>
|
||||
#include "eeprominterface.h"
|
||||
#include "er9xeeprom.h"
|
||||
class EFile;
|
||||
class RleFile;
|
||||
|
||||
class Er9xInterface : public EEPROMInterface
|
||||
{
|
||||
@@ -50,7 +50,7 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
protected:
|
||||
|
||||
EFile *efile;
|
||||
RleFile *efile;
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
@@ -125,7 +125,6 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.disablePotScroll=(disablePotScroll==1);
|
||||
result.disableBG=(disableBG==1);
|
||||
result.filterInput = filterInput;
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
getEEPROMString(result.ownerName, ownerName, sizeof(ownerName));
|
||||
@@ -507,8 +506,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.traineron= traineron;
|
||||
// c9x.t2throttle = t2throttle;
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
@@ -574,7 +571,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -599,7 +596,6 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
return c9x;
|
||||
}
|
||||
@@ -628,8 +624,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
break;
|
||||
}
|
||||
c9x.traineron= traineron;
|
||||
// c9x.t2throttle = t2throttle;
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH;
|
||||
c9x.thrTrim = thrTrim;
|
||||
@@ -695,7 +689,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trim[i];
|
||||
c9x.flightModeData[0].trim[i] = trim[i];
|
||||
|
||||
for (int i=0; i<ERSKY9X_MAX_CURVE5; i++) {
|
||||
c9x.curves[i].count = 5;
|
||||
@@ -720,7 +714,6 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
|
||||
c9x.frsky = frsky;
|
||||
c9x.frsky.usrProto=FrSkyUsrProto;
|
||||
c9x.frsky.imperial=FrSkyImperial;
|
||||
c9x.frsky.FrSkyGpsAlt=FrSkyGpsAlt;
|
||||
// for (int i=0; i<8; i++) {
|
||||
// c9x.frskyalarms[i].frskyAlarmLimit=frskyAlarms.alarmData[i].frskyAlarmLimit;
|
||||
@@ -731,8 +724,8 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
// c9x.customdisplay[i]=customDisplayIndex[i];
|
||||
// }
|
||||
for (int i=0; i<5;i++) {
|
||||
c9x.phaseData[0].gvars[i]=gvars[i].gvar;
|
||||
c9x.gvsource[i]=gvars[i].gvsource;
|
||||
c9x.flightModeData[0].gvars[i]=gvars[i].gvar;
|
||||
// c9x.gvsource[i]=gvars[i].gvsource;
|
||||
}
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -237,14 +237,14 @@ PACK(typedef struct t_Ersky9xgvar {
|
||||
// int8_t gvswitch ;
|
||||
}) Ersky9xGvarData ;
|
||||
|
||||
PACK(typedef struct t_Ersky9xPhaseData {
|
||||
PACK(typedef struct t_Ersky9xFlightModeData {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
uint16_t spare ; // Future expansion
|
||||
}) Ersky9xPhaseData;
|
||||
}) Ersky9xFlightModeData;
|
||||
|
||||
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
|
||||
int8_t swtch; //input
|
||||
@@ -421,7 +421,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
|
||||
// Add 6 bytes for custom telemetry screen
|
||||
uint8_t customDisplayIndex[6] ;
|
||||
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
|
||||
Ersky9xPhaseData phaseData[6] ;
|
||||
Ersky9xFlightModeData flightModeData[6] ;
|
||||
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
|
||||
|
||||
operator ModelData();
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
Ersky9xInterface::Ersky9xInterface():
|
||||
EEPROMInterface(BOARD_SKY9X),
|
||||
efile(new EFile())
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <QtXml>
|
||||
#include "eeprominterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
class EFile;
|
||||
class RleFile;
|
||||
|
||||
class Ersky9xInterface : public EEPROMInterface
|
||||
{
|
||||
@@ -50,7 +50,7 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
protected:
|
||||
|
||||
EFile *efile;
|
||||
RleFile *efile;
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
@@ -108,7 +108,6 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||
result.filterInput = filterInput;
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
// TODO frskyRssiAlarms[2];
|
||||
@@ -153,7 +152,6 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||
result.flashBeep = flashBeep;
|
||||
result.splashMode = disableSplashScreen;
|
||||
result.enableTelemetryAlarm = enableTelemetryAlarm;
|
||||
result.filterInput = filterInput;
|
||||
result.templateSetup = templateSetup;
|
||||
result.PPM_Multiplier = PPM_Multiplier;
|
||||
// TODO frskyRssiAlarms[2];
|
||||
@@ -349,9 +347,9 @@ t_Gruvin9xSwashRingData::operator SwashRingData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xPhaseData_v102::operator PhaseData ()
|
||||
t_Gruvin9xFlightModeData_v102::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
@@ -361,9 +359,9 @@ t_Gruvin9xPhaseData_v102::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Gruvin9xPhaseData_v106::operator PhaseData ()
|
||||
t_Gruvin9xFlightModeData_v106::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
@@ -456,7 +454,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
@@ -527,7 +525,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
c9x.moduleData[0].ppmPulsePol = pulsePol;
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++)
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int i=0; i<G9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<G9X_NUM_CHNOUT; i++)
|
||||
@@ -599,20 +597,20 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (phaseData[i].trim[j] > 125) {
|
||||
c9x.phaseData[i].trimRef[j] = 0;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (flightModeData[i].trim[j] > 125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 0;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else if (phaseData[i].trim[j] < -125) {
|
||||
c9x.phaseData[i].trimRef[j] = 129 + phaseData[i].trim[j];
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
else if (flightModeData[i].trim[j] < -125) {
|
||||
c9x.flightModeData[i].trimRef[j] = 129 + flightModeData[i].trim[j];
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
else {
|
||||
c9x.phaseData[i].trim[j] += subtrim[j];
|
||||
c9x.flightModeData[i].trim[j] += subtrim[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -690,13 +688,13 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<G9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,19 +244,19 @@ PACK(typedef struct t_Gruvin9xSwashRingData { // Swash Ring data
|
||||
t_Gruvin9xSwashRingData();
|
||||
}) Gruvin9xSwashRingData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xPhaseData_v102 {
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v102 {
|
||||
int8_t trim[4]; // -125..125 => trim value, 127 => use trim of phase 0, -128, -127, -126 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Gruvin9xPhaseData_v102() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v102)); }
|
||||
}) Gruvin9xPhaseData_v102;
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v102() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v102)); }
|
||||
}) Gruvin9xFlightModeData_v102;
|
||||
|
||||
|
||||
PACK(typedef struct t_Gruvin9xPhaseData_v106 {
|
||||
PACK(typedef struct t_Gruvin9xFlightModeData_v106 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -264,9 +264,9 @@ PACK(typedef struct t_Gruvin9xPhaseData_v106 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Gruvin9xPhaseData_v106() { memset(this, 0, sizeof(t_Gruvin9xPhaseData_v106)); }
|
||||
}) Gruvin9xPhaseData_v106;
|
||||
operator FlightModeData();
|
||||
t_Gruvin9xFlightModeData_v106() { memset(this, 0, sizeof(t_Gruvin9xFlightModeData_v106)); }
|
||||
}) Gruvin9xFlightModeData_v106;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xTimerData {
|
||||
int8_t mode:7; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
@@ -312,7 +312,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -344,7 +344,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -377,7 +377,7 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
int16_t subtrim[NUM_STICKS];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
@@ -409,7 +409,7 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
|
||||
Gruvin9xFrSkyData frsky;
|
||||
|
||||
operator ModelData();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
Gruvin9xInterface::Gruvin9xInterface(BoardEnum board):
|
||||
EEPROMInterface(board),
|
||||
efile(new EFile())
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class EFile;
|
||||
class RleFile;
|
||||
|
||||
class Gruvin9xInterface : public EEPROMInterface
|
||||
{
|
||||
@@ -57,7 +57,7 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
template <class T>
|
||||
bool loadGeneral(GeneralSettings &settings, int version=2);
|
||||
|
||||
EFile *efile;
|
||||
RleFile *efile;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
extern void getEEPROMZString(char *dst, const char *src, int size);
|
||||
extern RawSwitch open9xStockToSwitch(int8_t sw);
|
||||
|
||||
t_Open9xGruvin9xPhaseData_v207::operator PhaseData ()
|
||||
t_Open9xGruvin9xFlightModeData_v207::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -22,9 +22,9 @@ t_Open9xGruvin9xPhaseData_v207::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xGruvin9xPhaseData_v208::operator PhaseData ()
|
||||
t_Open9xGruvin9xFlightModeData_v208::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -461,13 +461,13 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,13 +546,13 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -635,13 +635,13 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -725,13 +725,13 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -812,13 +812,13 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "open9xStockeeprom.h"
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v207 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -30,20 +30,20 @@ PACK(typedef struct t_Open9xGruvin9xPhaseData_v207 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator PhaseData();
|
||||
t_Open9xGruvin9xPhaseData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v207)); }
|
||||
}) Open9xGruvin9xPhaseData_v207;
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v207)); }
|
||||
}) Open9xGruvin9xFlightModeData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xPhaseData_v208 {
|
||||
PACK(typedef struct t_Open9xGruvin9xFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[2];
|
||||
operator PhaseData();
|
||||
t_Open9xGruvin9xPhaseData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xPhaseData_v208)); }
|
||||
}) Open9xGruvin9xPhaseData_v208;
|
||||
operator FlightModeData();
|
||||
t_Open9xGruvin9xFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xGruvin9xFlightModeData_v208)); }
|
||||
}) Open9xGruvin9xFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xMixData_v207 {
|
||||
uint8_t destCh:4; // 0, 1..C9X_NUM_CHNOUT
|
||||
@@ -197,7 +197,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v207 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -231,7 +231,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -270,7 +270,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -310,7 +310,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -348,7 +348,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xGruvin9xFlightModeData_v208 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
@@ -220,9 +220,9 @@ t_Open9xArmExpoData_v212::operator ExpoData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmPhaseData_v208::operator PhaseData ()
|
||||
t_Open9xArmFlightModeData_v208::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -232,9 +232,9 @@ t_Open9xArmPhaseData_v208::operator PhaseData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmPhaseData_v212::operator PhaseData ()
|
||||
t_Open9xArmFlightModeData_v212::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = trim[i];
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
@@ -768,13 +768,13 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -857,13 +857,13 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -947,13 +947,13 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1031,13 +1031,13 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1118,13 +1118,13 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_ARM_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,26 +169,26 @@ PACK(typedef struct t_Open9xArmMixData_v212 {
|
||||
t_Open9xArmMixData_v212() { memset(this, 0, sizeof(t_Open9xArmMixData_v212)); }
|
||||
}) Open9xArmMixData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmPhaseData_v208 {
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v208 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
operator PhaseData();
|
||||
t_Open9xArmPhaseData_v208() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v208)); }
|
||||
}) Open9xArmPhaseData_v208;
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v208() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v208)); }
|
||||
}) Open9xArmFlightModeData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmPhaseData_v212 {
|
||||
PACK(typedef struct t_Open9xArmFlightModeData_v212 {
|
||||
int16_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
char name[6];
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
int16_t rotaryEncoders[1];
|
||||
operator PhaseData();
|
||||
t_Open9xArmPhaseData_v212() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v212)); }
|
||||
}) Open9xArmPhaseData_v212;
|
||||
operator FlightModeData();
|
||||
t_Open9xArmFlightModeData_v212() { memset(this, 0, sizeof(t_Open9xArmFlightModeData_v212)); }
|
||||
}) Open9xArmFlightModeData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
@@ -346,7 +346,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -385,7 +385,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -425,7 +425,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFrSkyData_v210 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -464,7 +464,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v208 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -502,7 +502,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
Open9xArmFlightModeData_v212 flightModeData[O9X_ARM_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
@@ -686,9 +686,9 @@ t_Open9xSwashRingData_v209::operator SwashRingData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xPhaseData_v201::operator PhaseData ()
|
||||
t_Open9xFlightModeData_v201::operator FlightModeData ()
|
||||
{
|
||||
PhaseData c9x;
|
||||
FlightModeData c9x;
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.trim[i] = (((int16_t)trim[i]) << 2) + ((trim_ext >> (2*i)) & 0x03);
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
@@ -842,7 +842,6 @@ t_Open9xFrSkyData_v204::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.imperial = imperial;
|
||||
c9x.blades = blades+2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
@@ -856,7 +855,6 @@ t_Open9xFrSkyData_v205::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.imperial = imperial;
|
||||
c9x.blades = blades+2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
@@ -949,13 +947,13 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1023,13 +1021,13 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1099,13 +1097,13 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1173,13 +1171,13 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1252,13 +1250,13 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1338,13 +1336,13 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1431,13 +1429,13 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1525,13 +1523,13 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1613,13 +1611,13 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
c9x.extendedLimits = extendedLimits;
|
||||
c9x.extendedTrims = extendedTrims;
|
||||
for (int i=0; i<O9X_MAX_FLIGHT_MODES; i++) {
|
||||
c9x.phaseData[i] = phaseData[i];
|
||||
c9x.flightModeData[i] = flightModeData[i];
|
||||
for (int j=0; j<NUM_STICKS; j++) {
|
||||
if (c9x.phaseData[i].trim[j] > 500) {
|
||||
c9x.phaseData[i].trimRef[j] = c9x.phaseData[i].trim[j] - 501;
|
||||
if (c9x.phaseData[i].trimRef[j] >= i)
|
||||
c9x.phaseData[i].trimRef[j] += 1;
|
||||
c9x.phaseData[i].trim[j] = 0;
|
||||
if (c9x.flightModeData[i].trim[j] > 500) {
|
||||
c9x.flightModeData[i].trimRef[j] = c9x.flightModeData[i].trim[j] - 501;
|
||||
if (c9x.flightModeData[i].trimRef[j] >= i)
|
||||
c9x.flightModeData[i].trimRef[j] += 1;
|
||||
c9x.flightModeData[i].trim[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ PACK(typedef struct t_Open9xSwashRingData_v209 { // Swash Ring data
|
||||
t_Open9xSwashRingData_v209() { memset(this, 0, sizeof(t_Open9xSwashRingData_v209)); }
|
||||
}) Open9xSwashRingData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xPhaseData_v201 {
|
||||
PACK(typedef struct t_Open9xFlightModeData_v201 {
|
||||
int8_t trim[4]; // -500..500 => trim value, 501 => use trim of phase 0, 502, 503, 504 => use trim of phases 1|2|3|4 instead
|
||||
int8_t trim_ext:8; // 2 less significant extra bits per trim (10bits trims)
|
||||
int8_t swtch; // swtch of phase[0] is not used
|
||||
@@ -453,9 +453,9 @@ PACK(typedef struct t_Open9xPhaseData_v201 {
|
||||
uint8_t fadeIn:4;
|
||||
uint8_t fadeOut:4;
|
||||
|
||||
operator PhaseData();
|
||||
t_Open9xPhaseData_v201() { memset(this, 0, sizeof(t_Open9xPhaseData_v201)); }
|
||||
}) Open9xPhaseData_v201;
|
||||
operator FlightModeData();
|
||||
t_Open9xFlightModeData_v201() { memset(this, 0, sizeof(t_Open9xFlightModeData_v201)); }
|
||||
}) Open9xFlightModeData_v201;
|
||||
|
||||
PACK(typedef struct t_Open9xTimerData_v201 {
|
||||
int8_t mode; // timer trigger source -> off, abs, stk, stk%, sw/!sw, !m_sw/!m_sw
|
||||
@@ -520,7 +520,7 @@ PACK(typedef struct t_Open9xModelData_v201 {
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v201 frsky;
|
||||
|
||||
operator ModelData();
|
||||
@@ -551,7 +551,7 @@ PACK(typedef struct t_Open9xModelData_v202 {
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -584,7 +584,7 @@ PACK(typedef struct t_Open9xModelData_v203 {
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v202 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -617,7 +617,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v204 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -650,7 +650,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v205 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -685,7 +685,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -724,7 +724,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFrSkyData_v208 frsky;
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -764,7 +764,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
@@ -802,7 +802,7 @@ PACK(typedef struct t_Open9xModelData_v211 {
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES];
|
||||
Open9xFlightModeData_v201 flightModeData[O9X_MAX_FLIGHT_MODES];
|
||||
|
||||
int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments
|
||||
uint8_t thrTraceSrc;
|
||||
|
||||
@@ -69,6 +69,7 @@ namespace Open9xGruvin9x {
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
@@ -176,13 +177,13 @@ void Open9xGruvin9xSimulator::setValues(TxInputs &inputs)
|
||||
void Open9xGruvin9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xGruvin9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xGruvin9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
@@ -203,13 +204,13 @@ void Open9xGruvin9xSimulator::wheelEvent(uint8_t steps)
|
||||
|
||||
unsigned int Open9xGruvin9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xGruvin9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#define GPS
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
@@ -55,7 +57,7 @@
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9xM128 {
|
||||
namespace OpenTxM128 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
@@ -68,6 +70,7 @@ namespace Open9xM128 {
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
@@ -109,102 +112,102 @@ uint8_t getStickMode()
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9xM128;
|
||||
using namespace OpenTxM128;
|
||||
|
||||
Open9xM128Simulator::Open9xM128Simulator()
|
||||
OpenTxM128Simulator::OpenTxM128Simulator()
|
||||
{
|
||||
}
|
||||
|
||||
bool Open9xM128Simulator::timer10ms()
|
||||
bool OpenTxM128Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xM128Simulator::getLcd()
|
||||
uint8_t * OpenTxM128Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xM128Simulator::lcdChanged(bool & lightEnable)
|
||||
bool OpenTxM128Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::start(QByteArray & eeprom, bool tests)
|
||||
void OpenTxM128Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(Open9xM128::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xM128::eeprom), eeprom.size()));
|
||||
memcpy(OpenTxM128::eeprom, eeprom.data(), std::min<int>(sizeof(OpenTxM128::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::start(const char * filename, bool tests)
|
||||
void OpenTxM128Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::stop()
|
||||
void OpenTxM128Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::getValues(TxOutputs &outputs)
|
||||
void OpenTxM128Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::setValues(TxInputs &inputs)
|
||||
void OpenTxM128Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::setTrim(unsigned int idx, int value)
|
||||
void OpenTxM128Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xM128::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
idx = OpenTxM128::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::getTrims(Trims & trims)
|
||||
void OpenTxM128Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9xM128::modn12x3[4*getStickMode() + i];
|
||||
uint8_t idx = OpenTxM128::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xM128Simulator::wheelEvent(uint8_t steps)
|
||||
void OpenTxM128Simulator::wheelEvent(uint8_t steps)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int Open9xM128Simulator::getPhase()
|
||||
unsigned int OpenTxM128Simulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xM128Simulator::getPhaseName(unsigned int phase)
|
||||
const char * OpenTxM128Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xM128Simulator::getError()
|
||||
const char * OpenTxM128Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef open9xM128_simulator_h
|
||||
#define open9xM128_simulator_h
|
||||
#ifndef OpenTxM128_simulator_h
|
||||
#define OpenTxM128_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class Open9xM128Simulator : public SimulatorInterface {
|
||||
class OpenTxM128Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xM128Simulator();
|
||||
OpenTxM128Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxsimulator.h"
|
||||
#include "opentxM64simulator.h"
|
||||
#include "opentxinterface.h"
|
||||
#include "opentxeeprom.h"
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Open9x {
|
||||
namespace OpenTxM64 {
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/common_avr/telemetry_driver.cpp"
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
@@ -74,6 +74,7 @@ namespace Open9x {
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
@@ -115,52 +116,52 @@ uint8_t getStickMode()
|
||||
|
||||
}
|
||||
|
||||
using namespace Open9x;
|
||||
using namespace OpenTxM64;
|
||||
|
||||
Open9xSimulator::Open9xSimulator()
|
||||
OpenTxM64Simulator::OpenTxM64Simulator()
|
||||
{
|
||||
#define INIT_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xSimulator::timer10ms()
|
||||
bool OpenTxM64Simulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xSimulator::getLcd()
|
||||
uint8_t * OpenTxM64Simulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool Open9xSimulator::lcdChanged(bool & lightEnable)
|
||||
bool OpenTxM64Simulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
void OpenTxM64Simulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(&Open9x::eeprom[0], eeprom.data(), 2048);
|
||||
memcpy(&OpenTxM64::eeprom[0], eeprom.data(), 2048);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSimulator::start(const char * filename, bool tests)
|
||||
void OpenTxM64Simulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSimulator::stop()
|
||||
void OpenTxM64Simulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Open9xSimulator::getValues(TxOutputs &outputs)
|
||||
void OpenTxM64Simulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
@@ -169,48 +170,48 @@ void Open9xSimulator::getValues(TxOutputs &outputs)
|
||||
g_beepCnt = 0;
|
||||
}
|
||||
|
||||
void Open9xSimulator::setValues(TxInputs &inputs)
|
||||
void OpenTxM64Simulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSimulator::setTrim(unsigned int idx, int value)
|
||||
void OpenTxM64Simulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
idx = OpenTxM64::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xSimulator::getTrims(Trims & trims)
|
||||
void OpenTxM64Simulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
uint8_t idx = Open9x::modn12x3[4*getStickMode() + i];
|
||||
uint8_t idx = OpenTxM64::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Open9xSimulator::getPhase()
|
||||
unsigned int OpenTxM64Simulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xSimulator::getPhaseName(unsigned int phase)
|
||||
const char * OpenTxM64Simulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * Open9xSimulator::getError()
|
||||
const char * OpenTxM64Simulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
class OpenTxEepromInterface;
|
||||
|
||||
class Open9xSimulator : public SimulatorInterface {
|
||||
class OpenTxM64Simulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Open9xSimulator();
|
||||
OpenTxM64Simulator();
|
||||
|
||||
virtual void start(QByteArray & eeprom, bool tests=true);
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
@@ -108,6 +109,7 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
@@ -119,6 +121,7 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
|
||||
int16_t g_anas[NUM_STICKS+BOARD_9X_NUM_POTS];
|
||||
|
||||
@@ -211,13 +214,13 @@ void Open9xSky9xSimulator::setValues(TxInputs &inputs)
|
||||
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
@@ -238,13 +241,13 @@ void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
|
||||
|
||||
unsigned int Open9xSky9xSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * Open9xSky9xSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/gui/menus.cpp"
|
||||
#include "radio/src/gui/menu_model.cpp"
|
||||
#include "radio/src/gui/menu_general.cpp"
|
||||
@@ -128,7 +129,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
#include "radio/src/lua.cpp"
|
||||
#include "radio/src/lua/src/lapi.c"
|
||||
#include "radio/src/lua/src/lcode.c"
|
||||
@@ -250,13 +251,13 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
|
||||
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightPhase(), idx);
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightPhase();
|
||||
uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
@@ -277,13 +278,13 @@ void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
|
||||
|
||||
unsigned int OpentxTaranisSimulator::getPhase()
|
||||
{
|
||||
return getFlightPhase();
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpentxTaranisSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.phaseData[0].name)+1];
|
||||
zchar2str(buff, g_model.phaseData[phase].name, sizeof(g_model.phaseData[0].name));
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
|
||||
@@ -187,9 +187,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++)
|
||||
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
|
||||
for (int i=0; i<7; i++) {
|
||||
for (int j=0; j<6; j++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_LUA_INPUT, i*16+j), val++);
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,15 +260,17 @@ class SourcesConversionTable: public ConversionTable {
|
||||
|
||||
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
|
||||
if (version < 216) {
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_RX_BATT || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPD || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPEED || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
|
||||
continue;
|
||||
}
|
||||
if (!IS_ARM(board)) {
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR|| i==TELEMETRY_SOURCE_RX_BATT || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_A3_MIN || i==TELEMETRY_SOURCE_A4_MIN)
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_A3_MIN || i==TELEMETRY_SOURCE_A4_MIN)
|
||||
continue;
|
||||
}
|
||||
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
|
||||
if (version >= 216 && IS_ARM(board)) {
|
||||
if (i==TELEMETRY_SOURCE_RSSI_RX)
|
||||
val += 1;
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME)
|
||||
val += 5;
|
||||
if (i==TELEMETRY_SOURCE_DTE)
|
||||
@@ -414,7 +416,7 @@ class TelemetrySourcesConversionTable: public ConversionTable {
|
||||
addConversion(1+TELEMETRY_SOURCE_RSSI_TX, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_RSSI_RX, val++);
|
||||
if (IS_ARM(board) && version >= 216)
|
||||
addConversion(1+TELEMETRY_SOURCE_RX_BATT, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_RESERVE, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_A1, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_A2, val++);
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
@@ -441,7 +443,7 @@ class TelemetrySourcesConversionTable: public ConversionTable {
|
||||
addConversion(1+TELEMETRY_SOURCE_HDG, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_VERTICAL_SPEED, val++);
|
||||
if (version >= 216) {
|
||||
addConversion(1+TELEMETRY_SOURCE_ASPD, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_ASPEED, val++);
|
||||
addConversion(1+TELEMETRY_SOURCE_DTE, val++);
|
||||
}
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
@@ -699,7 +701,7 @@ class HeliField: public StructField {
|
||||
|
||||
class FlightModeField: public TransformedField {
|
||||
public:
|
||||
FlightModeField(PhaseData & phase, int index, BoardEnum board, unsigned int version):
|
||||
FlightModeField(FlightModeData & phase, int index, BoardEnum board, unsigned int version):
|
||||
TransformedField(internalField),
|
||||
internalField("Phase"),
|
||||
phase(phase),
|
||||
@@ -824,7 +826,7 @@ class FlightModeField: public TransformedField {
|
||||
|
||||
protected:
|
||||
StructField internalField;
|
||||
PhaseData & phase;
|
||||
FlightModeData & phase;
|
||||
int index;
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
@@ -1007,7 +1009,7 @@ class MixField: public TransformedField {
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
if (mix.srcRaw.type == SOURCE_TYPE_STICK && mix.srcRaw.index < NUM_STICKS) {
|
||||
if (!mix.noExpo) {
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, mix.srcRaw.index, model);
|
||||
mix.srcRaw = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, mix.srcRaw.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1158,6 +1160,9 @@ class InputField: public TransformedField {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (expo.mode) {
|
||||
expo.srcRaw = RawSource(SOURCE_TYPE_STICK, expo.chn);
|
||||
}
|
||||
|
||||
expo.weight = smallGvarToC9x(_weight);
|
||||
|
||||
@@ -1247,13 +1252,20 @@ class CurvesField: public TransformedField {
|
||||
|
||||
for (int i=0; i<maxCurves; i++) {
|
||||
CurveData *curve = &curves[i];
|
||||
int size = (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
|
||||
if (offset+size > maxPoints) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
break;
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count);
|
||||
if (offset > maxPoints) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTX only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
_curves[i] = offset - (5*i);
|
||||
else {
|
||||
offset += (curve->type == CurveData::CURVE_TYPE_CUSTOM ? curve->count * 2 - 2 : curve->count) - 5;
|
||||
if (offset > maxPoints - 5 * maxCurves) {
|
||||
EEPROMWarnings += ::QObject::tr("OpenTx only accepts %1 points in all curves").arg(maxPoints) + "\n";
|
||||
break;
|
||||
}
|
||||
_curves[i] = offset;
|
||||
}
|
||||
for (int j=0; j<curve->count; j++) {
|
||||
*cur++ = curve->points[j].y;
|
||||
@@ -1263,7 +1275,6 @@ class CurvesField: public TransformedField {
|
||||
*cur++ = curve->points[j].x;
|
||||
}
|
||||
}
|
||||
offset += size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1537,7 +1548,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
else if (csw.func != LS_FN_OFF) {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
csw.val2 = v2;
|
||||
RawSource val1(csw.val1, model);
|
||||
RawSource val1(csw.val1);
|
||||
if (IS_ARM(board) && version < 216 && val1.type == SOURCE_TYPE_TELEMETRY) {
|
||||
switch (val1.index) {
|
||||
case TELEMETRY_SOURCE_TIMER1:
|
||||
@@ -1783,7 +1794,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
{
|
||||
_mode = 0;
|
||||
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
_active = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5));
|
||||
else
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
@@ -1855,7 +1866,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
fn.repeatParam = (version >= 216 ? _active : (_active*5));
|
||||
else
|
||||
fn.enabled = (_active & 0x01);
|
||||
@@ -1897,7 +1908,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
else if (fn.adjustMode == 2)
|
||||
fn.param = RawSource(SOURCE_TYPE_GVAR, value).toValue();
|
||||
else
|
||||
fn.param = value;
|
||||
fn.param = (int16_t)value;
|
||||
}
|
||||
else if (version >= 214) {
|
||||
fn.adjustMode = _mode;
|
||||
@@ -1906,7 +1917,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
else if (fn.adjustMode == 2)
|
||||
fn.param = RawSource(SOURCE_TYPE_GVAR, value).toValue();
|
||||
else
|
||||
fn.param = value;
|
||||
fn.param = (int8_t)value;
|
||||
}
|
||||
else {
|
||||
sourcesConversionTable->importValue(value, (int &)fn.param);
|
||||
@@ -2202,8 +2213,6 @@ class TelemetryVoltsSourceConversionTable: public ConversionTable
|
||||
TelemetryVoltsSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_ARM(board) && version >= 216)
|
||||
addConversion(TELEMETRY_VOLTS_SOURCE_RXBATT, val++);
|
||||
addConversion(TELEMETRY_VOLTS_SOURCE_A1, val++);
|
||||
addConversion(TELEMETRY_VOLTS_SOURCE_A2, val++);
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
@@ -2412,10 +2421,10 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board))
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new UnsignedField<3>(modelData.telemetryProtocol));
|
||||
else
|
||||
internalField.Append(new ConversionField< SignedField<3> >(modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
internalField.Append(new ConversionField< UnsignedField<3> >((unsigned int &)modelData.moduleData[0].protocol, &protocolsConversionTable, "Protocol", ::QObject::tr("OpenTX doesn't accept this protocol")));
|
||||
|
||||
internalField.Append(new BoolField<1>(modelData.thrTrim));
|
||||
|
||||
@@ -2466,7 +2475,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
|
||||
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
|
||||
internalField.Append(new FlightModeField(modelData.phaseData[i], i, board, version));
|
||||
internalField.Append(new FlightModeField(modelData.flightModeData[i], i, board, version));
|
||||
|
||||
if (!IS_ARM(board) || version < 216) {
|
||||
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
|
||||
@@ -2490,7 +2499,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if ((board == BOARD_STOCK || (board == BOARD_M128 && version >= 215)) && (variant & GVARS_VARIANT)) {
|
||||
for (int i=0; i<MAX_GVARS(board, version); i++) {
|
||||
// on M64 GVARS are common to all phases, and there is no name
|
||||
internalField.Append(new SignedField<16>(modelData.phaseData[0].gvars[i]));
|
||||
internalField.Append(new SignedField<16>(modelData.flightModeData[0].gvars[i]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2550,7 +2559,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<7; i++) {
|
||||
ScriptData & script = modelData.scriptData[i];
|
||||
internalField.Append(new ZCharField<10>(script.filename));
|
||||
internalField.Append(new CharField<10>(script.filename));
|
||||
internalField.Append(new ZCharField<10>(script.name));
|
||||
for (int j=0; j<10; j++) {
|
||||
internalField.Append(new SignedField<8>(script.inputs[j]));
|
||||
@@ -2569,8 +2578,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<8>(modelData.frsky.rxBattAlarms[0]));
|
||||
internalField.Append(new UnsignedField<8>(modelData.frsky.rxBattAlarms[1]));
|
||||
internalField.Append(new SpareBitsField<16>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2703,7 +2711,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
internalField.Append(new SignedField<2>((int &)generalData.hapticMode));
|
||||
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new SignedField<8>(generalData.switchesDelay));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
|
||||
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
|
||||
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
|
||||
@@ -2806,7 +2818,8 @@ void OpenTxGeneralData::beforeExport()
|
||||
void OpenTxGeneralData::afterImport()
|
||||
{
|
||||
for (int i=0; i<4; i++) {
|
||||
if (i<2 && generalData.potsType[i] == 0)
|
||||
generalData.potsType[i] = potsType[i];
|
||||
if (i<2 && potsType[i] == 0)
|
||||
generalData.potsType[i] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "opentxeeprom.h"
|
||||
#include "open9xGruvin9xeeprom.h"
|
||||
#include "open9xSky9xeeprom.h"
|
||||
#include "opentxsimulator.h"
|
||||
#include "opentxM64simulator.h"
|
||||
#include "opentxM128simulator.h"
|
||||
#include "opentxGruvin9xsimulator.h"
|
||||
#include "opentxSky9xsimulator.h"
|
||||
@@ -45,7 +45,7 @@ size_t SizeOfArray( T(&)[ N ] )
|
||||
|
||||
OpenTxEepromInterface::OpenTxEepromInterface(BoardEnum board):
|
||||
EEPROMInterface(board),
|
||||
efile(new EFile())
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ int OpenTxEepromInterface::getSize(ModelData &model)
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
|
||||
|
||||
OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmwareVariant());
|
||||
OpenTxModelData open9xModel(model, board, 255, GetCurrentFirmware()->getVariantNumber());
|
||||
|
||||
QByteArray eeprom;
|
||||
open9xModel.Export(eeprom);
|
||||
@@ -441,7 +441,7 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board);
|
||||
|
||||
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmwareVariant());
|
||||
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmware()->getVariantNumber());
|
||||
// open9xGeneral.Dump();
|
||||
|
||||
QByteArray eeprom;
|
||||
@@ -453,9 +453,26 @@ int OpenTxEepromInterface::getSize(GeneralSettings &settings)
|
||||
return efile->size(0);
|
||||
}
|
||||
|
||||
FirmwareInterface * OpenTxFirmware::getFirmwareVariant(const QString & id)
|
||||
{
|
||||
if (id.contains(getId()+"-") || (!id.contains("-") && id.contains(getId()))) {
|
||||
FirmwareInterface * result = new OpenTxFirmware(id, this);
|
||||
// TODO result.variant = firmware->getVariant(id);
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int OpenTxFirmware::getCapability(const Capability capability)
|
||||
{
|
||||
switch (capability) {
|
||||
case Imperial:
|
||||
if (IS_ARM(board))
|
||||
return 0;
|
||||
else
|
||||
return id.contains("imperial") ? 1 : 0;
|
||||
case ModelImage:
|
||||
if (IS_TARANIS(board))
|
||||
return 1;
|
||||
@@ -491,8 +508,18 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return 5;
|
||||
case FlightModesHaveFades:
|
||||
return 1;
|
||||
case Heli:
|
||||
if (IS_TARANIS(board))
|
||||
return id.contains("noheli") ? 0 : 1;
|
||||
else
|
||||
return id.contains("heli") ? 1 : 0;
|
||||
case Gvars:
|
||||
return IS_ARM(board) ? 9 : 5;
|
||||
if (IS_TARANIS(board))
|
||||
return id.contains("nogvars") ? 0 : 9;
|
||||
else if (id.contains("gvars"))
|
||||
return IS_ARM(board) ? 9 : 5;
|
||||
else
|
||||
return 0;
|
||||
case FlightModesName:
|
||||
return (IS_TARANIS(board) ? 10 : 6);
|
||||
case GvarsName:
|
||||
@@ -504,7 +531,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return 1;
|
||||
case GvarsAreNamed:
|
||||
case GvarsFlightModes:
|
||||
return ((IS_ARM(board)||(board==BOARD_GRUVIN9X)) ? 1 : 0);
|
||||
return ((IS_ARM(board) || board==BOARD_GRUVIN9X) ? 1 : 0);
|
||||
case Mixes:
|
||||
return (IS_ARM(board) ? O9X_ARM_MAX_MIXERS : O9X_MAX_MIXERS);
|
||||
case OffsetWeight:
|
||||
@@ -563,17 +590,12 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case SoundPitch:
|
||||
return 1;
|
||||
case Haptic:
|
||||
return 1;
|
||||
return (board == BOARD_GRUVIN9X || IS_SKY9X(board) || board == BOARD_TARANIS_PLUS || id.contains("haptic"));
|
||||
case ModelTrainerEnable:
|
||||
if (IS_ARM(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
case HasFuncRepeat:
|
||||
case HasContrast:
|
||||
return 1;
|
||||
case Beeperlen:
|
||||
return 1;
|
||||
case MaxVolume:
|
||||
return (IS_ARM(board) ? 23 : 7);
|
||||
case HasSoundMixer:
|
||||
@@ -624,11 +646,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return 1;
|
||||
case HasVarioSink:
|
||||
return ((board == BOARD_GRUVIN9X || IS_ARM(board)) ? true : false);
|
||||
case HasVariants:
|
||||
if (IS_TARANIS(board))
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
case HasFailsafe:
|
||||
return (IS_ARM(board) ? 32 : 0);
|
||||
case NumModules:
|
||||
@@ -661,9 +678,15 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return IS_TARANIS(board) ? 32 : 0;
|
||||
case TrainerInputs:
|
||||
return IS_ARM(board) ? 16 : 8;
|
||||
case LuaInputs:
|
||||
case LuaScripts:
|
||||
return IS_TARANIS(board) ? 7 : 0;
|
||||
case LuaInputsPerScript:
|
||||
return IS_TARANIS(board) ? 10 : 0;
|
||||
case LuaOutputsPerScript:
|
||||
return IS_TARANIS(board) ? 6 : 0;
|
||||
case LimitsPer1000:
|
||||
case EnhancedCurves:
|
||||
return IS_TARANIS(board);
|
||||
case HasFasOffset:
|
||||
return (IS_STOCK(board) ? false : true);
|
||||
case HasMahPersistent:
|
||||
@@ -679,11 +702,24 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return SIMU_M128_VARIANTS;
|
||||
else
|
||||
return 0;
|
||||
case MavlinkTelemetry:
|
||||
return id.contains("mavlink") ? 1 : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
||||
{
|
||||
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
|
||||
return false;
|
||||
|
||||
if (source == TELEMETRY_SOURCE_DTE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
{
|
||||
if (IS_TARANIS(board)) {
|
||||
@@ -905,7 +941,7 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
return true;
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareUrl(QString & id)
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
switch (board) {
|
||||
@@ -915,6 +951,7 @@ QString OpenTxFirmware::getFirmwareUrl(QString & id)
|
||||
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
|
||||
break;
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
@@ -944,9 +981,9 @@ SimulatorInterface * OpenTxFirmware::getSimulator()
|
||||
{
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
return new Open9xSimulator();
|
||||
return new OpenTxM64Simulator();
|
||||
case BOARD_M128:
|
||||
return new Open9xM128Simulator();
|
||||
return new OpenTxM128Simulator();
|
||||
case BOARD_GRUVIN9X:
|
||||
return new Open9xGruvin9xSimulator();
|
||||
case BOARD_SKY9X:
|
||||
@@ -970,7 +1007,7 @@ void registerOpenTxFirmwares()
|
||||
Option fai_options[] = { { "faichoice", QObject::tr("Possibility to enable FAI MODE at field") }, { "faimode", QObject::tr("FAI MODE always enabled") }, { NULL } };
|
||||
|
||||
/* 9x board */
|
||||
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK, false);
|
||||
openTx = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X board"), BOARD_STOCK);
|
||||
openTx->addOptions(ext_options);
|
||||
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1008,7 +1045,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
openTx = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128, false);
|
||||
openTx = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), BOARD_M128);
|
||||
openTx->addOptions(ext_options);
|
||||
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1040,7 +1077,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9XR board */
|
||||
openTx = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK, false);
|
||||
openTx = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK);
|
||||
openTx->addOptions(extr_options);
|
||||
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1075,7 +1112,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
openTx = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128, false);
|
||||
openTx = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128);
|
||||
openTx->addOptions(extr_options);
|
||||
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1105,8 +1142,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* Gruvin9x board */
|
||||
openTx = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X, false);
|
||||
openTx->setVariantBase(FRSKY_VARIANT);
|
||||
openTx = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), BOARD_GRUVIN9X);
|
||||
openTx->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1135,8 +1171,7 @@ void registerOpenTxFirmwares()
|
||||
|
||||
#ifndef __APPLE__
|
||||
/* SKY9X board */
|
||||
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X, true);
|
||||
openTx->setVariantBase(FRSKY_VARIANT);
|
||||
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
|
||||
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1158,9 +1193,8 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOptions(fai_options);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* SKY9X board */
|
||||
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO, true);
|
||||
openTx->setVariantBase(FRSKY_VARIANT);
|
||||
/* 9XR-Pro */
|
||||
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
|
||||
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1181,33 +1215,10 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
openTx->addOptions(fai_options);
|
||||
firmwares.push_back(openTx);
|
||||
openTx = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X, true);
|
||||
openTx->setVariantBase(FRSKY_VARIANT);
|
||||
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
openTx->addOption("nofp", QObject::tr("No flight modes"));
|
||||
openTx->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
openTx->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
openTx->addOption("ppmus", QObject::tr("Channel values displayed in us"));
|
||||
openTx->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
openTx->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
openTx->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
openTx->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
openTx->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
openTx->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
openTx->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
openTx->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
openTx->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
openTx->addOption("sqt5font", QObject::tr("Use alternative SQT5 font"));
|
||||
openTx->addOption("tsticks", QObject::tr("Use FrSky Taranis sticks in a 9X/9XR"));
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
openTx->addOptions(fai_options);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
#endif
|
||||
|
||||
/* Taranis board */
|
||||
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS, true);
|
||||
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
@@ -1218,7 +1229,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
/* Taranis Plus board */
|
||||
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS, true);
|
||||
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
@@ -1227,7 +1238,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOptions(fai_options);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
default_firmware_variant = GetFirmwareVariant("opentx-9x-heli-templates-en");
|
||||
default_firmware_variant = GetFirmware("opentx-9x-heli-templates-en");
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-20.open-tx.org/companion"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-20.open-tx.org/firmware"
|
||||
|
||||
class EFile;
|
||||
class RleFile;
|
||||
|
||||
class OpenTxEepromInterface : public EEPROMInterface
|
||||
{
|
||||
@@ -74,14 +74,19 @@ class OpenTxEepromInterface : public EEPROMInterface
|
||||
template <class T>
|
||||
bool saveGeneral(GeneralSettings &settings, BoardEnum board, uint32_t version, uint32_t variant);
|
||||
|
||||
EFile *efile;
|
||||
RleFile *efile;
|
||||
|
||||
};
|
||||
|
||||
class OpenTxFirmware: public FirmwareInterface {
|
||||
public:
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board, bool voice = false):
|
||||
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board), voice)
|
||||
OpenTxFirmware(const QString & id, OpenTxFirmware * parent):
|
||||
FirmwareInterface(parent, id, parent->getName(), parent->getBoard(), parent->eepromInterface)
|
||||
{
|
||||
}
|
||||
|
||||
OpenTxFirmware(const QString & id, const QString & name, const BoardEnum board):
|
||||
FirmwareInterface(id, name, board, new OpenTxEepromInterface(board))
|
||||
{
|
||||
addLanguage("en");
|
||||
addLanguage("fr");
|
||||
@@ -103,19 +108,23 @@ class OpenTxFirmware: public FirmwareInterface {
|
||||
addTTSLanguage("pl");
|
||||
addTTSLanguage("pt");
|
||||
addTTSLanguage("es");
|
||||
addTTSLanguage("hu");
|
||||
}
|
||||
|
||||
virtual FirmwareInterface * getFirmwareVariant(const QString & id);
|
||||
|
||||
virtual QString getStampUrl();
|
||||
|
||||
virtual QString getReleaseNotesUrl();
|
||||
|
||||
virtual QString getFirmwareUrl(QString & id);
|
||||
virtual QString getFirmwareUrl();
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
virtual SimulatorInterface * getSimulator();
|
||||
|
||||
|
||||
};
|
||||
|
||||
void registerOpenTxFirmwares();
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
#define DATE_STR "@DATE@"
|
||||
#define TIME_STR "@TIME@"
|
||||
#define VERS_STR "@C9X_VERSION@"
|
||||
#define MOD_STR "FH"
|
||||
|
||||
@@ -85,7 +85,6 @@ Th9xGeneral::operator GeneralSettings ()
|
||||
}
|
||||
result.stickMode = stickMode;
|
||||
result.inactivityTimer = inactivityMin;
|
||||
result.filterInput = adcFilt;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -296,7 +295,7 @@ t_Th9xModelData::operator ModelData ()
|
||||
for (int i=0; i<TH9X_MAX_MIXERS; i++)
|
||||
c9x.mixData[i] = mixData[i];
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
c9x.phaseData[0].trim[i] = trimData[i].itrim;
|
||||
c9x.flightModeData[0].trim[i] = trimData[i].itrim;
|
||||
for (int i=0; i<TH9X_MAX_CURVES3; i++) {
|
||||
c9x.curves[i].count = 3;
|
||||
for (int j=0; j<3; j++) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
Th9xInterface::Th9xInterface():
|
||||
EEPROMInterface(BOARD_STOCK),
|
||||
efile(new EFile())
|
||||
efile(new RleFile())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class EFile;
|
||||
class RleFile;
|
||||
|
||||
class Th9xInterface : public EEPROMInterface
|
||||
{
|
||||
@@ -50,7 +50,7 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
protected:
|
||||
|
||||
EFile *efile;
|
||||
RleFile *efile;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,17 @@ FlashInterface::FlashInterface(QString fileName):
|
||||
version = seekLabel(VERS_MARK);
|
||||
date = seekLabel(DATE_MARK);
|
||||
time = seekLabel(TIME_MARK);
|
||||
eeprom = seekLabel(EEPR_MARK);
|
||||
eepromId = seekLabel(EEPR_MARK);
|
||||
|
||||
if (eepromId.contains('-')) {
|
||||
QStringList list = eepromId.split('-');
|
||||
eepromVersion = list[0].toInt();
|
||||
eepromVariant = list[1].toInt();
|
||||
}
|
||||
else {
|
||||
eepromVersion = eepromId.toInt();
|
||||
}
|
||||
|
||||
versionId = version2index(version);
|
||||
SeekSplash();
|
||||
isValidFlag = true;
|
||||
@@ -182,7 +192,7 @@ void FlashInterface::SeekSplash(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, sizeof(OTX_SPS_TARANIS)), QByteArray(OTX_SPE, sizeof(OTX_SPE)), 6790)) {
|
||||
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 6784)) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
|
||||
@@ -49,7 +49,9 @@ class FlashInterface
|
||||
int getSize() { return flash_size; }
|
||||
inline QString getVersion() { return version; }
|
||||
unsigned int getVersionId() { return versionId; }
|
||||
inline QString getEEprom() { return eeprom; }
|
||||
inline int getEEpromVersion() { return eepromVersion; }
|
||||
inline int getEEpromVariant() { return eepromVariant; }
|
||||
inline QString getEEpromId() { return eepromId; }
|
||||
QImage getSplash();
|
||||
bool setSplash(const QImage & newsplash);
|
||||
bool hasSplash();
|
||||
@@ -72,7 +74,9 @@ class FlashInterface
|
||||
QString time;
|
||||
QString version;
|
||||
int versionId;
|
||||
QString eeprom;
|
||||
QString eepromId;
|
||||
int eepromVersion;
|
||||
int eepromVariant;
|
||||
QByteArray splash;
|
||||
uint splash_offset;
|
||||
uint splash_size;
|
||||
|
||||
@@ -14,6 +14,12 @@ FirmwarePreferencesDialog::FirmwarePreferencesDialog(QWidget *parent) :
|
||||
ui->setupUi(this);
|
||||
setWindowIcon(CompanionIcon("fwpreferences.png"));
|
||||
initSettings();
|
||||
|
||||
foreach(const char *lang, GetCurrentFirmware()->getFirmwareBase()->ttslanguages) {
|
||||
ui->voiceCombo->addItem(lang);
|
||||
if (current_firmware_variant->getId().contains(QString("-tts%1").arg(lang)))
|
||||
ui->voiceCombo->setCurrentIndex(ui->voiceCombo->count() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
FirmwarePreferencesDialog::~FirmwarePreferencesDialog()
|
||||
|
||||
@@ -81,56 +81,6 @@
|
||||
<string>Set voice language.
|
||||
May be different from firmware language</string>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>en</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>cz</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>de</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>es</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>fi</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>fr</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>it</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>pl</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>pt</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>se</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="5">
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "appdata.h"
|
||||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#define BIT_WARN_THR ( 0x01 )
|
||||
#define BIT_WARN_SW ( 0x02 )
|
||||
@@ -51,7 +50,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->chkSG->setValue(switchstate & 0x3);
|
||||
switchstate >>= 2;
|
||||
ui->chkSH->setValue(switchstate & 0x3);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
for (int i=0; pmsl[i]; i++) {
|
||||
pmsl[i]->hide();
|
||||
}
|
||||
@@ -83,30 +83,28 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
|
||||
switchDefPosEditLock=true;
|
||||
populateBacklightCB(ui->backlightswCB, g_eeGeneral.backlightMode);
|
||||
bool voice = current_firmware_variant.id.contains("voice");
|
||||
|
||||
if (!GetCurrentFirmware()->getCapability(MultiLangVoice)) {
|
||||
ui->VoiceLang_label->hide();
|
||||
ui->voiceLang_CB->hide();
|
||||
} else {
|
||||
voiceLangEditLock=true;
|
||||
populateVoiceLangCB(ui->voiceLang_CB, g_eeGeneral.ttsLanguage);
|
||||
voiceLangEditLock=false;
|
||||
}
|
||||
bool mavlink = current_firmware_variant.id.contains("mavlink");
|
||||
if (!mavlink) {
|
||||
else {
|
||||
voiceLangEditLock = true;
|
||||
populateVoiceLangCB(ui->voiceLang_CB, g_eeGeneral.ttsLanguage);
|
||||
voiceLangEditLock = false;
|
||||
}
|
||||
|
||||
if (!GetCurrentFirmware()->getCapability(MavlinkTelemetry)) {
|
||||
ui->mavbaud_CB->hide();
|
||||
ui->mavbaud_label->hide();
|
||||
} else {
|
||||
mavbaudEditLock=true;
|
||||
}
|
||||
else {
|
||||
mavbaudEditLock = true;
|
||||
ui->mavbaud_CB->setCurrentIndex(g_eeGeneral.mavbaud);
|
||||
populateVoiceLangCB(ui->voiceLang_CB, g_eeGeneral.ttsLanguage);
|
||||
mavbaudEditLock=false;
|
||||
// TODO why ??? populateVoiceLangCB(ui->voiceLang_CB, g_eeGeneral.ttsLanguage);
|
||||
mavbaudEditLock = false;
|
||||
}
|
||||
|
||||
if (!GetCurrentFirmware()->getCapability(HasContrast)) {
|
||||
ui->contrastSB->hide();
|
||||
ui->label_contrast->hide();
|
||||
}
|
||||
if (!GetCurrentFirmware()->getCapability(HasSoundMixer)) {
|
||||
ui->beepVolume_SL->hide();
|
||||
ui->beepVolume_label->hide();
|
||||
@@ -122,7 +120,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->varioPMax_SB->hide();
|
||||
ui->varioR0_label->hide();
|
||||
ui->varioR0_SB->hide();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->beepVolume_SL->setValue(g_eeGeneral.beepVolume);
|
||||
ui->varioVolume_SL->setValue(g_eeGeneral.varioVolume);
|
||||
ui->bgVolume_SL->setValue(g_eeGeneral.backgroundVolume);
|
||||
@@ -169,11 +168,12 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->displayTypeCB->setDisabled(true);
|
||||
ui->displayTypeCB->hide();
|
||||
}
|
||||
if (!GetCurrentFirmware()->getCapability(HasVolume) && !voice) {
|
||||
if (!GetCurrentFirmware()->getCapability(HasVolume)) {
|
||||
ui->volume_SB->hide();
|
||||
ui->volume_SB->setDisabled(true);
|
||||
ui->label_volume->hide();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->volume_SB->setMaximum(GetCurrentFirmware()->getCapability(MaxVolume));
|
||||
}
|
||||
if (!GetCurrentFirmware()->getCapability(HasBrightness)) {
|
||||
@@ -309,7 +309,15 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) :
|
||||
ui->backlightColor2_label->hide();
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(GetCurrentFirmware()->getBoard()) + " GeneralEdit");
|
||||
if (IS_ARM(eepromInterface->getBoard())) {
|
||||
ui->switchesDelay->setValue(10*(g_eeGeneral.switchesDelay+15));
|
||||
}
|
||||
else {
|
||||
ui->switchesDelay->hide();
|
||||
ui->switchesDelayLabel->hide();
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
GeneralEdit::~GeneralEdit()
|
||||
@@ -520,6 +528,12 @@ void GeneralEdit::on_backlightautoSB_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralEdit::on_switchesDelay_valueChanged()
|
||||
{
|
||||
g_eeGeneral.switchesDelay = (ui->switchesDelay->value() / 10) - 15;
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
void GeneralEdit::on_backlightColor_SL_valueChanged()
|
||||
{
|
||||
g_eeGeneral.backlightColor = ui->backlightColor_SL->value();
|
||||
@@ -1065,7 +1079,8 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
if (name.isEmpty()) {
|
||||
ui->calstore_PB->setDisabled(true);
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
if (!(calib.isEmpty())) {
|
||||
int ret = QMessageBox::question(this, "Companion",
|
||||
@@ -1104,7 +1119,50 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralEdit::shrink() {
|
||||
resize(100,100);
|
||||
resize(0,0);
|
||||
void GeneralEdit::shrink()
|
||||
{
|
||||
resize(100, 100);
|
||||
resize(0, 0);
|
||||
}
|
||||
|
||||
bool GeneralEdit::eventFilter(QObject *object, QEvent * event)
|
||||
{
|
||||
QWidget * widget = qobject_cast<QWidget*>(object);
|
||||
if (widget) {
|
||||
if (event->type() == QEvent::Wheel) {
|
||||
if (widget->focusPolicy() == Qt::WheelFocus) {
|
||||
event->accept();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
event->ignore();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::FocusIn) {
|
||||
widget->setFocusPolicy(Qt::WheelFocus);
|
||||
}
|
||||
else if (event->type() == QEvent::FocusOut) {
|
||||
widget->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(object, event);
|
||||
}
|
||||
|
||||
void GeneralEdit::disableMouseScrolling()
|
||||
{
|
||||
Q_FOREACH(QComboBox * cb, findChildren<QComboBox*>()) {
|
||||
cb->installEventFilter(this);
|
||||
cb->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
Q_FOREACH(QAbstractSpinBox * sb, findChildren<QAbstractSpinBox*>()) {
|
||||
sb->installEventFilter(this);
|
||||
sb->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
Q_FOREACH(QSlider * slider, findChildren<QSlider*>()) {
|
||||
slider->installEventFilter(this);
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@ class GeneralEdit : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
public:
|
||||
explicit GeneralEdit(RadioData &radioData, QWidget *parent = 0);
|
||||
~GeneralEdit();
|
||||
void updateSettings();
|
||||
|
||||
private:
|
||||
private:
|
||||
Ui::GeneralEdit *ui;
|
||||
RadioData &radioData;
|
||||
GeneralSettings g_eeGeneral;
|
||||
@@ -28,11 +28,15 @@ private:
|
||||
void getGeneralSwitchDefPos(int i, bool val);
|
||||
void setSwitchDefPos();
|
||||
void updateVarioPitchRange();
|
||||
void disableMouseScrolling();
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void modelValuesChanged();
|
||||
|
||||
private slots:
|
||||
private slots:
|
||||
void on_faimode_CB_stateChanged(int );
|
||||
void on_speakerPitchSB_editingFinished();
|
||||
void on_timezoneSB_editingFinished();
|
||||
@@ -132,6 +136,7 @@ private slots:
|
||||
void setValues();
|
||||
void shrink();
|
||||
void stickReverseEdited();
|
||||
void on_switchesDelay_valueChanged();
|
||||
};
|
||||
|
||||
#endif // GENERALEDIT_H
|
||||
|
||||
@@ -1968,6 +1968,52 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="0">
|
||||
<widget class="QLabel" name="switchesDelayLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Play Delay (switch mid position)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="34" column="1">
|
||||
<widget class="QSpinBox" name="switchesDelay">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">LCD Screen Contrast</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Values can be 20-45</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>300</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabTrainer">
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
#include "googleanalytics.h"
|
||||
#include <QtGui>
|
||||
|
||||
#define TRACKING_ID "UA-40098569-1"
|
||||
|
||||
GoogleAnalytics ga;
|
||||
|
||||
GoogleAnalytics::GoogleAnalytics():
|
||||
userId(qrand()),
|
||||
networkManager(new QNetworkAccessManager(this))
|
||||
{
|
||||
}
|
||||
|
||||
GoogleAnalytics::~GoogleAnalytics()
|
||||
{
|
||||
delete networkManager;
|
||||
}
|
||||
|
||||
void GoogleAnalytics::sendPageView(QString title)
|
||||
{
|
||||
// create request and set URL of receiver
|
||||
QNetworkRequest request;
|
||||
QUrl host("http://www.google-analytics.com/collect");
|
||||
request.setUrl(host);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
// setup parameters of request
|
||||
QString requestParams;
|
||||
requestParams += "v=1"; // version of protocol
|
||||
requestParams += "&t=pageview"; // type of request
|
||||
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
|
||||
requestParams += "&cid=" + QString::number(userId); // unique user identifier
|
||||
requestParams += "&dp=companion-" + title.toLower().replace(" ", "-"); // name of page
|
||||
requestParams += "&dt=" + title; // title of page
|
||||
requestParams += "&ul=" + QLocale::system().name(); // language
|
||||
|
||||
// send request via post method
|
||||
networkManager->post(request, requestParams.toStdString().c_str());
|
||||
}
|
||||
|
||||
void GoogleAnalytics::sendEvent(QString category, QString action, QString label)
|
||||
{
|
||||
// create request and set URL of receiver
|
||||
QNetworkRequest request;
|
||||
QUrl host("http://www.google-analytics.com/collect");
|
||||
request.setUrl(host);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||
|
||||
// setup parameters of request
|
||||
QString requestParams;
|
||||
requestParams += "v=1"; // version of protocol
|
||||
requestParams += "&t=event"; // type of request
|
||||
requestParams += "&ec=" + category;
|
||||
requestParams += "&ea=" + action;
|
||||
requestParams += "&el=" + label;
|
||||
requestParams += "&tid=" TRACKING_ID; // Google Analytics account
|
||||
requestParams += "&cid=" + QString::number(userId); // unique user identifier
|
||||
requestParams += "&dt=Companion"; // name of page (or app name)
|
||||
requestParams += "&ul=" + QLocale::system().name(); // language
|
||||
|
||||
// send request via post method
|
||||
networkManager->post(request, requestParams.toStdString().c_str());
|
||||
}
|
||||
|
||||
void GoogleAnalytics::slot_receive(QNetworkReply * reply)
|
||||
{
|
||||
// output information about reply
|
||||
qDebug() << "RequestUrl:" << reply->request().url();
|
||||
qDebug() << "Status:" << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
qDebug() << "Error:"<< reply->error();
|
||||
QByteArray bytes = reply->readAll();
|
||||
qDebug() << "Contents" << QString::fromUtf8(bytes.data(), bytes.size());
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <QtNetwork>
|
||||
|
||||
class GoogleAnalytics: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GoogleAnalytics();
|
||||
~GoogleAnalytics();
|
||||
void sendPageView(QString page);
|
||||
void sendEvent(QString category, QString action, QString label="");
|
||||
|
||||
protected slots:
|
||||
void slot_receive(QNetworkReply * reply);
|
||||
|
||||
protected:
|
||||
int userId;
|
||||
QNetworkAccessManager * networkManager;
|
||||
};
|
||||
|
||||
extern GoogleAnalytics ga;
|
||||
@@ -72,7 +72,7 @@ QString getInputStr(ModelData & model, int index)
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, index).toString();
|
||||
result = RawSource(SOURCE_TYPE_STICK, index).toString(model);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -140,20 +140,6 @@ void populatePhasesCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
|
||||
}
|
||||
|
||||
bool gvarsEnabled()
|
||||
{
|
||||
int gvars=0;
|
||||
if (GetCurrentFirmware()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars=1;
|
||||
}
|
||||
return gvars;
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
|
||||
QObject(),
|
||||
weightGV(weightGV),
|
||||
@@ -165,14 +151,14 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
|
||||
{
|
||||
lock = true;
|
||||
|
||||
if (gvarsEnabled()) {
|
||||
if (GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
populateGVCB(weightCB, weight);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
else {
|
||||
weightGV->hide();
|
||||
if (weight > maxi || weight < -mini) {
|
||||
if (weight > maxi || weight < mini) {
|
||||
weight = deflt;
|
||||
}
|
||||
}
|
||||
@@ -363,36 +349,6 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
|
||||
{
|
||||
GeneralSettings fakeSettings;
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
populateSwitchCB(b, value, fakeSettings);
|
||||
}
|
||||
else {
|
||||
RawSwitch item;
|
||||
|
||||
b->clear();
|
||||
|
||||
item = RawSwitch(SWITCH_TYPE_NONE);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
|
||||
for (int i=1; i<=GetCurrentFirmware()->getCapability(SwitchesPositions); i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=1; i<=6; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
|
||||
{
|
||||
RawSwitch item;
|
||||
@@ -523,8 +479,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
|
||||
void populateGVCB(QComboBox *b, int value)
|
||||
{
|
||||
int selected=0;
|
||||
int nullitem;
|
||||
bool selected = false;
|
||||
|
||||
b->clear();
|
||||
|
||||
@@ -534,29 +489,22 @@ void populateGVCB(QComboBox *b, int value)
|
||||
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||
if (value == gval) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
selected=1;
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
b->addItem("---", 0);
|
||||
|
||||
nullitem=b->count()-1;
|
||||
if (value == 0) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
selected=1;
|
||||
}
|
||||
|
||||
for (int i=1; i<=pgvars; i++) {
|
||||
int16_t gval = (int16_t)(10000+i);
|
||||
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
||||
if (value == gval) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
selected=1;
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (selected==0)
|
||||
b->setCurrentIndex(nullitem);
|
||||
if (!selected) {
|
||||
b->setCurrentIndex(pgvars);
|
||||
}
|
||||
}
|
||||
|
||||
void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags)
|
||||
@@ -567,16 +515,27 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
|
||||
if (flags & POPULATE_SOURCES) {
|
||||
item = RawSource(SOURCE_TYPE_NONE);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
if (flags & POPULATE_SCRIPT_OUTPUTS) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
|
||||
item = RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j);
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (flags & POPULATE_VIRTUAL_INPUTS) {
|
||||
int virtualInputs = GetCurrentFirmware()->getCapability(VirtualInputs);
|
||||
for (int i=0; i<virtualInputs; i++) {
|
||||
if (model.isInputValid(i)) {
|
||||
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, &model);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i);
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -585,12 +544,12 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (flags & POPULATE_SOURCES) {
|
||||
for (int i=0; i<4+GetCurrentFirmware()->getCapability(Pots); i++) {
|
||||
item = RawSource(SOURCE_TYPE_STICK, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(RotaryEncoders); i++) {
|
||||
item = RawSource(SOURCE_TYPE_ROTARY_ENCODER, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -598,27 +557,27 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (flags & POPULATE_TRIMS) {
|
||||
for (int i=0; i<4; i++) {
|
||||
item = RawSource(SOURCE_TYPE_TRIM, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & POPULATE_SOURCES) {
|
||||
item = RawSource(SOURCE_TYPE_MAX);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
if (flags & POPULATE_SWITCHES) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Switches); i++) {
|
||||
item = RawSource(SOURCE_TYPE_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
|
||||
item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -626,19 +585,19 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (flags & POPULATE_SOURCES) {
|
||||
for (int i=0; i<NUM_CYC; i++) {
|
||||
item = RawSource(SOURCE_TYPE_CYC, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(TrainerInputs); i++) {
|
||||
item = RawSource(SOURCE_TYPE_PPM, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Outputs); i++) {
|
||||
item = RawSource(SOURCE_TYPE_CH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -648,7 +607,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(GetCurrentFirmware()->getBoard()))
|
||||
continue;
|
||||
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -657,7 +616,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(GetCurrentFirmware()->getBoard()))
|
||||
continue;
|
||||
item = RawSource(SOURCE_TYPE_TELEMETRY, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -665,7 +624,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (flags & POPULATE_GVARS) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Gvars); i++) {
|
||||
item = RawSource(SOURCE_TYPE_GVAR, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
@@ -791,7 +750,8 @@ QString getFrSkyMeasure(int units)
|
||||
|
||||
QString getFrSkySrc(int index)
|
||||
{
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString();
|
||||
ModelData model;
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString(model);
|
||||
}
|
||||
|
||||
QString getTrimInc(ModelData * g_model)
|
||||
@@ -835,7 +795,7 @@ QString getPhasesStr(unsigned int phases, ModelData & model)
|
||||
for (int i=0; i<numphases;i++) {
|
||||
if (!(phases & (1<<i))) {
|
||||
if (count++ > 0) str += QString(", ");
|
||||
str += getPhaseName(i+1, model.phaseData[i].name);
|
||||
str += getPhaseName(i+1, model.flightModeData[i].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,6 @@ class CompanionIcon: public QIcon {
|
||||
CompanionIcon(QString baseimage);
|
||||
};
|
||||
|
||||
bool gvarsEnabled();
|
||||
|
||||
class GVarGroup : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
@@ -84,7 +82,6 @@ class CurveGroup : public QObject {
|
||||
|
||||
#define POPULATE_ONOFF 0x01
|
||||
#define POPULATE_TIMER_MODES 0x02
|
||||
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value);
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr=0);
|
||||
|
||||
void populatePhasesCB(QComboBox *b, int value);
|
||||
@@ -92,13 +89,14 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
QString getProtocolStr(const int proto);
|
||||
QString getPhasesStr(unsigned int phases, ModelData & model);
|
||||
|
||||
#define POPULATE_SOURCES 1
|
||||
#define POPULATE_TRIMS 2
|
||||
#define POPULATE_SWITCHES 4
|
||||
#define POPULATE_GVARS 8
|
||||
#define POPULATE_TELEMETRY 16
|
||||
#define POPULATE_TELEMETRYEXT 32
|
||||
#define POPULATE_VIRTUAL_INPUTS 64
|
||||
#define POPULATE_SOURCES (1<<0)
|
||||
#define POPULATE_TRIMS (1<<1)
|
||||
#define POPULATE_SWITCHES (1<<2)
|
||||
#define POPULATE_GVARS (1<<3)
|
||||
#define POPULATE_TELEMETRY (1<<4)
|
||||
#define POPULATE_TELEMETRYEXT (1<<5)
|
||||
#define POPULATE_VIRTUAL_INPUTS (1<<6)
|
||||
#define POPULATE_SCRIPT_OUTPUTS (1<<7)
|
||||
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
@@ -132,4 +130,12 @@ QPixmap makePixMap( QImage image, QString firmwareType );
|
||||
int version2index(QString version);
|
||||
QString index2version(int index);
|
||||
|
||||
class QTimeS : public QTime
|
||||
{
|
||||
public:
|
||||
QTimeS(int s) { int h = s/3600; s %= 3600; int m = s/60; s %=60; setHMS(h, m, s); };
|
||||
QTimeS(const QTime & q) : QTime(q) {};
|
||||
int seconds() const { return hour()*3600 + minute()*60 + second(); };
|
||||
};
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 2.4 KiB |
@@ -1091,18 +1091,6 @@
|
||||
offset="1"
|
||||
id="stop4633-8" />
|
||||
</linearGradient>
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter5060"
|
||||
x="-0.10864612"
|
||||
width="1.2172922"
|
||||
y="-0.24492737"
|
||||
height="1.4898547">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="5.7995994"
|
||||
id="feGaussianBlur5062" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
id="linearGradient4709-5">
|
||||
<stop
|
||||
@@ -1163,18 +1151,6 @@
|
||||
offset="1"
|
||||
id="stop4633-9" />
|
||||
</linearGradient>
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter6148"
|
||||
x="-0.090552361"
|
||||
width="1.1811047"
|
||||
y="-0.1778305"
|
||||
height="1.355661">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="5.1385088"
|
||||
id="feGaussianBlur6150" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient5786"
|
||||
@@ -2566,7 +2542,7 @@
|
||||
fx="299.52417"
|
||||
fy="779.74567"
|
||||
r="55.418938"
|
||||
gradientTransform="matrix(0.45002749,0.03665999,-0.00806819,0.09904275,-32.330683,866.95508)"
|
||||
gradientTransform="matrix(0.45002749,0.03665999,-0.00806819,0.09904275,194.65059,702.90631)"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
@@ -2577,7 +2553,7 @@
|
||||
x2="294.27679"
|
||||
y2="794.37579"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-203.53553,162.44975)" />
|
||||
gradientTransform="translate(23.445741,-1.5990189)" />
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter5149"
|
||||
@@ -2607,7 +2583,7 @@
|
||||
x2="292.177"
|
||||
y2="803.63416"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-203.53553,162.44975)" />
|
||||
gradientTransform="translate(23.445741,-1.5990189)" />
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter5295"
|
||||
@@ -2835,7 +2811,7 @@
|
||||
xlink:href="#linearGradient5127-5"
|
||||
id="linearGradient5695"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-203.69622,-0.7961383)"
|
||||
gradientTransform="matrix(1.3146629,0,0,1.3146629,-298.3169,-166.23615)"
|
||||
x1="326.85025"
|
||||
y1="793.87579"
|
||||
x2="294.27679"
|
||||
@@ -2845,7 +2821,7 @@
|
||||
xlink:href="#linearGradient5093-1"
|
||||
id="radialGradient5699"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.78006028,0.14595423,-0.08994153,0.48069744,-67.795168,373.85384)"
|
||||
gradientTransform="matrix(1.0255163,0.19188061,-0.1182428,0.63195509,-119.65283,326.30228)"
|
||||
cx="253.82587"
|
||||
cy="792.63324"
|
||||
fx="253.82587"
|
||||
@@ -2856,7 +2832,7 @@
|
||||
xlink:href="#linearGradient5105-3"
|
||||
id="radialGradient5714"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.97852709,0.20611827,-0.04337458,0.20591673,-164.16094,578.0247)"
|
||||
gradientTransform="matrix(1.2864332,0.27097604,-0.05702295,0.27071109,-246.34133,594.71814)"
|
||||
cx="246.97363"
|
||||
cy="789.21893"
|
||||
fx="246.97363"
|
||||
@@ -2867,7 +2843,7 @@
|
||||
xlink:href="#linearGradient5117-0"
|
||||
id="radialGradient5718"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.45002749,0.03665999,-0.00806819,0.09904275,-32.49138,703.70919)"
|
||||
gradientTransform="matrix(0.59163445,0.04819552,-0.01060695,0.13020783,-73.240247,759.95088)"
|
||||
cx="299.52417"
|
||||
cy="779.74567"
|
||||
fx="299.52417"
|
||||
@@ -2878,7 +2854,7 @@
|
||||
xlink:href="#linearGradient5727"
|
||||
id="linearGradient5722"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="translate(-203.69622,-0.7961383)"
|
||||
gradientTransform="translate(-211.47439,79.106926)"
|
||||
x1="266.15909"
|
||||
y1="735.04486"
|
||||
x2="292.177"
|
||||
@@ -2898,9 +2874,9 @@
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
borderlayer="true"
|
||||
inkscape:window-width="1280"
|
||||
inkscape:window-height="972"
|
||||
inkscape:window-x="1280"
|
||||
inkscape:window-width="1024"
|
||||
inkscape:window-height="744"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
showguides="true"
|
||||
@@ -2913,7 +2889,7 @@
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
@@ -2922,162 +2898,33 @@
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-702.36218)">
|
||||
<path
|
||||
style="opacity:0.16607774;fill:#212121;fill-opacity:1;stroke:none;filter:url(#filter5427)"
|
||||
d="m 353.28858,830.27639 19,-0.25 -0.75,-10.25 -24.25,-11.75 -0.5,22.25 z"
|
||||
id="path5361"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="matrix(0.80136773,0,0,0.80136773,-149.24088,316.37583)" />
|
||||
<path
|
||||
style="opacity:0.60070669;fill:#212121;fill-opacity:1;stroke:none;filter:url(#filter5357)"
|
||||
d="m 323.59376,743.0011 c -2.02047,0.27313 -4.06987,0.40162 -5.65936,2.82968 l -20.98682,32.54135 -46.21815,29.24005 0.23581,0 46.21815,29.24006 20.98681,32.54135 c 1.58949,2.42806 3.63889,2.55655 5.65937,2.82968 l 13.44099,0 0,-64.61109 -0.23581,0 0,-64.61108 -13.44099,0 z"
|
||||
id="path3473-4"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="matrix(1,0,0,0.94301708,-203.53553,204.05043)" />
|
||||
<path
|
||||
style="fill:#dc3232;fill-opacity:1;stroke:#000000;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 109.94896,891.54774 c -2.02047,0.27313 -4.06987,0.40162 -5.65936,2.82968 l -20.986823,32.54135 -46.21815,29.24005 0.23581,0 46.21815,29.24006 20.986813,32.54132 c 1.58949,2.428 3.63889,2.5565 5.65937,2.8297 l 13.44099,0 0,-64.61108 -0.23581,0 0,-64.61108 -13.44099,0 z"
|
||||
id="path3473"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="opacity:0.9181272;fill:url(#linearGradient5187);fill-opacity:1;stroke:#ffffff;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5161)"
|
||||
d="m 121.40197,893.5435 c -3.98587,0.0736 -7.99299,-0.14058 -11.96875,0.0937 l 0,5e-5 c -5.66719,0.75957 -6.41414,8.52927 -10.027703,11.99566 -5.47113,7.65546 -9.64823,16.62401 -15.87971,23.508 -14.19753,8.98836 -28.39506,17.97673 -42.59259,26.96509 14.71745,9.43817 29.76941,18.54698 44.28125,28.1875 7.64889,11.13495 14.17209,23.3742 22.437503,33.9062 4.5008,1.2612 9.34531,0.2231 13.96875,0.5625"
|
||||
id="path5153"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccc" />
|
||||
<path
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.27199996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 62.109637,948.31825 c -16.29822,0.1086 -26.48309,3.75139 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0291 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.03 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50585,7.42792 25.08486,-1.81148 45.880773,-5.3502 71.788463,-5.77727 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -25.89384,-0.42928 -46.669003,-3.96648 -71.744253,-5.77727 -3.46945,-0.25055 -6.75183,-0.34465 -9.81546,-0.32423 z"
|
||||
id="path3408"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scccccsccss" />
|
||||
<path
|
||||
sodipodi:nodetypes="scccccsccss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5115"
|
||||
d="m 62.109637,948.31825 c -16.29822,0.1086 -26.48309,3.75139 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0291 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.03 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50585,7.42792 25.08486,-1.81148 45.880773,-5.3502 71.788463,-5.77727 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -25.89384,-0.42928 -46.669003,-3.96648 -71.744253,-5.77727 -3.46945,-0.25055 -6.75183,-0.34465 -9.81546,-0.32423 z"
|
||||
style="fill:url(#radialGradient5123);fill-opacity:1;stroke:#000000;stroke-width:1.27199996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
sodipodi:nodetypes="cssccscc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5688"
|
||||
d="m 83.892766,952.60695 c -6.87778,-0.7158 -13.77991,-1.4658 -21.23736,-2.0043 -2.45227,-0.1771 -4.77613,-0.2503 -6.94156,-0.2358 -3.14581,0.021 -5.92519,0.2417 -8.37115,0.5895 -1.14311,3.3062 -0.96581,6.6124 0,9.9186 4.12512,0.5858 9.30688,0.7874 15.31271,0.3537 7.45864,-0.5386 14.35978,-1.2885 21.23736,-2.0043 0.64914,-2.1131 0.89851,-4.2832 0,-6.6174 z"
|
||||
style="fill:#212121;fill-opacity:1;stroke:#000000;stroke-width:0.33334607px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:#535353;fill-opacity:1;stroke:none;filter:url(#filter5684)"
|
||||
d="m 81.404082,954.22675 c -6.151626,-0.53187 -12.32503,-1.0891 -18.995124,-1.48925 -2.193359,-0.13156 -4.271866,-0.1859 -6.208671,-0.17519 -2.813676,0.0156 -5.29961,0.17959 -7.487325,0.43801 -1.022421,2.45651 -0.863841,4.91301 0,7.36951 3.68959,0.43523 8.324262,0.58507 13.695996,0.26283 6.671159,-0.4002 12.843677,-0.95735 18.995124,-1.48924 0.580604,-1.56999 0.803647,-3.1824 0,-4.91667 z"
|
||||
id="path3462-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssccscc"
|
||||
transform="matrix(0.9487876,0,0,0.65487255,5.1779868,331.94549)" />
|
||||
<rect
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#070707;stroke-width:1.32051849;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3507"
|
||||
width="13.912606"
|
||||
height="8.489048"
|
||||
x="70.280167"
|
||||
y="952.14117" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:2.07510066;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 72.506544,957.02087 46.329316,15.02601"
|
||||
id="path4279-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#000000;stroke-width:2.07510066;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="M 72.050618,955.14715 118.73347,941.00501"
|
||||
id="path4279"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
style="fill:#dcc75f;fill-opacity:1;stroke:#000000;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 61.200064,948.43449 c -16.29822,0.10861 -26.49671,3.74925 -26.71875,7.75 -4.7e-4,0.0292 -4.7e-4,0.0648 0,0.0937 -4.7e-4,0.0302 -4.7e-4,0.0638 0,0.0937 0.25241,4.75514 14.56443,9.02156 36.5,7.4375 5.05245,-0.36484 9.80312,-0.85532 14.59375,-1.3125 6.24289,-3.59689 7.9814,-7.60209 0,-12.4375 -4.78394,-0.45667 -9.51469,-0.91674 -14.5625,-1.28125 -3.46945,-0.25057 -6.74887,-0.36418 -9.8125,-0.34375 z m -5.65625,2.28125 c 2.16543,-0.0144 4.48523,0.0729 6.9375,0.25 7.45745,0.53854 14.37222,1.28416 21.25,2 0.89851,2.33414 0.64914,4.51196 0,6.625 -6.87758,0.71588 -13.79136,1.46138 -21.25,2 -6.00583,0.43371 -11.18738,0.21075 -15.3125,-0.375 -0.96581,-3.30621 -1.14311,-6.60003 0,-9.90625 2.44596,-0.3478 5.22919,-0.57275 8.375,-0.59375 z"
|
||||
id="path5103"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.07200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 112.08596,954.0289 c -18.568463,0.8356 -18.753283,3.98005 0.0834,4.59333 10.27215,-0.38097 20.26392,-0.53862 31.52949,-0.72433 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -11.25276,-0.18656 -21.32425,-0.0108 -31.58339,-0.39085 z"
|
||||
id="path3466"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.57200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 116.82782,1020.465 -0.74788,-58.411 7.07421,0"
|
||||
id="path3501"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.57200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 123.15415,950.73527 -7.07421,0 0.23581,-58.95173"
|
||||
id="path3503"
|
||||
inkscape:connector-curvature="0" />
|
||||
<rect
|
||||
style="opacity:0.53003534;fill:#212121;fill-opacity:1;stroke:none"
|
||||
id="rect3505"
|
||||
width="5.3357005"
|
||||
height="3.2573676"
|
||||
x="116.40572"
|
||||
y="939.42657" />
|
||||
<rect
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="rect3509"
|
||||
width="5.6508331"
|
||||
height="3.9498441"
|
||||
x="-959.20496"
|
||||
y="70.752983"
|
||||
transform="matrix(0,-1,1,0,0,0)" />
|
||||
<rect
|
||||
style="opacity:0.53003534;fill:#212121;fill-opacity:1;stroke:none"
|
||||
id="rect3505-6"
|
||||
width="5.3357005"
|
||||
height="3.2573676"
|
||||
x="117.03843"
|
||||
y="-973.44843"
|
||||
transform="scale(1,-1)" />
|
||||
<path
|
||||
style="opacity:0.77385158;fill:none;stroke:#ffffff;stroke-width:1.10000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5149)"
|
||||
d="m 35.13604,955.48871 c 15.716517,-12.07971 44.811908,-4.83224 68.98008,-1.28033"
|
||||
id="path5135"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5125"
|
||||
d="m 112.08596,954.0289 c -18.568463,0.8356 -18.753283,3.98005 0.0834,4.59333 10.27215,-0.38097 20.26392,-0.53862 31.52949,-0.72433 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -11.25276,-0.18656 -21.32425,-0.0108 -31.58339,-0.39085 z"
|
||||
style="fill:url(#linearGradient5133);fill-opacity:1;stroke:#000000;stroke-width:1.07200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
style="opacity:0.54063607;fill:#333333;fill-opacity:1;stroke:none;filter:url(#filter5295)"
|
||||
d="m 49.934137,963.20838 c 18.42376,3.94814 47.50436,4.19404 63.500003,3.625 l 4.25,0.75 5.625,3.875 0.125,-13.25 -30.500003,3.75 -27.25,1.5 z"
|
||||
id="path5189"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<path
|
||||
style="opacity:0.16607774;fill:#212121;fill-opacity:1;stroke:none;filter:url(#filter5427-6)"
|
||||
d="m 353.28858,830.27639 19,-0.25 -0.75,-10.25 -24.25,-11.75 -0.5,22.25 z"
|
||||
id="path5361-7"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="matrix(0.80136773,0,0,0.80136773,-149.40158,153.12994)" />
|
||||
transform="matrix(1.0535285,0,0,1.0535285,-226.93776,36.124757)" />
|
||||
<path
|
||||
style="opacity:0.60070669;fill:#212121;fill-opacity:1;stroke:none;filter:url(#filter5357-0)"
|
||||
d="m 323.59376,743.0011 c -2.02047,0.27313 -4.06987,0.40162 -5.65936,2.82968 l -20.98682,32.54135 -46.21815,29.24005 0.23581,0 46.21815,29.24006 20.98681,32.54135 c 1.58949,2.42806 3.63889,2.55655 5.65937,2.82968 l 13.44099,0 0,-64.61109 -0.23581,0 0,-64.61108 -13.44099,0 z"
|
||||
id="path3473-4-1"
|
||||
inkscape:connector-curvature="0"
|
||||
transform="matrix(1,0,0,0.94301708,-203.69622,40.804542)" />
|
||||
transform="matrix(1.314663,0,0,1.2397496,-298.31692,-111.54527)" />
|
||||
<path
|
||||
style="fill:#dc3232;fill-opacity:1;stroke:#000000;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 109.78826,728.30185 c -2.02047,0.27313 -4.06987,0.40162 -5.65936,2.82968 l -20.98682,32.54135 -46.21815,29.24005 0.23581,0 46.21815,29.24006 20.98681,32.54135 c 1.58949,2.42806 3.63889,2.55655 5.65937,2.82968 l 13.44099,0 0,-64.61109 -0.23581,0 0,-64.61108 -13.44099,0 z"
|
||||
style="fill:#dc3232;fill-opacity:1;stroke:#000000;stroke-width:1.54078507;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 113.80952,792.28197 c -2.65624,0.35907 -5.35051,0.528 -7.44015,3.72007 l -27.590593,42.78091 -60.761289,38.44082 0.31001,0 60.761291,38.44082 27.590571,42.7809 c 2.08965,3.19209 4.78392,3.36101 7.44017,3.72009 l 17.67038,0 0,-84.94181 -0.31001,0 0,-84.9418 -17.67038,0 z"
|
||||
id="path3473-5"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="opacity:0.9181272;fill:url(#linearGradient5722);fill-opacity:1;stroke:#fffcfc;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5161-7)"
|
||||
d="m 121.24127,730.29761 c -3.98587,0.0736 -7.99299,-0.14058 -11.96875,0.0937 l 0,5e-5 c -5.66719,0.75957 -6.41414,8.52927 -10.0277,11.99566 -5.47113,7.65546 -9.64823,16.62401 -15.87971,23.508 -14.19753,8.98836 -28.39506,17.97673 -42.59259,26.96509 14.71745,9.43817 29.76941,18.54698 44.28125,28.1875 7.64889,11.13495 14.17209,23.37424 22.4375,33.90625 4.5008,1.26119 9.34531,0.22306 13.96875,0.5625"
|
||||
d="m 113.4631,810.20067 c -3.98587,0.0736 -7.99299,-0.14058 -11.96875,0.0937 l 0,5e-5 c -5.667194,0.75957 -6.414144,8.52927 -10.027704,11.99566 -5.47113,7.65546 -9.64823,16.62401 -15.87971,23.508 -14.19753,8.98836 -28.39506,17.97673 -42.59259,26.96509 14.71745,9.43817 29.76941,18.54698 44.28125,28.1875 7.64889,11.13495 14.17209,23.37424 22.4375,33.90625 4.500804,1.26119 9.345314,0.22306 13.968754,0.5625"
|
||||
id="path5153-1"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccccc" />
|
||||
sodipodi:nodetypes="ccccccccc"
|
||||
transform="matrix(1.314663,0,0,1.314663,-20.299359,-270.23509)" />
|
||||
<path
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.27199996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 61.94894,785.07236 c -16.29822,0.1086 -26.48309,3.75139 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0291 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.03 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50585,7.42792 25.08486,-1.81148 45.88077,-5.3502 71.78847,-5.77727 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -25.89385,-0.42928 -46.66901,-3.96648 -71.74426,-5.77727 -3.46945,-0.25055 -6.75183,-0.34465 -9.81546,-0.32423 z"
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.67225122;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 50.916942,866.91606 c -21.426667,0.14277 -34.816338,4.93181 -35.108246,10.19146 l -0.01946,0 c -6.18e-4,0.0383 -6.18e-4,0.0781 0,0.11622 -6.18e-4,0.0394 -6.18e-4,0.0767 0,0.11621 l 0.01946,0 c 0.331835,6.25141 19.15502,11.84772 47.992889,9.76522 32.978135,-2.38149 60.317745,-7.03371 94.377645,-7.59517 2.19752,-0.16792 2.22008,-4.44342 -0.0388,-4.57259 -34.04168,-0.56436 -61.354016,-5.21459 -94.319516,-7.59516 -4.561157,-0.32939 -8.876381,-0.45311 -12.904022,-0.42626 z"
|
||||
id="path3408-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="scccccsccss" />
|
||||
@@ -3085,11 +2932,11 @@
|
||||
sodipodi:nodetypes="scccccsccss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5115-3"
|
||||
d="m 61.94894,785.07236 c -16.29822,0.1086 -26.48309,3.75139 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0291 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.03 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50585,7.42792 25.08486,-1.81148 45.88077,-5.3502 71.78847,-5.77727 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -25.89385,-0.42928 -46.66901,-3.96648 -71.74426,-5.77727 -3.46945,-0.25055 -6.75183,-0.34465 -9.81546,-0.32423 z"
|
||||
style="fill:url(#radialGradient5718);fill-opacity:1;stroke:#000000;stroke-width:1.27199996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
d="m 50.916942,866.91606 c -21.426667,0.14277 -34.816338,4.93181 -35.108246,10.19146 l -0.01946,0 c -6.18e-4,0.0383 -6.18e-4,0.0781 0,0.11622 -6.18e-4,0.0394 -6.18e-4,0.0767 0,0.11621 l 0.01946,0 c 0.331835,6.25141 19.15502,11.84772 47.992889,9.76522 32.978135,-2.38149 60.317745,-7.03371 94.377645,-7.59517 2.19752,-0.16792 2.22008,-4.44342 -0.0388,-4.57259 -34.04168,-0.56436 -61.354016,-5.21459 -94.319516,-7.59516 -4.561157,-0.32939 -8.876381,-0.45311 -12.904022,-0.42626 z"
|
||||
style="fill:url(#radialGradient5718);fill-opacity:1;stroke:#000000;stroke-width:1.67225122;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
style="fill:#dcc75f;fill-opacity:1;stroke:#000000;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 86.65625,786.46948 c -4.78394,-0.45667 -9.52801,-0.93243 -14.57582,-1.29694 -3.46945,-0.25057 -6.75183,-0.34466 -9.81546,-0.32423 -16.29822,0.10861 -26.48309,3.7514 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0292 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.0302 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50586,7.42792 5.05245,-0.36484 9.79992,-0.83976 14.59055,-1.29694 6.24289,-3.59689 7.9814,-7.6034 0,-12.43881 z"
|
||||
style="fill:#dcc75f;fill-opacity:1;stroke:#000000;stroke-width:1.54078507;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 83.398727,868.7528 c -6.289269,-0.60036 -12.526122,-1.22584 -19.16229,-1.70504 -4.561158,-0.32942 -8.876381,-0.45311 -12.904023,-0.42626 -21.426666,0.1428 -34.816337,4.93183 -35.108245,10.19147 l -0.01946,0 c -6.18e-4,0.0384 -6.18e-4,0.0781 0,0.11622 -6.18e-4,0.0398 -6.18e-4,0.0767 0,0.11621 l 0.01946,0 c 0.331834,6.25141 19.15502,11.84772 47.992902,9.76522 6.642269,-0.47965 12.883592,-1.104 19.181656,-1.70505 8.207296,-4.72869 10.492848,-9.9959 0,-16.35284 z"
|
||||
id="path3481-9-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="csscccccscc" />
|
||||
@@ -3097,109 +2944,111 @@
|
||||
sodipodi:nodetypes="csscccccscc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5103-4"
|
||||
d="m 86.65625,786.46948 c -4.78394,-0.45667 -9.52801,-0.93243 -14.57582,-1.29694 -3.46945,-0.25057 -6.75183,-0.34466 -9.81546,-0.32423 -16.29822,0.10861 -26.48309,3.7514 -26.70513,7.75215 l -0.0148,0 c -4.7e-4,0.0292 -4.7e-4,0.0594 0,0.0884 -4.7e-4,0.0302 -4.7e-4,0.0584 0,0.0884 l 0.0148,0 c 0.25241,4.75514 14.57029,9.01198 36.50586,7.42792 5.05245,-0.36484 9.79992,-0.83976 14.59055,-1.29694 6.24289,-3.59689 7.9814,-7.6034 0,-12.43881 z"
|
||||
style="fill:url(#radialGradient5714);fill-opacity:1;stroke:#000000;stroke-width:1.17200005;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
d="m 83.398727,868.7528 c -6.289269,-0.60036 -12.526122,-1.22584 -19.16229,-1.70504 -4.561158,-0.32942 -8.876381,-0.45311 -12.904023,-0.42626 -21.426666,0.1428 -34.816337,4.93183 -35.108245,10.19147 l -0.01946,0 c -6.18e-4,0.0384 -6.18e-4,0.0781 0,0.11622 -6.18e-4,0.0398 -6.18e-4,0.0767 0,0.11621 l 0.01946,0 c 0.331834,6.25141 19.15502,11.84772 47.992902,9.76522 6.642269,-0.47965 12.883592,-1.104 19.181656,-1.70505 8.207296,-4.72869 10.492848,-9.9959 0,-16.35284 z"
|
||||
style="fill:url(#radialGradient5714);fill-opacity:1;stroke:#000000;stroke-width:1.54078507;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
style="fill:#212121;fill-opacity:1;stroke:#000000;stroke-width:0.33334607px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 84.79273,789.36109 c -6.87778,-0.71584 -13.77991,-1.46582 -21.23736,-2.00436 -2.45227,-0.17709 -4.77613,-0.25023 -6.94156,-0.2358 -3.14581,0.021 -5.92519,0.24171 -8.37115,0.58951 -1.14311,3.30622 -0.96581,6.61242 0,9.91863 4.12512,0.58575 9.30688,0.78742 15.31271,0.35371 7.45864,-0.53862 14.35978,-1.28848 21.23736,-2.00436 0.64914,-2.11304 0.89851,-4.28319 0,-6.61733 z"
|
||||
style="fill:#212121;fill-opacity:1;stroke:#000000;stroke-width:0.43823776px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 80.948826,872.55429 c -9.041962,-0.94109 -18.115937,-1.92705 -27.919971,-2.63505 -3.223908,-0.23282 -6.279001,-0.32897 -9.125811,-0.31 -4.135681,0.0276 -7.789628,0.31777 -11.005241,0.77501 -1.502805,4.34655 -1.269715,8.6931 0,13.03965 5.423142,0.77006 12.23541,1.03519 20.131052,0.46501 9.805599,-0.70811 18.878271,-1.69391 27.919971,-2.63506 0.8534,-2.77794 1.181238,-5.63095 0,-8.69956 z"
|
||||
id="path3462-2"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cssccscc" />
|
||||
<path
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.07200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 111.92526,790.78301 c -18.56846,0.8356 -18.75328,3.98005 0.0834,4.59333 10.27215,-0.38097 20.26392,-0.53862 31.5295,-0.72433 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -11.25277,-0.18656 -21.32426,-0.0108 -31.5834,-0.39085 z"
|
||||
style="fill:#3234bd;fill-opacity:1;stroke:#000000;stroke-width:1.40931869;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 116.61896,874.42364 c -24.411268,1.09853 -24.654245,5.23242 0.10964,6.03868 13.50442,-0.50085 26.64022,-0.70811 41.45066,-0.95225 2.19753,-0.16792 2.22009,-4.44343 -0.0388,-4.57259 -14.7936,-0.24526 -28.03421,-0.0142 -41.52152,-0.51384 z"
|
||||
id="path3466-9"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.57200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 116.66712,857.21915 -0.74788,-58.41104 7.07421,0"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.75198728;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 122.85291,961.76477 -0.98322,-76.79083 9.30021,0"
|
||||
id="path3501-7"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccc" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:0.57200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 122.99345,787.48938 -7.07421,0 0.23581,-58.95173"
|
||||
style="fill:none;stroke:#000000;stroke-width:0.75198728;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 131.1699,870.09362 -9.30021,0 0.31002,-77.50165"
|
||||
id="path3503-0"
|
||||
inkscape:connector-curvature="0" />
|
||||
<rect
|
||||
style="opacity:0.53003534;fill:#212121;fill-opacity:1;stroke:none"
|
||||
id="rect3505-65"
|
||||
width="5.3357005"
|
||||
height="3.2573676"
|
||||
x="116.59856"
|
||||
y="769.81677" />
|
||||
width="7.0146475"
|
||||
height="4.2823405"
|
||||
x="122.76275"
|
||||
y="846.86011" />
|
||||
<rect
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#070707;stroke-width:1.32051849;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#070707;stroke-width:1.73603678;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3507-5"
|
||||
width="13.912606"
|
||||
height="8.489048"
|
||||
x="83.024162"
|
||||
y="768.74274" />
|
||||
width="18.290388"
|
||||
height="11.160236"
|
||||
x="78.623749"
|
||||
y="845.44812" />
|
||||
<rect
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="rect3509-5"
|
||||
width="9.1964684"
|
||||
height="4.1266208"
|
||||
x="83.613701"
|
||||
y="768.62482" />
|
||||
width="12.090257"
|
||||
height="5.4251156"
|
||||
x="79.398796"
|
||||
y="845.29315" />
|
||||
<path
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#000000;stroke-width:2.07510066;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 89.03726,770.51128 31.1265,0"
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#000000;stroke-width:2.72805786;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 86.528952,847.77314 40.920858,0"
|
||||
id="path4279-9"
|
||||
inkscape:connector-curvature="0" />
|
||||
<rect
|
||||
style="opacity:0.53003534;fill:#212121;fill-opacity:1;stroke:none"
|
||||
id="rect3505-6-1"
|
||||
width="5.3357005"
|
||||
height="3.2573676"
|
||||
x="116.87774"
|
||||
y="-815.68268"
|
||||
width="7.0146475"
|
||||
height="4.2823405"
|
||||
x="123.12979"
|
||||
y="-907.15833"
|
||||
transform="scale(1,-1)" />
|
||||
<rect
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#070707;stroke-width:1.32051849;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
style="fill:#81ff51;fill-opacity:1;stroke:#070707;stroke-width:1.73603678;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3507-7-5"
|
||||
width="13.912606"
|
||||
height="8.489048"
|
||||
x="83.303337"
|
||||
y="-816.75671"
|
||||
width="18.290388"
|
||||
height="11.160236"
|
||||
x="78.990768"
|
||||
y="-908.57037"
|
||||
transform="scale(1,-1)" />
|
||||
<rect
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="rect3509-8-5"
|
||||
width="9.1964684"
|
||||
height="4.1266208"
|
||||
x="83.892845"
|
||||
y="-816.87463"
|
||||
width="12.090257"
|
||||
height="5.4251156"
|
||||
x="79.76577"
|
||||
y="-908.72534"
|
||||
transform="scale(1,-1)" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:2.07510066;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 89.31641,814.98818 31.12651,0"
|
||||
style="fill:none;stroke:#000000;stroke-width:2.72805786;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 86.895941,906.24528 40.920869,0"
|
||||
id="path4279-7-2"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
sodipodi:nodetypes="cssccscc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5075-7"
|
||||
d="m 85.29273,788.86109 c -6.87778,-0.71584 -13.77991,-1.46582 -21.23736,-2.00436 -2.45227,-0.17709 -4.77613,-0.25023 -6.94156,-0.2358 -3.14581,0.021 -5.92519,0.24171 -8.37115,0.58951 -1.14311,3.30622 -0.96581,6.61242 0,9.91863 4.12512,0.58575 9.30688,0.78742 15.31271,0.35371 7.45864,-0.53862 14.35978,-1.28848 21.23736,-2.00436 0.64914,-2.11304 0.89851,-4.28319 0,-6.61733 z"
|
||||
style="fill:url(#radialGradient5699);fill-opacity:1;stroke:#070707;stroke-width:0.33334607px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0" />
|
||||
d="m 81.606158,871.89696 c -9.041964,-0.94109 -18.115938,-1.92706 -27.919971,-2.63506 -3.223908,-0.23281 -6.279001,-0.32897 -9.125812,-0.31 -4.13568,0.0276 -7.789627,0.31777 -11.00524,0.77501 -1.502805,4.34657 -1.269716,8.69311 0,13.03965 5.423142,0.77007 12.23541,1.0352 20.131052,0.46502 9.805597,-0.7081 18.878271,-1.69392 27.919971,-2.63506 0.8534,-2.77793 1.181237,-5.63095 0,-8.69956 z"
|
||||
style="fill:url(#radialGradient5699);fill-opacity:1;stroke:#070707;stroke-width:0.43823776px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0" />
|
||||
<path
|
||||
style="opacity:0.77385158;fill:none;stroke:#ffffff;stroke-width:1.60000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter5149-4)"
|
||||
d="m 37.80377,792.06605 c 14.47908,-8.72095 39.33183,-4.30191 63.5,-0.75"
|
||||
d="m 30.025596,871.96911 c 14.47908,-8.72095 39.33183,-4.30191 63.5,-0.75"
|
||||
id="path5135-0"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
sodipodi:nodetypes="cc"
|
||||
transform="matrix(1.314663,0,0,1.314663,-20.299359,-270.23509)" />
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path5125-7"
|
||||
d="m 111.92526,790.78301 c -18.56846,0.8356 -18.75328,3.98005 0.0834,4.59333 10.27215,-0.38097 20.26392,-0.53862 31.5295,-0.72433 1.67155,-0.12773 1.68871,-3.3799 -0.0295,-3.47815 -11.25277,-0.18656 -21.32426,-0.0108 -31.5834,-0.39085 z"
|
||||
style="fill:url(#linearGradient5695);fill-opacity:1;stroke:#000000;stroke-width:1.07200003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
d="m 116.61896,874.42364 c -24.411268,1.09853 -24.654245,5.23242 0.10964,6.03868 13.50442,-0.50085 26.64022,-0.70811 41.45066,-0.95225 2.19753,-0.16792 2.22009,-4.44343 -0.0388,-4.57259 -14.7936,-0.24526 -28.03421,-0.0142 -41.52152,-0.51384 z"
|
||||
style="fill:url(#linearGradient5695);fill-opacity:1;stroke:#000000;stroke-width:1.40931869;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
style="opacity:0.54063607;fill:#333333;fill-opacity:1;stroke:none;filter:url(#filter5295-5)"
|
||||
d="m 49.77344,799.96249 c 18.42376,3.94814 47.50436,4.19404 63.5,3.625 l 4.25,0.75 5.625,3.875 0.125,-13.25 -30.5,3.75 -27.25,1.5 z"
|
||||
d="m 41.995266,879.86555 c 18.42376,3.94814 47.50436,4.19404 63.500004,3.625 l 4.25,0.75 5.625,3.875 0.125,-13.25 -30.500004,3.75 -27.25,1.5 z"
|
||||
id="path5189-4"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
transform="matrix(1.314663,0,0,1.314663,-20.299359,-270.23509)" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -350,9 +350,9 @@ void logsDialog::on_mapsButton_clicked() {
|
||||
geFile.close();
|
||||
QStringList parameters;
|
||||
#ifdef __APPLE__
|
||||
gePath = "/usr/bin/open";
|
||||
parameters << "-a";
|
||||
parameters << "Google\ Earth";
|
||||
parameters << gePath;
|
||||
gePath = "/usr/bin/open";
|
||||
#endif
|
||||
parameters << geFilename;
|
||||
QProcess *process = new QProcess(this);
|
||||
@@ -525,7 +525,8 @@ void logsDialog::plotValue(int index, int plot, int numplots)
|
||||
ui->customPlot->graph(0)->setScatterStyle(QCP::ssNone);
|
||||
//ui->customPlot->graph()->setLineStyle((QCPGraph::LineStyle)(rand()%5+1));
|
||||
ui->customPlot->graph(0)->setPen(graphPen);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->customPlot->xAxis2->setRange(0, maxx-minx);
|
||||
ui->customPlot->yAxis2->setTickLabels(true);
|
||||
ui->customPlot->yAxis2->setRange(miny,maxy);
|
||||
@@ -540,7 +541,8 @@ void logsDialog::plotValue(int index, int plot, int numplots)
|
||||
//ui->customPlot->graph()->setLineStyle((QCPGraph::LineStyle)(rand()%5+1));
|
||||
ui->customPlot->graph(1)->setPen(graphPen);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ui->customPlot->yAxis->setTickLabels(false);
|
||||
ui->customPlot->yAxis2->setTickLabels(false);
|
||||
ui->customPlot->yAxis->setRange(-1100, 1100);
|
||||
|
||||
@@ -63,8 +63,7 @@
|
||||
#include "warnings.h"
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include "taranisnotfound.h"
|
||||
#include "googleanalytics.h"
|
||||
#include "radionotfound.h"
|
||||
#include "firmwares/opentx/opentxinterface.h" // TODO get rid of this include
|
||||
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
@@ -106,7 +105,7 @@ MainWindow::MainWindow():
|
||||
restoreState(g.mainWinState());
|
||||
restoreGeometry(g.mainWinGeo());
|
||||
|
||||
setUnifiedTitleAndToolBarOnMac(true);
|
||||
// setUnifiedTitleAndToolBarOnMac(true);
|
||||
this->setWindowIcon(QIcon(":/icon.png"));
|
||||
this->setIconSize(QSize(32, 32));
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
@@ -152,7 +151,8 @@ MainWindow::MainWindow():
|
||||
if (!(printing && (model >=0 && model<GetEepromInterface()->getMaxModels()) && !printfilename.isEmpty() )) {
|
||||
statusBar()->showMessage(tr("File loaded"), 2000);
|
||||
child->show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
child->show();
|
||||
child->print(model,printfilename);
|
||||
child->close();
|
||||
@@ -163,8 +163,6 @@ MainWindow::MainWindow():
|
||||
if (printing) {
|
||||
QTimer::singleShot(0, this, SLOT(autoClose()));
|
||||
}
|
||||
|
||||
ga.sendPageView("Home");
|
||||
}
|
||||
|
||||
void MainWindow::displayWarnings()
|
||||
@@ -232,7 +230,7 @@ void MainWindow::checkForUpdates()
|
||||
}
|
||||
else if (checkForUpdatesState & CHECK_FIRMWARE) {
|
||||
checkForUpdatesState -= CHECK_FIRMWARE;
|
||||
QString stamp = GetFirmware(current_firmware_variant.id)->getStampUrl();
|
||||
QString stamp = GetCurrentFirmware()->getStampUrl();
|
||||
if (!stamp.isEmpty()) {
|
||||
networkManager = new QNetworkAccessManager(this);
|
||||
connect(networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(checkForFirmwareUpdateFinished(QNetworkReply*)));
|
||||
@@ -364,7 +362,7 @@ void MainWindow::firmwareDownloadAccepted()
|
||||
return;
|
||||
}
|
||||
file.close();
|
||||
g.fwRev.set(current_firmware_variant.id, version2index(firmwareVersionString));
|
||||
g.fwRev.set(current_firmware_variant->getId(), version2index(firmwareVersionString));
|
||||
if (g.profile[g.id()].burnFirmware()) {
|
||||
int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the radio now ?"), QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret == QMessageBox::Yes) {
|
||||
@@ -399,7 +397,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
int currentVersion = g.fwRev.get(current_firmware_variant.id);
|
||||
int currentVersion = g.fwRev.get(current_firmware_variant->getId());
|
||||
QString currentVersionString = index2version(currentVersion);
|
||||
|
||||
QMessageBox msgBox;
|
||||
@@ -408,10 +406,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
|
||||
if (currentVersion == 0) {
|
||||
QString rn = GetFirmware(current_firmware_variant.id)->getReleaseNotesUrl();
|
||||
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?").arg(current_firmware_variant.id).arg(versionString));
|
||||
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?").arg(current_firmware_variant->getId()).arg(versionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
@@ -423,7 +421,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
if (msgBox.clickedButton() == rnButton) {
|
||||
contributorsDialog *cd = new contributorsDialog(this,2,rn);
|
||||
cd->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 %2 now ?").arg(versionString), QMessageBox::Yes | QMessageBox::No);
|
||||
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)
|
||||
download = true;
|
||||
else
|
||||
@@ -437,10 +435,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
}
|
||||
}
|
||||
else if (version > currentVersion) {
|
||||
QString rn = GetFirmware(current_firmware_variant.id)->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton;
|
||||
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 ?").arg(current_firmware_variant.id).arg(currentVersionString).arg(versionString));
|
||||
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 ?").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()) {
|
||||
@@ -478,7 +476,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
if (ignore) {
|
||||
int res = QMessageBox::question(this, "Companion", tr("Ignore this release %1?").arg(versionString), QMessageBox::Yes | QMessageBox::No);
|
||||
if (res==QMessageBox::Yes) {
|
||||
g.fwRev.set(current_firmware_variant.id, version);
|
||||
g.fwRev.set(current_firmware_variant->getId(), version);
|
||||
}
|
||||
}
|
||||
else if (download == true) {
|
||||
@@ -495,9 +493,10 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
|
||||
void MainWindow::startFirmwareDownload()
|
||||
{
|
||||
QString url = current_firmware_variant.getFirmwareUrl();
|
||||
QString url = current_firmware_variant->getFirmwareUrl();
|
||||
qDebug() << url;
|
||||
QString ext = url.mid(url.lastIndexOf("."));
|
||||
QString defaultFilename = g.flashDir() + "/" + current_firmware_variant.id;
|
||||
QString defaultFilename = g.flashDir() + "/" + current_firmware_variant->getId();
|
||||
if (g.profile[g.id()].renameFwFiles()) {
|
||||
defaultFilename += "-" + firmwareVersionString;
|
||||
}
|
||||
@@ -510,7 +509,6 @@ void MainWindow::startFirmwareDownload()
|
||||
downloadDialog * dd = new downloadDialog(this, url, filename);
|
||||
connect(dd, SIGNAL(accepted()), this, SLOT(firmwareDownloadAccepted()));
|
||||
dd->exec();
|
||||
ga.sendEvent(getBoardName(GetCurrentFirmware()->getBoard()), "Download", url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,7 +560,7 @@ void MainWindow::setIconThemeSize(int index)
|
||||
|
||||
void MainWindow::newFile()
|
||||
{
|
||||
MdiChild *child = createMdiChild();
|
||||
MdiChild * child = createMdiChild();
|
||||
child->newFile();
|
||||
child->show();
|
||||
}
|
||||
@@ -635,7 +633,7 @@ void MainWindow::loadProfile() //TODO Load all variables - Also HW!
|
||||
g.id( profnum );
|
||||
|
||||
// TODO Get rid of this global variable - The profile.firmware is the real source
|
||||
current_firmware_variant = GetFirmwareVariant(g.profile[g.id()].fwType());
|
||||
current_firmware_variant = GetFirmware(g.profile[g.id()].fwType());
|
||||
|
||||
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
|
||||
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
|
||||
@@ -911,15 +909,13 @@ QString MainWindow::FindMassstoragePath(QString filename)
|
||||
DWORD dwMaxFileNameLength=256;
|
||||
DWORD dwFileSystemFlags=0;
|
||||
bool ret = GetVolumeInformationW( (WCHAR *) drive.absolutePath().utf16(),szVolumeName,256,&dwSerialNumber,&dwMaxFileNameLength,&dwFileSystemFlags,szFileSystemName,256);
|
||||
if(ret) {
|
||||
if (ret) {
|
||||
QString vName = QString::fromUtf16 ( (const ushort *) szVolumeName) ;
|
||||
if (vName.contains("TARANIS")) {
|
||||
temppath = drive.absolutePath();
|
||||
eepromfile = temppath;
|
||||
eepromfile.append("/" + filename);
|
||||
if (QFile::exists(eepromfile)) {
|
||||
return eepromfile;
|
||||
}
|
||||
temppath = drive.absolutePath();
|
||||
eepromfile = temppath;
|
||||
eepromfile.append("/" + filename);
|
||||
if (QFile::exists(eepromfile)) {
|
||||
return eepromfile;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -991,7 +987,6 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
|
||||
ad->setWindowIcon(CompanionIcon("read_flash.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
sleep(1);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
@@ -1026,7 +1021,6 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
|
||||
ad->setWindowIcon(CompanionIcon("write_flash.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
sleep(1);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
@@ -1055,64 +1049,87 @@ bool MainWindow::readEepromFromRadio(const QString filename, const QString messa
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this);
|
||||
tnfd->exec();
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = FindMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
else {
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (!path.isEmpty()) {
|
||||
QStringList str;
|
||||
str << path << filename;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||
ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
sleep(1);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (result == false && !IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
QStringList str = GetReceiveEEpromCommand(filename);
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
|
||||
ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
sleep(1);
|
||||
result = true;
|
||||
}
|
||||
|
||||
if (!QFileInfo(filename).exists())
|
||||
if (result == false && IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
RadioNotFoundDialog *dialog = new RadioNotFoundDialog(this);
|
||||
dialog->exec();
|
||||
delete dialog;
|
||||
}
|
||||
|
||||
if (!QFileInfo(filename).exists()) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool MainWindow::writeEepromToRadio(const QString filename, const QString message)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("EEPROM.BIN");
|
||||
if (path.isEmpty()) {
|
||||
taranisNotFoundDialog *tnfd = new taranisNotFoundDialog(this);
|
||||
tnfd->exec();
|
||||
return false;
|
||||
// On previous OpenTX we called the EEPROM file "TARANIS.BIN" :(
|
||||
path = FindMassstoragePath("TARANIS.BIN");
|
||||
}
|
||||
else {
|
||||
if (path.isEmpty()) {
|
||||
// Mike's bootloader calls the EEPROM file "ERSKY9X.BIN" :(
|
||||
path = FindMassstoragePath("ERSKY9X.BIN");
|
||||
}
|
||||
if (!path.isEmpty()) {
|
||||
QStringList str;
|
||||
str << filename << path;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||
ad->setWindowIcon(CompanionIcon("read_eeprom.png"));
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message, AVR_DIALOG_SHOW_DONE);
|
||||
ad->setWindowIcon(CompanionIcon("write_eeprom.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
sleep(1);
|
||||
return true;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (result == false && !IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
QStringList str = GetSendEEpromCommand(filename);
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write Backup To Radio", AVR_DIALOG_SHOW_DONE);
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, "Write EEPROM To Radio", AVR_DIALOG_SHOW_DONE);
|
||||
ad->setWindowIcon(CompanionIcon("write_eeprom.png"));
|
||||
ad->exec();
|
||||
delete ad;
|
||||
return true;
|
||||
result = true;
|
||||
}
|
||||
|
||||
if (result == false && IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
RadioNotFoundDialog *dialog = new RadioNotFoundDialog(this);
|
||||
dialog->exec();
|
||||
delete dialog;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void MainWindow::writeBackup()
|
||||
@@ -1244,11 +1261,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
|
||||
if (!flash.isValid())
|
||||
return false;
|
||||
|
||||
unsigned int version = 0;
|
||||
unsigned int variant = 0;
|
||||
|
||||
QString fwEEprom = flash.getEEprom();
|
||||
version = fwEEprom.toInt();
|
||||
unsigned int version = flash.getEEpromVersion();
|
||||
unsigned int variant = flash.getEEpromVariant();
|
||||
|
||||
QFile file(backupFile);
|
||||
int eeprom_size = file.size();
|
||||
@@ -1310,7 +1324,7 @@ void MainWindow::writeFlash(QString fileToFlash)
|
||||
if (backupEnable) {
|
||||
QDateTime datetime;
|
||||
backupFile.clear();
|
||||
backupFile=backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
}
|
||||
|
||||
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
|
||||
@@ -1402,6 +1416,7 @@ void MainWindow::compare()
|
||||
void MainWindow::logFile()
|
||||
{
|
||||
logsDialog *fd = new logsDialog(this);
|
||||
fd->setWindowFlags(Qt::Window); //to show minimize an maximize buttons
|
||||
fd->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
fd->show();
|
||||
}
|
||||
@@ -1411,11 +1426,11 @@ void MainWindow::about()
|
||||
QString aboutStr = "<center><img src=\":/images/companion-title.png\"></center><br/>";
|
||||
aboutStr.append(tr("OpenTX Home Page: <a href='%1'>%1</a>").arg("http://www.open-tx.org"));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("The OpenTX Companion project was originally forked from <a href='%2'>eePe</a>").arg("http://code.google.com/p/eepe"));
|
||||
aboutStr.append(tr("The OpenTX Companion project was originally forked from <a href='%1'>eePe</a>").arg("http://code.google.com/p/eepe"));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("If you've found this program useful, please support by <a href='%1'>donating</a>").arg(DONATE_STR));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("Version %1, %3").arg(C9X_VERSION).arg(__DATE__));
|
||||
aboutStr.append(QString("Version %1, %2").arg(C9X_VERSION).arg(__DATE__));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2014<br/>");
|
||||
QMessageBox msgBox(this);
|
||||
@@ -1452,10 +1467,11 @@ void MainWindow::updateMenus()
|
||||
|
||||
MdiChild *MainWindow::createMdiChild()
|
||||
{
|
||||
MdiChild *child = new MdiChild();
|
||||
MdiChild * child = new MdiChild();
|
||||
mdiArea->addSubWindow(child);
|
||||
if(!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized())
|
||||
if (!child->parentWidget()->isMaximized() && !child->parentWidget()->isMinimized()) {
|
||||
child->parentWidget()->resize(400, 400);
|
||||
}
|
||||
|
||||
connect(child, SIGNAL(copyAvailable(bool)),cutAct, SLOT(setEnabled(bool)));
|
||||
connect(child, SIGNAL(copyAvailable(bool)),copyAct, SLOT(setEnabled(bool)));
|
||||
@@ -1921,15 +1937,16 @@ void MainWindow::updateProfilesActions()
|
||||
}
|
||||
|
||||
void MainWindow::createProfile()
|
||||
{ int i;
|
||||
for (i=0; i<MAX_PROFILES && g.profile[i].existsOnDisk(); i++)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<MAX_PROFILES && g.profile[i].existsOnDisk(); i++)
|
||||
;
|
||||
if (i==MAX_PROFILES) //Failed to find free slot
|
||||
return;
|
||||
|
||||
// Copy current profile to new and give it a new name
|
||||
g.profile[i] = g.profile[g.id()];
|
||||
g.profile[i].name( QString(tr("New Radio")));
|
||||
g.profile[i].name(tr("New Radio"));
|
||||
|
||||
g.id(i);
|
||||
updateMenus();
|
||||
@@ -1937,7 +1954,7 @@ for (i=0; i<MAX_PROFILES && g.profile[i].existsOnDisk(); i++)
|
||||
|
||||
QString MainWindow::strippedName(const QString &fullFileName)
|
||||
{
|
||||
return QFileInfo(fullFileName).fileName();
|
||||
return QFileInfo(fullFileName).fileName();
|
||||
}
|
||||
|
||||
int MainWindow::getEpromVersion(QString fileName)
|
||||
@@ -1952,6 +1969,7 @@ int MainWindow::getEpromVersion(QString fileName)
|
||||
return -1;
|
||||
}
|
||||
int fileType = getFileType(fileName);
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
@@ -1960,7 +1978,9 @@ int MainWindow::getEpromVersion(QString fileName)
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(testData);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return -1;
|
||||
|
||||
@@ -53,9 +53,7 @@
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
#include "wizarddialog.h"
|
||||
#include "taranisnotfound.h"
|
||||
#include <QFileInfo>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
@@ -72,17 +70,15 @@ MdiChild::MdiChild():
|
||||
fileChanged(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowIcon(CompanionIcon("open.png"));
|
||||
setWindowIcon(CompanionIcon("open.png"));
|
||||
ui->SimulateTxButton->setIcon(CompanionIcon("simulate.png"));
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
eepromInterfaceChanged();
|
||||
|
||||
if(!(this->isMaximized() || this->isMinimized())) {
|
||||
if (!(this->isMaximized() || this->isMinimized())) {
|
||||
adjustSize();
|
||||
}
|
||||
|
||||
ga.sendPageView(getBoardName(firmware->getBoard()) + " Models");
|
||||
}
|
||||
|
||||
MdiChild::~MdiChild()
|
||||
@@ -242,6 +238,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
|
||||
int fileType = getFileType(fileName);
|
||||
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
@@ -253,7 +250,9 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
QTextStream inputStream(&file);
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Error opening file %1:\n%2.")
|
||||
@@ -402,7 +401,7 @@ bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
|
||||
int eeprom_size = 0;
|
||||
|
||||
if (fileType != FILE_TYPE_XML) {
|
||||
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmwareVariant(), 0/*last version*/);
|
||||
eeprom_size = GetEepromInterface()->save(eeprom, radioData, GetCurrentFirmware()->getVariantNumber(), 0/*last version*/);
|
||||
if (!eeprom_size) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
|
||||
return false;
|
||||
@@ -416,6 +415,7 @@ bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
|
||||
|
||||
QTextStream outputStream(&file);
|
||||
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!XmlInterface(outputStream).save(radioData)) {
|
||||
QMessageBox::warning(this, tr("Error"),tr("Cannot write file %1:\n%2.").arg(myFile).arg(file.errorString()));
|
||||
@@ -423,7 +423,9 @@ bool MdiChild::saveFile(const QString &fileName, bool setCurrent)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { // write hex
|
||||
else
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { // write hex
|
||||
if (fileType==FILE_TYPE_EEPE)
|
||||
outputStream << EEPE_EEPROM_FILE_HEADER << "\n";
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
minSB->setAccelerated(true);
|
||||
minSB->setDecimals(1);
|
||||
minSB->setMinimum(model.extendedLimits ? -125 : -100);
|
||||
minSB->setMinimum(-model.getChannelsMax());
|
||||
minSB->setSingleStep(0.1);
|
||||
minSB->setMaximum(0);
|
||||
minSB->setValue(float(model.limitData[i].min) / 10);
|
||||
@@ -85,7 +85,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
maxSB->setDecimals(1);
|
||||
maxSB->setMinimum(0);
|
||||
maxSB->setSingleStep(0.1);
|
||||
maxSB->setMaximum(model.extendedLimits ? 125 : 100);
|
||||
maxSB->setMaximum(model.getChannelsMax());
|
||||
maxSB->setValue(float(model.limitData[i].max) / 10);
|
||||
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
|
||||
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
|
||||
@@ -136,6 +136,8 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
}
|
||||
// Push the rows up
|
||||
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
Channels::~Channels()
|
||||
@@ -192,8 +194,12 @@ void Channels::refreshExtendedLimits()
|
||||
QDoubleSpinBox * minDSB = minSpins[i];
|
||||
QDoubleSpinBox * maxDSB = maxSpins[i];
|
||||
|
||||
minDSB->setMinimum(model.extendedLimits ? -125 : -100);
|
||||
maxDSB->setMaximum(model.extendedLimits ? 125 : 100);
|
||||
minDSB->setMinimum(-model.getChannelsMax());
|
||||
maxDSB->setMaximum(model.getChannelsMax());
|
||||
|
||||
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
|
||||
if ( model.limitData[i].min < -model.getChannelsMax() ) model.limitData[i].min = -model.getChannelsMax();
|
||||
if ( model.limitData[i].max > +model.getChannelsMax() ) model.limitData[i].max = +model.getChannelsMax();
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -180,6 +180,8 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
|
||||
addTemplate(tr("Symmetrical f(x)=-f(-x)"), CURVE_COEFF_ENABLE, curveSymmetricalY);
|
||||
addTemplate(tr("Symmetrical f(x)=f(-x)"), CURVE_COEFF_ENABLE | CURVE_YMID_ENABLE, curveSymmetricalX);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -246,12 +248,13 @@ void Curves::updateCurveType()
|
||||
index = model.curves[currentCurve].count - 2;
|
||||
}
|
||||
else {
|
||||
ui->curveSmooth->hide();
|
||||
if (model.curves[currentCurve].count == 5)
|
||||
index += 2;
|
||||
index = 1;
|
||||
else if (model.curves[currentCurve].count == 9)
|
||||
index += 4;
|
||||
index = 2;
|
||||
else if (model.curves[currentCurve].count == 17)
|
||||
index += 6;
|
||||
index = 3;
|
||||
}
|
||||
|
||||
ui->curvePoints->setCurrentIndex(index);
|
||||
|
||||
@@ -87,7 +87,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
lang="en";
|
||||
path.append(lang);
|
||||
QDir qd(path);
|
||||
int vml= firmware->getCapability(VoicesMaxLength)+4;
|
||||
int vml= firmware->getCapability(VoicesMaxLength);
|
||||
if (qd.exists()) {
|
||||
QStringList filters;
|
||||
filters << "*.wav" << "*.WAV";
|
||||
@@ -196,6 +196,8 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
// Push rows upward
|
||||
addDoubleSpring(gridLayout, 5, num_fsw+1);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -264,7 +266,11 @@ void CustomFunctionsPanel::playMusic()
|
||||
else {
|
||||
phononCurrent = index;
|
||||
clickObject->clear();
|
||||
#ifdef __APPLE__
|
||||
clickObject->setCurrentSource(QUrl("file://"+track));
|
||||
#else
|
||||
clickObject->setCurrentSource(QUrl(track));
|
||||
#endif
|
||||
clickObject->play();
|
||||
playBT[index]->setIcon(CompanionIcon("stop.png"));
|
||||
}
|
||||
@@ -376,7 +382,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
|
||||
if (index != FuncBackgroundMusic && firmware->getCapability(HasFuncRepeat)) {
|
||||
if (index != FuncBackgroundMusic) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_REPEAT;
|
||||
fswtchRepeat[i]->update();
|
||||
}
|
||||
@@ -571,10 +577,10 @@ void CustomFunctionsPanel::fsw_customContextMenuRequested(QPoint pos)
|
||||
bool hasData = mimeData->hasFormat("application/x-companion-fsw");
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(fswDelete()),tr("Delete"));
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"),this,SLOT(fswCopy()),tr("Ctrl+C"));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("&Cut"),this,SLOT(fswCut()),tr("Ctrl+X"));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"),this,SLOT(fswPaste()),tr("Ctrl+V"))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(fswDelete()),tr("Delete"));
|
||||
|
||||
contextMenu.exec(globalPos);
|
||||
}
|
||||
@@ -584,24 +590,12 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
||||
b->clear();
|
||||
for (unsigned int i=0; i<FuncCount; i++) {
|
||||
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
|
||||
if (!firmware->getCapability(HasVolume)) {
|
||||
if (i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
}
|
||||
if ((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
if ((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
if ((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) {
|
||||
if (((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
|
||||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
|
||||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
|
||||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
|
||||
((i>=FuncAdjustGV1 && i<=FuncAdjustGVLast) && !firmware->getCapability(Gvars))
|
||||
) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
|
||||
@@ -18,10 +18,18 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
setWindowTitle(tr("Edit %1").arg(getInputStr(model, ed->chn)));
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()))
|
||||
gvGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100);
|
||||
else
|
||||
gvGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100);
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, -100, 100);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, ed->offset, 0, -100, 100);
|
||||
}
|
||||
else {
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, ed->weight, 100, 0, 100);
|
||||
gvOffsetGroup = NULL;
|
||||
ui->offsetLabel->hide();
|
||||
ui->offsetGV->hide();
|
||||
ui->offsetSB->hide();
|
||||
ui->offsetCB->hide();
|
||||
}
|
||||
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
|
||||
|
||||
@@ -105,7 +113,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
|
||||
ExpoDialog::~ExpoDialog()
|
||||
{
|
||||
delete gvGroup;
|
||||
delete gvWeightGroup;
|
||||
delete gvOffsetGroup;
|
||||
delete curveGroup;
|
||||
delete ui;
|
||||
}
|
||||
@@ -113,7 +122,7 @@ ExpoDialog::~ExpoDialog()
|
||||
void ExpoDialog::updateScale()
|
||||
{
|
||||
if (firmware->getCapability(VirtualInputs) && ed->srcRaw.type == SOURCE_TYPE_TELEMETRY) {
|
||||
RawSourceRange range = ed->srcRaw.getRange();
|
||||
RawSourceRange range = ed->srcRaw.getRange(model, generalSettings);
|
||||
ui->scaleLabel->show();
|
||||
ui->scale->show();
|
||||
ui->scale->setDecimals(range.decimals);
|
||||
@@ -137,7 +146,7 @@ void ExpoDialog::valuesChanged()
|
||||
updateScale();
|
||||
}
|
||||
|
||||
RawSourceRange range = srcRaw.getRange();
|
||||
RawSourceRange range = srcRaw.getRange(model, generalSettings);
|
||||
ed->scale = round(float(ui->scale->value()) / range.step);
|
||||
ed->carryTrim = 1 - ui->trimCB->currentIndex();
|
||||
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
|
||||
@@ -31,7 +31,8 @@ class ExpoDialog : public QDialog {
|
||||
FirmwareInterface * firmware;
|
||||
ExpoData * ed;
|
||||
char * inputName;
|
||||
GVarGroup * gvGroup;
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
CurveGroup * curveGroup;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>Source for the mixer.</string>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -44,20 +44,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="inputName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1,0">
|
||||
<item>
|
||||
@@ -92,14 +78,28 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_phases">
|
||||
<property name="text">
|
||||
<string>Flight modes</string>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="inputName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="sourceCB">
|
||||
<property name="whatsThis">
|
||||
<string>Source for the mixer.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Weight</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lb_FP0">
|
||||
@@ -256,14 +256,14 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Switch</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="10" column="1">
|
||||
<widget class="QComboBox" name="switchesCB">
|
||||
<property name="whatsThis">
|
||||
<string>Switch used to enable the line.
|
||||
@@ -271,14 +271,14 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="sideLabel">
|
||||
<property name="text">
|
||||
<string>Stick Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QComboBox" name="sideCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -297,7 +297,7 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0" colspan="2">
|
||||
<item row="14" column="0" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -316,7 +316,7 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0" colspan="2">
|
||||
<item row="13" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -370,14 +370,14 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_curves">
|
||||
<property name="text">
|
||||
<string>Curve</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="8" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,1,0">
|
||||
<item>
|
||||
<widget class="QComboBox" name="curveTypeCB">
|
||||
@@ -429,6 +429,47 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="offsetLabel">
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<layout class="QHBoxLayout" name="offsetLayout" stretch="0,0,1,0">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="offsetGV">
|
||||
<property name="text">
|
||||
<string>GV</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="offsetSB"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="offsetCB">
|
||||
<property name="whatsThis">
|
||||
<string>The source for the mixer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="offsetSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
|
||||
@@ -9,10 +9,9 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
ui(new Ui::FlightMode),
|
||||
phaseIdx(phaseIdx),
|
||||
phase(model.phaseData[phaseIdx]),
|
||||
phase(model.flightModeData[phaseIdx]),
|
||||
reCount(firmware->getCapability(RotaryEncoders)),
|
||||
gvCount(((!firmware->getCapability(HasVariants)) || (GetCurrentFirmwareVariant() & GVARS_VARIANT)) ?
|
||||
firmware->getCapability(Gvars) : 0)
|
||||
gvCount(firmware->getCapability(Gvars))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -121,7 +120,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
}
|
||||
|
||||
// GVars
|
||||
if (gvCount > 0) {
|
||||
if (gvCount > 0 && (firmware->getCapability(GvarsFlightModes) || phaseIdx == 0) ) {
|
||||
QGridLayout *gvLayout = new QGridLayout(ui->gvGB);
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
int col = 0;
|
||||
@@ -171,6 +170,8 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
||||
ui->gvGB->hide();
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -200,31 +201,24 @@ void FlightModePanel::update()
|
||||
trimUpdate(i);
|
||||
}
|
||||
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
gvNames[i]->setText(model.gvars_names[i]);
|
||||
gvValues[i]->setDisabled(false);
|
||||
int idx = phase.gvars[i];
|
||||
PhaseData *phasegvar = &phase;
|
||||
while (idx > 1024) {
|
||||
idx -= 1025;
|
||||
phasegvar = &model.phaseData[idx];
|
||||
idx = phasegvar->gvars[i];
|
||||
gvValues[i]->setDisabled(true);
|
||||
}
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
gvValues[i]->setValue(phasegvar->gvars[i]);
|
||||
if (phaseIdx == 0)
|
||||
if (ui->gvGB->isVisible()) {
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
gvNames[i]->setText(model.gvars_names[i]);
|
||||
gvValues[i]->setDisabled(model.isGVarLinked(phaseIdx, i));
|
||||
gvValues[i]->setValue(model.getGVarValue(phaseIdx, i));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()) && phaseIdx == 0) {
|
||||
gvPopups[i]->setChecked(model.gvars_popups[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<reCount; i++) {
|
||||
reValues[i]->setDisabled(false);
|
||||
int idx = phase.rotaryEncoders[i];
|
||||
PhaseData *phasere = &phase;
|
||||
FlightModeData *phasere = &phase;
|
||||
while (idx > 1024) {
|
||||
idx -= 1025;
|
||||
phasere = &model.phaseData[idx];
|
||||
phasere = &model.flightModeData[idx];
|
||||
idx = phasere->rotaryEncoders[i];
|
||||
reValues[i]->setDisabled(true);
|
||||
}
|
||||
@@ -304,14 +298,6 @@ void FlightModePanel::GVName_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void FlightModePanel::GVSource_currentIndexChanged(int index)
|
||||
{
|
||||
QComboBox *comboBox = qobject_cast<QComboBox*>(sender());
|
||||
int gvar = comboBox->property("index").toInt();
|
||||
model.gvsource[gvar] = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void FlightModePanel::phaseGVUse_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
@@ -449,7 +435,7 @@ void FlightModesPanel::onPhaseModified()
|
||||
QString FlightModesPanel::getTabName(int index)
|
||||
{
|
||||
QString result = tr("Flight Mode %1").arg(index);
|
||||
const char *name = model.phaseData[index].name;
|
||||
const char *name = model.flightModeData[index].name;
|
||||
if (firmware->getCapability(FlightModesName) && strlen(name) > 0) {
|
||||
result += tr(" (%1)").arg(name);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ class FlightModePanel : public ModelPanel
|
||||
void phaseTrim_valueChanged();
|
||||
void phaseTrimSlider_valueChanged();
|
||||
void GVName_editingFinished();
|
||||
void GVSource_currentIndexChanged(int index);
|
||||
void phaseGVValue_editingFinished();
|
||||
void phaseGVUse_currentIndexChanged(int index);
|
||||
void phaseGVPopupToggled(bool checked);
|
||||
@@ -45,7 +44,7 @@ class FlightModePanel : public ModelPanel
|
||||
private:
|
||||
Ui::FlightMode *ui;
|
||||
int phaseIdx;
|
||||
PhaseData & phase;
|
||||
FlightModeData & phase;
|
||||
int reCount;
|
||||
int gvCount;
|
||||
QVector<QLabel *> trimsLabel;
|
||||
|
||||
@@ -14,6 +14,8 @@ HeliPanel::HeliPanel(QWidget *parent, ModelData & model, GeneralSettings & gener
|
||||
connect(ui->swashInvertELE, SIGNAL(stateChanged(int)), this, SLOT(edited()));
|
||||
connect(ui->swashInvertAIL, SIGNAL(stateChanged(int)), this, SLOT(edited()));
|
||||
connect(ui->swashInvertCOL, SIGNAL(stateChanged(int)), this, SLOT(edited()));
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
HeliPanel::~HeliPanel()
|
||||
|
||||
@@ -162,14 +162,15 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
|
||||
}
|
||||
|
||||
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());
|
||||
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();
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(model);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,6 +272,9 @@ void InputsPanel::setSelectedByExpoList(QList<int> list)
|
||||
|
||||
void InputsPanel::exposDelete(bool ask)
|
||||
{
|
||||
QList<int> list = createExpoListFromSelected();
|
||||
if(list.isEmpty()) return;
|
||||
|
||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||
|
||||
if(ask)
|
||||
@@ -280,7 +284,7 @@ void InputsPanel::exposDelete(bool ask)
|
||||
|
||||
|
||||
if ((ret == QMessageBox::Yes) || (!ask)) {
|
||||
exposDeleteList(createExpoListFromSelected());
|
||||
exposDeleteList(list);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
cswitchValue[i]->setAccelerated(true);
|
||||
cswitchValue[i]->setDecimals(0);
|
||||
cswitchValue[i]->setProperty("index", i);
|
||||
connect(cswitchValue[i], SIGNAL(editingFinished()), this, SLOT(edited()));
|
||||
connect(cswitchValue[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
gridLayout->addWidget(cswitchValue[i], i+1, 2);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
|
||||
@@ -70,7 +70,7 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
cswitchOffset[i]->setMinimum(-125);
|
||||
cswitchOffset[i]->setAccelerated(true);
|
||||
cswitchOffset[i]->setDecimals(0);
|
||||
connect(cswitchOffset[i], SIGNAL(editingFinished()), this, SLOT(edited()));
|
||||
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
cswitchOffset[i]->setVisible(false);
|
||||
v2Layout->addWidget(cswitchOffset[i]);
|
||||
cswitchOffset2[i] = new QDoubleSpinBox(this);
|
||||
@@ -79,9 +79,15 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
cswitchOffset2[i]->setMinimum(-125);
|
||||
cswitchOffset2[i]->setAccelerated(true);
|
||||
cswitchOffset2[i]->setDecimals(0);
|
||||
connect(cswitchOffset2[i], SIGNAL(editingFinished()), this, SLOT(edited()));
|
||||
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
cswitchOffset2[i]->setVisible(false);
|
||||
v2Layout->addWidget(cswitchOffset2[i]);
|
||||
cswitchTOffset[i] = new QTimeEdit(this);
|
||||
cswitchTOffset[i]->setProperty("index",i);
|
||||
cswitchTOffset[i]->setAccelerated(true);
|
||||
connect(cswitchTOffset[i],SIGNAL(editingFinished()),this,SLOT(edited()));
|
||||
v2Layout->addWidget(cswitchTOffset[i]);
|
||||
cswitchTOffset[i]->setVisible(false);
|
||||
gridLayout->addLayout(v2Layout, i+1, 3);
|
||||
|
||||
// AND
|
||||
@@ -116,6 +122,9 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
}
|
||||
// Push rows upward
|
||||
addVSpring(gridLayout,0,firmware->getCapability(LogicalSwitches)+1);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -129,14 +138,9 @@ void LogicalSwitchesPanel::v1Edited(int value)
|
||||
int i = sender()->property("index").toInt();
|
||||
model.customSw[i].val1 = cswitchSource1[i]->itemData(value).toInt();
|
||||
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_VOFS) {
|
||||
RawSource source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() - range.offset) / range.step/* TODO - source.getRawOffset(model)*/;
|
||||
}
|
||||
RawSource source = RawSource(model.customSw[i].val1);
|
||||
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() - range.offset) / range.step;
|
||||
setSwitchWidgetVisibility(i);
|
||||
}
|
||||
emit modified();
|
||||
@@ -202,37 +206,41 @@ void LogicalSwitchesPanel::edited()
|
||||
}
|
||||
|
||||
RawSource source;
|
||||
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case LS_FAMILY_VOFS:
|
||||
{
|
||||
source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
cswitchOffset[i]->setValue(model.customSw[i].val2*range.step);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val2 = round((cswitchOffset[i]->value()-range.offset)/range.step);
|
||||
cswitchOffset[i]->setValue(model.customSw[i].val2*range.step + range.offset);
|
||||
}
|
||||
source = RawSource(model.customSw[i].val1);
|
||||
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
|
||||
double value = source.isTimeBased() ? QTimeS(cswitchTOffset[i]->time()).seconds() : cswitchOffset[i]->value();
|
||||
model.customSw[i].val2 = round((value-range.offset)/range.step);;
|
||||
value = model.customSw[i].val2*range.step + range.offset;
|
||||
if (source.isTimeBased())
|
||||
cswitchTOffset[i]->setTime(QTimeS(round(value)));
|
||||
else
|
||||
cswitchOffset[i]->setValue(value);
|
||||
break;
|
||||
}
|
||||
case LS_FAMILY_TIMER:
|
||||
model.customSw[i].val1 = TimToVal(cswitchValue[i]->value());
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1, 0.1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
if (sender() == cswitchOffset[i]) {
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
}
|
||||
else {
|
||||
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
|
||||
}
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, true);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
|
||||
cswitchOffset2[i]->clear();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -242,11 +250,11 @@ void LogicalSwitchesPanel::edited()
|
||||
}
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero)
|
||||
void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, double minimum)
|
||||
{
|
||||
sb->setVisible(true);
|
||||
sb->setDecimals(1);
|
||||
sb->setMinimum(allowZero ? 0.0 : 0.1);
|
||||
sb->setMinimum(minimum);
|
||||
sb->setMaximum(175);
|
||||
float value = ValToTim(timer);
|
||||
if (value>=60)
|
||||
@@ -256,6 +264,7 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool
|
||||
else
|
||||
sb->setSingleStep(0.1);
|
||||
sb->setValue(value);
|
||||
sb->setSuffix("");
|
||||
}
|
||||
|
||||
#define SOURCE1_VISIBLE 0x1
|
||||
@@ -263,28 +272,37 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool
|
||||
#define VALUE1_VISIBLE 0x4
|
||||
#define VALUE2_VISIBLE 0x8
|
||||
#define VALUE3_VISIBLE 0x10
|
||||
#define VALUE_TO_VISIBLE 0x20
|
||||
|
||||
void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
unsigned int mask = 0;
|
||||
RawSource source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
RawSource source = RawSource(model.customSw[i].val1);
|
||||
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
|
||||
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case LS_FAMILY_VOFS:
|
||||
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE;
|
||||
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
mask |= SOURCE1_VISIBLE;
|
||||
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
cswitchOffset[i]->setDecimals(range.decimals);
|
||||
cswitchOffset[i]->setSingleStep(range.step);
|
||||
if (model.customSw[i].func == LS_FN_DPOS || model.customSw[i].func == LS_FN_DAPOS) {
|
||||
cswitchOffset[i]->setMinimum(range.step*-127);
|
||||
cswitchOffset[i]->setMaximum(range.step*127);
|
||||
cswitchOffset[i]->setValue(range.step*model.customSw[i].val2);
|
||||
if (source.isTimeBased()) {
|
||||
mask |= VALUE_TO_VISIBLE;
|
||||
int maxTime = round(range.max);
|
||||
int value = round(range.step*model.customSw[i].val2 + range.offset);
|
||||
cswitchTOffset[i]->setMaximumTime(QTimeS(maxTime));
|
||||
cswitchTOffset[i]->setDisplayFormat((maxTime>=3600)?"hh:mm:ss":"mm:ss");
|
||||
cswitchTOffset[i]->setTime(QTimeS(value));
|
||||
}
|
||||
else {
|
||||
mask |= VALUE2_VISIBLE;
|
||||
if (range.unit.isEmpty())
|
||||
cswitchOffset[i]->setSuffix("");
|
||||
else
|
||||
cswitchOffset[i]->setSuffix(" " + range.unit);
|
||||
cswitchOffset[i]->setMinimum(range.min);
|
||||
cswitchOffset[i]->setMaximum(range.max);
|
||||
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
|
||||
@@ -299,18 +317,22 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
case LS_FAMILY_STAY:
|
||||
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, true);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value());
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
|
||||
cswitchOffset2[i]->clear();
|
||||
}
|
||||
break;
|
||||
case LS_FAMILY_VCOMP:
|
||||
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
mask |= VALUE1_VISIBLE | VALUE2_VISIBLE;
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1, 0.1);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -319,7 +341,7 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
cswitchValue[i]->setVisible(mask & VALUE1_VISIBLE);
|
||||
cswitchOffset[i]->setVisible(mask & VALUE2_VISIBLE);
|
||||
cswitchOffset2[i]->setVisible(mask & VALUE3_VISIBLE);
|
||||
|
||||
cswitchTOffset[i]->setVisible(mask & VALUE_TO_VISIBLE);
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -367,6 +389,34 @@ void LogicalSwitchesPanel::populateCSWCB(QComboBox *b, int value)
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
|
||||
{
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
populateSwitchCB(b, value, generalSettings, POPULATE_ONOFF);
|
||||
}
|
||||
else {
|
||||
RawSwitch item;
|
||||
|
||||
b->clear();
|
||||
|
||||
item = RawSwitch(SWITCH_TYPE_NONE);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
|
||||
for (int i=1; i<=firmware->getCapability(SwitchesPositions); i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=1; i<=6; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LogicalSwitchesPanel::updateLine(int i)
|
||||
{
|
||||
lock = true;
|
||||
@@ -437,10 +487,10 @@ void LogicalSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
||||
bool hasData = mimeData->hasFormat("application/x-companion-csw");
|
||||
|
||||
QMenu contextMenu;
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(cswDelete()),tr("Delete"));
|
||||
contextMenu.addAction(CompanionIcon("copy.png"), tr("&Copy"),this,SLOT(cswCopy()),tr("Ctrl+C"));
|
||||
contextMenu.addAction(CompanionIcon("cut.png"), tr("&Cut"),this,SLOT(cswCut()),tr("Ctrl+X"));
|
||||
contextMenu.addAction(CompanionIcon("paste.png"), tr("&Paste"),this,SLOT(cswPaste()),tr("Ctrl+V"))->setEnabled(hasData);
|
||||
contextMenu.addAction(CompanionIcon("clear.png"), tr("&Delete"),this,SLOT(cswDelete()),tr("Delete"));
|
||||
|
||||
contextMenu.exec(globalPos);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "modelpanel.h"
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QTimeEdit>
|
||||
|
||||
class LogicalSwitchesPanel : public ModelPanel
|
||||
{
|
||||
@@ -33,6 +34,7 @@ class LogicalSwitchesPanel : public ModelPanel
|
||||
QDoubleSpinBox * cswitchValue[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchOffset[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchOffset2[C9X_NUM_CSW];
|
||||
QTimeEdit * cswitchTOffset[C9X_NUM_CSW];
|
||||
QComboBox * cswitchAnd[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchDuration[C9X_NUM_CSW];
|
||||
QDoubleSpinBox * cswitchDelay[C9X_NUM_CSW];
|
||||
@@ -42,8 +44,9 @@ class LogicalSwitchesPanel : public ModelPanel
|
||||
int selectedSwitch;
|
||||
|
||||
void populateCSWCB(QComboBox *b, int value);
|
||||
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value);
|
||||
void updateLine(int index);
|
||||
void updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero=false);
|
||||
void updateTimerParam(QDoubleSpinBox *sb, int timer, double minimum=0);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
|
||||
this->setWindowTitle(tr("DEST -> CH%1").arg(md->destCh));
|
||||
|
||||
populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
|
||||
populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
|
||||
ui->sourceCB->removeItem(0);
|
||||
|
||||
int limit = firmware->getCapability(OffsetWeight);
|
||||
@@ -142,7 +142,7 @@ void MixerDialog::valuesChanged()
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
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 };
|
||||
md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt(), &model);
|
||||
md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt());
|
||||
if (firmware->getCapability(HasNoExpo)) {
|
||||
bool drVisible = (md->srcRaw.type == SOURCE_TYPE_STICK && md->srcRaw.index < NUM_STICKS);
|
||||
ui->MixDR_CB->setEnabled(drVisible);
|
||||
|
||||
@@ -170,16 +170,12 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
default: str += " "; break;
|
||||
};
|
||||
|
||||
//set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type)
|
||||
if (md->srcRaw.model == 0)
|
||||
md->srcRaw.model = &model;
|
||||
|
||||
//highlight source if needed
|
||||
// highlight source if needed
|
||||
if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
str += " <b>" + Qt::escape(md->srcRaw.toString()) + "</b>";
|
||||
str += " <b>" + Qt::escape(md->srcRaw.toString(model)) + "</b>";
|
||||
}
|
||||
else {
|
||||
str += " " + Qt::escape(md->srcRaw.toString());
|
||||
str += " " + Qt::escape(md->srcRaw.toString(model));
|
||||
}
|
||||
|
||||
str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true)));
|
||||
@@ -191,9 +187,8 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
|
||||
str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString()));
|
||||
}
|
||||
|
||||
if (md->carryTrim) {
|
||||
str += " " + Qt::escape(tr("NoTrim"));
|
||||
}
|
||||
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)));
|
||||
@@ -323,6 +318,9 @@ void MixesPanel::setSelectedByMixList(QList<int> list)
|
||||
|
||||
void MixesPanel::mixersDelete(bool ask)
|
||||
{
|
||||
QList<int> list = createMixListFromSelected();
|
||||
if(list.isEmpty()) return;
|
||||
|
||||
QMessageBox::StandardButton ret = QMessageBox::No;
|
||||
|
||||
if(ask)
|
||||
@@ -332,7 +330,7 @@ void MixesPanel::mixersDelete(bool ask)
|
||||
|
||||
|
||||
if ((ret == QMessageBox::Yes) || (!ask)) {
|
||||
mixersDeleteList(createMixListFromSelected());
|
||||
mixersDeleteList(list);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
@@ -523,10 +521,17 @@ void MixesPanel::mixerlistWidget_KeyPress(QKeyEvent *event)
|
||||
|
||||
int MixesPanel::gm_moveMix(int idx, bool dir) //true=inc=down false=dec=up
|
||||
{
|
||||
if(idx>firmware->getCapability(Mixes) || (idx==0 && !dir) || (idx==firmware->getCapability(Mixes) && dir)) return idx;
|
||||
if(idx>firmware->getCapability(Mixes) || (idx==firmware->getCapability(Mixes) && dir)) return idx;
|
||||
|
||||
MixData &src=model.mixData[idx];
|
||||
|
||||
if (idx==0 && !dir) {
|
||||
//special case: topmost mixer moving up
|
||||
if (src.destCh > 1) src.destCh--;
|
||||
return idx;
|
||||
}
|
||||
|
||||
int tdx = dir ? idx+1 : idx-1;
|
||||
MixData &src=model.mixData[idx];
|
||||
MixData &tgt=model.mixData[tdx];
|
||||
|
||||
unsigned int outputs = firmware->getCapability(Outputs);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "telemetry.h"
|
||||
#include "appdata.h"
|
||||
#include <QScrollArea>
|
||||
#include "googleanalytics.h"
|
||||
|
||||
ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, FirmwareInterface * firmware) :
|
||||
QDialog(parent),
|
||||
@@ -29,7 +28,8 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
||||
ui->pushButton->setIcon(CompanionIcon("simulate.png"));
|
||||
SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware);
|
||||
addTab(setupPanel, tr("Setup"));
|
||||
addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli"));
|
||||
if (firmware->getCapability(Heli))
|
||||
addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli"));
|
||||
addTab(new FlightModesPanel(this, model, generalSettings, firmware), tr("Flight Modes"));
|
||||
addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs"));
|
||||
addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes"));
|
||||
@@ -43,8 +43,6 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw
|
||||
addTab(new TelemetryPanel(this, model, generalSettings, firmware), tr("Telemetry"));
|
||||
|
||||
connect(setupPanel, SIGNAL(extendedLimitsToggled()), chnPanel, SLOT(refreshExtendedLimits()));
|
||||
|
||||
ga.sendPageView(getBoardName(firmware->getBoard()) + " ModelEdit");
|
||||
}
|
||||
|
||||
ModelEdit::~ModelEdit()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "modelpanel.h"
|
||||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
|
||||
ModelPanel::ModelPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
QWidget(parent),
|
||||
@@ -57,3 +59,44 @@ void ModelPanel::addDoubleSpring(QGridLayout * gridLayout, int col, int row)
|
||||
gridLayout->addItem(spacer, row, col);
|
||||
}
|
||||
|
||||
bool ModelPanel::eventFilter(QObject *object, QEvent * event)
|
||||
{
|
||||
QWidget * widget = qobject_cast<QWidget*>(object);
|
||||
if (widget) {
|
||||
if (event->type() == QEvent::Wheel) {
|
||||
if (widget->focusPolicy() == Qt::WheelFocus) {
|
||||
event->accept();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
event->ignore();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::FocusIn) {
|
||||
widget->setFocusPolicy(Qt::WheelFocus);
|
||||
}
|
||||
else if (event->type() == QEvent::FocusOut) {
|
||||
widget->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
}
|
||||
return QWidget::eventFilter(object, event);
|
||||
}
|
||||
|
||||
void ModelPanel::disableMouseScrolling()
|
||||
{
|
||||
Q_FOREACH(QComboBox * cb, findChildren<QComboBox*>()) {
|
||||
cb->installEventFilter(this);
|
||||
cb->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
Q_FOREACH(QAbstractSpinBox * sb, findChildren<QAbstractSpinBox*>()) {
|
||||
sb->installEventFilter(this);
|
||||
sb->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
|
||||
Q_FOREACH(QSlider * slider, findChildren<QSlider*>()) {
|
||||
slider->installEventFilter(this);
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ class ModelPanel : public QWidget
|
||||
void addHSpring(QGridLayout *, int col, int row);
|
||||
void addVSpring(QGridLayout *, int col, int row);
|
||||
void addDoubleSpring(QGridLayout *, int col, int row);
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
void disableMouseScrolling();
|
||||
};
|
||||
|
||||
#endif // CHANNELS_H
|
||||
|
||||
@@ -22,10 +22,13 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
||||
ui->persistentValue->hide();
|
||||
}
|
||||
|
||||
ui->countdownBeep->addItem(tr("Silent"));
|
||||
ui->countdownBeep->addItem(tr("Beeps"));
|
||||
ui->countdownBeep->setField(&timer.countdownBeep, this);
|
||||
ui->countdownBeep->addItem(tr("Silent"), 0);
|
||||
ui->countdownBeep->addItem(tr("Beeps"), 1);
|
||||
if (IS_ARM(GetEepromInterface()->getBoard()) || IS_2560(GetEepromInterface()->getBoard()))
|
||||
ui->countdownBeep->addItem(tr("Voice"));
|
||||
ui->countdownBeep->addItem(tr("Voice"), 2);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
@@ -56,7 +59,6 @@ void TimerPanel::update()
|
||||
ui->persistentValue->setText(QString(" %1(%2:%3:%4)").arg(sign<0 ? "-" :" ").arg(hours, 2, 10, QLatin1Char('0')).arg(minutes, 2, 10, QLatin1Char('0')).arg(seconds, 2, 10, QLatin1Char('0')));
|
||||
}
|
||||
|
||||
ui->countdownBeep->setCurrentIndex(timer.countdownBeep);
|
||||
ui->minuteBeep->setChecked(timer.minuteBeep);
|
||||
}
|
||||
|
||||
@@ -80,12 +82,6 @@ void TimerPanel::on_persistent_toggled(bool checked)
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TimerPanel::on_countdownBeep_currentIndexChanged(int index)
|
||||
{
|
||||
timer.countdownBeep = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TimerPanel::on_minuteBeep_toggled(bool checked)
|
||||
{
|
||||
timer.minuteBeep = checked;
|
||||
@@ -150,7 +146,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
||||
label->setText(QString::number(i+1));
|
||||
QDoubleSpinBox * spinbox = new QDoubleSpinBox(this);
|
||||
spinbox->setMinimumSize(QSize(20, 0));
|
||||
spinbox->setRange(-100, 100);
|
||||
spinbox->setRange(-150, 150);
|
||||
spinbox->setSingleStep(0.1);
|
||||
spinbox->setDecimals(1);
|
||||
spinbox->setValue(((double)module.failsafeChannels[i]*100)/1024);
|
||||
@@ -163,6 +159,8 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
||||
}
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -234,7 +232,7 @@ void ModulePanel::update()
|
||||
ui->ppmDelay->setValue(module.ppmDelay);
|
||||
ui->label_ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
|
||||
ui->ppmFrameLength->setVisible(mask & MASK_PPM_FIELDS);
|
||||
ui->ppmFrameLength->setMinimum(module.channelsCount*(model.extendedLimits ? 2.250 :2)+3.5);
|
||||
ui->ppmFrameLength->setMinimum(module.channelsCount*(model.extendedLimits ? 2.250 : 2)+3.5);
|
||||
ui->ppmFrameLength->setMaximum(firmware->getCapability(PPMFrameLength));
|
||||
ui->ppmFrameLength->setValue(22.5+((double)module.ppmFrameLength)*0.5);
|
||||
|
||||
@@ -424,6 +422,9 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->centerBeepLayout->addWidget(checkbox, 0, i+1);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(onBeepCenterToggled(bool)));
|
||||
centerBeepCheckboxes << checkbox;
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
|
||||
checkbox->hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Startup switches warnings
|
||||
@@ -472,7 +473,7 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->potWarningLayout->addWidget(cb, 0, i+1);
|
||||
connect(cb, SIGNAL(toggled(bool)), this, SLOT(potWarningToggled(bool)));
|
||||
potWarningCheckboxes << cb;
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard())) {
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==2) {
|
||||
cb->hide();
|
||||
}
|
||||
}
|
||||
@@ -481,6 +482,9 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->label_potWarning->hide();
|
||||
ui->potWarningMode->hide();
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ class TimerPanel : public ModelPanel
|
||||
void on_value_editingFinished();
|
||||
void on_persistent_toggled(bool checked);
|
||||
void on_minuteBeep_toggled(bool checked);
|
||||
void on_countdownBeep_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
TimerData & timer;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="countdownBeep"/>
|
||||
<widget class="QUnsignedAutoComboBox" name="countdownBeep"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="minuteBeep">
|
||||
@@ -79,6 +79,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QUnsignedAutoComboBox</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header>qautocombobox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -50,6 +50,8 @@ TelemetryAnalog::TelemetryAnalog(QWidget *parent, FrSkyChannelData & analog, Mod
|
||||
else {
|
||||
ui->label_Max->setText(tr("Range"));
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
void TelemetryAnalog::update()
|
||||
@@ -166,7 +168,8 @@ void TelemetryAnalog::on_RatioSB_editingFinished()
|
||||
if (calib<0) {
|
||||
if (calib<((ratio*-128)/255)) {
|
||||
analog.offset=-128;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
analog.offset=round(calib*255/ratio);
|
||||
}
|
||||
}
|
||||
@@ -292,7 +295,6 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
|
||||
fieldsCB[l][c] = new QComboBox(this);
|
||||
fieldsCB[l][c]->setProperty("index", c + (l<<8));
|
||||
populateTelemetrySourceCB(fieldsCB[l][c], screen.body.lines[l].source[c], l==3, model.frsky.usrProto);
|
||||
ui->screenNumsLayout->addWidget(fieldsCB[l][c], l, c, 1, 1);
|
||||
connect(fieldsCB[l][c], SIGNAL(currentIndexChanged(int)), this, SLOT(customFieldChanged(int)));
|
||||
}
|
||||
@@ -301,7 +303,6 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
for (int l=0; l<4; l++) {
|
||||
barsCB[l] = new QComboBox(this);
|
||||
barsCB[l]->setProperty("index", l);
|
||||
populateTelemetrySourceCB(barsCB[l], screen.body.bars[l].source, false, model.frsky.usrProto);
|
||||
connect(barsCB[l], SIGNAL(currentIndexChanged(int)), this, SLOT(barSourceChanged(int)));
|
||||
ui->screenBarsLayout->addWidget(barsCB[l], l, 0, 1, 1);
|
||||
|
||||
@@ -324,6 +325,8 @@ TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model,
|
||||
ui->screenBarsLayout->addWidget(maxSB[l], l, 3, 1, 1);
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -332,10 +335,16 @@ void TelemetryCustomScreen::populateTelemetrySourceCB(QComboBox *b, unsigned int
|
||||
int telem_hub[] = {0,0,0,0,0,0,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,2,2,1,1,1,1,1,1};
|
||||
b->clear();
|
||||
|
||||
b->addItem(RawSource(SOURCE_TYPE_NONE, 0).toString());
|
||||
b->addItem(RawSource(SOURCE_TYPE_NONE, 0).toString(model));
|
||||
|
||||
for (unsigned int i = 0; i < (last ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_DISPLAY_COUNT); i++) {
|
||||
b->addItem(RawSource(SOURCE_TYPE_TELEMETRY, i).toString());
|
||||
b->addItem(RawSource(SOURCE_TYPE_TELEMETRY, i).toString(model));
|
||||
if (!firmware->isTelemetrySourceAvailable(i)) {
|
||||
//disable item
|
||||
QModelIndex index = b->model()->index(i+1, 0);
|
||||
QVariant v(0);
|
||||
b->model()->setData(index, v, Qt::UserRole - 1);
|
||||
}
|
||||
if (!(i>=sizeof(telem_hub)/sizeof(int) || telem_hub[i]==0 || ((telem_hub[i]>=hubproto) && hubproto!=0))) {
|
||||
QModelIndex index = b->model()->index(i, 0);
|
||||
QVariant v(0);
|
||||
@@ -365,6 +374,16 @@ void TelemetryCustomScreen::update()
|
||||
ui->screenNums->setVisible(screen.type == 0);
|
||||
ui->screenBars->setVisible(screen.type != 0);
|
||||
|
||||
for (int l=0; l<4; l++) {
|
||||
for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
|
||||
populateTelemetrySourceCB(fieldsCB[l][c], screen.body.lines[l].source[c], l==3, model.frsky.usrProto);
|
||||
}
|
||||
}
|
||||
|
||||
for (int l=0; l<4; l++) {
|
||||
populateTelemetrySourceCB(barsCB[l], screen.body.bars[l].source, false, model.frsky.usrProto);
|
||||
}
|
||||
|
||||
if (screen.type == 0) {
|
||||
for (int l=0; l<4; l++) {
|
||||
for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
|
||||
@@ -388,8 +407,8 @@ void TelemetryCustomScreen::updateBar(int line)
|
||||
int index = screen.body.bars[line].source;
|
||||
barsCB[line]->setCurrentIndex(index);
|
||||
if (index) {
|
||||
RawSource source = RawSource(SOURCE_TYPE_TELEMETRY, index-1, &model);
|
||||
RawSourceRange range = source.getRange(true);
|
||||
RawSource source = RawSource(SOURCE_TYPE_TELEMETRY, index-1);
|
||||
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;
|
||||
@@ -476,6 +495,14 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
model.frsky.usrProto = 1;
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocolLabel->hide();
|
||||
ui->telemetryProtocol->hide();
|
||||
}
|
||||
|
||||
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
|
||||
ui->A1Layout->addWidget(analogs[0]);
|
||||
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
@@ -501,6 +528,7 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++) {
|
||||
TelemetryCustomScreen * tab = new TelemetryCustomScreen(this, model, model.frsky.screens[i], generalSettings, firmware);
|
||||
ui->customScreens->addTab(tab, tr("Telemetry screen %1").arg(i+1));
|
||||
telemetryCustomScreens[i] = tab;
|
||||
}
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
@@ -508,6 +536,8 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
ui->bladesCount->setMaximum(128);
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
setup();
|
||||
}
|
||||
|
||||
@@ -522,20 +552,6 @@ void TelemetryPanel::setup()
|
||||
|
||||
lock = true;
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->rxbattAlarm1DSB->setValue((13.2*model.frsky.rxBattAlarms[0])/255);
|
||||
ui->rxbattAlarm2DSB->setValue((13.2*model.frsky.rxBattAlarms[1])/255);
|
||||
}
|
||||
else {
|
||||
ui->rxbattLabel->hide();
|
||||
ui->rxbattAlarm1Label->hide();
|
||||
ui->rxbattAlarm2Label->hide();
|
||||
ui->rxbattAlarm1CB->hide();
|
||||
ui->rxbattAlarm2CB->hide();
|
||||
ui->rxbattAlarm1DSB->hide();
|
||||
ui->rxbattAlarm2DSB->hide();
|
||||
}
|
||||
|
||||
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
|
||||
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
|
||||
if (!IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
@@ -600,27 +616,10 @@ void TelemetryPanel::setup()
|
||||
}
|
||||
}
|
||||
|
||||
if (!(firmware->getCapability(HasAltitudeSel)||firmware->getCapability(HasVario))) {
|
||||
ui->altimetryGB->hide();
|
||||
}
|
||||
ui->altimetryGB->setVisible(firmware->getCapability(HasAltitudeSel) || firmware->getCapability(HasVario)),
|
||||
ui->frskyProtoCB->setDisabled(firmware->getCapability(NoTelemetryProtocol));
|
||||
|
||||
if (firmware->getCapability(NoTelemetryProtocol)) {
|
||||
ui->frskyProtoCB->setDisabled(true);
|
||||
}
|
||||
else {
|
||||
ui->frskyProtoCB->setEnabled(true);
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(TelemetryUnits)) {
|
||||
ui->frskyUnitsCB->setDisabled(true);
|
||||
int index=0;
|
||||
if (firmware_id.contains("imperial")) {
|
||||
index=1;
|
||||
}
|
||||
ui->frskyUnitsCB->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
if ((firmware->getCapability(Telemetry)&TM_HASWSHH)) {
|
||||
if (firmware->getCapability(Telemetry) & TM_HASWSHH) {
|
||||
ui->frskyProtoCB->addItem(tr("Winged Shadow How High"));
|
||||
}
|
||||
else {
|
||||
@@ -654,7 +653,6 @@ void TelemetryPanel::setup()
|
||||
}
|
||||
|
||||
ui->frskyProtoCB->setCurrentIndex(model.frsky.usrProto);
|
||||
ui->frskyUnitsCB->setCurrentIndex(model.frsky.imperial);
|
||||
ui->bladesCount->setValue(model.frsky.blades);
|
||||
|
||||
populateVoltsSource();
|
||||
@@ -684,9 +682,6 @@ void TelemetryPanel::populateVoltsSource()
|
||||
{
|
||||
QUnsignedAutoComboBox * cb = ui->frskyVoltCB;
|
||||
cb->setField(&model.frsky.voltsSource, this);
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
cb->addItem(tr("RxBatt"), TELEMETRY_VOLTS_SOURCE_RXBATT);
|
||||
}
|
||||
cb->addItem(tr("A1"), TELEMETRY_VOLTS_SOURCE_A1);
|
||||
cb->addItem(tr("A2"), TELEMETRY_VOLTS_SOURCE_A2);
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
@@ -711,26 +706,28 @@ void TelemetryPanel::populateCurrentSource()
|
||||
cb->addItem(tr("FAS"), TELEMETRY_CURRENT_SOURCE_FAS);
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_telemetryProtocol_currentIndexChanged(int index)
|
||||
{
|
||||
model.telemetryProtocol = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::onAnalogModified()
|
||||
{
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_frskyUnitsCB_currentIndexChanged(int index)
|
||||
{
|
||||
model.frsky.imperial = index;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_bladesCount_editingFinished()
|
||||
{
|
||||
model.frsky.blades = ui->bladesCount->value();
|
||||
emit modified();
|
||||
model.frsky.blades = ui->bladesCount->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
|
||||
{
|
||||
model.frsky.usrProto = index;
|
||||
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
|
||||
telemetryCustomScreens[i]->update();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -776,18 +773,6 @@ void TelemetryPanel::on_varioLimitMin_DSB_editingFinished()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rxbattAlarm1DSB_editingFinished()
|
||||
{
|
||||
model.frsky.rxBattAlarms[0] = round(ui->rxbattAlarm1DSB->value()/(13.2/255));
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rxbattAlarm2DSB_editingFinished()
|
||||
{
|
||||
model.frsky.rxBattAlarms[1] = round(ui->rxbattAlarm2DSB->value()/(13.2/255));
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_varioLimitMax_DSB_editingFinished()
|
||||
{
|
||||
model.frsky.varioMax = round(ui->varioLimitMax_DSB->value()-10);
|
||||
|
||||
@@ -83,17 +83,15 @@ class TelemetryPanel : public ModelPanel
|
||||
virtual ~TelemetryPanel();
|
||||
|
||||
private slots:
|
||||
void on_telemetryProtocol_currentIndexChanged(int index);
|
||||
void onAnalogModified();
|
||||
void on_frskyProtoCB_currentIndexChanged(int index);
|
||||
void on_frskyUnitsCB_currentIndexChanged(int index);
|
||||
void on_bladesCount_editingFinished();
|
||||
void on_AltitudeToolbar_ChkB_toggled(bool checked);
|
||||
void on_rssiAlarm1CB_currentIndexChanged(int index);
|
||||
void on_rssiAlarm2CB_currentIndexChanged(int index);
|
||||
void on_rssiAlarm1SB_editingFinished();
|
||||
void on_rssiAlarm2SB_editingFinished();
|
||||
void on_rxbattAlarm1DSB_editingFinished();
|
||||
void on_rxbattAlarm2DSB_editingFinished();
|
||||
void on_AltitudeGPS_ChkB_toggled(bool checked);
|
||||
void on_varioLimitMin_DSB_editingFinished();
|
||||
void on_varioLimitMax_DSB_editingFinished();
|
||||
@@ -107,6 +105,7 @@ class TelemetryPanel : public ModelPanel
|
||||
private:
|
||||
Ui::Telemetry *ui;
|
||||
TelemetryAnalog * analogs[4];
|
||||
TelemetryCustomScreen * telemetryCustomScreens[4];
|
||||
|
||||
void setup();
|
||||
void telBarUpdate();
|
||||
|
||||