Compare commits
370 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1599e85820 | |||
| cc89285a4c | |||
| 79792dfd7b | |||
| e4f00e867f | |||
| 250730789c | |||
| 0807edfc20 | |||
| 5c107aeece | |||
| 050c1b5a7f | |||
| e9bcb05a93 | |||
| 691f4aa0ae | |||
| 0045d8bcc8 | |||
| 7adccc23dc | |||
| 13657587b1 | |||
| ccb4db4c70 | |||
| b6e8b73589 | |||
| 88ca7fcc68 | |||
| 3f3af01cca | |||
| 7ec2c2c5a9 | |||
| 92c208c003 | |||
| a1e0b550fd | |||
| d5db9b7410 | |||
| 129b46ed2b | |||
| 7f3dbd0b57 | |||
| 6443c49285 | |||
| 9fa354779c | |||
| 3134b601d4 | |||
| b5c59368ca | |||
| a575709088 | |||
| a0132fc4e7 | |||
| ddac3ea5e0 | |||
| f4174e6756 | |||
| 958c51b374 | |||
| 8d1121dcc1 | |||
| 47f949c491 | |||
| 5790716a0b | |||
| c141554fc1 | |||
| 560a297680 | |||
| b86f45e15b | |||
| 80bc6f2d1a | |||
| 2b39d703a1 | |||
| 03988a3a62 | |||
| 5b7853029c | |||
| 4daf15869b | |||
| ba736a6a64 | |||
| 086204aed5 | |||
| 44d4e93ad1 | |||
| 2e57549982 | |||
| 946c17770a | |||
| eb9e6d3c80 | |||
| e1a865650f | |||
| 3d3e077fae | |||
| 13f33e38f8 | |||
| e0d5989bef | |||
| 41a6e7c4ab | |||
| 64cd872055 | |||
| 0341b9ffce | |||
| 75e613331b | |||
| c521fce20b | |||
| 62df9831d8 | |||
| 051ec88bee | |||
| f1f6bbfc24 | |||
| 02fdede06b | |||
| aec2170e7e | |||
| d7a9710a9c | |||
| d4be000ccc | |||
| be531b77f0 | |||
| 9263dde231 | |||
| 473e69b3c3 | |||
| 10d0c56b08 | |||
| c68e91c004 | |||
| e11eb2480e | |||
| 6b318e1383 | |||
| 382e4d2d4b | |||
| 3b2524dcbb | |||
| f75fedcb0d | |||
| 797b4d9f1e | |||
| 77d892a5de | |||
| 0b163ba067 | |||
| 4ebca98cdf | |||
| 1147db45a4 | |||
| 4a6a20a2aa | |||
| 7e0c78e2b7 | |||
| 7cfb1b24a1 | |||
| 0615fa780c | |||
| e43afd8001 | |||
| 04966868eb | |||
| 52ebba3802 | |||
| 3b8c5bbeb1 | |||
| 8e2c280e4a | |||
| e0544e2d1e | |||
| f76a368497 | |||
| 0c5f5695cc | |||
| 863272bc52 | |||
| 15912854e8 | |||
| ad33bff31c | |||
| b8195e1372 | |||
| 97a8dc33be | |||
| ff4f914d34 | |||
| 4104efbb17 | |||
| a7d0816ac7 | |||
| 7cf66c56c2 | |||
| 55f71f053b | |||
| 7a45b3f71b | |||
| 4ef981e914 | |||
| 338c34427e | |||
| f41ac20051 | |||
| dee5a510f5 | |||
| 917b114b49 | |||
| 2a5ab33d67 | |||
| 59b457650a | |||
| 72a15318be | |||
| 3e1d87d5b3 | |||
| b5f6618238 | |||
| 23e597fffe | |||
| 2f9ae3750d | |||
| dcc9dcbe99 | |||
| bfd2e2c538 | |||
| 638648a0a4 | |||
| d6c7b63f90 | |||
| 9f29003553 | |||
| 4b4522f2ee | |||
| 54343be57e | |||
| d449075a54 | |||
| 9a615adff7 | |||
| 8427e6ed04 | |||
| c5e8dcff38 | |||
| d7909e7dbc | |||
| 1fd1e141f2 | |||
| f65e42833e | |||
| cc4e28857d | |||
| 52a52fdb8a | |||
| 19f392131c | |||
| fb3dd1303c | |||
| c6a04394c5 | |||
| 301cd0538b | |||
| d28c71db86 | |||
| 56fb01a958 | |||
| 5e96d02120 | |||
| 9a23c3fcc6 | |||
| fe901dabdf | |||
| 806d547ced | |||
| a495885472 | |||
| 946fda5705 | |||
| cefc78dbe8 | |||
| 6acfabeaf0 | |||
| 9a40830f8a | |||
| 3004a61695 | |||
| 3660101e37 | |||
| acb7f1e17f | |||
| 75e1bead3f | |||
| 81a7a554c3 | |||
| c5c92c012b | |||
| 5f951abc15 | |||
| 017f64a7a4 | |||
| dfde65f397 | |||
| bdb50052ba | |||
| 5cc8f41bce | |||
| 08cb4550f6 | |||
| 4c342a1883 | |||
| de96f607e2 | |||
| 927c511556 | |||
| 95fe7ad197 | |||
| 1b93340319 | |||
| ca0e58e923 | |||
| 43b8ee361b | |||
| ee533c7950 | |||
| 2b9242fac2 | |||
| 83887f1532 | |||
| 1734ca6919 | |||
| f299a5bfdf | |||
| 95201db642 | |||
| 103fea7b98 | |||
| 358badfed9 | |||
| 63713578fe | |||
| 22a8a5cc80 | |||
| 5827b0fd6c | |||
| cfe1a3777f | |||
| d5396f8377 | |||
| dcf7cd2c65 | |||
| 71e54b3072 | |||
| fdca5a11b0 | |||
| 8223cd907d | |||
| c2f8ef83c7 | |||
| 7fceed4f5f | |||
| 2519df3b59 | |||
| 6e30373f86 | |||
| b29d8c50ba | |||
| fe3efb9483 | |||
| f926b85611 | |||
| 401f0f2a4f | |||
| 701d02ba8e | |||
| 67a599e0b9 | |||
| 0f4f49b64e | |||
| 84bf31f908 | |||
| 1d9056fe8d | |||
| 5c175bfd7f | |||
| b74a3987c0 | |||
| d1be1b4ea0 | |||
| 01ef176173 | |||
| 3e0a314307 | |||
| 6622324483 | |||
| 286a865d30 | |||
| 5d72bbdc90 | |||
| a44d0ddc14 | |||
| 97ef3fa916 | |||
| f9f7ddd639 | |||
| 33910c8721 | |||
| e72a049683 | |||
| f7fafc0948 | |||
| 1d867a0daa | |||
| 3c56ea0122 | |||
| 6db97c573b | |||
| 5853ac635f | |||
| fad9710012 | |||
| 9abeb15360 | |||
| 29b8b2685c | |||
| 79a5f65a2c | |||
| c07e965542 | |||
| 9e4f9bb7ed | |||
| 32f278ee3f | |||
| 860409de29 | |||
| 48081db9f6 | |||
| 02f06706c2 | |||
| 1da4df143c | |||
| 6ce34c511c | |||
| 27fe5c198f | |||
| cd821116c5 | |||
| 65fc20ddde | |||
| 2037c33ce1 | |||
| 2e76be5b0b | |||
| cdcf64e38c | |||
| fd1181dc09 | |||
| c7bd968586 | |||
| 11cc82a7ac | |||
| 1ba6a56641 | |||
| 366c286e73 | |||
| afddad9396 | |||
| 110c5da1e7 | |||
| fda4cac1ed | |||
| 7d0f5a9d9b | |||
| e64866244d | |||
| 1c38ccaa12 | |||
| 40ae1879e8 | |||
| 979a86f24e | |||
| 992897a5a7 | |||
| 8733915634 | |||
| 643e449f52 | |||
| c36acc5372 | |||
| 3913a36aeb | |||
| 2a4bc2cf6a | |||
| fe865dfdae | |||
| 45cdfac22b | |||
| c07a2d338a | |||
| 16a37db86f | |||
| 695e05c713 | |||
| 29eafb4fba | |||
| 7599d22c83 | |||
| 027f442079 | |||
| 56fd1e8039 | |||
| 0e1ab00ed3 | |||
| 7ebebb312a | |||
| 364bf6ac23 | |||
| b7e4a3c63b | |||
| d6c17a7ead | |||
| 3854e05f26 | |||
| 087e606021 | |||
| 4c8789106d | |||
| 5ff4d8829a | |||
| a313d541dc | |||
| a8300715a9 | |||
| d118acdf20 | |||
| 9f60e3c909 | |||
| 9d7e38aeff | |||
| 5c71d74aab | |||
| e738293a52 | |||
| 870002ab79 | |||
| 07d62e39db | |||
| 48365f36a5 | |||
| b43d336978 | |||
| e5ae58d4d7 | |||
| b141203bc1 | |||
| 16eaa0347d | |||
| c0c7968fc4 | |||
| e1463b99e6 | |||
| e8318cd8de | |||
| 0eb71cb4f2 | |||
| c5f3010295 | |||
| 641b6a321a | |||
| a42b63ff34 | |||
| d2ec99513c | |||
| 8eb3480acc | |||
| c9ae964428 | |||
| c51a85f376 | |||
| 6c54374ed8 | |||
| da76106465 | |||
| 3b3555df48 | |||
| c8ae36997e | |||
| 30bf6f7530 | |||
| 1786d998f8 | |||
| 708ef3bc98 | |||
| 4aa6bd12ca | |||
| c46c1f887a | |||
| a8172e3588 | |||
| 91341fa759 | |||
| 0bad169008 | |||
| aa7c320821 | |||
| 5c67e20fa5 | |||
| aa62f0d6f1 | |||
| c86ace9976 | |||
| b11d45dbb5 | |||
| 50b76183da | |||
| 1a7fb12f15 | |||
| cbfdf9b9f5 | |||
| 3f7b289ebe | |||
| 295491f965 | |||
| 16f465b147 | |||
| c91511565e | |||
| b6759d5434 | |||
| 1771a47637 | |||
| 677995205d | |||
| a6a71b8650 | |||
| ab4efe89cc | |||
| efb37a4419 | |||
| d85ee61cb3 | |||
| eecdef3c5a | |||
| a1883db889 | |||
| 0dd15ebbab | |||
| 3ad57cf3ff | |||
| f27c092ba4 | |||
| e8aaa67450 | |||
| 43b84385d8 | |||
| 7fe39791ff | |||
| a3fac6049f | |||
| e3eb236e7b | |||
| a57053e390 | |||
| f2362bb748 | |||
| 8780535ff9 | |||
| 12af6a8a19 | |||
| 7faa7c79bf | |||
| 0ac9998e6b | |||
| a76fc4c88c | |||
| 26469b8627 | |||
| ba4dd66891 | |||
| be67637ec6 | |||
| 595a191be4 | |||
| 1ff32c64f5 | |||
| 87f8ea516b | |||
| 86df9fee4a | |||
| bd7769e717 | |||
| c42696102a | |||
| 82a4ad4103 | |||
| 685dece185 | |||
| a43271c7a6 | |||
| bbe4e7d4c3 | |||
| 3d9553d5f3 | |||
| 5e02140ac7 | |||
| d54525fe7a | |||
| 8a819dbed5 | |||
| b4cffbcce1 | |||
| 9a5bd48712 | |||
| d8bc752291 | |||
| f6740c4583 | |||
| 5f0bfc50e9 | |||
| f61bb941dc | |||
| 0600122102 | |||
| bfd385115f | |||
| d7112b5dd7 | |||
| acaa77daab | |||
| 03c9b2c4a2 | |||
| 826eb2569c |
+13
-7
@@ -1,14 +1,20 @@
|
||||
language: cpp
|
||||
|
||||
before_install:
|
||||
- sudo apt-get remove cmake cmake-data --yes
|
||||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo apt-get update
|
||||
- sudo apt-get remove cmake cmake-data --yes
|
||||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
|
||||
- sudo add-apt-repository ppa:beineri/opt-qt551 --yes
|
||||
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
|
||||
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
- sudo apt-get update -qq
|
||||
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
|
||||
|
||||
install:
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4
|
||||
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
|
||||
- export CXX="g++-5" CC="gcc-5"
|
||||
|
||||
script:
|
||||
- radio/util/commit-tests.sh
|
||||
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS .. && cmake --build .
|
||||
- ./radio/util/commit-tests.sh .
|
||||
|
||||
+19
-1
@@ -9,6 +9,10 @@ set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFI
|
||||
message(STATUS "OpenTX ${VERSION}")
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
cmake_policy(SET CMP0023 OLD)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
|
||||
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
|
||||
@@ -18,5 +22,19 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
|
||||
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Xml)
|
||||
find_package(Qt5LinguistTools)
|
||||
find_package(Qt5PrintSupport)
|
||||
find_package(Qt5Multimedia)
|
||||
|
||||
include(Macros)
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
git_id(GIT_STR)
|
||||
|
||||
add_subdirectory(${RADIO_SRC_DIRECTORY})
|
||||
add_subdirectory(${COMPANION_SRC_DIRECTORY})
|
||||
|
||||
if(Qt5Widgets_FOUND)
|
||||
add_subdirectory(${COMPANION_SRC_DIRECTORY})
|
||||
endif()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
##OpenTX 2.2 Branch
|
||||
|
||||
[](https://travis-ci.org/opentx/opentx)
|
||||
[](https://travis-ci.org/opentx/opentx)
|
||||
[](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
|
||||
|
||||
|
||||
+2
-5
@@ -5,7 +5,7 @@ macro(add_bitmaps_target targetname filter width format)
|
||||
set(target ${target}.lbm)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format}
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
|
||||
DEPENDS ${bitmap}
|
||||
)
|
||||
list(APPEND bitmaps_files ${target})
|
||||
@@ -15,11 +15,8 @@ endmacro(add_bitmaps_target)
|
||||
|
||||
macro(add_truetype_font_target radio name font size bold)
|
||||
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
|
||||
add_custom_command(
|
||||
OUTPUT ${target}.png
|
||||
OUTPUT ${target}.specs
|
||||
add_custom_target(ttf_${radio}_${name}
|
||||
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
add_custom_target(ttf_${radio}_${name} DEPENDS ${target}.png ${target}.specs)
|
||||
endmacro(add_truetype_font_target)
|
||||
+20
-21
@@ -4,25 +4,25 @@
|
||||
# SDL_FOUND, if false, do not try to link to SDL
|
||||
# SDL_INCLUDE_DIR, where to find SDL.h
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDLmain which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
# $SDLDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDLDIR
|
||||
# used in building SDL.
|
||||
# l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Modified by Eric Wing.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
||||
# Added a search for SDLmain which is needed by some platforms.
|
||||
# Added a search for threads which is needed by some platforms.
|
||||
# Added needed compile switches for MinGW.
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# People will have to manually change the cache values of
|
||||
# SDL_LIBRARY to override this selection.
|
||||
#
|
||||
# Note that the header path has changed from SDL/SDL.h to just SDL.h
|
||||
@@ -46,14 +46,14 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
|
||||
/opt/local/include/SDL # DarwinPorts
|
||||
/opt/local/include
|
||||
/opt/csw/include/SDL # Blastwave
|
||||
/opt/csw/include
|
||||
/opt/csw/include
|
||||
/opt/include/SDL
|
||||
/opt/include
|
||||
C:/Programs/SDL/include
|
||||
)
|
||||
# I'm not sure if I should do a special casing for Apple. It is
|
||||
# I'm not sure if I should do a special casing for Apple. It is
|
||||
# unlikely that other Unix systems will find the framework path.
|
||||
# But if they do ([Next|Open|GNU]Step?),
|
||||
# But if they do ([Next|Open|GNU]Step?),
|
||||
# do they want the -framework option also?
|
||||
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
|
||||
@@ -83,7 +83,7 @@ IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# SDL-1.1 is the name used by FreeBSD ports...
|
||||
# don't confuse it for the version number.
|
||||
FIND_LIBRARY(SDL_LIBRARY_TEMP
|
||||
FIND_LIBRARY(SDL_LIBRARY_TEMP
|
||||
NAMES SDL SDL-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
@@ -93,13 +93,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
C:/Programs/SDL/lib/x86
|
||||
)
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
# seem to provide SDLmain for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
FIND_LIBRARY(SDLMAIN_LIBRARY
|
||||
FIND_LIBRARY(SDLMAIN_LIBRARY
|
||||
NAMES SDLmain SDLmain-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
@@ -109,13 +109,12 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
)
|
||||
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
|
||||
# SDL may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
IF(NOT APPLE)
|
||||
FIND_PACKAGE(Threads)
|
||||
@@ -136,14 +135,14 @@ IF(SDL_LIBRARY_TEMP)
|
||||
ENDIF(SDLMAIN_LIBRARY)
|
||||
|
||||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there. I think it has something to do
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there. I think it has something to do
|
||||
# with the CACHE STRING. Maybe somebody else knows how to fix this.
|
||||
# The problem is mainly cosmetic, and not a functional issue.
|
||||
IF(APPLE)
|
||||
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if Find the threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
@@ -162,4 +161,4 @@ IF(SDL_LIBRARY_TEMP)
|
||||
SET(SDL_FOUND "YES")
|
||||
ENDIF(SDL_LIBRARY_TEMP)
|
||||
|
||||
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
|
||||
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
|
||||
|
||||
@@ -2,6 +2,7 @@ macro(today RESULT)
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
include(Macros)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
|
||||
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
@@ -27,24 +25,6 @@ if(TABLE_LAYOUT)
|
||||
message(STATUS "Using QTableWidget")
|
||||
endif(TABLE_LAYOUT)
|
||||
|
||||
message(STATUS "Looking for XercesC ")
|
||||
find_package(XercesC)
|
||||
if(XERCESC_FOUND)
|
||||
include_directories(${XERCESC_INCLUDE_DIR})
|
||||
set(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
|
||||
else()
|
||||
message(FATAL_ERROR "XercesC not found! Please set XercesC path ...")
|
||||
endif()
|
||||
|
||||
message(STATUS "Looking for Xsd ")
|
||||
find_package(Xsd)
|
||||
if(XSD_FOUND)
|
||||
include_directories(${XSD_INCLUDE_DIR})
|
||||
message("XSD Include Path: " ${XSD_INCLUDE_DIR})
|
||||
else()
|
||||
message(FATAL_ERROR "XSD not found! Please set XSD path ...")
|
||||
endif()
|
||||
|
||||
message(STATUS "Looking for SDL ")
|
||||
find_package(Sdl)
|
||||
if(SDL_FOUND)
|
||||
@@ -56,21 +36,6 @@ else()
|
||||
message("SDL not found! Joysticks support will be disabled. Simulator audio will not work.")
|
||||
endif()
|
||||
|
||||
find_package(Qt4 4.8.1 REQUIRED)
|
||||
set(QT_USE_QTNETWORK True)
|
||||
set(QT_USE_QTXML True)
|
||||
include(${QT_USE_FILE})
|
||||
|
||||
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(STATUS "Looking for QT lupdate ")
|
||||
find_package(Lupdate)
|
||||
if(LUPDATE_FOUND)
|
||||
@@ -81,12 +46,6 @@ endif()
|
||||
|
||||
add_definitions(-DQXT_STATIC)
|
||||
|
||||
add_custom_command(
|
||||
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "/EHsc /LD")
|
||||
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
|
||||
@@ -108,7 +67,6 @@ include_directories(
|
||||
${COMPANION_SRC_DIRECTORY}
|
||||
${COMPANION_SRC_DIRECTORY}/shared
|
||||
${SIMU_SRC_DIRECTORY}
|
||||
${XSD_INCLUDE_DIR}
|
||||
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
|
||||
)
|
||||
|
||||
@@ -116,7 +74,6 @@ add_subdirectory(shared)
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(generaledit)
|
||||
add_subdirectory(simulation)
|
||||
add_subdirectory(firmwares/opentx/simulator)
|
||||
add_subdirectory(qcustomplot)
|
||||
add_subdirectory(qxtcommandoptions)
|
||||
|
||||
@@ -139,9 +96,10 @@ set(common_SRCS
|
||||
appdata.cpp
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
qt5_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
qt5_use_modules(common Core Xml Widgets)
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
@@ -236,14 +194,11 @@ set(companion_UIS
|
||||
radionotfound.ui
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
set(companion_RESOURCES
|
||||
companion.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
)
|
||||
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
|
||||
@@ -264,23 +219,23 @@ foreach(language ${LANGUAGES})
|
||||
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
|
||||
endforeach(language)
|
||||
|
||||
set(companion_SRCS ${companion_SRCS})
|
||||
qt4_wrap_ui(companion_SRCS ${companion_UIS})
|
||||
qt4_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
|
||||
qt4_add_translation(companion_QM ${companion_TS})
|
||||
qt4_add_resources(companion_SRCS ${companion_RCS})
|
||||
qt5_wrap_ui(companion_SRCS ${companion_UIS})
|
||||
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
|
||||
qt5_add_translation(companion_QM ${companion_TS})
|
||||
qt5_add_resources(companion_RCC ${companion_RESOURCES})
|
||||
|
||||
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
|
||||
|
||||
if(APPLE)
|
||||
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
|
||||
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${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(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM})
|
||||
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
|
||||
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -294,21 +249,20 @@ set(simu_MOC_HDRS
|
||||
modeledit/node.h
|
||||
)
|
||||
|
||||
set(simu_SRCS ${simu_SRCS})
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS})
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
|
||||
if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
|
||||
else()
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${SIMULATOR_NAME} simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
# TODO not the same link command than companion?
|
||||
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
@@ -329,9 +283,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
|
||||
# Linux specific code
|
||||
set(OperatingSystem "Linux")
|
||||
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
else()
|
||||
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
|
||||
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
|
||||
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
@@ -359,7 +317,7 @@ if(WIN32)
|
||||
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
DEPENDS simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
COMMENT "Simulator Windows NSIS Installer")
|
||||
|
||||
add_custom_target(installer
|
||||
@@ -386,7 +344,6 @@ if(APPLE)
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync -r ${XSD_INCLUDE_DIR}/.. companion.app/Contents/Frameworks/
|
||||
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
|
||||
@@ -414,7 +371,7 @@ set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
|
||||
|
||||
# The file stripping is deliberately disabled, with the stripped file we get
|
||||
# The file stripping is deliberately disabled, with the stripped file we get
|
||||
# very poor trace-backs from the users when they report Companion crash
|
||||
set(CPACK_STRIP_FILES FALSE)
|
||||
|
||||
|
||||
@@ -312,6 +312,8 @@ QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
QString Profile::controlTypes() const { return _controlTypes; }
|
||||
QString Profile::controlNames() const { return _controlNames; }
|
||||
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
@@ -342,6 +344,8 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlTypes (const QString x) { store(x, _controlTypes, "ControlTypes" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::controlNames (const QString x) { store(x, _controlNames, "ControlNames" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
@@ -378,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
controlTypes ( rhs.controlTypes() );
|
||||
controlNames ( rhs.controlNames() );
|
||||
txCurrentCalibration ( rhs.txCurrentCalibration() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
@@ -423,6 +429,8 @@ void Profile::initFwVariables()
|
||||
_stickPotCalib = "";
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
_controlTypes = "";
|
||||
_controlNames = "";
|
||||
|
||||
_txCurrentCalibration = 0;
|
||||
_gsStickMode = 0;
|
||||
@@ -483,6 +491,8 @@ void Profile::flush()
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _controlTypes, "ControlTypes" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _controlNames, "ControlNames" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
@@ -595,6 +605,10 @@ void AppData::warningId (const int x) { store(x, _warningId,
|
||||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
{
|
||||
}
|
||||
|
||||
void AppData::init()
|
||||
{
|
||||
//Initialize the profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
|
||||
@@ -125,6 +125,8 @@ class Profile: protected CompStoreObj
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
QString _controlTypes;
|
||||
QString _controlNames;
|
||||
int _txCurrentCalibration;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
@@ -156,6 +158,8 @@ class Profile: protected CompStoreObj
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
QString controlTypes() const;
|
||||
QString controlNames() const;
|
||||
int txCurrentCalibration() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
@@ -186,6 +190,8 @@ class Profile: protected CompStoreObj
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void controlTypes (const QString);
|
||||
void controlNames (const QString);
|
||||
void txCurrentCalibration (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
@@ -378,6 +384,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
// Constructor
|
||||
AppData();
|
||||
void init();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
||||
@@ -109,14 +109,9 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
#else
|
||||
ui->useCompanionNightlyBuilds->hide();
|
||||
ui->useFirmwareNightlyBuilds->hide();
|
||||
#endif
|
||||
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef BURNCONFIGDIALOG_H_
|
||||
#define BURNCONFIGDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define MEM_TYPE_EEPROM 1
|
||||
#define MEM_TYPE_FLASH 2
|
||||
|
||||
@@ -82,12 +82,15 @@ class MyProxyStyle : public QProxyStyle
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Companion");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
g.init();
|
||||
|
||||
QStringList strl = QApplication::arguments();
|
||||
if (strl.contains("--version")) {
|
||||
printf("%s\n", VERSION);
|
||||
@@ -106,7 +109,7 @@ int main(int argc, char *argv[])
|
||||
app.installTranslator(&companionTranslator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<RCC>
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>images/customize.png</file>
|
||||
<file>icon.png</file>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef _COMPAREDIALOG_H
|
||||
#define _COMPAREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets>
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@@ -27,7 +27,7 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
|
||||
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)
|
||||
if (!errors.test(ALL_OK)
|
||||
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef CUSTOMIZESPLASHDIALOG_H
|
||||
#define CUSTOMIZESPLASHDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
namespace Ui
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "downloaddialog.h"
|
||||
#include "ui_downloaddialog.h"
|
||||
#include <QMessageBox>
|
||||
#include <QtGui>
|
||||
#include <QTime>
|
||||
#include "helpers.h"
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#ifndef DOWNLOADDIALOG_H
|
||||
#define DOWNLOADDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QFile>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class downloadDialog;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <list>
|
||||
#include <float.h>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
#include "firmwares/th9x/th9xinterface.h"
|
||||
@@ -1169,9 +1170,9 @@ GeneralSettings::GeneralSettings()
|
||||
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
imperial=byte8u;
|
||||
QString chars=t_CountrySet.mid(4,2);
|
||||
ttsLanguage[0]=chars[0].toAscii();
|
||||
ttsLanguage[1]=chars[1].toAscii();
|
||||
QString chars = t_CountrySet.mid(4, 2);
|
||||
ttsLanguage[0] = chars[0].toLatin1();
|
||||
ttsLanguage[1] = chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1524,7 +1525,7 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
|
||||
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
|
||||
}
|
||||
|
||||
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
|
||||
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
|
||||
{
|
||||
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
@@ -1685,7 +1686,7 @@ unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
@@ -1705,7 +1706,7 @@ unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
@@ -1726,7 +1727,7 @@ unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QtXml>
|
||||
#include <QtXml> // This should be removed from here, and remove Xml dependency from all libs which don't need it.
|
||||
#include <QComboBox>
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
@@ -46,7 +46,10 @@ QString getBoardName(BoardEnum board);
|
||||
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9E(board) (board==BOARD_TARANIS_X9E)
|
||||
#define IS_ARM(board) (IS_TARANIS(board) || IS_SKY9X(board))
|
||||
#define IS_HORUS(board) (board==BOARD_HORUS)
|
||||
#define IS_FLAMENCO(board) (board==BOARD_FLAMENCO)
|
||||
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
|
||||
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
|
||||
|
||||
const uint8_t modn12x3[4][4]= {
|
||||
{1, 2, 3, 4},
|
||||
@@ -1077,7 +1080,7 @@ class ModelData {
|
||||
void setTrimValue(int phaseIdx, int trimIdx, int value);
|
||||
|
||||
bool isGVarLinked(int phaseIdx, int gvarIdx);
|
||||
int getGVarValue(int phaseIdx, int gvarIdx);
|
||||
int getGVarFieldValue(int phaseIdx, int gvarIdx);
|
||||
|
||||
ModelData removeGlobalVars();
|
||||
|
||||
@@ -1506,8 +1509,7 @@ void registerOpenTxFirmwares();
|
||||
void unregisterOpenTxFirmwares();
|
||||
|
||||
enum EepromLoadErrors {
|
||||
NO_ERROR,
|
||||
|
||||
ALL_OK,
|
||||
UNKNOWN_ERROR,
|
||||
UNSUPPORTED_NEWER_VERSION,
|
||||
WRONG_SIZE,
|
||||
|
||||
+33
-5
@@ -236,6 +236,9 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
|
||||
|
||||
unsigned int RleFile::EeFsGetFree()
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
unsigned int ret = 0;
|
||||
unsigned int i;
|
||||
if (IS_ARM(board))
|
||||
@@ -255,6 +258,9 @@ unsigned int RleFile::EeFsGetFree()
|
||||
*/
|
||||
void RleFile::EeFsFree(unsigned int blk)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return;
|
||||
|
||||
unsigned int i = blk;
|
||||
while (EeFsGetLink(i)) i = EeFsGetLink(i);
|
||||
if (IS_ARM(board)) {
|
||||
@@ -272,6 +278,8 @@ void RleFile::EeFsFree(unsigned int blk)
|
||||
*/
|
||||
unsigned int RleFile::EeFsAlloc()
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
|
||||
if (ret) {
|
||||
if (IS_ARM(board))
|
||||
@@ -285,12 +293,18 @@ unsigned int RleFile::EeFsAlloc()
|
||||
|
||||
unsigned int RleFile::size(unsigned int id)
|
||||
{
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
else
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
}
|
||||
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
if (IS_HORUS(board)) {
|
||||
return 1;
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
if (eepromFatHeader) {
|
||||
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
|
||||
if (eepromFatHeader->files[i_fileId].exists) {
|
||||
@@ -324,6 +338,9 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
|
||||
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
|
||||
len -= m_pos;
|
||||
if (i_len > len) i_len = len;
|
||||
@@ -344,6 +361,9 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
// G: Read runlength (RLE) compressed bytes into buf.
|
||||
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
memset(buf, 0, i_len);
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
@@ -416,9 +436,11 @@ unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersi
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
if (zeroes > 0) {
|
||||
for (int i = 0; i < zeroes; i++)
|
||||
dst.append((char) 0);
|
||||
zeroes = 0;
|
||||
}
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
@@ -525,6 +547,9 @@ void RleFile::closeTrunc()
|
||||
|
||||
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
create(i_fileId, typ);
|
||||
bool state0 = true;
|
||||
uint8_t cnt = 0;
|
||||
@@ -571,6 +596,9 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
|
||||
*/
|
||||
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
openRd(i_fileId);
|
||||
if (eepromFatHeader) {
|
||||
|
||||
@@ -114,7 +114,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
|
||||
return md;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, sizeof(Er9xGeneral));
|
||||
break;
|
||||
@@ -326,7 +326,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tmod, data, sizeof(Er9xModelData));
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,7 @@ class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
@@ -315,7 +315,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
|
||||
return md;
|
||||
}
|
||||
@@ -333,7 +333,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
|
||||
break;
|
||||
@@ -373,7 +373,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
|
||||
break;
|
||||
|
||||
@@ -54,7 +54,7 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { return 0; };
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
internalCache.push_back(element);
|
||||
return element.table;
|
||||
}
|
||||
static void Cleanup()
|
||||
static void Cleanup()
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
@@ -370,7 +370,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
internalCache.push_back(element);
|
||||
return element.table;
|
||||
}
|
||||
static void Cleanup()
|
||||
static void Cleanup()
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
@@ -384,7 +384,7 @@ std::list<SourcesConversionTable::Cache> SourcesConversionTable::internalCache;
|
||||
|
||||
void OpenTxEepromCleanup(void)
|
||||
{
|
||||
SourcesConversionTable::Cleanup();
|
||||
SourcesConversionTable::Cleanup();
|
||||
SwitchesConversionTable::Cleanup();
|
||||
}
|
||||
|
||||
@@ -392,8 +392,8 @@ template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toAscii(),
|
||||
QObject::tr("Switch ").toAscii()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toAscii()),
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
|
||||
QObject::tr("Switch ").toLatin1()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toLatin1()),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
@@ -408,14 +408,14 @@ class SwitchField: public ConversionField< SignedField<N> > {
|
||||
_switch = sw.toValue();
|
||||
ConversionField< SignedField<N> >::beforeExport();
|
||||
}
|
||||
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
ConversionField< SignedField<N> >::afterImport();
|
||||
ConversionField< SignedField<N> >::afterImport();
|
||||
sw = RawSwitch(_switch);
|
||||
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< SignedField<N> >::internalField.getName()).arg(sw.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected:
|
||||
RawSwitch & sw;
|
||||
int _switch;
|
||||
@@ -553,7 +553,7 @@ template <int N>
|
||||
class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())),
|
||||
source(source),
|
||||
_source(0)
|
||||
@@ -569,13 +569,13 @@ class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
_source = source.toValue();
|
||||
ConversionField< UnsignedField<N> >::beforeExport();
|
||||
}
|
||||
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
ConversionField< UnsignedField<N> >::afterImport();
|
||||
ConversionField< UnsignedField<N> >::afterImport();
|
||||
source = RawSource(_source);
|
||||
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< UnsignedField<N> >::internalField.getName()).arg(source.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
RawSource & source;
|
||||
@@ -1465,7 +1465,13 @@ class CurvesField: public TransformedField {
|
||||
maxPoints(IS_ARM(board) ? 512 : 112-8)
|
||||
{
|
||||
for (int i=0; i<maxCurves; i++) {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
if (IS_TARANIS(board) && version >= 218) {
|
||||
internalField.Append(new UnsignedField<1>((unsigned int &)curves[i].type));
|
||||
internalField.Append(new BoolField<1>(curves[i].smooth));
|
||||
internalField.Append(new ConversionField< SignedField<6> >(curves[i].count, -5));
|
||||
internalField.Append(new ZCharField<3>(curves[i].name));
|
||||
}
|
||||
else if (IS_TARANIS(board) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<3>((unsigned int &)curves[i].type));
|
||||
internalField.Append(new BoolField<1>(curves[i].smooth));
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
@@ -1622,7 +1628,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
||||
{
|
||||
int val=0;
|
||||
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
|
||||
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
for (int i=1; i<=MAX_SWITCHES_POSITION(board, version); i++) {
|
||||
int s = switchIndex(i, board, version);
|
||||
@@ -1767,7 +1773,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
~LogicalSwitchField()
|
||||
~LogicalSwitchField()
|
||||
{
|
||||
delete andswitchesConversionTable;
|
||||
}
|
||||
@@ -2113,7 +2119,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
if (fn.swtch.type != SWITCH_TYPE_NONE) {
|
||||
_func = fn.func;
|
||||
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
|
||||
_active = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5));
|
||||
else
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
@@ -2209,7 +2215,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
{
|
||||
fn.func = (AssignFunc)_func;
|
||||
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
|
||||
fn.repeatParam = (version >= 216 ? _active : (_active*5));
|
||||
else
|
||||
fn.enabled = (_active & 0x01);
|
||||
@@ -2226,7 +2232,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = (int8_t)value;
|
||||
fn.param = (int16_t)(uint16_t)value;
|
||||
}
|
||||
else if (fn.func >= FuncSetTimer1 && fn.func <= FuncSetTimer3) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
@@ -2529,7 +2535,7 @@ class FrskyScreenField: public DataField {
|
||||
else
|
||||
numbers.Append(new SpareBitsField<4*8>());
|
||||
}
|
||||
|
||||
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
script.Append(new CharField<8>(screen.body.script.filename));
|
||||
script.Append(new SpareBitsField<16*8>());
|
||||
@@ -2878,7 +2884,7 @@ class SensorField: public TransformedField {
|
||||
_instance = sensor.formula;
|
||||
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
|
||||
_param = (sensor.source) + (sensor.index << 8);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
_param = (sensor.gps) + (sensor.alt << 8);
|
||||
@@ -2900,7 +2906,7 @@ class SensorField: public TransformedField {
|
||||
sensor.formula = _instance;
|
||||
if (sensor.formula == SensorData::TELEM_FORMULA_CELL)
|
||||
(sensor.source = _sources[0], sensor.index = _sources[1]);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_ADD || sensor.formula == SensorData::TELEM_FORMULA_AVERAGE || sensor.formula == SensorData::TELEM_FORMULA_MULTIPLY || sensor.formula == SensorData::TELEM_FORMULA_MIN || sensor.formula == SensorData::TELEM_FORMULA_MAX)
|
||||
for (int i=0; i<4; ++i)
|
||||
sensor.sources[i] = _sources[i];
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
@@ -3193,7 +3199,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
if (IS_TARANIS(board) && version < 218) {
|
||||
for (int i=0; i<MAX_CURVES(board, version); i++) {
|
||||
internalField.Append(new ZCharField<6>(modelData.curves[i].name));
|
||||
}
|
||||
@@ -3221,13 +3227,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++) {
|
||||
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
@@ -3249,7 +3255,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version == 216) {
|
||||
@@ -3369,8 +3375,9 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
|
||||
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
internalField.Append(new SignedField<16>(generalData.trainer.calib[i]));
|
||||
}
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
internalField.Append(new UnsignedField<6>(generalData.trainer.mix[i].src));
|
||||
internalField.Append(new UnsignedField<2>(generalData.trainer.mix[i].mode));
|
||||
@@ -3379,7 +3386,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.view, 0, MAX_VIEWS(board)-1));
|
||||
|
||||
internalField.Append(new SpareBitsField<2>());
|
||||
internalField.Append(new SpareBitsField<2>()); // TODO buzzerMode?
|
||||
internalField.Append(new BoolField<1>(generalData.fai));
|
||||
internalField.Append(new SignedField<2>((int &)generalData.beeperMode));
|
||||
internalField.Append(new BoolField<1>(generalData.flashBeep));
|
||||
@@ -3396,13 +3403,18 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
|
||||
if (IS_9X(board) && version >= 215) {
|
||||
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
|
||||
if (IS_9X(board)) {
|
||||
if (version >= 215) {
|
||||
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(generalData.minuteBeep));
|
||||
internalField.Append(new BoolField<1>(generalData.preBeep));
|
||||
}
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(generalData.minuteBeep));
|
||||
internalField.Append(new BoolField<1>(generalData.preBeep));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
}
|
||||
if (version >= 216 && IS_TARANIS(board))
|
||||
internalField.Append(new SignedField<3>(generalData.splashDuration));
|
||||
@@ -3415,20 +3427,19 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new SignedField<8>(generalData.switchesDelay));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
internalField.Append(new SpareBitsField<8>()); // TODO blOffBright + blOnBright
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
|
||||
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
|
||||
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
|
||||
internalField.Append(new SignedField<8>(generalData.hapticLength));
|
||||
|
||||
if (version < 216 || !IS_9X(board)) {
|
||||
if (version < 216 || (version < 218 && !IS_9X(board)) || (!IS_9X(board) && !IS_TARANIS(board))) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
|
||||
}
|
||||
|
||||
if (version >= 216 && !IS_TARANIS(board)) {
|
||||
internalField.Append(new UnsignedField<4>(generalData.stickReverse));
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
internalField.Append(new UnsignedField<8>(generalData.stickReverse));
|
||||
}
|
||||
|
||||
internalField.Append(new SignedField<3>(generalData.beeperLength));
|
||||
@@ -3450,33 +3461,46 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||
if (version >= 213) {
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
if (version < 218) internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
|
||||
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
|
||||
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
|
||||
if (version < 218) internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
|
||||
}
|
||||
if (version >= 214) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.countryCode));
|
||||
internalField.Append(new UnsignedField<8>(generalData.imperial));
|
||||
}
|
||||
if (version >= 215) {
|
||||
internalField.Append(new CharField<2>(generalData.ttsLanguage));
|
||||
internalField.Append(new SignedField<8>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.varioVolume));
|
||||
if (version < 218) {
|
||||
internalField.Append(new SignedField<8>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.varioVolume));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SignedField<4>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.varioVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.backgroundVolume));
|
||||
}
|
||||
if (version >= 216) {
|
||||
internalField.Append(new SignedField<8>(generalData.varioPitch));
|
||||
internalField.Append(new SignedField<8>(generalData.varioRange));
|
||||
internalField.Append(new SignedField<8>(generalData.varioRepeat));
|
||||
}
|
||||
internalField.Append(new SignedField<8>(generalData.backgroundVolume));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.backgroundVolume));
|
||||
}
|
||||
if (version >= 218) {
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
|
||||
}
|
||||
}
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
if (version >= 217) {
|
||||
@@ -3502,11 +3526,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(board))
|
||||
internalField.Append(new SpareBitsField<64>());
|
||||
internalField.Append(new SpareBitsField<64>()); // switchUnlockStates
|
||||
else if (IS_TARANIS(board))
|
||||
internalField.Append(new SpareBitsField<16>());
|
||||
|
||||
if (version >= 217) {
|
||||
internalField.Append(new SpareBitsField<16>()); // switchUnlockStates
|
||||
|
||||
if (version == 217) {
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
|
||||
}
|
||||
}
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -973,7 +973,7 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
return NOT_OPENTX;
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
return ALL_OK;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
@@ -1081,7 +1081,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
|
||||
}
|
||||
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -1097,25 +1097,10 @@ QString OpenTxFirmware::getFirmwareBaseUrl()
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
{
|
||||
QString url = getFirmwareBaseUrl();
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
|
||||
break;
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_AR9X:
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
break;
|
||||
default:
|
||||
url.clear();
|
||||
break;
|
||||
}
|
||||
if (IS_ARM(board))
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
else
|
||||
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -1340,7 +1325,7 @@ void registerOpenTxFirmwares()
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("sdcard", QObject::tr("Support for SD memory card"));
|
||||
//firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
//firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
@@ -1438,6 +1423,7 @@ void registerOpenTxFirmwares()
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
firmware->addOption("horussticks", QObject::tr("Horus magnetic sticks"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
git_id(GIT_STR)
|
||||
|
||||
configure_file(${RADIO_SRC_DIRECTORY}/stamp.h.in ${RADIO_SRC_DIRECTORY}/stamp.h @ONLY)
|
||||
|
||||
set(OPENTX_SRC_FILES
|
||||
opentxsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}/radio/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${RADIO_BIN_DIRECTORY}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${COMPANION_SRC_DIRECTORY}/firmwares/opentx
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs/option
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/CoOS
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/Lua/src
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
set(CMAKE_SHARED_LINKER_FLAGS -F/Library/Frameworks)
|
||||
endif(APPLE)
|
||||
|
||||
if(DEFINED TRANSLATIONS)
|
||||
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
|
||||
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
|
||||
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
|
||||
endif()
|
||||
|
||||
set(COMMON_DEFINITIONS
|
||||
${COMMON_DEFINITIONS}
|
||||
SUFFIX="${SUFFIX}"
|
||||
HELI
|
||||
GVARS
|
||||
FLIGHT_MODES
|
||||
PPM_CENTER_ADJUSTABLE
|
||||
PPM_LIMITS_SYMETRICAL
|
||||
OVERRIDE_CHANNEL_FUNCTION
|
||||
FAI_CHOICE
|
||||
)
|
||||
|
||||
set(COMMON_LIBRARIES
|
||||
${QT_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${SDL_LIBRARY}
|
||||
)
|
||||
|
||||
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-horus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
set(dependencies_9x 9x_bitmaps firmware_translations)
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-ar9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
set(dependencies_taranis taranis_bitmaps firmware_translations)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis_x9e)
|
||||
|
||||
add_dependencies(opentx-horus${SUFFIX}-simulator horus_bitmaps horus_fonts firmware_translations lua_export_horus)
|
||||
|
||||
set(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
opentx-9xr${SUFFIX}-simulator
|
||||
opentx-9x128${SUFFIX}-simulator
|
||||
opentx-9xr128${SUFFIX}-simulator
|
||||
opentx-gruvin9x${SUFFIX}-simulator
|
||||
opentx-mega2560${SUFFIX}-simulator
|
||||
opentx-sky9x${SUFFIX}-simulator
|
||||
opentx-9xrpro${SUFFIX}-simulator
|
||||
opentx-ar9x${SUFFIX}-simulator
|
||||
opentx-taranis${SUFFIX}-simulator
|
||||
opentx-taranisplus${SUFFIX}-simulator
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
opentx-horus${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega64
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9X with ATmega128
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega128
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Gruvin9x
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Mega2560
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560 PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Sky9x
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR-PRO
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# AR9X
|
||||
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis standard
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis Plus
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis X9E
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Horus
|
||||
target_include_directories(opentx-horus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/horus PRIVATE ${RADIO_SRC_DIRECTORY}/fonts/horus PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/horus)
|
||||
target_compile_definitions(opentx-horus${SUFFIX}-simulator PRIVATE PCBHORUS CPUARM CPUSTM32 STM32F40_41xxx COLORLCD VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-horus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set(SIMULATOR_BUNDLES)
|
||||
foreach(_file ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${_file}-bundle")
|
||||
add_custom_target(${SIMULATOR_BUNDLE}
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND pwd
|
||||
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${_file}
|
||||
)
|
||||
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
|
||||
endforeach()
|
||||
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
|
||||
endif(APPLE)
|
||||
|
||||
@@ -1,695 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxsimulator.h"
|
||||
#include <QDebug>
|
||||
#include <stdio.h>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#define COMPANION
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define GUI
|
||||
#define SPLASH
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define GPS
|
||||
#define VARIO
|
||||
#define GAUGES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#if defined(PCBFLAMENCO)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define LUAINPUTS
|
||||
#else
|
||||
#define BUZZER
|
||||
#define TEMPLATES
|
||||
#endif
|
||||
#define BOLD_FONT
|
||||
#define HAPTIC
|
||||
#define THRTRACE
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TIMERS 3
|
||||
#else
|
||||
#define TIMERS 2
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
#define ROTARY_ENCODERS 1
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define ROTARY_ENCODERS 2
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define FRSKY_SPORT
|
||||
#endif
|
||||
|
||||
#if defined (PCBTARANIS)
|
||||
#define MIXERS_MONITOR
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
namespace NAMESPACE {
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/main_arm.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/tasks_arm.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/telemetry/telemetry.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/sbus.cpp"
|
||||
#include "radio/src/crc16.cpp"
|
||||
#else
|
||||
#include "radio/src/main_avr.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/storage/storage_common.cpp"
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "radio/src/storage/eeprom_common.cpp"
|
||||
#include "radio/src/storage/eeprom_rlc.cpp"
|
||||
#elif defined(EEPROM)
|
||||
#include "radio/src/storage/eeprom_common.cpp"
|
||||
#include "radio/src/storage/eeprom_raw.cpp"
|
||||
#elif defined(SDCARD)
|
||||
#include "radio/src/storage/sdcard_raw.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBSKY9X)
|
||||
#include "radio/src/storage/eeprom_conversions.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/debug.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/functions.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/sdcard.cpp"
|
||||
#endif
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/trainer_input.cpp"
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/horus/bitmaps.cpp"
|
||||
#include "radio/src/gui/horus/curves.cpp"
|
||||
#include "radio/src/gui/horus/fonts.cpp"
|
||||
#include "radio/src/gui/horus/widgets.cpp"
|
||||
#include "radio/src/gui/horus/navigation.cpp"
|
||||
#include "radio/src/gui/horus/popups.cpp"
|
||||
#include "radio/src/gui/horus/helpers.cpp"
|
||||
#include "radio/src/gui/horus/menus.cpp"
|
||||
#include "radio/src/gui/horus/menu_model.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_select.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/horus/menu_general.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/horus/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/horus/view_main.cpp"
|
||||
#include "radio/src/gui/horus/view_statistics.cpp"
|
||||
#include "radio/src/gui/horus/view_channels.cpp"
|
||||
#include "radio/src/gui/horus/view_telemetry.cpp"
|
||||
#include "radio/src/gui/horus/view_text.cpp"
|
||||
#include "radio/src/gui/horus/view_about.cpp"
|
||||
#include "radio/src/gui/horus/lcd.cpp"
|
||||
#include "radio/src/gui/horus/splash.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/gui/Flamenco/fonts.cpp"
|
||||
#include "radio/src/gui/Flamenco/widgets.cpp"
|
||||
#include "radio/src/gui/Flamenco/navigation.cpp"
|
||||
#include "radio/src/gui/Flamenco/popups.cpp"
|
||||
#include "radio/src/gui/Flamenco/helpers.cpp"
|
||||
#include "radio/src/gui/Flamenco/menus.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_custom_functions.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_main.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_statistics.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_channels.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_text.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_about.cpp"
|
||||
#include "radio/src/gui/Flamenco/lcd.cpp"
|
||||
#include "radio/src/gui/Flamenco/splash.cpp"
|
||||
#include "radio/src/targets/flamenco/tw8823_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/taranis/fonts.cpp"
|
||||
#include "radio/src/gui/taranis/widgets.cpp"
|
||||
#include "radio/src/gui/taranis/navigation.cpp"
|
||||
#include "radio/src/gui/taranis/popups.cpp"
|
||||
#include "radio/src/gui/taranis/helpers.cpp"
|
||||
#include "radio/src/gui/taranis/menus.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_select.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_version.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_diaganas.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/taranis/view_main.cpp"
|
||||
#include "radio/src/gui/taranis/view_statistics.cpp"
|
||||
#include "radio/src/gui/taranis/view_channels.cpp"
|
||||
#include "radio/src/gui/taranis/view_telemetry.cpp"
|
||||
#include "radio/src/gui/taranis/view_text.cpp"
|
||||
#include "radio/src/gui/taranis/view_about.cpp"
|
||||
#include "radio/src/gui/taranis/lcd.cpp"
|
||||
#include "radio/src/gui/taranis/splash.cpp"
|
||||
#else
|
||||
#include "radio/src/gui/9x/fonts.cpp"
|
||||
#include "radio/src/gui/9x/widgets.cpp"
|
||||
#include "radio/src/gui/9x/navigation.cpp"
|
||||
#include "radio/src/gui/9x/popups.cpp"
|
||||
#include "radio/src/gui/9x/helpers.cpp"
|
||||
#include "radio/src/gui/9x/menus.cpp"
|
||||
#include "radio/src/gui/9x/menu_model.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_select.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/9x/menu_model_templates.cpp"
|
||||
#include "radio/src/gui/9x/menu_general.cpp"
|
||||
#include "radio/src/gui/9x/menu_general_setup.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/gui/9x/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/9x/view_text.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9x/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/9x/menu_general_version.cpp"
|
||||
#include "radio/src/gui/9x/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/9x/menu_general_diaganas.cpp"
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/9x/menu_general_hardware.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9x/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/9x/view_main.cpp"
|
||||
#include "radio/src/gui/9x/view_statistics.cpp"
|
||||
#include "radio/src/gui/9x/view_telemetry.cpp"
|
||||
#if !defined(CPUM64)
|
||||
#include "radio/src/gui/9x/view_about.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9x/lcd.cpp"
|
||||
#include "radio/src/gui/9x/splash.cpp"
|
||||
#endif
|
||||
|
||||
#if !defined(VIRTUALINPUTS)
|
||||
#include "radio/src/templates.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/logs.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(RTCLOCK)
|
||||
#include "radio/src/rtc.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(BUZZER)
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
#include "radio/src/targets/horus/board_horus.cpp"
|
||||
#include "radio/src/targets/horus/keys_driver.cpp"
|
||||
#include "radio/src/targets/horus/audio_driver.cpp"
|
||||
#include "radio/src/targets/horus/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/horus/haptic_driver.cpp"
|
||||
#include "radio/src/targets/horus/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/horus/trainer_driver.cpp"
|
||||
#include "radio/src/targets/horus/serial2_driver.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/targets/flamenco/board_flamenco.cpp"
|
||||
#include "radio/src/targets/flamenco/keys_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/audio_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/eeprom_driver.cpp"
|
||||
// #include "radio/src/targets/flamenco/haptic_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/pulses_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/rtc_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/trainer_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
#if defined(REV9E)
|
||||
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
|
||||
#endif
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/serial2_driver.cpp"
|
||||
#elif defined(PCBSKY9X)
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#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/serial2_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
#elif defined(PCBMEGA2560)
|
||||
#include "radio/src/targets/mega2560/board_mega2560.cpp"
|
||||
#else
|
||||
#include "radio/src/targets/9x/board_stock.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/gui_helpers.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/telemetry/frsky_d_arm.cpp"
|
||||
#else
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#endif
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_nl.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
#include "radio/src/lua/interface.cpp"
|
||||
#include "radio/src/lua/api_general.cpp"
|
||||
#include "radio/src/lua/api_lcd.cpp"
|
||||
#include "radio/src/lua/api_model.cpp"
|
||||
#include "radio/src/thirdparty/Lua/src/lapi.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcode.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lctype.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldebug.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldo.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lfunc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lgc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/llex.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmem.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lobject.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lopcodes.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lparser.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstate.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstring.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lrotable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lundump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lvm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lzio.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbaselib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/linit.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmathlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbitlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/loadlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lauxlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltablib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcorolib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/liolib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstrlib.c"
|
||||
#endif
|
||||
|
||||
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void resetTrims()
|
||||
{
|
||||
TRIMS_GPIO_REG_RVD |= TRIMS_GPIO_PIN_RVD;
|
||||
TRIMS_GPIO_REG_RVU |= TRIMS_GPIO_PIN_RVU;
|
||||
TRIMS_GPIO_REG_RHL |= TRIMS_GPIO_PIN_RHL;
|
||||
TRIMS_GPIO_REG_RHR |= TRIMS_GPIO_PIN_RHR;
|
||||
TRIMS_GPIO_REG_LVD |= TRIMS_GPIO_PIN_LVD;
|
||||
TRIMS_GPIO_REG_LVU |= TRIMS_GPIO_PIN_LVU;
|
||||
TRIMS_GPIO_REG_LHL |= TRIMS_GPIO_PIN_LHL;
|
||||
TRIMS_GPIO_REG_LHR |= TRIMS_GPIO_PIN_LHR;
|
||||
}
|
||||
#endif
|
||||
|
||||
void delay_01us(::uint16_t nb)
|
||||
{
|
||||
}
|
||||
|
||||
OpenTxSimulator::OpenTxSimulator()
|
||||
{
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setSdPath(const QString &sdPath)
|
||||
{
|
||||
#if defined(SDCARD)
|
||||
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setVolumeGain(int value)
|
||||
{
|
||||
volumeGain = value;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
::uint8_t * OpenTxSimulator::getLcd()
|
||||
{
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
|
||||
start((const char *)0, tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] = 0;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
#endif
|
||||
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(volumeGain);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
#if defined(CPUARM)
|
||||
StopAudioThread();
|
||||
#endif
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
#if defined(PCBSKY9X)
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
|
||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
::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 = NAMESPACE::modn12x3[4*getStickMode() + i];
|
||||
::int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxSimulator::wheelEvent(int steps)
|
||||
{
|
||||
#if defined(PCBHORUS) || defined(PCBFLAMENCO)
|
||||
if (steps > 0)
|
||||
rotencValue -= 2;
|
||||
else
|
||||
rotencValue += 2;
|
||||
#elif defined(REV9E)
|
||||
if (steps == 255)
|
||||
rotencValue -= 2;
|
||||
else
|
||||
rotencValue += 2;
|
||||
#elif defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] += steps*4;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] += steps;
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned int OpenTxSimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
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 * OpenTxSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
processSportPacket(data);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->custom.ratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setLuaStateReloadPermanentScripts()
|
||||
{
|
||||
#if defined(LUA)
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
|
||||
{
|
||||
traceCallback = callback;
|
||||
}
|
||||
|
||||
class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
{
|
||||
public:
|
||||
OpenTxSimulatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
virtual SimulatorInterface *create()
|
||||
{
|
||||
return new OpenTxSimulator();
|
||||
}
|
||||
|
||||
virtual QString name()
|
||||
{
|
||||
return QString("opentx-" FLAVOUR SUFFIX);
|
||||
}
|
||||
|
||||
virtual BoardEnum type()
|
||||
{
|
||||
#if defined(PCBHORUS)
|
||||
return BOARD_HORUS;
|
||||
#elif defined(PCBFLAMENCO)
|
||||
return BOARD_FLAMENCO;
|
||||
#elif defined(PCBTARANIS)
|
||||
return BOARD_TARANIS;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
extern "C" DLLEXPORT SimulatorFactory *registerSimu()
|
||||
{
|
||||
return new NAMESPACE::OpenTxSimulatorFactory();
|
||||
}
|
||||
@@ -123,7 +123,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
if (xmlOK) {
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
if (!errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
@@ -162,7 +162,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
|
||||
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FLASHEEPROMDIALOG_H_
|
||||
#define FLASHEEPROMDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
|
||||
@@ -203,7 +203,6 @@ void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
||||
void FlashFirmwareDialog::on_burnButton_clicked()
|
||||
{
|
||||
g.flashDir(QFileInfo(fwName).dir().absolutePath());
|
||||
g.profile[g.id()].fwName(fwName);
|
||||
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
|
||||
g.backupOnFlash(ui->backupEEprom->isChecked());
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef FLASH_FIRMWARE_DIALOG_H
|
||||
#define FLASH_FIRMWARE_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
@@ -24,7 +24,8 @@ foreach(name ${generaledit_NAMES})
|
||||
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
qt5_use_modules(generaledit Widgets Xml Multimedia)
|
||||
@@ -14,7 +14,7 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(layout);
|
||||
|
||||
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->setColumnCount(3);
|
||||
tableWidget->setShowGrid(false);
|
||||
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
#include <QScrollArea>
|
||||
#include "generaledit.h"
|
||||
#include "ui_generaledit.h"
|
||||
#include "helpers.h"
|
||||
@@ -84,12 +81,15 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
{
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
int numSwPots=GetCurrentFirmware()->getCapability(Switches)+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
if (calib.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
QString hwtypes = g.profile[profile_id].controlTypes();
|
||||
QString controlNames=g.profile[profile_id].controlNames();
|
||||
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
@@ -136,6 +136,45 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, radio calibration was not retrieved"));
|
||||
}
|
||||
if (hwtypes.length()==numSwPots) {
|
||||
QString Byte;
|
||||
int16_t byte16;
|
||||
QByteArray qba;
|
||||
int16_t offset;
|
||||
bool ok;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
qba = controlNames.mid(3*i,3).toLatin1();
|
||||
strcpy(generalSettings.stickName[i], qba.data());
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
Byte=hwtypes.mid(i,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.switchConfig[i]=byte16;
|
||||
strcpy(generalSettings.switchName[i], qba.data());
|
||||
}
|
||||
offset = GetCurrentFirmware()->getCapability(Switches);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.potConfig[i]=byte16;
|
||||
strcpy(generalSettings.potName[i], qba.data());
|
||||
}
|
||||
offset += GetCurrentFirmware()->getCapability(Pots);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.sliderConfig[i]=byte16;
|
||||
strcpy(generalSettings.sliderName[i], qba.data());
|
||||
}
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
|
||||
}
|
||||
if ((DisplaySet.length()==6) && (BeeperSet.length()==4) && (HapticSet.length()==6) && (SpeakerSet.length()==6)) {
|
||||
generalSettings.stickMode=GSStickMode;
|
||||
uint8_t byte8u;
|
||||
@@ -183,8 +222,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
if (ok)
|
||||
generalSettings.imperial=byte8u;
|
||||
chars=CountrySet.mid(4,2);
|
||||
generalSettings.ttsLanguage[0]=chars[0].toAscii();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toAscii();
|
||||
generalSettings.ttsLanguage[0]=chars[0].toLatin1();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -200,13 +239,15 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
int profile_id=ui->profile_CB->itemData(ui->profile_CB->currentIndex()).toInt();
|
||||
|
||||
QString name=g.profile[profile_id].name();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders);
|
||||
if (name.isEmpty()) {
|
||||
ui->calstore_PB->setDisabled(true);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
QString calib=g.profile[profile_id].stickPotCalib();
|
||||
QString hwtypes=g.profile[profile_id].controlTypes();
|
||||
QString controlNames=g.profile[profile_id].controlNames();
|
||||
if (!(calib.isEmpty())) {
|
||||
int ret = QMessageBox::question(this, "Companion",
|
||||
tr("Do you want to store calibration in %1 profile<br>overwriting existing calibration?").arg(name) ,
|
||||
@@ -227,6 +268,25 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
hwtypes.clear();
|
||||
controlNames.clear();
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
controlNames.append(QString("%1").arg(generalSettings.stickName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.switchConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.switchName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.potConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.potName[i], -3));
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
hwtypes.append(QString("%1").arg((uint16_t)generalSettings.sliderConfig[i], 1));
|
||||
controlNames.append(QString("%1").arg(generalSettings.sliderName[i], -3));
|
||||
}
|
||||
g.profile[profile_id].controlTypes( hwtypes );
|
||||
g.profile[profile_id].controlNames( controlNames );
|
||||
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GENERALEDIT_H
|
||||
#define GENERALEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "genericpanel.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "generalsetup.h"
|
||||
#include "ui_generalsetup.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
@@ -275,8 +274,8 @@ void GeneralSetupPanel::populateBacklightCB()
|
||||
void GeneralSetupPanel::populateVoiceLangCB()
|
||||
{
|
||||
QComboBox * b = ui->voiceLang_CB;
|
||||
QString strings[] = { QObject::tr("English"), QObject::tr("Finnish"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), NULL};
|
||||
QString langcode[] = { "en", "fi","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", NULL};
|
||||
QString strings[] = { QObject::tr("English"), QObject::tr("Dutch"), QObject::tr("French"), QObject::tr("Italian"), QObject::tr("German"), QObject::tr("Czech"), QObject::tr("Slovak"), QObject::tr("Spanish"), QObject::tr("Polish"), QObject::tr("Portuguese"), QObject::tr("Swedish"), QObject::tr("Hungarian"), NULL};
|
||||
QString langcode[] = { "en", "nl","fr", "it", "de", "cz", "sk", "es", "pl", "pt", "se", "hu", NULL};
|
||||
|
||||
b->clear();
|
||||
for (int i=0; strings[i]!=NULL; i++) {
|
||||
@@ -316,7 +315,7 @@ void GeneralSetupPanel::on_voiceLang_CB_currentIndexChanged(int index)
|
||||
if (!lock) {
|
||||
QString code = ui->voiceLang_CB->itemData(index).toString();
|
||||
for (int i=0; i<2; i++) {
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toAscii();
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toLatin1();
|
||||
}
|
||||
generalSettings.ttsLanguage[2] = '\0';
|
||||
emit modified();
|
||||
|
||||
@@ -658,7 +658,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="adjustRTC">
|
||||
<property name="toolTip">
|
||||
<string>If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio.</string>
|
||||
<string>Automatically adjust the radio's clock if a GPS is connected to telemetry.</string>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
|
||||
@@ -86,7 +86,7 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
|
||||
{
|
||||
memset(dest, 0, length+1);
|
||||
if (b->currentText() != "----") {
|
||||
strncpy(dest, b->currentText().toAscii(), length);
|
||||
strncpy(dest, b->currentText().toLatin1(), length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef HELPERS_H
|
||||
#define HELPERS_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QTableWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QDebug>
|
||||
|
||||
@@ -499,12 +499,12 @@ void LogsDialog::on_fileOpen_BT_clicked()
|
||||
}
|
||||
}
|
||||
|
||||
ui->logTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
ui->logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
QVarLengthArray<int> sizes;
|
||||
for (int i = 0; i < ui->logTable->columnCount(); i++) {
|
||||
sizes.append(ui->logTable->columnWidth(i));
|
||||
}
|
||||
ui->logTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
|
||||
ui->logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||
for (int i = 0; i < ui->logTable->columnCount(); i++) {
|
||||
ui->logTable->setColumnWidth(i, sizes.at(i));
|
||||
}
|
||||
|
||||
+136
-138
@@ -71,7 +71,6 @@
|
||||
#include "progressdialog.h"
|
||||
|
||||
#define OPENTX_COMPANION_DOWNLOADS "http://downloads-22.open-tx.org/companion"
|
||||
#define OPENTX_NIGHT_COMPANION_DOWNLOADS "http://downloads-22.open-tx.org/nightly/companion"
|
||||
#define DONATE_STR "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QUZ48K4SEXDP2"
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -85,8 +84,10 @@
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#define OPENTX_NIGHT_COMPANION_DOWNLOADS "http://downloads-22.open-tx.org/nightly/companion/windows"
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#define OPENTX_NIGHT_COMPANION_DOWNLOADS "http://downloads-22.open-tx.org/nightly/companion/linux"
|
||||
#endif
|
||||
|
||||
MainWindow::MainWindow():
|
||||
@@ -275,51 +276,57 @@ void MainWindow::closeUpdatesWaitDialog()
|
||||
}
|
||||
}
|
||||
|
||||
QString MainWindow::seekCodeString(const QByteArray & qba, const QString & label)
|
||||
{
|
||||
int posLabel = qba.indexOf(label);
|
||||
if (posLabel < 0)
|
||||
return QString::null;
|
||||
int start = qba.indexOf("\"", posLabel + label.length());
|
||||
if (start < 0)
|
||||
return QString::null;
|
||||
int end = qba.indexOf("\"", start + 1);
|
||||
if (end < 0)
|
||||
return QString::null;
|
||||
return qba.mid(start + 1, end - start - 1);
|
||||
}
|
||||
|
||||
void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
{
|
||||
QByteArray qba = reply->readAll();
|
||||
int i = qba.indexOf("VERSION");
|
||||
if (i>0) {
|
||||
QString version = qba.mid(i+14, qba.indexOf("\"", i+14)-i-14);
|
||||
QString version = seekCodeString(qba, "VERSION");
|
||||
if (version.isNull())
|
||||
return onUpdatesError();
|
||||
|
||||
if (version.isNull()) {
|
||||
return onUpdatesError();
|
||||
}
|
||||
int vnum = version2index(version);
|
||||
|
||||
int vnum = version2index(version);
|
||||
QString c9xversion = QString(VERSION);
|
||||
int c9xver = version2index(c9xversion);
|
||||
|
||||
QString c9xversion = QString(VERSION);
|
||||
int c9xver = version2index(c9xversion);
|
||||
|
||||
if (c9xver < vnum) {
|
||||
if (c9xver < vnum) {
|
||||
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
|
||||
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
|
||||
"Would you like to download it?").arg(version) ,
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
|
||||
"Would you like to download it?").arg(version) ,
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if (ret == QMessageBox::Yes) {
|
||||
QDir dir(g.updatesDir());
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), dir.absoluteFilePath(QString(COMPANION_INSTALLER).arg(version)), tr("Executable (*.exe)"));
|
||||
if (!fileName.isEmpty()) {
|
||||
g.updatesDir(QFileInfo(fileName).dir().absolutePath());
|
||||
downloadDialog * dd = new downloadDialog(this, QString("%1/%2").arg(getCompanionUpdateBaseUrl()).arg(QString(COMPANION_INSTALLER).arg(version)), fileName);
|
||||
installer_fileName = fileName;
|
||||
connect(dd, SIGNAL(accepted()), this, SLOT(updateDownloaded()));
|
||||
dd->exec();
|
||||
}
|
||||
if (ret == QMessageBox::Yes) {
|
||||
QDir dir(g.updatesDir());
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), dir.absoluteFilePath(QString(COMPANION_INSTALLER).arg(version)), tr("Executable (*.exe)"));
|
||||
if (!fileName.isEmpty()) {
|
||||
g.updatesDir(QFileInfo(fileName).dir().absolutePath());
|
||||
downloadDialog * dd = new downloadDialog(this, QString("%1/%2").arg(getCompanionUpdateBaseUrl()).arg(QString(COMPANION_INSTALLER).arg(version)), fileName);
|
||||
installer_fileName = fileName;
|
||||
connect(dd, SIGNAL(accepted()), this, SLOT(updateDownloaded()));
|
||||
dd->exec();
|
||||
}
|
||||
}
|
||||
#else
|
||||
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available, please check the OpenTX website!"));
|
||||
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available, please check the OpenTX website!"));
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (downloadDialog_forWait && checkForUpdatesState==0) {
|
||||
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
return onUpdatesError();
|
||||
if (downloadDialog_forWait && checkForUpdatesState==0) {
|
||||
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
|
||||
}
|
||||
}
|
||||
|
||||
checkForUpdates();
|
||||
@@ -350,7 +357,7 @@ void MainWindow::firmwareDownloadAccepted()
|
||||
QTextStream inputStream(&file);
|
||||
QString hline = inputStream.readLine();
|
||||
if (hline.startsWith("ERROR:")) {
|
||||
int errnum=hline.mid(6).toInt();
|
||||
int errnum = hline.mid(6).toInt();
|
||||
switch(errnum) {
|
||||
case 1:
|
||||
errormsg = tr("Not enough memory for all the selected firmware options");
|
||||
@@ -388,114 +395,105 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
bool ignore = false;
|
||||
|
||||
QByteArray qba = reply->readAll();
|
||||
QString versionString = seekCodeString(qba, "VERSION");
|
||||
QString dateString = seekCodeString(qba, "DATE");
|
||||
if (versionString.isNull() || dateString.isNull())
|
||||
return onUpdatesError();
|
||||
|
||||
long version = 0;
|
||||
long version = version2index(versionString);
|
||||
if (version <= 0)
|
||||
return onUpdatesError();
|
||||
|
||||
int versionIndex = qba.indexOf("VERS_STR");
|
||||
int dateIndex = qba.indexOf("DATE_STR");
|
||||
QString fullVersionString = QString("%1 (%2)").arg(versionString).arg(dateString);
|
||||
|
||||
QString versionString;
|
||||
if (versionIndex > 0 && dateIndex > 0) {
|
||||
firmwareVersionString = qba.mid(versionIndex+10, qba.indexOf("\"", versionIndex+10)-versionIndex-10);
|
||||
QString dateString = qba.mid(dateIndex+10, 10);
|
||||
version = version2index(firmwareVersionString);
|
||||
versionString = QString("%1 (%2)").arg(firmwareVersionString).arg(dateString);
|
||||
}
|
||||
|
||||
if (version > 0) {
|
||||
if (checkForUpdatesState & AUTOMATIC_DOWNLOAD) {
|
||||
checkForUpdatesState -= AUTOMATIC_DOWNLOAD;
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
int currentVersion = g.fwRev.get(current_firmware_variant->getId());
|
||||
QString currentVersionString = index2version(currentVersion);
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Companion");
|
||||
QSpacerItem * horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
QGridLayout * layout = (QGridLayout*)msgBox.layout();
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
|
||||
if (currentVersion == 0) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(versionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0, 0);
|
||||
msgBox.exec();
|
||||
if (msgBox.clickedButton() == rnButton) {
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
|
||||
dialog->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString), QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret2 == QMessageBox::Yes)
|
||||
download = true;
|
||||
else
|
||||
ignore = true;
|
||||
}
|
||||
else if (msgBox.clickedButton() == YesButton ) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else if (version > currentVersion) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0,0);
|
||||
msgBox.exec();
|
||||
if( msgBox.clickedButton() == rnButton ) {
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
|
||||
dialog->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(versionString),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret2 == QMessageBox::Yes) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else if (msgBox.clickedButton() == YesButton ) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (downloadDialog_forWait && checkForUpdatesState==0) {
|
||||
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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->getId(), version);
|
||||
}
|
||||
}
|
||||
else if (download == true) {
|
||||
startFirmwareDownload();
|
||||
}
|
||||
if (checkForUpdatesState & AUTOMATIC_DOWNLOAD) {
|
||||
checkForUpdatesState -= AUTOMATIC_DOWNLOAD;
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
// TODO remove serverFails config?
|
||||
return onUpdatesError();
|
||||
int currentVersion = g.fwRev.get(current_firmware_variant->getId());
|
||||
QString currentVersionString = index2version(currentVersion);
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle("Companion");
|
||||
QSpacerItem * horizontalSpacer = new QSpacerItem(500, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
QGridLayout * layout = (QGridLayout*)msgBox.layout();
|
||||
layout->addItem(horizontalSpacer, layout->rowCount(), 0, 1, layout->columnCount());
|
||||
|
||||
if (currentVersion == 0) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(fullVersionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0, 0);
|
||||
msgBox.exec();
|
||||
if (msgBox.clickedButton() == rnButton) {
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
|
||||
dialog->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(fullVersionString), QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret2 == QMessageBox::Yes)
|
||||
download = true;
|
||||
else
|
||||
ignore = true;
|
||||
}
|
||||
else if (msgBox.clickedButton() == YesButton ) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else if (version > currentVersion) {
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\n\nWe recommend you view the release notes using the button below to learn about any changes that may be important to you.").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(fullVersionString));
|
||||
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
|
||||
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
|
||||
if (!rn.isEmpty()) {
|
||||
rnButton = msgBox.addButton(trUtf8("Release Notes"), QMessageBox::ActionRole);
|
||||
}
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.resize(0,0);
|
||||
msgBox.exec();
|
||||
if( msgBox.clickedButton() == rnButton ) {
|
||||
ReleaseNotesFirmwareDialog * dialog = new ReleaseNotesFirmwareDialog(this, rn);
|
||||
dialog->exec();
|
||||
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(fullVersionString),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret2 == QMessageBox::Yes) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else if (msgBox.clickedButton() == YesButton ) {
|
||||
download = true;
|
||||
}
|
||||
else {
|
||||
ignore = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (downloadDialog_forWait && checkForUpdatesState==0) {
|
||||
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ignore) {
|
||||
int res = QMessageBox::question(this, "Companion", tr("Ignore this release %1?").arg(fullVersionString), QMessageBox::Yes | QMessageBox::No);
|
||||
if (res==QMessageBox::Yes) {
|
||||
g.fwRev.set(current_firmware_variant->getId(), version);
|
||||
}
|
||||
}
|
||||
else if (download == true) {
|
||||
startFirmwareDownload();
|
||||
}
|
||||
|
||||
checkForUpdates();
|
||||
@@ -901,7 +899,7 @@ void MainWindow::about()
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(QString("Version %1, %2").arg(VERSION).arg(__DATE__));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2015<br/>");
|
||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2016<br/>");
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setWindowIcon(CompanionIcon("information.png"));
|
||||
msgBox.setWindowTitle(tr("About Companion"));
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QMainWindow>
|
||||
#include <QtWidgets>
|
||||
#include <QDateTime>
|
||||
#include "downloaddialog.h"
|
||||
#include "eeprominterface.h"
|
||||
@@ -83,6 +82,7 @@ class MainWindow : public QMainWindow
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
void setLanguage(const QString & langString);
|
||||
QString seekCodeString(const QByteArray & qba, const QString & label);
|
||||
|
||||
private slots:
|
||||
void openDocURL();
|
||||
@@ -164,7 +164,7 @@ class MainWindow : public QMainWindow
|
||||
QMenu * createRecentFileMenu();
|
||||
QMenu * createProfilesMenu();
|
||||
void autoClose();
|
||||
|
||||
|
||||
private:
|
||||
void closeUpdatesWaitDialog();
|
||||
void onUpdatesError();
|
||||
@@ -205,7 +205,7 @@ class MainWindow : public QMainWindow
|
||||
downloadDialog * downloadDialog_forWait;
|
||||
unsigned int checkForUpdatesState;
|
||||
QString firmwareVersionString;
|
||||
|
||||
|
||||
QNetworkAccessManager *networkManager;
|
||||
|
||||
QMenu *fileMenu;
|
||||
|
||||
@@ -270,7 +270,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
|
||||
if (errors.test(NO_ERROR)) {
|
||||
if (errors.test(ALL_OK)) {
|
||||
ui->modelsList->refreshList();
|
||||
if(resetCurrentFile) setCurrentFile(fileName);
|
||||
return true;
|
||||
@@ -301,7 +301,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
file.close();
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
if (!errors.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName), errors.to_ulong());
|
||||
return false;
|
||||
}
|
||||
@@ -339,9 +339,9 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
}
|
||||
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
if (!errorsEeprom.test(ALL_OK)) {
|
||||
std::bitset<NUM_ERRORS> errorsBackup((unsigned long long)LoadBackup(radioData, eeprom, eeprom_size, 0));
|
||||
if (!errorsBackup.test(NO_ERROR)) {
|
||||
if (!errorsBackup.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary EEPROM File %1").arg(fileName), (errorsEeprom | errorsBackup).to_ulong());
|
||||
return false;
|
||||
}
|
||||
@@ -617,7 +617,7 @@ bool MdiChild::loadBackup()
|
||||
}
|
||||
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
if (!errorsEeprom.test(ALL_OK)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,8 @@ foreach(name ${modeledit_NAMES})
|
||||
set(modeledit_UIS ${modeledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(modeledit_SRCS ${modeledit_UIS})
|
||||
qt4_wrap_cpp(modeledit_SRCS ${modeledit_HDRS})
|
||||
qt5_wrap_ui(modeledit_SRCS ${modeledit_UIS})
|
||||
qt5_wrap_cpp(modeledit_SRCS ${modeledit_HDRS})
|
||||
|
||||
add_library(modeledit ${modeledit_SRCS})
|
||||
add_library(modeledit ${modeledit_SRCS})
|
||||
qt5_use_modules(modeledit Widgets Xml Multimedia)
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
#include "channels.h"
|
||||
#include "helpers.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, int min, int max, int deflt):
|
||||
firmware(firmware),
|
||||
@@ -200,7 +194,7 @@ void Channels::nameEdited()
|
||||
if (!lock) {
|
||||
QLineEdit *le = qobject_cast<QLineEdit*>(sender());
|
||||
int index = le->property("index").toInt();
|
||||
strcpy(model->limitData[index].name, le->text().toAscii());
|
||||
strcpy(model->limitData[index].name, le->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "helpers.h"
|
||||
#include "modeledit.h"
|
||||
#include <QSpinBox>
|
||||
|
||||
class GVarGroup;
|
||||
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
#include "node.h"
|
||||
#include "edge.h"
|
||||
#include "helpers.h"
|
||||
#include <QSpinBox>
|
||||
#include <QCheckBox>
|
||||
#include <QPushButton>
|
||||
#include <QMessageBox>
|
||||
#include <QAction>
|
||||
|
||||
#define GFX_MARGIN 16
|
||||
|
||||
@@ -491,7 +486,7 @@ void Curves::on_curveSmooth_currentIndexChanged(int index)
|
||||
void Curves::on_curveName_editingFinished()
|
||||
{
|
||||
memset(model->curves[currentCurve].name, 0, sizeof(model->curves[currentCurve].name));
|
||||
strcpy(model->curves[currentCurve].name, ui->curveName->text().toAscii());
|
||||
strcpy(model->curves[currentCurve].name, ui->curveName->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QSpinBox>
|
||||
|
||||
enum CopyAction {
|
||||
CURVE_COPY,
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="curveName">
|
||||
<property name="maxLength">
|
||||
<number>6</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -43,13 +43,9 @@ void RepeatComboBox::update()
|
||||
|
||||
CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GenericPanel(parent, model, generalSettings, firmware),
|
||||
functions(model ? model->customFn : generalSettings.customFn)
|
||||
#if defined(PHONON)
|
||||
,
|
||||
phononCurrent(-1),
|
||||
clickObject(NULL),
|
||||
clickOutput(NULL)
|
||||
#endif
|
||||
functions(model ? model->customFn : generalSettings.customFn),
|
||||
mediaPlayerCurrent(-1),
|
||||
mediaPlayer(NULL)
|
||||
{
|
||||
Stopwatch s1("CustomFunctionsPanel - populate");
|
||||
lock = true;
|
||||
@@ -70,7 +66,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
s1.report("get tracks");
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS/FUNCTIONS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
if (functions[i].func==FuncPlayScript) {
|
||||
QString temp = functions[i].paramarm;
|
||||
@@ -178,14 +174,12 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
|
||||
paramLayout->addWidget(fswtchBLcolor[i]);
|
||||
connect(fswtchBLcolor[i], SIGNAL(sliderReleased()), this, SLOT(customFunctionEdited()));
|
||||
|
||||
#ifdef PHONON
|
||||
playBT[i] = new QPushButton(this);
|
||||
playBT[i]->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||
playBT[i]->setProperty("index", i);
|
||||
playBT[i]->setIcon(playIcon);
|
||||
paramLayout->addWidget(playBT[i]);
|
||||
connect(playBT[i], SIGNAL(pressed()), this, SLOT(playMusic()));
|
||||
#endif
|
||||
|
||||
QHBoxLayout * repeatLayout = new QHBoxLayout();
|
||||
tableLayout->addLayout(i, 4, repeatLayout);
|
||||
@@ -220,35 +214,42 @@ CustomFunctionsPanel::~CustomFunctionsPanel()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef PHONON
|
||||
void CustomFunctionsPanel::mediaPlayer_state(Phonon::State newState, Phonon::State oldState)
|
||||
void CustomFunctionsPanel::onMediaPlayerStateChanged(QMediaPlayer::State state)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
if ((newState==Phonon::ErrorState || newState==Phonon::StoppedState || newState==Phonon::PausedState) && oldState==Phonon::PlayingState) {
|
||||
clickObject->stop();
|
||||
clickObject->clearQueue();
|
||||
clickObject->clear();
|
||||
if (phononCurrent >= 0) {
|
||||
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
phononCurrent = -1;
|
||||
if (state==QMediaPlayer::StoppedState || state==QMediaPlayer::PausedState) {
|
||||
mediaPlayer->stop();
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::onMediaPlayerError(QMediaPlayer::Error error)
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::playMusic()
|
||||
{
|
||||
if (!clickObject) {
|
||||
clickObject = new Phonon::MediaObject(this);
|
||||
clickOutput = new Phonon::AudioOutput(Phonon::NoCategory, this);
|
||||
Phonon::createPath(clickObject, clickOutput);
|
||||
connect(clickObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(mediaPlayer_state(Phonon::State, Phonon::State)));
|
||||
if (!mediaPlayer) {
|
||||
mediaPlayer = new QMediaPlayer(this);
|
||||
connect(mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onMediaPlayerStateChanged(QMediaPlayer::State)));
|
||||
connect(mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(onMediaPlayerError(QMediaPlayer::Error)));
|
||||
}
|
||||
|
||||
QPushButton * button = qobject_cast<QPushButton*>(sender());
|
||||
int index = button->property("index").toInt();
|
||||
int index = sender()->property("index").toInt();
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
QDir qd(path);
|
||||
QString track;
|
||||
@@ -272,29 +273,22 @@ void CustomFunctionsPanel::playMusic()
|
||||
return;
|
||||
}
|
||||
|
||||
if (phononCurrent == index) {
|
||||
clickObject->stop();
|
||||
clickObject->clear();
|
||||
if (mediaPlayerCurrent == index) {
|
||||
mediaPlayer->stop();
|
||||
playBT[index]->setIcon(CompanionIcon("play.png"));
|
||||
phononCurrent = -1;
|
||||
mediaPlayerCurrent = -1;
|
||||
}
|
||||
else {
|
||||
if (phononCurrent >= 0) {
|
||||
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
if (mediaPlayerCurrent >= 0) {
|
||||
playBT[mediaPlayerCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
}
|
||||
phononCurrent = index;
|
||||
clickObject->clear();
|
||||
#ifdef __APPLE__
|
||||
clickObject->setCurrentSource(QUrl("file://"+track));
|
||||
#else
|
||||
clickObject->setCurrentSource(QUrl(track));
|
||||
#endif
|
||||
clickObject->play();
|
||||
mediaPlayerCurrent = index;
|
||||
mediaPlayer->setMedia(QUrl::fromLocalFile(track));
|
||||
mediaPlayer->play();
|
||||
playBT[index]->setIcon(CompanionIcon("stop.png"));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#define CUSTOM_FUNCTION_NUMERIC_PARAM (1<<0)
|
||||
#define CUSTOM_FUNCTION_SOURCE_PARAM (1<<1)
|
||||
@@ -373,8 +367,8 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
else if (func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) {
|
||||
if (modified) cfn.adjustMode = fswtchGVmode[i]->currentIndex();
|
||||
widgetsMask |= CUSTOM_FUNCTION_GV_MODE + CUSTOM_FUNCTION_ENABLE;
|
||||
if (cfn.adjustMode==0) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_GV_MODE | (IS_ARM(firmware->getBoard()) ? CUSTOM_FUNCTION_REPEAT : CUSTOM_FUNCTION_ENABLE);
|
||||
if (cfn.adjustMode==0 || cfn.adjustMode==3) {
|
||||
if (modified) cfn.param = fswtchParam[i]->value();
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
@@ -526,9 +520,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
fswtchRepeat[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_REPEAT);
|
||||
fswtchGVmode[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_MODE);
|
||||
fswtchBLcolor[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_BL_COLOR);
|
||||
#ifdef PHONON
|
||||
playBT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_PLAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::update()
|
||||
@@ -677,12 +669,6 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
|
||||
case 2:
|
||||
populateSourceCB(b, RawSource(value), generalSettings, model, POPULATE_GVARS);
|
||||
break;
|
||||
case 3:
|
||||
b->clear();
|
||||
b->addItem("-1", 0);
|
||||
b->addItem("+1", 1);
|
||||
b->setCurrentIndex(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -3,24 +3,14 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QLabel>
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <QTimeEdit>
|
||||
#ifdef PHONON
|
||||
#include <phonon/audiooutput.h>
|
||||
#include <phonon/mediaobject.h>
|
||||
#include <phonon/mediasource.h>
|
||||
#endif
|
||||
#include <QtMultimedia>
|
||||
|
||||
class RepeatComboBox: public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RepeatComboBox(QWidget *parent, int & repeatParam);
|
||||
RepeatComboBox(QWidget * parent, int & repeatParam);
|
||||
void update();
|
||||
|
||||
signals:
|
||||
@@ -35,7 +25,7 @@ class RepeatComboBox: public QComboBox
|
||||
|
||||
class CustomFunctionsPanel : public GenericPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomFunctionsPanel(QWidget *parent, ModelData * mode, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
@@ -52,10 +42,9 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
void fsw_customContextMenuRequested(QPoint pos);
|
||||
void refreshCustomFunction(int index, bool modified=false);
|
||||
void onChildModified();
|
||||
#ifdef PHONON
|
||||
void playMusic();
|
||||
void mediaPlayer_state(Phonon::State newState, Phonon::State oldState);
|
||||
#endif
|
||||
void onMediaPlayerStateChanged(QMediaPlayer::State state);
|
||||
void onMediaPlayerError(QMediaPlayer::Error error);
|
||||
void fswDelete();
|
||||
void fswCopy();
|
||||
void fswPaste();
|
||||
@@ -68,7 +57,7 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
|
||||
QSet<QString> tracksSet;
|
||||
QSet<QString> scriptsSet;
|
||||
int phononCurrent;
|
||||
int mediaPlayerCurrent;
|
||||
QComboBox * fswtchSwtch[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchFunc[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QCheckBox * fswtchParamGV[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
@@ -81,10 +70,7 @@ class CustomFunctionsPanel : public GenericPanel
|
||||
RepeatComboBox * fswtchRepeat[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchGVmode[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QSlider * fswtchBLcolor[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
#ifdef PHONON
|
||||
Phonon::MediaObject *clickObject;
|
||||
Phonon::AudioOutput *clickOutput;
|
||||
#endif
|
||||
QMediaPlayer * mediaPlayer;
|
||||
|
||||
int selectedFunction;
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void ExpoDialog::valuesChanged()
|
||||
ed->swtch = RawSwitch(ui->switchesCB->itemData(ui->switchesCB->currentIndex()).toInt());
|
||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||
|
||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||
strcpy(ed->name, ui->lineName->text().toLatin1().data());
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
inputName = ui->inputName->text();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef EXPODIALOG_H
|
||||
#define EXPODIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "modelprinter.h"
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "flightmodes.h"
|
||||
#include "ui_flightmode.h"
|
||||
// #include "firmwares/opentx/opentxeeprom.h" // TODO shouldn't be there
|
||||
#include "helpers.h"
|
||||
#include <QComboBox>
|
||||
#include <QGridLayout>
|
||||
|
||||
FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
@@ -220,7 +217,7 @@ void FlightModePanel::update()
|
||||
gvNames[i]->setText(model->gvars_names[i]);
|
||||
}
|
||||
gvValues[i]->setDisabled(model->isGVarLinked(phaseIdx, i));
|
||||
gvValues[i]->setValue(model->getGVarValue(phaseIdx, i));
|
||||
gvValues[i]->setValue(model->getGVarFieldValue(phaseIdx, i));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()) && phaseIdx == 0) {
|
||||
gvPopups[i]->setChecked(model->gvars_popups[i]);
|
||||
}
|
||||
@@ -244,7 +241,7 @@ void FlightModePanel::update()
|
||||
void FlightModePanel::phaseName_editingFinished()
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender());
|
||||
strcpy(phase.name, lineEdit->text().toAscii());
|
||||
strcpy(phase.name, lineEdit->text().toLatin1());
|
||||
emit modified();
|
||||
emit nameModified();
|
||||
}
|
||||
@@ -312,7 +309,7 @@ void FlightModePanel::GVName_editingFinished()
|
||||
QLineEdit *lineedit = qobject_cast<QLineEdit*>(sender());
|
||||
int gvar = lineedit->property("index").toInt();
|
||||
memset(&model->gvars_names[gvar], 0, sizeof(model->gvars_names[gvar]));
|
||||
strcpy(model->gvars_names[gvar], lineedit->text().toAscii());
|
||||
strcpy(model->gvars_names[gvar], lineedit->text().toLatin1());
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QVector>
|
||||
#include <QLabel>
|
||||
#include <QTabWidget>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
|
||||
namespace Ui {
|
||||
class FlightMode;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "inputs.h"
|
||||
#include <QMessageBox>
|
||||
#include "expodialog.h"
|
||||
#include "helpers.h"
|
||||
|
||||
@@ -199,7 +198,7 @@ void InputsPanel::gm_openExpo(int index)
|
||||
if (g->exec()) {
|
||||
model->expoData[index] = mixd;
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
strncpy(model->inputNames[mixd.chn], inputName.toAscii().data(), 4);
|
||||
strncpy(model->inputNames[mixd.chn], inputName.toLatin1().data(), 4);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
@@ -288,8 +287,6 @@ void InputsPanel::mimeExpoDropped(int index, const QMimeData *data, Qt::DropActi
|
||||
pasteExpoMimeData(data, idx);
|
||||
}
|
||||
|
||||
#include <iostream>
|
||||
#include <QtGui/qwidget.h>
|
||||
void InputsPanel::pasteExpoMimeData(const QMimeData * mimeData, int destIdx)
|
||||
{
|
||||
if (mimeData->hasFormat("application/x-companion-expo")) {
|
||||
@@ -325,11 +322,12 @@ void InputsPanel::pasteExpoMimeData(const QMimeData * mimeData, int destIdx)
|
||||
|
||||
void InputsPanel::exposPaste()
|
||||
{
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
QListWidgetItem *item = ExposlistWidget->currentItem();
|
||||
if (item)
|
||||
pasteExpoMimeData(mimeData, item->data(Qt::UserRole).toByteArray().at(0));
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
QListWidgetItem *item = ExposlistWidget->currentItem();
|
||||
if (item) {
|
||||
pasteExpoMimeData(mimeData, item->data(Qt::UserRole).toByteArray().at(0));
|
||||
}
|
||||
}
|
||||
|
||||
void InputsPanel::exposDuplicate()
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
#include "logicalswitches.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include "helpers.h"
|
||||
|
||||
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QTimeEdit>
|
||||
|
||||
class LogicalSwitchesPanel : public ModelPanel
|
||||
{
|
||||
|
||||
@@ -159,8 +159,7 @@ void MixerDialog::valuesChanged()
|
||||
md->delayUp = round(ui->delayUpSB->value()*scale);
|
||||
md->speedDown = round(ui->slowDownSB->value()*scale);
|
||||
md->speedUp = round(ui->slowUpSB->value()*scale);
|
||||
|
||||
strcpy(md->name, ui->mixerName->text().toAscii());
|
||||
strcpy(md->name, ui->mixerName->text().toLatin1());
|
||||
|
||||
md->flightModes = 0;
|
||||
for (int i=8; i>=0 ; i--) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef MIXERDIALOG_H
|
||||
#define MIXERDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class GVarGroup;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef MIXERSLIST_H
|
||||
#define MIXERSLIST_H
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#define MIX_ROW_HEIGHT_INCREASE 8 //how much space is added above mixer row (for new channel), if 0 space adding is disabled
|
||||
const int GroupHeaderRole = (Qt::UserRole+2); //defines new user role for list items. If value is > 0, then space is added before that item
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "mixes.h"
|
||||
#include "helpers.h"
|
||||
// #include <QMessageBox>
|
||||
// #include "expodialog.h"
|
||||
|
||||
MixesPanel::MixesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include "customfunctions.h"
|
||||
#include "telemetry.h"
|
||||
#include "appdata.h"
|
||||
#include <QScrollArea>
|
||||
|
||||
ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmware * firmware) :
|
||||
QDialog(parent),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef MODELEDIT_H
|
||||
#define MODELEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "genericpanel.h"
|
||||
|
||||
class RadioData;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#ifndef NODE_H
|
||||
#define NODE_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define DEFAULT_BALL_SIZE 10
|
||||
#define BALL_HEIGHT 2
|
||||
|
||||
@@ -115,7 +115,7 @@ void TimerPanel::on_minuteBeep_toggled(bool checked)
|
||||
void TimerPanel::on_name_editingFinished()
|
||||
{
|
||||
int length = ui->name->maxLength();
|
||||
strncpy(timer.name, ui->name->text().toAscii(), length);
|
||||
strncpy(timer.name, ui->name->text().toLatin1(), length);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -728,14 +728,14 @@ void SetupPanel::on_throttleSource_currentIndexChanged(int index)
|
||||
void SetupPanel::on_name_editingFinished()
|
||||
{
|
||||
int length = ui->name->maxLength();
|
||||
strncpy(model->name, ui->name->text().toAscii(), length);
|
||||
strncpy(model->name, ui->name->text().toLatin1(), length);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void SetupPanel::on_image_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
strncpy(model->bitmap, ui->image->currentText().toAscii(), 10);
|
||||
strncpy(model->bitmap, ui->image->currentText().toLatin1(), 10);
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/BMP/");
|
||||
QDir qd(path);
|
||||
@@ -774,6 +774,7 @@ void SetupPanel::populateThrottleSourceCB()
|
||||
|
||||
lock = true;
|
||||
|
||||
ui->throttleSource->clear();
|
||||
ui->throttleSource->addItem(QObject::tr("THR"));
|
||||
|
||||
if (IS_TARANIS_X9E(GetEepromInterface()->getBoard())) {
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QVector>
|
||||
#include <QCheckBox>
|
||||
#include <QSlider>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QLabel>
|
||||
|
||||
namespace Ui {
|
||||
class Setup;
|
||||
|
||||
@@ -648,7 +648,7 @@ void TelemetrySensorPanel::updateSourcesComboBox(AutoComboBox * cb, bool negativ
|
||||
void TelemetrySensorPanel::on_name_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
strcpy(sensor.label, ui->name->text().toAscii());
|
||||
strcpy(sensor.label, ui->name->text().toLatin1());
|
||||
emit dataModified();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
#include "modeledit.h"
|
||||
#include "eeprominterface.h"
|
||||
#include <QGroupBox>
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
class AutoComboBox;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#include "templates.h"
|
||||
#include <QListWidget>
|
||||
#include <QMessageBox>
|
||||
|
||||
#define CHANNEL_ORDER(x) generalSettings.getDefaultStick(x)
|
||||
#define CC(x) (CHANNEL_ORDER(x)) //need to invert this to work with dest
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef TEMPLATES_H
|
||||
#define TEMPLATES_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
class Templates : public QWidget
|
||||
|
||||
@@ -269,7 +269,7 @@ QString ModelPrinter::printInputName(int idx)
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, idx).toString(&model);
|
||||
}
|
||||
return Qt::escape(result);
|
||||
return result.toHtmlEscaped();
|
||||
}
|
||||
|
||||
QString ModelPrinter::printInputLine(int idx)
|
||||
@@ -288,26 +288,29 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
||||
}
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
str += Qt::escape(input.srcRaw.toString(&model));
|
||||
str += input.srcRaw.toString(&model).toHtmlEscaped();
|
||||
}
|
||||
|
||||
str += " " + Qt::escape(tr("Weight")) + QString("(%1)").arg(getGVarString(input.weight,true));
|
||||
if (input.curve.value) str += " " + Qt::escape(input.curve.toString());
|
||||
str += " " + tr("Weight").toHtmlEscaped() + QString("(%1)").arg(getGVarString(input.weight,true).toHtmlEscaped());
|
||||
if (input.curve.value) str += " " + input.curve.toString().toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(input.flightModes);
|
||||
if (!flightModesStr.isEmpty()) str += " " + Qt::escape(flightModesStr);
|
||||
if (!flightModesStr.isEmpty()) str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (input.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + Qt::escape(tr("Switch")) + QString("(%1)").arg(input.swtch.toString());
|
||||
str += " " + tr("Switch").toHtmlEscaped() + QString("(%1)").arg(input.swtch.toString().toHtmlEscaped());
|
||||
|
||||
|
||||
if (firmware->getCapability(VirtualInputs)) {
|
||||
if (input.carryTrim>0) str += " " + Qt::escape(tr("NoTrim"));
|
||||
else if (input.carryTrim<0) str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model));
|
||||
if (input.carryTrim>0) str += " " + tr("NoTrim").toHtmlEscaped();
|
||||
else if (input.carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(input.carryTrim)-1)).toString(&model).toHtmlEscaped();
|
||||
}
|
||||
|
||||
if (input.offset)
|
||||
str += " " + tr("Offset(%1)").arg(getGVarString(input.offset)).toHtmlEscaped();
|
||||
|
||||
if (firmware->getCapability(HasExpoNames) && input.name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(input.name));
|
||||
str += QString(" [%1]").arg(input.name).toHtmlEscaped();
|
||||
|
||||
return str;
|
||||
}
|
||||
@@ -323,7 +326,7 @@ QString ModelPrinter::printMixerName(int curDest)
|
||||
name.append(" ");
|
||||
str += name.left(8);
|
||||
}
|
||||
return Qt::escape(str);
|
||||
return str.toHtmlEscaped();
|
||||
}
|
||||
|
||||
QString ModelPrinter::printMixerLine(int idx, bool showMultiplex, int highlightedSource)
|
||||
@@ -346,43 +349,43 @@ QString ModelPrinter::printMixerLine(const MixData & mix, bool showMultiplex, in
|
||||
str += " ";
|
||||
}
|
||||
// highlight source if needed
|
||||
QString source = Qt::escape(mix.srcRaw.toString(&model));
|
||||
QString source = mix.srcRaw.toString(&model).toHtmlEscaped();
|
||||
if ( (mix.srcRaw.type == SOURCE_TYPE_CH) && (mix.srcRaw.index+1 == (int)highlightedSource) ) {
|
||||
source = "<b>" + source + "</b>";
|
||||
}
|
||||
str += " " + source;
|
||||
|
||||
str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(mix.weight, true)));
|
||||
str += " " + tr("Weight(%1)").arg(getGVarString(mix.weight, true)).toHtmlEscaped();
|
||||
|
||||
QString flightModesStr = printFlightModes(mix.flightModes);
|
||||
if (!flightModesStr.isEmpty())
|
||||
str += " " + Qt::escape(flightModesStr);
|
||||
str += " " + flightModesStr.toHtmlEscaped();
|
||||
|
||||
if (mix.swtch.type != SWITCH_TYPE_NONE)
|
||||
str += " " + Qt::escape(tr("Switch(%1)").arg(mix.swtch.toString()));
|
||||
str += " " + tr("Switch(%1)").arg(mix.swtch.toString()).toHtmlEscaped();
|
||||
|
||||
if (mix.carryTrim > 0)
|
||||
str += " " + Qt::escape(tr("NoTrim"));
|
||||
str += " " + tr("NoTrim").toHtmlEscaped();
|
||||
else if (mix.carryTrim < 0)
|
||||
str += " " + RawSource(SOURCE_TYPE_TRIM, (-(mix.carryTrim)-1)).toString(&model);
|
||||
|
||||
if (firmware->getCapability(HasNoExpo) && mix.noExpo)
|
||||
str += " " + Qt::escape(tr("No DR/Expo"));
|
||||
str += " " + tr("No DR/Expo").toHtmlEscaped();
|
||||
if (mix.sOffset)
|
||||
str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(mix.sOffset)));
|
||||
str += " " + tr("Offset(%1)").arg(getGVarString(mix.sOffset)).toHtmlEscaped();
|
||||
if (mix.curve.value)
|
||||
str += " " + Qt::escape(mix.curve.toString());
|
||||
str += " " + mix.curve.toString().toHtmlEscaped();
|
||||
int scale = firmware->getCapability(SlowScale);
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
if (mix.delayDown || mix.delayUp)
|
||||
str += " " + Qt::escape(tr("Delay(u%1:d%2)").arg((double)mix.delayUp/scale).arg((double)mix.delayDown/scale));
|
||||
str += " " + tr("Delay(u%1:d%2)").arg((double)mix.delayUp/scale).arg((double)mix.delayDown/scale).toHtmlEscaped();
|
||||
if (mix.speedDown || mix.speedUp)
|
||||
str += " " + Qt::escape(tr("Slow(u%1:d%2)").arg((double)mix.speedUp/scale).arg((double)mix.speedDown/scale));
|
||||
str += " " + tr("Slow(u%1:d%2)").arg((double)mix.speedUp/scale).arg((double)mix.speedDown/scale).toHtmlEscaped();
|
||||
if (mix.mixWarn)
|
||||
str += " " + Qt::escape(tr("Warn(%1)").arg(mix.mixWarn));
|
||||
str += " " + tr("Warn(%1)").arg(mix.mixWarn).toHtmlEscaped();
|
||||
if (firmware->getCapability(HasMixerNames) && mix.name[0])
|
||||
str += Qt::escape(QString(" [%1]").arg(mix.name));
|
||||
str += QString(" [%1]").arg(mix.name).toHtmlEscaped();
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
#ifndef MODELSLIST_H
|
||||
#define MODELSLIST_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include <QListWidget>
|
||||
|
||||
struct CurrentSelection
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _PRINTDIALOG_H
|
||||
#define _PRINTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
|
||||
else {
|
||||
if (!destinationInfo.exists()) {
|
||||
// qDebug() << "Copy" << path << "to" << destinationPath;
|
||||
progress->addText(tr("Copy %1 to %2\n").arg(path).arg(destinationPath));
|
||||
progress->addText(tr("Copy %1 to %2").arg(path).arg(destinationPath) + "\n");
|
||||
if (!QFile::copy(path, destinationPath)) {
|
||||
return QObject::tr("Copy '%1' to '%2' failed").arg(path).arg(destinationPath);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ QString SyncProcess::updateEntry(const QString & path, const QDir & source, cons
|
||||
if (!destinationFile.open(QFile::WriteOnly)) {
|
||||
return QObject::tr("Write '%1' failed").arg(destinationPath);
|
||||
}
|
||||
progress->addText(tr("Write %1\n").arg(destinationPath));
|
||||
progress->addText(tr("Write %1").arg(destinationPath) + "\n");
|
||||
// qDebug() << "Write" << destinationPath;
|
||||
QTextStream destinationStream(&destinationFile);
|
||||
destinationStream << sourceContents;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef SYNCPROCESS_H_
|
||||
#define SYNCPROCESS_H_
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ set(qcustomplot_HDRS
|
||||
qcustomplot.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
|
||||
qt5_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
|
||||
|
||||
add_library(qcustomplot ${qcustomplot_SRCS})
|
||||
qt5_use_modules(qcustomplot Widgets PrintSupport)
|
||||
|
||||
@@ -45,14 +45,8 @@
|
||||
#include <QMargins>
|
||||
#include <qmath.h>
|
||||
#include <limits>
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <qnumeric.h>
|
||||
# include <QPrinter>
|
||||
# include <QPrintEngine>
|
||||
#else
|
||||
# include <QtNumeric>
|
||||
# include <QtPrintSupport>
|
||||
#endif
|
||||
#include <QtNumeric>
|
||||
#include <QtPrintSupport>
|
||||
|
||||
class QCPPainter;
|
||||
class QCustomPlot;
|
||||
|
||||
@@ -2,10 +2,8 @@ set(qxtcommandoptions_SRCS
|
||||
qxtcommandoptions.cpp
|
||||
)
|
||||
|
||||
set(qxtcommandoptions_HDRS
|
||||
qxtcommandoptions.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(qxtcommandoptions_SRCS ${qxtcommandoptions_HDRS})
|
||||
qt5_wrap_cpp(qxtcommandoptions_SRCS)
|
||||
|
||||
add_library(qxtcommandoptions ${qxtcommandoptions_SRCS})
|
||||
qt5_use_modules(qxtcommandoptions Widgets)
|
||||
|
||||
|
||||
@@ -150,19 +150,19 @@ static int isQtOption(const QString& param)
|
||||
if (param.left(5) == "-psn_") return 1;
|
||||
#endif
|
||||
QString name = param.mid(1), value;
|
||||
bool hasEquals;
|
||||
// bool hasEquals;
|
||||
|
||||
// Separate the option and the value, if present
|
||||
if (name.indexOf('=') != -1)
|
||||
{
|
||||
value = param.section('=', 1);
|
||||
name = param.section('=', 0, 0);
|
||||
hasEquals = true;
|
||||
// hasEquals = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
value = "";
|
||||
hasEquals = false;
|
||||
// hasEquals = false;
|
||||
}
|
||||
|
||||
const char* option;
|
||||
@@ -540,7 +540,7 @@ void QxtCommandOptionsPrivate::parse(const QStringList& params)
|
||||
int ct = params.count();
|
||||
int skip = 0;
|
||||
bool endFlags = false;
|
||||
bool notUnrecognized, hasEquals;
|
||||
bool /*notUnrecognized, */hasEquals;
|
||||
QString name, param, value;
|
||||
|
||||
while (pos < ct)
|
||||
@@ -566,7 +566,7 @@ void QxtCommandOptionsPrivate::parse(const QStringList& params)
|
||||
positional.append(param);
|
||||
continue;
|
||||
}
|
||||
notUnrecognized = false;
|
||||
// notUnrecognized = false;
|
||||
|
||||
if (flagStyle != QxtCommandOptions::Slash && param == "--")
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ QT_FORWARD_DECLARE_CLASS(QTextStream)
|
||||
QT_FORWARD_DECLARE_CLASS(QIODevice)
|
||||
|
||||
|
||||
class QXT_CORE_EXPORT QxtCommandOptions
|
||||
class QxtCommandOptions
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(QxtCommandOptions)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ QString getRadioInterfaceCmd()
|
||||
{
|
||||
burnConfigDialog bcd;
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
if (IS_STM32(eepromInterface->getBoard())) {
|
||||
return bcd.getDFU();
|
||||
}
|
||||
else if (IS_SKY9X(GetEepromInterface()->getBoard())) {
|
||||
|
||||
@@ -14,9 +14,9 @@ set(shared_HDRS
|
||||
autolineedit.h
|
||||
genericpanel.h
|
||||
hexspinbox.h
|
||||
verticalscrollarea.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(shared_SRCS ${shared_HDRS})
|
||||
qt5_wrap_cpp(shared_SRCS ${shared_HDRS})
|
||||
|
||||
add_library(shared ${shared_SRCS})
|
||||
add_library(shared ${shared_SRCS})
|
||||
qt5_use_modules(shared Widgets)
|
||||
@@ -44,7 +44,7 @@ class AutoLineEdit: public QLineEdit
|
||||
void onEdited()
|
||||
{
|
||||
if (field && !lock) {
|
||||
strcpy(field, text().toAscii());
|
||||
strcpy(field, text().toLatin1());
|
||||
if (panel) {
|
||||
emit panel->modified();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,8 @@ include_directories(
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
)
|
||||
|
||||
qt4_wrap_ui(simulation_SRCS ${simulation_UIS})
|
||||
qt4_wrap_cpp(simulation_SRCS ${simulation_HDRS})
|
||||
qt5_wrap_ui(simulation_SRCS ${simulation_UIS})
|
||||
qt5_wrap_cpp(simulation_SRCS ${simulation_HDRS})
|
||||
|
||||
add_library(simulation ${simulation_SRCS})
|
||||
qt5_use_modules(simulation Widgets Xml)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtGui>
|
||||
#include <QStyleOption>
|
||||
|
||||
class ButtonsWidget : public QWidget
|
||||
{
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#include <QtGui>
|
||||
#include <stdint.h>
|
||||
#include "debugoutput.h"
|
||||
#include "ui_debugoutput.h"
|
||||
|
||||
@@ -18,7 +16,6 @@ DebugOutput::DebugOutput(QWidget * parent):
|
||||
QFont newFont("Courier", 9);
|
||||
ui->Output->setFont(newFont);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
DebugOutput::~DebugOutput()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef debugoutput_h
|
||||
#define debugoutput_h
|
||||
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@@ -27,29 +27,31 @@ Joystick::~Joystick()
|
||||
|
||||
bool Joystick::open(int stick)
|
||||
{
|
||||
if ( isOpen() )
|
||||
if (isOpen())
|
||||
close();
|
||||
|
||||
joystick = SDL_JoystickOpen(stick);
|
||||
if ( joystick ) {
|
||||
if (joystick) {
|
||||
numAxes = SDL_JoystickNumAxes(joystick);
|
||||
numButtons = SDL_JoystickNumButtons(joystick);
|
||||
numHats = SDL_JoystickNumHats(joystick);
|
||||
numTrackballs = SDL_JoystickNumBalls(joystick);
|
||||
joystickTimer.start(eventTimeout);
|
||||
return TRUE;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "ERROR: couldn't open SDL joystick #%d", stick);
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Joystick::close()
|
||||
{
|
||||
joystickTimer.stop();
|
||||
if ( joystick )
|
||||
if (joystick) {
|
||||
SDL_JoystickClose(joystick);
|
||||
joystick = NULL;
|
||||
joystick = NULL;
|
||||
}
|
||||
numAxes = numButtons = numHats = numTrackballs = 0;
|
||||
}
|
||||
|
||||
@@ -70,15 +72,19 @@ void Joystick::processEvents()
|
||||
emit axisValueChanged(i, moved);
|
||||
axes[i] = moved;
|
||||
axisRepeatTimers[i].restart();
|
||||
} else if (autoRepeat && moved != 0) {
|
||||
}
|
||||
else if (autoRepeat && moved != 0) {
|
||||
if ( axisRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
|
||||
emit axisValueChanged(i, moved);
|
||||
axes[i] = moved;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
axisRepeatTimers[i].restart();
|
||||
} else
|
||||
}
|
||||
else {
|
||||
emit axisValueChanged(i, 0);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < numButtons; i++) {
|
||||
Uint8 changed = SDL_JoystickGetButton(joystick, i);
|
||||
|
||||
@@ -31,7 +31,7 @@ class Joystick : public QObject
|
||||
|
||||
Joystick(QObject *parent = 0,
|
||||
int joystickEventTimeout = SDL_JOYSTICK_DEFAULT_EVENT_TIMEOUT,
|
||||
bool doAutoRepeat = TRUE,
|
||||
bool doAutoRepeat = true,
|
||||
int autoRepeatDelay = SDL_JOYSTICK_DEFAULT_AUTOREPEAT_DELAY);
|
||||
~Joystick();
|
||||
bool open(int);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "joystickdialog.h"
|
||||
#include "ui_joystickdialog.h"
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
|
||||
joystickDialog::joystickDialog(QWidget *parent, int stick) :
|
||||
QDialog(parent),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef JOYSTICKDIALOG_H
|
||||
#define JOYSTICKDIALOG_H
|
||||
|
||||
#include <QtWidgets>
|
||||
#include "joystick.h"
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class joystickDialog;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef SIMULATORDIALOG_H
|
||||
#define SIMULATORDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "modeledit/node.h"
|
||||
#include "telemetrysimu.h"
|
||||
#include "trainersimu.h"
|
||||
|
||||
@@ -71,7 +71,7 @@ for (int i=0; i<NUM_LOGICAL_SWITCH; i++)
|
||||
#if defined(GVARS)
|
||||
for (int fm=0; fm<MAX_FLIGHT_MODES; fm++) {
|
||||
for (int gv=0; gv<MAX_GVARS; gv++) {
|
||||
outputs.gvars[fm][gv] = GVAR_VALUE(gv, getGVarFlightPhase(fm, gv));
|
||||
outputs.gvars[fm][gv] = GVAR_VALUE(gv, getGVarFlightMode(fm, gv));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef simulator_interface_h
|
||||
#define simulator_interface_h
|
||||
#ifndef _SIMULATOR_INTERFACE_H_
|
||||
#define _SIMULATOR_INTERFACE_H_
|
||||
|
||||
#include "constants.h"
|
||||
#include <inttypes.h>
|
||||
@@ -99,7 +99,7 @@ class SimulatorInterface
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) = 0;
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) = 0;
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) = 0;
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) = 0;
|
||||
|
||||
@@ -128,4 +128,4 @@ void unregisterSimulators();
|
||||
SimulatorFactory *getSimulatorFactory(const QString &name);
|
||||
extern QMap<QString, SimulatorFactory *> registered_simulators;
|
||||
|
||||
#endif
|
||||
#endif // _SIMULATOR_INTERFACE_H_
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QSlider>
|
||||
#include <QtGui>
|
||||
#include <QFrame>
|
||||
|
||||
class SliderWidget : public QSlider
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user