Compare commits
483 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d48dca7a8 | |||
| 426077ed16 | |||
| 81f2b91b91 | |||
| 7ac876af54 | |||
| 147d041b20 | |||
| 45ea2bf559 | |||
| c9fd91e755 | |||
| f2d316b89b | |||
| 0283161f3d | |||
| 87b2a4c0f1 | |||
| 013152cf1f | |||
| 57881edb93 | |||
| 82450c6419 | |||
| 7ad5c1e287 | |||
| 02e9eb3555 | |||
| 7284db8514 | |||
| f7c1888509 | |||
| 3159dd5066 | |||
| 221e3dbdda | |||
| e5b27d3de4 | |||
| f9946dff03 | |||
| 2c2b6e7483 | |||
| 1c16a99d9e | |||
| 0771486e4e | |||
| 4040828e7a | |||
| 66caf7dc79 | |||
| 3decae21b0 | |||
| ff8183fdbb | |||
| f0a5b28ef5 | |||
| b814373391 | |||
| c059e9affb | |||
| 0dee1c207f | |||
| cbcf06964e | |||
| 9285985ff8 | |||
| 415ae55a93 | |||
| 526c88dbe8 | |||
| 5ccdbeb8f8 | |||
| f91bfb1310 | |||
| 641a382ef3 | |||
| 2b6cf2aa9d | |||
| d476696126 | |||
| 909350dc66 | |||
| e62c552217 | |||
| fc935126b2 | |||
| 3018328ae7 | |||
| eb657d5686 | |||
| fa2bf0afaa | |||
| f481d2f236 | |||
| bdb22c37c6 | |||
| 6aa4bd1c68 | |||
| 9f1a6c85c7 | |||
| 23389081a5 | |||
| 920e856dfd | |||
| 30336ff481 | |||
| eb03c6a054 | |||
| 46218c148e | |||
| 1f557bcda7 | |||
| 19567b099d | |||
| 18e85c4cbb | |||
| ad34c2042e | |||
| 8d96cfa420 | |||
| 0783f728a9 | |||
| 9e1f19a8ed | |||
| 6914b4347a | |||
| 95ea3514e7 | |||
| 7e385b8754 | |||
| b9a518192b | |||
| 70fe6327c9 | |||
| f432a2d4ec | |||
| 7522f97695 | |||
| 674e3a8872 | |||
| f32ff084ad | |||
| 31a651ad1a | |||
| b5cf6a13b0 | |||
| 31924c1a23 | |||
| 73cddc76cf | |||
| 64f66133cb | |||
| 9c135095af | |||
| 18f7586890 | |||
| 8818aba486 | |||
| 042b2498b3 | |||
| 03f6d9ca77 | |||
| 82e2ecb362 | |||
| dadac58103 | |||
| 297f7fa374 | |||
| b7bdefabb3 | |||
| 0cb1221312 | |||
| 00fb68084a | |||
| ac0d710efa | |||
| a29279e995 | |||
| 92bc7e9946 | |||
| 3b2878f88a | |||
| d862a13290 | |||
| 9d9e0b83c4 | |||
| 3fc2a27346 | |||
| e0035aea53 | |||
| 74cd5e3041 | |||
| 3b9391df96 | |||
| 22f0ff4660 | |||
| 02a84d04cd | |||
| edece6f083 | |||
| d65b04d393 | |||
| 57c4b8a4c6 | |||
| 8b74de27d3 | |||
| e726848d83 | |||
| 3d409ba7c0 | |||
| 25fdffc417 | |||
| f83239945c | |||
| ce832b2736 | |||
| 6aa2bd2f83 | |||
| 47f8e6d0b6 | |||
| 0f9ddc736b | |||
| a4a6d27f83 | |||
| 25e60aeb66 | |||
| 5447490fed | |||
| 5a4a8ce43e | |||
| b645c9b03a | |||
| 62b21985a8 | |||
| fbc31db730 | |||
| c86d326869 | |||
| da68fd68c5 | |||
| 89a62f115e | |||
| 47fa885cfa | |||
| 6c3591507f | |||
| b4ceda1a98 | |||
| 27bba73d3c | |||
| f4ccc9023b | |||
| ced0546dd9 | |||
| 367bb54119 | |||
| 88be3ac7a6 | |||
| cb13ad1e8c | |||
| 1bada4d7d6 | |||
| 87675d3baf | |||
| 52226f362a | |||
| 713a99b1a9 | |||
| 2ef2a0cc58 | |||
| 6c44fff39d | |||
| 8848fad8f9 | |||
| bc4028bf8c | |||
| 4fdbed2c76 | |||
| df0162048f | |||
| a6410c7a5b | |||
| 50557c38bc | |||
| f4f99b14ea | |||
| 7b68109f3d | |||
| b6d85433c6 | |||
| 578a305a5f | |||
| 6cb6084afb | |||
| 712a66fe6f | |||
| db97a2653a | |||
| 0d49d27ee2 | |||
| 42d036b510 | |||
| 1bbe107c07 | |||
| 098324f5b9 | |||
| 8c3bcb28b1 | |||
| 1e504d040b | |||
| f01f5cdb89 | |||
| bd2699f2ca | |||
| 37170ea8d6 | |||
| 90874090e7 | |||
| 36c6311cb2 | |||
| 30cccb30a4 | |||
| 6e0a65c0d6 | |||
| 20f933019a | |||
| 5b00408d46 | |||
| 78243be714 | |||
| 64cf7c16f8 | |||
| 1fb0810778 | |||
| 79b94bd361 | |||
| 6e43250671 | |||
| 5656851168 | |||
| 601c0ca80e | |||
| 264a007c6e | |||
| a6509a1380 | |||
| 54b45db3fd | |||
| 5027eac7b3 | |||
| cf9ba4152c | |||
| be3c5c4796 | |||
| 980b30f5bf | |||
| 7b7e195604 | |||
| ae34fa0637 | |||
| ff57ed6c4c | |||
| de00bda9e4 | |||
| 37933643ad | |||
| 53bac0e0b7 | |||
| 65a73161b0 | |||
| b9911c0c71 | |||
| 4355e8e3a4 | |||
| 74e699fd7f | |||
| 23dfbddb1d | |||
| b9c0f8309c | |||
| b7770cb9d0 | |||
| a829f643f6 | |||
| 642b3b2773 | |||
| dc4ccebae8 | |||
| 02c8bcf0fa | |||
| 509a1f27df | |||
| 5c9467f134 | |||
| cdb18612e3 | |||
| 8d0ab09a02 | |||
| becd3fe3a2 | |||
| 61518190e7 | |||
| 7526eb3985 | |||
| 3d59de9f95 | |||
| 187c802b5e | |||
| 345d980bb1 | |||
| c4bf58f13d | |||
| 8c660c356c | |||
| cbfc78e01c | |||
| d54c952a10 | |||
| 1796c5be57 | |||
| 7a9f8576ed | |||
| 2aa401fa28 | |||
| 653dc3d0d0 | |||
| d4033efd84 | |||
| e4b5746c47 | |||
| 2ca2b3be1b | |||
| ab93580b54 | |||
| a60e55d8bc | |||
| ce052fb64c | |||
| c6f694f96f | |||
| 0a1dfa8064 | |||
| b857f928ac | |||
| 9883aeced7 | |||
| d222e0c828 | |||
| 089e50f176 | |||
| cef12652bc | |||
| 9c73f0ba41 | |||
| 25cdeff642 | |||
| d3bad3d98a | |||
| 29fb4a6fda | |||
| 730bc8c608 | |||
| 8c85b7504b | |||
| 787a6ef983 | |||
| 232b9d6c20 | |||
| f1cc0a3666 | |||
| 1eb52f27fb | |||
| 2c6ed340b4 | |||
| 0c3a4883f5 | |||
| bfe760868f | |||
| d135e22b52 | |||
| d1bf393c3c | |||
| 7d0f9efc7b | |||
| 4f99e86706 | |||
| 117977654e | |||
| 218073256c | |||
| a46aa6cd41 | |||
| 30f0cbceb2 | |||
| ec0e2dd441 | |||
| 8cf1f96796 | |||
| 906a36c1d2 | |||
| b2f7ee1349 | |||
| 7975ccb5bf | |||
| cb8c33b60e | |||
| 35ce95d401 | |||
| 07ddec8a1f | |||
| e92ca34661 | |||
| 8d59090460 | |||
| 08f70bc61b | |||
| 0cfd640680 | |||
| 25ce79f9e0 | |||
| bef750fd30 | |||
| 4b5101532e | |||
| 30cc26d38b | |||
| 08c7f53436 | |||
| 377ae33a9e | |||
| 0094efecfb | |||
| 045c381f3c | |||
| 92f4a9491d | |||
| a2c7f2ca73 | |||
| 996961cc09 | |||
| fdb270f663 | |||
| 4784ab7828 | |||
| 253e1bab88 | |||
| 6a15221c2c | |||
| 515cf67b77 | |||
| b9c6d7d40b | |||
| d690f5dda3 | |||
| 72cdc95761 | |||
| 71863e6e36 | |||
| cee474e736 | |||
| 132c61057a | |||
| 55bf59142a | |||
| 2d21fb54e1 | |||
| 894a9a6f04 | |||
| d594b30aa7 | |||
| 55697a1b2c | |||
| 8b0f8a35e0 | |||
| 1cc697d40d | |||
| 6a29d3e5ae | |||
| c5bf0e784a | |||
| 4837bb2f12 | |||
| e6620995b9 | |||
| 2991da1d94 | |||
| 8c9f821bec | |||
| 76568c5f50 | |||
| 919441f457 | |||
| 7aeb2ab303 | |||
| 7b379f3362 | |||
| 02ce3cc0de | |||
| 57cd700211 | |||
| b5e36699b3 | |||
| 8ca138a7ba | |||
| 23c9efa514 | |||
| f261118a1c | |||
| d38a7b05f2 | |||
| cfb54bb70d | |||
| eba227d9da | |||
| 8a5b9f8583 | |||
| 2df15a9f3d | |||
| f70087b5ef | |||
| f0e41eed2e | |||
| 00ab31550c | |||
| 30ef400791 | |||
| 9e50103155 | |||
| e3d1afff56 | |||
| 013de8882d | |||
| 116fe0dcb6 | |||
| cddbcd95fb | |||
| a0fbfee721 | |||
| 6439a977f2 | |||
| 3b0e93a527 | |||
| 6975eef35d | |||
| 8b45512103 | |||
| 4edb931b7c | |||
| c0fd5fafb1 | |||
| 8ecba27adb | |||
| ae029aa3f5 | |||
| 1fc6ca33d1 | |||
| 2633c4549e | |||
| 80bd182513 | |||
| 40ac4608a7 | |||
| c8ff7bb9e2 | |||
| cd2f352772 | |||
| 8c73df5e65 | |||
| ec1eb77ab7 | |||
| 73c03318d2 | |||
| d516b15e82 | |||
| 79d446b2af | |||
| cb9fe3c500 | |||
| e27aeba53f | |||
| 0bdb08e41c | |||
| 7e5f5ce4b1 | |||
| bfa3592810 | |||
| 07f02a29e5 | |||
| 338363b05d | |||
| 047e4f7065 | |||
| 0271823db9 | |||
| d827395434 | |||
| 94ced113c3 | |||
| 2a0b34146f | |||
| b13598d788 | |||
| 4a59b9032b | |||
| 47a7b9f08b | |||
| 22a2b6f325 | |||
| 84fe66bc82 | |||
| 89db641a9c | |||
| 81001f9e24 | |||
| a731fb4a29 | |||
| d0e2caba46 | |||
| 10e71abe4d | |||
| 10b1836a31 | |||
| 2860d842dd | |||
| a18a79bcba | |||
| 6d46d52bfd | |||
| 729f68f33f | |||
| 59966a1e40 | |||
| caf0c42cac | |||
| dc295c8cb4 | |||
| 641187c3af | |||
| 026b0f141e | |||
| d28c1417c7 | |||
| f37092efd0 | |||
| d95518c91e | |||
| ed4465d78f | |||
| b7de352e83 | |||
| 42aa3ca4ba | |||
| f4afe50c32 | |||
| 8726fe1329 | |||
| 2fc2c58338 | |||
| f44a744a09 | |||
| b0b29b57fe | |||
| 9f70a5baaf | |||
| 38c8b95fd7 | |||
| bc0969181e | |||
| 16bdd1ae93 | |||
| 15eb56908c | |||
| e74ab6f15b | |||
| 7bf73ac365 | |||
| a5d14f631f | |||
| 5947054e3b | |||
| 8255a84571 | |||
| 91fdbd17c0 | |||
| c3ece1f12f | |||
| beb93fdf5f | |||
| 5d60f776ad | |||
| 07f238b974 | |||
| c916bb38d0 | |||
| a1ceb4a4f3 | |||
| 263d2cf201 | |||
| 482d7e0335 | |||
| 4f323d980f | |||
| eb7b662ff2 | |||
| 689dacf577 | |||
| 8762e46dbb | |||
| c8eba005d3 | |||
| 34a1b2eeca | |||
| 2ae475a9e8 | |||
| 5413619846 | |||
| 9bc7ed52d4 | |||
| 1de327e386 | |||
| 039d084228 | |||
| b7aab8b64f | |||
| cffd5aa2bc | |||
| 01d9445a49 | |||
| 9c2f9b8b78 | |||
| 4ab58cb559 | |||
| 1804bcd133 | |||
| 4b8d9a5549 | |||
| 7426bfafc0 | |||
| c9e66c9502 | |||
| bb57632121 | |||
| aa739f394c | |||
| 2ecbd8e6a9 | |||
| edabaed304 | |||
| 75fd4378fe | |||
| bf60fd2631 | |||
| 8e06e4b8a3 | |||
| 62f3f71bb3 | |||
| 64227a2cb6 | |||
| d911220697 | |||
| 001f53efe3 | |||
| 1161647908 | |||
| b54afa04e6 | |||
| bfeda24dcd | |||
| ef6b36526d | |||
| 67990ea9a3 | |||
| 446da70fb1 | |||
| 9e3c90dcd9 | |||
| ef3bf78085 | |||
| 3118970cf4 | |||
| b9d951919e | |||
| 28d95f9844 | |||
| ed583e704f | |||
| aba2e31ce2 | |||
| be27447196 | |||
| 2cc47a9146 | |||
| a86ec3bcb0 | |||
| 1c45019403 | |||
| 8f10e8e212 | |||
| 704f1c95cc | |||
| f50d94bded | |||
| 7a7371d651 | |||
| be071767c7 | |||
| 7f31bde6d0 | |||
| 108109b579 | |||
| ceff3262f9 | |||
| bc31b7d3dd | |||
| bd8371892d | |||
| 5cfcc27fb4 | |||
| 8f07439943 | |||
| c052ff26c7 | |||
| 5dd3af7d3c | |||
| 5b9f0dd6a9 | |||
| 7e2b78f2b5 | |||
| b9e2635ec1 | |||
| caede92d09 | |||
| e62651ac14 | |||
| 643d45e4c0 | |||
| a2e930d6a3 | |||
| 9342be9e48 | |||
| 125923d7d6 | |||
| fbdb328c6a | |||
| 6c17e1efc8 | |||
| 6273fb7e7c | |||
| f6cc9067d8 | |||
| 8ce5d38093 | |||
| 9397c470da | |||
| c8b3ea7f36 | |||
| 3a55f85ef1 | |||
| f5889dc912 | |||
| f12b8a50ec | |||
| b561967d3e |
+14
@@ -0,0 +1,14 @@
|
||||
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
|
||||
|
||||
install:
|
||||
- sudo apt-get install -y 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
|
||||
|
||||
script:
|
||||
- radio/util/commit-tests.sh
|
||||
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
|
||||
+148
-6
@@ -173,12 +173,12 @@ Keith Hertzog
|
||||
Johan Moelich
|
||||
Timo Esser
|
||||
Dean Church (monthly)
|
||||
Brian Paddock (monthly)
|
||||
Brian Paddock
|
||||
Jean Pierre Parisy
|
||||
Norbert Martsch
|
||||
Jean-Marie Guitard
|
||||
Mike Perkins
|
||||
Tilman Baumann (monthly)
|
||||
Tilman Baumann
|
||||
Fred Larssen
|
||||
Ari Aalto
|
||||
Robert Sams
|
||||
@@ -189,7 +189,7 @@ Paul Robinson
|
||||
Dave Matison
|
||||
Mike Matheny
|
||||
Pino Agostino
|
||||
Graham Boucher (monthly)
|
||||
Graham Boucher
|
||||
Nelson Noura
|
||||
Joel Allamy
|
||||
Philip David Martin
|
||||
@@ -200,7 +200,7 @@ Timothy Pelletier
|
||||
Glen Roe (ShowMaster)
|
||||
Jan Van Ooteghem
|
||||
David Ankers - Special thanks here to the OpenPilot project!
|
||||
Lawrence Christensen (monthly)
|
||||
Lawrence Christensen
|
||||
Leo Duflou
|
||||
Bruce Wood
|
||||
Arnd Feige
|
||||
@@ -259,7 +259,7 @@ Peter Mitrik
|
||||
Thomas Majewski
|
||||
ANF King
|
||||
Henrik Hammarström
|
||||
Kenneth Lilja (monthly)
|
||||
Kenneth Lilja
|
||||
R Wells
|
||||
Uwe Jordt
|
||||
Harald Wilczak
|
||||
@@ -600,7 +600,7 @@ Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini (monthly)
|
||||
Patrizio Simoncini
|
||||
Harald Gabler
|
||||
Michael Brown
|
||||
Julien Gérard
|
||||
@@ -640,3 +640,145 @@ Jeffery Golias
|
||||
Nick Milton
|
||||
Paul Zasso
|
||||
Reidar Johannes Lillebotn
|
||||
Handley William
|
||||
Luke Williams
|
||||
Michael Shellim
|
||||
Brian Spearing
|
||||
Derek Foster
|
||||
Pasi Pitkänen
|
||||
Lexington S Morley
|
||||
Jeff Roberson
|
||||
Volkov Victor
|
||||
Mike Perkins
|
||||
Bryan Anderson
|
||||
Daniel Garber
|
||||
Pavel Stein
|
||||
Ravi Gupta
|
||||
Patrick Tuxbury
|
||||
Mark Deverell
|
||||
John Capell
|
||||
Neil McVean
|
||||
Matthew Elyash
|
||||
Kerry Cochrell
|
||||
Willem Aandewiel
|
||||
Reg Bell
|
||||
Jean Chenoz
|
||||
Philippe Grand
|
||||
Tauno Rautakorpi
|
||||
Jeff Dillingham
|
||||
Brad Kelley
|
||||
Shaun Currier
|
||||
Danilo Schiara
|
||||
John Hennig
|
||||
RK Custom Homes
|
||||
James Houck
|
||||
Piet Teekens
|
||||
Tommy Widenflycht
|
||||
Johan Petrus Theophilus Maria van Melis
|
||||
Ralph Gustafson
|
||||
Paul Luby
|
||||
Andrew Duncan
|
||||
Stephen Crowther
|
||||
Edward Glover
|
||||
Kelly Byrd
|
||||
Brad Curtis
|
||||
Wolfgang Kuhl
|
||||
LitePilots - litepilots.com
|
||||
John Beidl
|
||||
Roy Nixon
|
||||
Glen Roe
|
||||
CY Enterprise
|
||||
Evening Shade Pottery
|
||||
Gilles Dando
|
||||
Patrick Richard
|
||||
Justin Altemeier
|
||||
Constant Dupuis
|
||||
Tony Kenward
|
||||
Pierre Rondel
|
||||
Ernest Luguera Sanchez
|
||||
Adam Brackney
|
||||
Joe Baker
|
||||
单 雷平
|
||||
Ben Fay
|
||||
Chris Monk
|
||||
Stan von Miller
|
||||
Christian Krebs
|
||||
Michel Motte
|
||||
Graziano Rampinelli
|
||||
Joe Baker
|
||||
Jean-Philippe Laurent
|
||||
Romain Rouzaud
|
||||
Michel Garbarino
|
||||
Henri Mirra
|
||||
Otto Fröhlich
|
||||
Thomas Cramer
|
||||
Anthony Trombetta
|
||||
Fernando Rimoldi
|
||||
Dietmar Drees
|
||||
Michal Kowalski
|
||||
Ivan Correa
|
||||
Modellbau
|
||||
Massimo Luigi Stara
|
||||
Graham Baldwin
|
||||
Tomasz Rejman
|
||||
Wolfgang Lang
|
||||
John Greenwood
|
||||
Till von Reumont
|
||||
Paul Pereira Brunner
|
||||
Donald L Singer
|
||||
Junsun Lee
|
||||
Guy Lamaison
|
||||
Erwin Dulken
|
||||
Mike H Dailey
|
||||
Jon Cammarata
|
||||
Martin Krueger
|
||||
Adolfo Perogio
|
||||
Sylvain Techer
|
||||
Wes Warner
|
||||
Kevin Caldwell
|
||||
Ali Ersan Gur
|
||||
Hans-Rudolf Riniker
|
||||
Sébastien Boutard
|
||||
Jean Chessé
|
||||
Mike H Dailey
|
||||
Don Polk
|
||||
Roberto Orsello
|
||||
Borovikov Dmitriy
|
||||
John Lipscomb
|
||||
Peter Glassey
|
||||
Joseph Kramer
|
||||
F.Javier Martinez Velasco
|
||||
Claudio Piccinini
|
||||
John Jackson
|
||||
John Beech
|
||||
Rene Traa
|
||||
Sebastien Charpentier (monthly)
|
||||
Nigel Hendriks
|
||||
Frédéric Devillard
|
||||
Albert Herzog
|
||||
Anindya Mukerjee
|
||||
Kenny Stanberry
|
||||
Tauno Rautakorpi
|
||||
Mathias Krapp
|
||||
Fernando Rimoldi
|
||||
Wolfgang Rauser
|
||||
Richard Shagam
|
||||
Stephen Bailey
|
||||
DK-System
|
||||
Casa Kuxtal
|
||||
Alain Labonne
|
||||
Christopher Potts
|
||||
Douglas George
|
||||
Michael Banks
|
||||
Jon Wiltshire
|
||||
David Green
|
||||
Guy Willems
|
||||
Xavier Mestelan Pinon
|
||||
Maik Gottschalk
|
||||
Scott Sparks
|
||||
John Dunning
|
||||
RAD51
|
||||
Ron Powell
|
||||
Alain Labonne
|
||||
Carol Sills
|
||||
Franck Aßmann
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
##OpenTX Master Branch
|
||||
##OpenTX 2.0 Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Master Branch. This code branch holds the source code for the latest stable release.
|
||||
|
||||
The ongoing development is not done in this branch. It is performed in the branch called next.
|
||||
The ongoing development is not done in this branch. It is performed in the branches `master` and/or `next`. This branch is used for bug fixes of OpenTX 2.0.x series.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
|
||||
@@ -1,3 +1,80 @@
|
||||
<h2>Version 2.0.18 / 2016-01-03</h2>
|
||||
<ul>
|
||||
<li>Enabled <i>Mixers monitor</i> in Taranis simulator</li>
|
||||
<li>Better support for multi-axes in Log Viewer (<a href=https://github.com/opentx/opentx/issues/2267>#2267</a>)</li>
|
||||
<li>File path issue in Taranis simulator function <i>findTrueFileName()</i> on Windows (<a href=https://github.com/opentx/opentx/issues/2301>#2301</a>)</li>
|
||||
<li>Added simulator volume gain setting (<a href=https://github.com/opentx/opentx/issues/2260>#2260</a>)</li>
|
||||
<li>Added GPS glitch filtering and Latitude/Longitude position synchronization to Google Earth export (<a href=https://github.com/opentx/opentx/issues/2326>#2326</a>)</li>
|
||||
<li>Fixed a rare program crash when editing Input for 9X radio (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
|
||||
<li>Fixed missing RSSI audio warnings if simulator was started multiple times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
|
||||
<li>EU-only firmware option added</li>
|
||||
<li>Joystick channel mapping bug fixed (<a href=https://github.com/opentx/opentx/issues/1732>#1732</a>)</li>
|
||||
<li>Physical switches were missing from Adjust Volume special function sources (<a href=https://github.com/opentx/opentx/issues/2414>#2414</a>)</li>
|
||||
<li>Fixed a rare program crash: input name buffer overflow (<a href=https://github.com/opentx/opentx/issues/2420>#2420</a>)</li>
|
||||
<li>Alarms did not work if user started radio simulation several times (<a href=https://github.com/opentx/opentx/issues/2446>#2446</a>)</li>
|
||||
<li>Fixed endless loop in model compare (<a href=https://github.com/opentx/opentx/issues/2734>#2734</a>)</li>
|
||||
<li>Prevent user from opening 2.1 or higher EEPE (<a href=https://github.com/opentx/opentx/issues/2620>#2620</a>)</li>
|
||||
<li>Center beep checkbook for P3 was missing for some radios (<a href=https://github.com/opentx/opentx/issues/2707>#2707</a>)</li>
|
||||
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
|
||||
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Version 2.0.17 / 2015-05-04</h2>
|
||||
<ul>
|
||||
<li>Simulator crash (<a href=https://github.com/opentx/opentx/issues/2253>#2253</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.0.16 / 2015-05-03</h2>
|
||||
<ul>
|
||||
<li><i>nooverridech</i> firmware option was not working</li>
|
||||
<li>Fixed setting Expo from gvars for 9XR-Pro (<a href=https://github.com/opentx/opentx/issues/2040>#2040</a>)</li>
|
||||
<li>Added Mixers Monitor screen option <i>mixersmon</i> (<a href=https://github.com/opentx/opentx/issues/1945>#1945</a>)</li>
|
||||
<li>Added audio playing in simulator (<a href=https://github.com/opentx/opentx/issues/457>#457</a>)</li>
|
||||
<li>Fixed sorting of audio tracks (<a href=https://github.com/opentx/opentx/issues/2002>#2002</a>)</li>
|
||||
<li>Model wizard fixes (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
|
||||
<li>GVAR names removed for 9x, radio doesn't support them (<a href=https://github.com/opentx/opentx/issues/2150>#2150</a>)</li>
|
||||
<li>Some LS sources didn't follow the Imperial units setting (<a href=https://github.com/opentx/opentx/issues/2180>#2180</a>)</li>
|
||||
<li>Added more fields to the telemetry simulator (<a href=https://github.com/opentx/opentx/issues/2171>#2171</a>)</li>
|
||||
<li>Log viewer improvements and massive speed increase (<a href=https://github.com/opentx/opentx/issues/1863>#1863</a>, <a href=https://github.com/opentx/opentx/issues/2163>#2163</a>)</li>
|
||||
<li>Added Battery meter range setting (<a href=https://github.com/opentx/opentx/issues/2195>#2195</a>)</li>
|
||||
<li>Improvements in Print and Compare dialogs (<a href=https://github.com/opentx/opentx/issues/2219>#2219</a>)</li>
|
||||
<li>Reset pots to the middle by right double clicking them in Simulator (<a href=https://github.com/opentx/opentx/issues/1939>#1939</a>)</li>
|
||||
<li>Minor fixes: <a href=https://github.com/opentx/opentx/issues/2153>#2153</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2138>#2138</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2090>#2090</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/2122>#2122</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.0.15 / 2015-01-13</h2>
|
||||
<ul>
|
||||
<li>Firmware was not written correctly on radio when compatibility warning check enabled</li>
|
||||
<li>Time format for Special Functions Set Timers</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.14 / 2015-01-12</h2>
|
||||
<ul>
|
||||
<li>OpenTX Companion and Companion9x can now be installed side by side on Linux</li>
|
||||
<li>Improved TAB order in dialogs</li>
|
||||
<li>Special Function <i>Start Logs</i> renamed to more appropriate <i>SD Logs</i></li>
|
||||
<li>Improvements for MAC build</li>
|
||||
<li>Fixes to Google Earth logs export</li>
|
||||
<li>Firmware compatibility warning check added when flashing new firmware to radio</li>
|
||||
<li>Fixed issue with Telemetry Type setting on 9XR-PRO</li>
|
||||
<li>Added Telemetry simulator</li>
|
||||
<li>Added Trainer simulator</li>
|
||||
<li>Added Debug Output window</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
<li>More reliable method of writing EEPROM.BIN and FIRMWARE.BIN to radio</li>
|
||||
<li>Fixed issue with Edge function INSTANT for V1>2s</li>
|
||||
<li>Fixed buffer overflow in Joystick code</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.13 / 2014-11-20</h2>
|
||||
<ul>
|
||||
<li>Too many curves shown on non ARM boards</li>
|
||||
@@ -68,13 +145,13 @@
|
||||
<ul>
|
||||
<li>Sound should be ok on all platforms</li>
|
||||
<li>Min/Max reviewed in Logical switches (for the whole telemetry)</li>
|
||||
<li>Various bug fixes</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.3</h2>
|
||||
<ul>
|
||||
<li>EEPROM import bug on AdjustGVAR function</li>
|
||||
<li>Timers correctly displayed in logical switches tab</li>
|
||||
<li>Timers correctly displayed in logical switches tab</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.2</h2>
|
||||
@@ -248,4 +325,4 @@
|
||||
<li>Try to reduce modeledit window form MAC</li>
|
||||
<li>Wrong init of RF-Module data</li>
|
||||
<li>Read flash from TX didn't worked for Taranis</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
@@ -2,7 +2,7 @@ PROJECT( companion )
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "0" )
|
||||
SET( C9X_VERSION_REVISION "13" )
|
||||
SET( C9X_VERSION_REVISION "18" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
@@ -33,11 +33,12 @@ IF ( SDL_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} )
|
||||
MESSAGE("SDL Include Path: " ${SDL_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DJOYSTICKS )
|
||||
ADD_DEFINITIONS( -DSIMU_AUDIO )
|
||||
ELSE()
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled" )
|
||||
MESSAGE( "SDL not found! Joysticks support will be disabled. Simulator audio will not work." )
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
|
||||
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
|
||||
SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
@@ -106,6 +107,7 @@ include_directories(
|
||||
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(simulation)
|
||||
add_subdirectory(qcustomplot)
|
||||
|
||||
set(common_SRCS
|
||||
eeprominterface.cpp
|
||||
@@ -114,7 +116,7 @@ set(common_SRCS
|
||||
firmwares/er9x/er9xeeprom.cpp
|
||||
firmwares/er9x/er9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xeeprom.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/gruvin9x/gruvin9xinterface.cpp
|
||||
firmwares/ersky9x/ersky9xeeprom.cpp
|
||||
firmwares/ersky9x/ersky9xinterface.cpp
|
||||
${RADIO_SRC_DIRECTORY}/bitmaps/sticks.lbm
|
||||
@@ -147,7 +149,7 @@ set(companion_SRCS
|
||||
mdichild.cpp
|
||||
generaledit.cpp
|
||||
modelslist.cpp
|
||||
mountlist.cpp
|
||||
mountlist.cpp
|
||||
avroutputdialog.cpp
|
||||
apppreferencesdialog.cpp
|
||||
fwpreferencesdialog.cpp
|
||||
@@ -164,7 +166,6 @@ set(companion_SRCS
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
radionotfound.cpp
|
||||
qcustomplot.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
@@ -189,12 +190,11 @@ set(companion_MOC_HDRS
|
||||
mdichild.h
|
||||
mainwindow.h
|
||||
radionotfound.h
|
||||
qcustomplot.h
|
||||
qautocombobox.h
|
||||
helpers.h
|
||||
wizarddialog.h
|
||||
)
|
||||
|
||||
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
avroutputdialog.ui
|
||||
@@ -276,14 +276,14 @@ QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
|
||||
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
ADD_EXECUTABLE(companion MACOSX_BUNDLE ${companion_SRCS} ${companion_QM})
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
|
||||
ELSE( )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ADD_EXECUTABLE(companion WIN32 ${companion_SRCS} ${companion_QM})
|
||||
ENDIF( )
|
||||
|
||||
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} modeledit simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
target_link_libraries(companion modeledit simulation common qcustomplot ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} )
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -344,16 +344,13 @@ else()
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
endif()
|
||||
|
||||
if(SDL_FOUND)
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
else()
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
endif()
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( TARGETS simulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES companion.desktop DESTINATION share/applications )
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
|
||||
@@ -364,7 +361,7 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
|
||||
INSTALL( FILES ../targets/linux/45-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
@@ -373,20 +370,20 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
IF( WIN32 )
|
||||
IF( MSVC )
|
||||
SET( NSI_IN_FILE companion-vs.nsi.in )
|
||||
SET( NSI_IN_FILE companion-vs.nsi.in )
|
||||
ELSE( )
|
||||
SET( NSI_IN_FILE companion-msys.nsi.in )
|
||||
ENDIF( )
|
||||
|
||||
SET( SYSDIR "$ENV{windir}/system32" )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
|
||||
SET( SYSDIR "$ENV{windir}/system32" )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
|
||||
|
||||
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
|
||||
"C:/Program Files/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Programs/NSIS"
|
||||
)
|
||||
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS companion.nsi
|
||||
DEPENDS ${PROJECT_NAME} simulator ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
@@ -405,21 +402,20 @@ IF( APPLE )
|
||||
ELSE( )
|
||||
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks ALL
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${PROJECT_NAME} )
|
||||
|
||||
|
||||
ADD_CUSTOM_TARGET( makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
@@ -428,7 +424,7 @@ IF( APPLE )
|
||||
ENDIF( )
|
||||
|
||||
ADD_CUSTOM_TARGET( stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
|
||||
|
||||
IF(WIN32)
|
||||
@@ -453,7 +449,7 @@ if(DPKG_PROGRAM)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Romolo Manfredini <romolo.manfredini-nosp@m-gmail.com>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${C9X_VERSION_MAJOR})
|
||||
SET(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${C9X_VERSION_MINOR})
|
||||
@@ -464,6 +460,6 @@ else(DPKG_PROGRAM)
|
||||
SET(CPACK_RPM_PACKAGE_VERSION ${C9X_VERSION})
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${C9X_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
endif(DPKG_PROGRAM)
|
||||
endif(DPKG_PROGRAM)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
+69
-23
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -20,7 +20,7 @@ AppData g;
|
||||
// ** CompStoreObj class********************
|
||||
void CompStoreObj::clear (const QString tag1, const QString tag2, const QString tag3)
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (tag2.isEmpty())
|
||||
{
|
||||
settings.remove(tag1);
|
||||
@@ -43,7 +43,7 @@ void CompStoreObj::clear (const QString tag1, const QString tag2, const QString
|
||||
|
||||
void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -56,7 +56,7 @@ void CompStoreObj::store(const QByteArray newArray, QByteArray &array, const QSt
|
||||
|
||||
void CompStoreObj::store(const QStringList newSList, QStringList &stringList, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -69,7 +69,7 @@ void CompStoreObj::store(const QStringList newSList, QStringList &stringList, co
|
||||
|
||||
void CompStoreObj::store(const QString newString, QString &string, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -82,7 +82,7 @@ void CompStoreObj::store(const QString newString, QString &string, const QString
|
||||
|
||||
void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -95,7 +95,7 @@ void CompStoreObj::store(const bool newTruth, bool &truth, const QString tag, co
|
||||
|
||||
void CompStoreObj::store(const int newNumber, int &number, const QString tag, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -109,7 +109,7 @@ void CompStoreObj::store(const int newNumber, int &number, const QString tag, co
|
||||
// Retrieval functions
|
||||
void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -121,7 +121,7 @@ void CompStoreObj::retrieve( QByteArray &array, const QString tag, const QString
|
||||
|
||||
void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -133,7 +133,7 @@ void CompStoreObj::retrieve( QStringList &stringList, const QString tag, const Q
|
||||
|
||||
void CompStoreObj::retrieve( QString &string, const QString tag, const QString def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -145,7 +145,7 @@ void CompStoreObj::retrieve( QString &string, const QString tag, const QString d
|
||||
|
||||
void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -157,7 +157,7 @@ void CompStoreObj::retrieve( bool &truth, const QString tag, const bool def, con
|
||||
|
||||
void CompStoreObj::retrieve( int &number, const QString tag, const int def, const QString group1, const QString group2 )
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (!group1.isEmpty()) settings.beginGroup(group1);
|
||||
if (!group2.isEmpty()) settings.beginGroup(group2);
|
||||
|
||||
@@ -241,7 +241,7 @@ JStickData::JStickData()
|
||||
void JStickData::remove()
|
||||
{
|
||||
// Remove all JStickData values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup( "JsCalibration" );
|
||||
settings.remove( QString( "stick%1_axe").arg(index) );
|
||||
settings.remove( QString( "stick%1_min").arg(index) );
|
||||
@@ -256,7 +256,7 @@ void JStickData::remove()
|
||||
|
||||
bool JStickData::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("JsCalibration");
|
||||
int axe = settings.value( QString("stick%1_axe").arg(index), -1 ).toInt();
|
||||
settings.endGroup();
|
||||
@@ -295,8 +295,11 @@ QString Profile::fwName() const { return _fwName; }
|
||||
QString Profile::fwType() const { return _fwType; }
|
||||
QString Profile::name() const { return _name; }
|
||||
QString Profile::sdPath() const { return _sdPath; }
|
||||
int Profile::volumeGain() const { return _volumeGain; }
|
||||
QString Profile::pBackupDir() const { return _pBackupDir; }
|
||||
QString Profile::splashFile() const { return _splashFile; }
|
||||
bool Profile::burnFirmware() const { return _burnFirmware; }
|
||||
bool Profile::penableBackup() const { return _penableBackup; }
|
||||
bool Profile::renameFwFiles() const { return _renameFwFiles; }
|
||||
int Profile::channelOrder() const { return _channelOrder; }
|
||||
int Profile::defaultMode() const { return _defaultMode; }
|
||||
@@ -313,6 +316,8 @@ int Profile::currentCalib() const { return _currentCalib; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::vBatMin() const { return _vBatMin; }
|
||||
int Profile::vBatMax() const { return _vBatMax; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
|
||||
// Set declarations
|
||||
@@ -320,9 +325,12 @@ void Profile::name (const QString x) { store(x, _name, "Name"
|
||||
void Profile::fwName (const QString x) { store(x, _fwName, "fwName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::fwType (const QString x) { store(x, _fwType, "fwType" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::sdPath (const QString x) { store(x, _sdPath, "sdPath" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::volumeGain (const int x) { store(x, _volumeGain, "volumeGain" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::pBackupDir (const QString x) { store(x, _pBackupDir, "pBackupDir" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::splashFile (const QString x) { store(x, _splashFile, "SplashFileName" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::burnFirmware (const bool x) { store(x, _burnFirmware, "burnFirmware" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::renameFwFiles (const bool x) { store(x, _renameFwFiles, "rename_firmware_files" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::penableBackup (const bool x) { store(x, _penableBackup, "penableBackup" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::channelOrder (const int x) { store(x, _channelOrder, "default_channel_order" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::defaultMode (const int x) { store(x, _defaultMode, "default_mode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
@@ -338,6 +346,8 @@ void Profile::currentCalib (const int x) { store(x, _currentCalib, "curren
|
||||
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));}
|
||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||
|
||||
// Constructor
|
||||
@@ -346,16 +356,19 @@ Profile::Profile()
|
||||
index = -1;
|
||||
}
|
||||
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
// The default copy operator can not be used since the index variable would be destroyed
|
||||
Profile& Profile::operator=(const Profile& rhs)
|
||||
{
|
||||
name ( rhs.name() );
|
||||
fwName ( rhs.fwName() );
|
||||
fwType ( rhs.fwType() );
|
||||
sdPath ( rhs.sdPath() );
|
||||
volumeGain ( rhs.volumeGain() );
|
||||
pBackupDir ( rhs.pBackupDir() );
|
||||
splashFile ( rhs.splashFile() );
|
||||
burnFirmware ( rhs.burnFirmware() );
|
||||
renameFwFiles( rhs.renameFwFiles() );
|
||||
penableBackup( rhs.penableBackup() );
|
||||
channelOrder ( rhs.channelOrder() );
|
||||
defaultMode ( rhs.defaultMode() );
|
||||
beeper ( rhs.beeper() );
|
||||
@@ -369,6 +382,8 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
vBatMin ( rhs.vBatMin() );
|
||||
vBatMax ( rhs.vBatMax() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
|
||||
return *this;
|
||||
@@ -377,7 +392,7 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
void Profile::remove()
|
||||
{
|
||||
// Remove all profile values from settings file
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.remove(QString("profile%1").arg(index));
|
||||
settings.endGroup();
|
||||
@@ -388,7 +403,7 @@ void Profile::remove()
|
||||
|
||||
bool Profile::existsOnDisk()
|
||||
{
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
settings.beginGroup("Profiles");
|
||||
settings.beginGroup(QString("profile%1").arg(index));
|
||||
QStringList keyList = settings.allKeys();
|
||||
@@ -413,6 +428,8 @@ void Profile::initFwVariables()
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_vBatMin = 0;
|
||||
_vBatMax = 0;
|
||||
_vBatWarn = 0;
|
||||
}
|
||||
|
||||
@@ -424,9 +441,12 @@ void Profile::init(int newIndex)
|
||||
_fwType = "";
|
||||
_name = "";
|
||||
_sdPath = "";
|
||||
_volumeGain = 10;
|
||||
_pBackupDir = "";
|
||||
_splashFile = "";
|
||||
_burnFirmware = false;
|
||||
_renameFwFiles = false;
|
||||
_penableBackup = false;
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
@@ -446,8 +466,11 @@ void Profile::flush()
|
||||
getset( _fwType, "fwType" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _name, "Name" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _sdPath, "sdPath" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _volumeGain, "volumeGain" ,10 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _pBackupDir, "pBackupDir" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _splashFile, "SplashFileName" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _burnFirmware, "burnFirmware" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _penableBackup, "penableBackup" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _renameFwFiles, "rename_firmware_files" ,false ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _channelOrder, "default_channel_order" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _defaultMode, "default_mode" ,1 ,"Profiles", QString("profile%1").arg(index));
|
||||
@@ -464,6 +487,8 @@ void Profile::flush()
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
}
|
||||
|
||||
@@ -499,6 +524,7 @@ QString AppData::snapshotDir() { return _snapshotDir; }
|
||||
QString AppData::updatesDir() { return _updatesDir; }
|
||||
|
||||
bool AppData::enableBackup() { return _enableBackup; }
|
||||
bool AppData::checkHardwareCompatibility() { return _checkHardwareCompatibility; }
|
||||
bool AppData::backupOnFlash() { return _backupOnFlash; }
|
||||
bool AppData::jsSupport() { return _jsSupport; }
|
||||
bool AppData::maximized() { return _maximized; }
|
||||
@@ -550,6 +576,7 @@ void AppData::updatesDir (const QString x) { store(x, _updatesDir,
|
||||
|
||||
void AppData::enableBackup (const bool x) { store(x, _enableBackup, "backupEnable" );}
|
||||
void AppData::backupOnFlash (const bool x) { store(x, _backupOnFlash, "backupOnFlash" );}
|
||||
void AppData::checkHardwareCompatibility(const bool x) { store(x, _checkHardwareCompatibility, "checkHardwareCompatibility");}
|
||||
void AppData::maximized (const bool x) { store(x, _maximized, "maximized" );}
|
||||
void AppData::jsSupport (const bool x) { store(x, _jsSupport, "js_support" );}
|
||||
void AppData::showSplash (const bool x) { store(x, _showSplash, "show_splash" );}
|
||||
@@ -581,11 +608,29 @@ AppData::AppData()
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||
joystick[i].init( i );
|
||||
|
||||
// Import settings from companion9x, but only do it one time.
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
QSettings settings(PRODUCT, COMPANY);
|
||||
if (profile[0].name().isEmpty() )
|
||||
// Move existing 2.0 settings if present
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings pre2016settings("OpenTX", "OpenTX Companion");
|
||||
|
||||
QStringList keys = pre2016settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, pre2016settings.value(*i));
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
|
||||
pre2016settings.clear();
|
||||
}
|
||||
|
||||
// Else import settings from companion9x if present
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings c9x_settings("companion9x", "companion9x");
|
||||
// Copy all settings from companion9x to companion
|
||||
QStringList keys = c9x_settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
@@ -629,7 +674,7 @@ AppData::AppData()
|
||||
settings.remove("patchImage");
|
||||
settings.remove("rename_firmware_files");
|
||||
settings.remove("sdPath");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("SplashFileName");
|
||||
settings.remove("startup_check_companion9x");
|
||||
settings.remove("wizardEnable");
|
||||
|
||||
@@ -645,7 +690,7 @@ AppData::AppData()
|
||||
|
||||
// Load and store all variables. Use default values if setting values are missing
|
||||
QString _tempString; // Do not touch. Do not change the settings version before a new verson update!
|
||||
getset( _tempString, "settings_version" ,"20" ); // This is a version marker. Will be used to upgrade the settings later on.
|
||||
getset( _tempString, "settings_version" ,"201" ); // This is a version marker. Will be used to upgrade the settings later on.
|
||||
|
||||
getset( _recentFiles, "recentFileList" ,"" );
|
||||
getset( _mainWinGeo, "mainWindowGeometry" ,"" );
|
||||
@@ -675,6 +720,7 @@ AppData::AppData()
|
||||
getset( _updatesDir, "lastUpdatesDir" ,"" );
|
||||
|
||||
getset( _enableBackup, "backupEnable" ,false );
|
||||
getset( _checkHardwareCompatibility, "checkHardwareCompatibility", true );
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
|
||||
+24
-6
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Kjell Kernen
|
||||
*
|
||||
*
|
||||
* 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.
|
||||
@@ -12,7 +12,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// All temporary and permanent global variables are defined here to make
|
||||
// initialization and storage safe and visible.
|
||||
// Do not access variables in QSettings directly, it is not type safe!
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
|
||||
#define COMPANY "OpenTX Companion"
|
||||
#define PRODUCT "OpenTX"
|
||||
#define COMPANY "OpenTX"
|
||||
#define PRODUCT "Companion 2.0"
|
||||
|
||||
#define MAX_PROFILES 15
|
||||
#define MAX_JOYSTICKS 8
|
||||
@@ -53,7 +53,7 @@ class CompStoreObj
|
||||
void getset( QString &string, const QString tag, const QString def, const QString group1="", const QString group2="" );
|
||||
void getset( bool &truth, const QString tag, const bool def, const QString group1="", const QString group2="" );
|
||||
void getset( int &number, const QString tag, const int def, const QString group1="", const QString group2="" );
|
||||
};
|
||||
};
|
||||
|
||||
class FwRevision: protected CompStoreObj
|
||||
{
|
||||
@@ -107,8 +107,11 @@ class Profile: protected CompStoreObj
|
||||
QString _fwType;
|
||||
QString _name;
|
||||
QString _sdPath;
|
||||
int _volumeGain;
|
||||
QString _pBackupDir;
|
||||
QString _splashFile;
|
||||
bool _burnFirmware;
|
||||
bool _penableBackup;
|
||||
bool _renameFwFiles;
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
@@ -126,6 +129,8 @@ class Profile: protected CompStoreObj
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _vBatMin;
|
||||
int _vBatMax;
|
||||
int _vBatWarn;
|
||||
|
||||
public:
|
||||
@@ -134,9 +139,12 @@ class Profile: protected CompStoreObj
|
||||
QString fwType() const;
|
||||
QString name() const;
|
||||
QString sdPath() const;
|
||||
int volumeGain() const;
|
||||
QString pBackupDir() const;
|
||||
QString splashFile() const;
|
||||
bool burnFirmware() const;
|
||||
bool renameFwFiles() const;
|
||||
bool penableBackup() const;
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
@@ -152,16 +160,21 @@ class Profile: protected CompStoreObj
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int vBatMin() const;
|
||||
int vBatMax() const;
|
||||
int vBatWarn() const;
|
||||
|
||||
// All the set definitions
|
||||
void name (const QString);
|
||||
void fwName (const QString);
|
||||
void fwType (const QString);
|
||||
void volumeGain (const int);
|
||||
void sdPath (const QString);
|
||||
void pBackupDir (const QString);
|
||||
void splashFile (const QString);
|
||||
void burnFirmware (const bool);
|
||||
void renameFwFiles (const bool);
|
||||
void penableBackup (const bool);
|
||||
void channelOrder (const int);
|
||||
void defaultMode (const int);
|
||||
|
||||
@@ -177,6 +190,8 @@ class Profile: protected CompStoreObj
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void vBatMin (const int);
|
||||
void vBatMax (const int);
|
||||
void vBatWarn (const int);
|
||||
|
||||
Profile();
|
||||
@@ -226,6 +241,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
bool _enableBackup;
|
||||
bool _backupOnFlash;
|
||||
bool _checkHardwareCompatibility;
|
||||
bool _maximized;
|
||||
bool _jsSupport;
|
||||
bool _showSplash;
|
||||
@@ -259,7 +275,7 @@ class AppData: protected CompStoreObj
|
||||
QString avrdudeLocation();
|
||||
QString dfuArguments();
|
||||
QString dfuLocation();
|
||||
QString lastFw();
|
||||
QString lastFw();
|
||||
QString locale();
|
||||
QString mcu();
|
||||
QString programmer();
|
||||
@@ -278,6 +294,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
bool enableBackup();
|
||||
bool backupOnFlash();
|
||||
bool checkHardwareCompatibility();
|
||||
bool jsSupport();
|
||||
bool maximized();
|
||||
bool showSplash();
|
||||
@@ -329,6 +346,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
void enableBackup (const bool);
|
||||
void backupOnFlash (const bool);
|
||||
void checkHardwareCompatibility (const bool);
|
||||
void maximized (const bool);
|
||||
void jsSupport (const bool);
|
||||
void showSplash (const bool);
|
||||
|
||||
@@ -48,6 +48,7 @@ void AppPreferencesDialog::writeValues()
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
g.historySize(ui->historySize->value());
|
||||
g.backLight(ui->backLightColor->currentIndex());
|
||||
g.profile[g.id()].volumeGain(round(ui->volumeGain->value() * 10.0));
|
||||
g.libDir(ui->libraryPath->text());
|
||||
g.gePath(ui->ge_lineedit->text());
|
||||
g.embedSplashes(ui->splashincludeCB->currentIndex());
|
||||
@@ -66,6 +67,8 @@ void AppPreferencesDialog::writeValues()
|
||||
g.profile[g.id()].renameFwFiles(ui->renameFirmware->isChecked());
|
||||
g.profile[g.id()].burnFirmware(ui->burnFirmware->isChecked());
|
||||
g.profile[g.id()].sdPath(ui->sdPath->text());
|
||||
g.profile[g.id()].pBackupDir(ui->profilebackupPath->text());
|
||||
g.profile[g.id()].penableBackup(ui->pbackupEnable->isChecked());
|
||||
g.profile[g.id()].splashFile(ui->SplashFileName->text());
|
||||
|
||||
// The profile name may NEVER be empty
|
||||
@@ -109,6 +112,7 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
ui->volumeGain->setValue(g.profile[g.id()].volumeGain() / 10.0);
|
||||
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
ui->backLightColor->setEnabled(false);
|
||||
@@ -164,6 +168,18 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->stickmodeCB->setCurrentIndex(g.profile[g.id()].defaultMode());
|
||||
ui->renameFirmware->setChecked(g.profile[g.id()].renameFwFiles());
|
||||
ui->sdPath->setText(g.profile[g.id()].sdPath());
|
||||
if (!g.profile[g.id()].pBackupDir().isEmpty()) {
|
||||
if (QDir(g.profile[g.id()].pBackupDir()).exists()) {
|
||||
ui->profilebackupPath->setText(g.profile[g.id()].pBackupDir());
|
||||
ui->pbackupEnable->setEnabled(true);
|
||||
ui->pbackupEnable->setChecked(g.profile[g.id()].penableBackup());
|
||||
} else {
|
||||
ui->pbackupEnable->setDisabled(true);
|
||||
}
|
||||
} else {
|
||||
ui->pbackupEnable->setDisabled(true);
|
||||
}
|
||||
|
||||
ui->profileNameLE->setText(g.profile[g.id()].name());
|
||||
ui->SplashFileName->setText(g.profile[g.id()].splashFile());
|
||||
|
||||
@@ -224,8 +240,17 @@ void AppPreferencesDialog::on_backupPathButton_clicked()
|
||||
if (!fileName.isEmpty()) {
|
||||
g.backupDir(fileName);
|
||||
ui->backupPath->setText(fileName);
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_ProfilebackupPathButton_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,tr("Select your Models and Settings backup folder"), g.backupDir());
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->profilebackupPath->setText(fileName);
|
||||
ui->pbackupEnable->setEnabled(true);
|
||||
}
|
||||
ui->backupEnable->setEnabled(true);
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_ge_pathButton_clicked()
|
||||
@@ -263,8 +288,9 @@ void AppPreferencesDialog::on_joystickChkB_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void AppPreferencesDialog::on_joystickcalButton_clicked() {
|
||||
joystickDialog * jd=new joystickDialog(this, ui->joystickCB->currentIndex());
|
||||
void AppPreferencesDialog::on_joystickcalButton_clicked()
|
||||
{
|
||||
JoystickDialog *jd = new JoystickDialog(this, ui->joystickCB->currentIndex());
|
||||
jd->exec();
|
||||
}
|
||||
#endif
|
||||
@@ -434,6 +460,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
voice = NULL; // we will search for a voice checkbox
|
||||
|
||||
int index = 0;
|
||||
QWidget * prevFocus = ui->voiceCombo;
|
||||
foreach(QList<Option> opts, parent->opts) {
|
||||
foreach(Option opt, opts) {
|
||||
if (index >= optionsCheckBoxes.size()) {
|
||||
@@ -441,6 +468,9 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
ui->optionsLayout->addWidget(checkbox, optionsCheckBoxes.count()/5, optionsCheckBoxes.count()%5, 1, 1);
|
||||
optionsCheckBoxes.push_back(checkbox);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(firmwareOptionChanged(bool)));
|
||||
if (prevFocus) {
|
||||
QWidget::setTabOrder(prevFocus, checkbox);
|
||||
}
|
||||
}
|
||||
|
||||
QCheckBox *cb = optionsCheckBoxes.at(index++);
|
||||
@@ -452,6 +482,7 @@ void AppPreferencesDialog::populateFirmwareOptions(const FirmwareInterface * fir
|
||||
if (opt.name == QString("voice")) {
|
||||
voice = cb;
|
||||
}
|
||||
prevFocus = cb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +47,9 @@ class AppPreferencesDialog : public QDialog
|
||||
void on_snapshotPathButton_clicked();
|
||||
void on_snapshotClipboardCKB_clicked();
|
||||
void on_backupPathButton_clicked();
|
||||
void on_ProfilebackupPathButton_clicked();
|
||||
void on_ge_pathButton_clicked();
|
||||
|
||||
|
||||
void on_sdPathButton_clicked();
|
||||
void on_removeProfileButton_clicked();
|
||||
void on_SplashSelect_clicked();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -138,7 +138,7 @@ void avrOutputDialog::doCopy()
|
||||
|
||||
if (source.open(QIODevice::ReadOnly)) {
|
||||
QFile dest(destFile);
|
||||
if (dest.open(QIODevice::WriteOnly)) {
|
||||
if (dest.open(QIODevice::ReadWrite)) {
|
||||
addText(tr("Writing file: "));
|
||||
for (int i=0; i<blocks; i++) {
|
||||
int read = source.read(buf, BLKSIZE);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>531</width>
|
||||
<height>335</height>
|
||||
<height>422</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -817,6 +817,14 @@ Please only use this if you know what you are doing. There are no error checks
|
||||
<tabstop>avrdude_port</tabstop>
|
||||
<tabstop>avrArgs</tabstop>
|
||||
<tabstop>pushButton_4</tabstop>
|
||||
<tabstop>samba_location</tabstop>
|
||||
<tabstop>sb_browse</tabstop>
|
||||
<tabstop>arm_mcu</tabstop>
|
||||
<tabstop>samba_port</tabstop>
|
||||
<tabstop>dfu_location</tabstop>
|
||||
<tabstop>dfu_browse</tabstop>
|
||||
<tabstop>dfuArgs</tabstop>
|
||||
<tabstop>advCtrChkB</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
@@ -42,6 +42,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->EEbackupCB->hide();
|
||||
}
|
||||
ui->checkFirmwareCB->setChecked(g.checkHardwareCompatibility());
|
||||
}
|
||||
else {
|
||||
ui->FlashLoadButton->setText(tr("Browse for file"));
|
||||
@@ -49,6 +50,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchhw_CB->hide();
|
||||
ui->EEpromCB->hide();
|
||||
ui->checkFirmwareCB->hide();
|
||||
ui->BurnFlashButton->setDisabled(true);
|
||||
ui->FWFileName->clear();
|
||||
ui->DateField->clear();
|
||||
@@ -106,7 +108,7 @@ burnDialog::burnDialog(QWidget *parent, int Type, QString * fileName, bool * bac
|
||||
}
|
||||
}
|
||||
ui->FWFileName->hide();
|
||||
ui->FlashLoadButton->hide();
|
||||
ui->FlashLoadButton->hide();
|
||||
hexfileName->clear();
|
||||
}
|
||||
else if (Type==FLASH_FILE_TYPE) {
|
||||
@@ -166,7 +168,7 @@ void burnDialog::on_FlashLoadButton_clicked()
|
||||
ui->patchcalib_CB->setChecked(false);
|
||||
ui->patchhw_CB->setChecked(false);
|
||||
ui->patchhw_CB->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
ui->patchcalib_CB->hide();
|
||||
}
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
}
|
||||
@@ -203,7 +205,7 @@ void burnDialog::checkFw(QString fileName)
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("%1 may not be a valid firmware file").arg(fileName));
|
||||
}
|
||||
}
|
||||
ui->BurnFlashButton->setEnabled(true);
|
||||
QTimer::singleShot(0, this, SLOT(shrink()));
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
@@ -236,16 +238,17 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
if (!LoadEepromXml(radioData, doc)){
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
file.reset();
|
||||
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
QString hline = inputStream.readLine();
|
||||
@@ -266,7 +269,9 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
return true;
|
||||
}
|
||||
file.close();
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
@@ -290,7 +295,9 @@ bool burnDialog::checkeEprom(QString fileName)
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
int res = QMessageBox::question(this, "Companion",tr("Invalid binary Models and Settings File %1, Proceed anyway ?").arg(fileName),QMessageBox::Yes | QMessageBox::No);
|
||||
if (res == QMessageBox::No) {
|
||||
return false;
|
||||
@@ -327,7 +334,7 @@ void burnDialog::updateUI()
|
||||
ui->useFwImageCB->setChecked( imageSource == FIRMWARE );
|
||||
ui->useLibraryImageCB->setChecked( imageSource == LIBRARY );
|
||||
ui->useAnotherImageCB->setChecked( imageSource == ANOTHER );
|
||||
|
||||
|
||||
displaySplash();
|
||||
}
|
||||
|
||||
@@ -382,7 +389,7 @@ void burnDialog::on_useAnotherImageCB_clicked()
|
||||
else{
|
||||
imageSource = ANOTHER;
|
||||
imageFile = fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
@@ -408,6 +415,7 @@ void burnDialog::on_useLibraryImageCB_clicked()
|
||||
void burnDialog::on_BurnFlashButton_clicked()
|
||||
{
|
||||
if (hexType==FLASH_FILE_TYPE) {
|
||||
g.checkHardwareCompatibility(ui->checkFirmwareCB->isChecked());
|
||||
QString fileName=ui->FWFileName->text();
|
||||
if (!fileName.isEmpty()) {
|
||||
g.flashDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
@@ -423,6 +431,7 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
tempFile = generateProcessUniqueTempFileName("flash.hex");
|
||||
else
|
||||
tempFile = generateProcessUniqueTempFileName("flash.bin");
|
||||
qDebug() << "burnDialog::on_BurnFlashButton_clicked(): patching" << fileName << "with custom splash screen and saving to" << tempFile;
|
||||
FlashInterface flash(fileName);
|
||||
flash.setSplash(image);
|
||||
if (flash.saveFlash(tempFile) > 0) {
|
||||
@@ -446,7 +455,7 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
}
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("No firmware selected"));
|
||||
hexfileName->clear();
|
||||
hexfileName->clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +468,7 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t GSStickMode=(uint8_t) g.profile[g.id()].gsStickMode();
|
||||
uint8_t vBatWarn=(uint8_t) g.profile[g.id()].vBatWarn();
|
||||
|
||||
|
||||
QString DisplaySet= g.profile[g.id()].display();
|
||||
QString BeeperSet= g.profile[g.id()].beeper();
|
||||
QString HapticSet= g.profile[g.id()].haptic();
|
||||
@@ -553,7 +562,7 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong radio setting data in profile, Settings not patched"));
|
||||
}
|
||||
|
||||
|
||||
if (patch) {
|
||||
QString fileName = generateProcessUniqueTempFileName("temp.bin");
|
||||
QFile file(fileName);
|
||||
@@ -582,12 +591,12 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
else {
|
||||
hexfileName->clear();
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
hexfileName->append(ui->FWFileName->text());
|
||||
}
|
||||
}
|
||||
this->close();
|
||||
@@ -595,8 +604,8 @@ void burnDialog::on_BurnFlashButton_clicked()
|
||||
|
||||
void burnDialog::on_cancelButton_clicked()
|
||||
{
|
||||
hexfileName->clear();
|
||||
this->close();
|
||||
hexfileName->clear();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void burnDialog::on_EEpromCB_toggled(bool checked)
|
||||
|
||||
+28
-11
@@ -30,7 +30,7 @@
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<spacer name="hs2">
|
||||
@@ -76,6 +76,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="5" column="0">
|
||||
@@ -342,26 +355,29 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<widget class="QCheckBox" name="checkFirmwareCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="text">
|
||||
<string>Check Firmware compatibility</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
<tabstop>FWFileName</tabstop>
|
||||
<tabstop>FlashLoadButton</tabstop>
|
||||
<tabstop>versionField</tabstop>
|
||||
<tabstop>ModField</tabstop>
|
||||
<tabstop>DateField</tabstop>
|
||||
<tabstop>useProfileImageCB</tabstop>
|
||||
<tabstop>useFwImageCB</tabstop>
|
||||
<tabstop>useLibraryImageCB</tabstop>
|
||||
@@ -371,6 +387,7 @@
|
||||
<tabstop>patchhw_CB</tabstop>
|
||||
<tabstop>EEpromCB</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
<tabstop>BurnFlashButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
# XSD_FOUND, If false, don't try to use xsd
|
||||
|
||||
FIND_PATH( XSD_INCLUDE_DIR xsd/cxx/parser/elements.hxx
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/libxsd"
|
||||
"C:/Programs/xsd-3.3.0/libxsd"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/include"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/libxsd"
|
||||
$ENV{XSDDIR}/include
|
||||
$ENV{CODESYNTH}/include
|
||||
/usr/local/include /usr/include
|
||||
/usr/local/include /usr/include
|
||||
$ENV{XSDDIR}/libxsd
|
||||
)
|
||||
|
||||
IF( WIN32 )
|
||||
@@ -27,18 +28,19 @@ ENDIF( )
|
||||
FIND_PROGRAM( XSDCXX_EXECUTABLE
|
||||
NAMES
|
||||
${XSDCXX_FILENAME1} ${XSDCXX_FILENAME2}
|
||||
PATHS
|
||||
PATHS
|
||||
"/opt/local/xsd-3.3.0-i686-macosx/bin"
|
||||
"C:/Programs/xsd-3.3.0/bin"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/bin"
|
||||
"C:/mingw/xsd-3.3.0-i686-windows/bin"
|
||||
"C:/Program Files/CodeSynthesis XSD 3.2/bin"
|
||||
$ENV{XSDDIR}/bin
|
||||
/usr/local/bin
|
||||
/usr/bin
|
||||
$ENV{XSDDIR}/xsd
|
||||
)
|
||||
|
||||
MESSAGE(STATUS ${XSDCXX_EXECUTABLE})
|
||||
|
||||
|
||||
# if the include and the program are found then we have it
|
||||
IF( XSD_INCLUDE_DIR )
|
||||
IF( XSDCXX_EXECUTABLE )
|
||||
@@ -49,4 +51,4 @@ ENDIF( XSD_INCLUDE_DIR )
|
||||
MARK_AS_ADVANCED(
|
||||
XSD_INCLUDE_DIR
|
||||
XSDCXX_EXECUTABLE
|
||||
)
|
||||
)
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
#include <QSplashScreen>
|
||||
#include <QThread>
|
||||
#include <iostream>
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
#include <SDL.h>
|
||||
#undef main
|
||||
#endif
|
||||
#include "mainwindow.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
@@ -95,9 +99,22 @@ int main(int argc, char *argv[])
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
#ifdef JOYSTICKS
|
||||
sdlFlags |= SDL_INIT_JOYSTICK;
|
||||
#endif
|
||||
#ifdef SIMU_AUDIO
|
||||
sdlFlags |= SDL_INIT_AUDIO;
|
||||
#endif
|
||||
if (SDL_Init(sdlFlags) < 0) {
|
||||
fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError());
|
||||
}
|
||||
#endif
|
||||
|
||||
RegisterEepromInterfaces();
|
||||
registerOpenTxFirmwares();
|
||||
|
||||
if (g.profile[g.id()].fwType().isEmpty()){
|
||||
g.profile[g.id()].fwType(default_firmware_variant->getId());
|
||||
@@ -133,5 +150,9 @@ int main(int argc, char *argv[])
|
||||
UnregisterFirmwares();
|
||||
UnregisterEepromInterfaces();
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
SDL_Quit();
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+197
-80
@@ -24,8 +24,9 @@ public:
|
||||
uint8_t models[C9X_MAX_MODELS];
|
||||
};
|
||||
|
||||
CompareDialog::CompareDialog(QWidget * parent):
|
||||
CompareDialog::CompareDialog(QWidget * parent, FirmwareInterface * firmware):
|
||||
QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint),
|
||||
firmware(firmware),
|
||||
model1(0),
|
||||
model2(0),
|
||||
ui(new Ui::CompareDialog)
|
||||
@@ -75,6 +76,8 @@ void CompareDialog::dragLeaveEvent(QDragLeaveEvent *event)
|
||||
void CompareDialog::printDiff()
|
||||
{
|
||||
te->clear();
|
||||
curvefile1=generateProcessUniqueTempFileName("curve1.png");
|
||||
curvefile2=generateProcessUniqueTempFileName("curve2.png");
|
||||
printSetup();
|
||||
if (GetCurrentFirmware()->getCapability(FlightModes)) {
|
||||
printPhases();
|
||||
@@ -160,8 +163,8 @@ void CompareDialog::closeEvent(QCloseEvent *event)
|
||||
|
||||
CompareDialog::~CompareDialog()
|
||||
{
|
||||
qunlink(curvefile5);
|
||||
qunlink(curvefile9);
|
||||
qunlink(curvefile1);
|
||||
qunlink(curvefile1);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -250,10 +253,20 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model1->timers[0]), color)); //value, mode, count up/down
|
||||
color=getColor1(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model1->timers[1]), color)); //value, mode, count up/down
|
||||
color=getColor1(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1), color)); //proto, numch, delay,
|
||||
color=getColor1(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color));
|
||||
color=getColor1(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br> "); //proto, numch, delay,
|
||||
}
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1->moduleData[0]),color));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
color=getColor1(getProtocol(g_model1->moduleData[1]),getProtocol(g_model2->moduleData[1]));
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br> "); //proto, numch, delay,
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model1->moduleData[1]),color));
|
||||
}
|
||||
if (IS_TARANIS(firmware->getBoard())){
|
||||
color=getColor1(getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]));
|
||||
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),color));
|
||||
}
|
||||
color=getColor1(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor1(getTrimInc(g_model1),getTrimInc(g_model2));
|
||||
@@ -270,10 +283,20 @@ void CompareDialog::printSetup()
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model2->timers[0]),color)); //value, mode, count up/down
|
||||
color=getColor2(getTimerStr(g_model1->timers[1]), getTimerStr(g_model2->timers[1]));
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model2->timers[1]),color)); //value, mode, count up/down
|
||||
color=getColor2(getProtocol(g_model1),getProtocol(g_model2));
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2), color)); //proto, numch, delay,
|
||||
color=getColor2(g_model1->moduleData[0].ppmPulsePol, g_model2->moduleData[0].ppmPulsePol);
|
||||
str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color));
|
||||
color=getColor2(getProtocol(g_model1->moduleData[0]),getProtocol(g_model2->moduleData[0]));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br> "); //proto, numch, delay,
|
||||
}
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2->moduleData[0]),color));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
color=getColor2(getProtocol(g_model1->moduleData[1]),getProtocol(g_model2->moduleData[1]));
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br> "); //proto, numch, delay,
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model2->moduleData[1]),color));
|
||||
}
|
||||
if (IS_TARANIS(firmware->getBoard())){
|
||||
color=getColor2(getTrainerMode(g_model1->trainerMode, g_model1->moduleData[2]),getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]));
|
||||
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model2->trainerMode, g_model2->moduleData[2]),color));
|
||||
}
|
||||
color=getColor2(g_model1->thrTrim,g_model2->thrTrim);
|
||||
str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color));
|
||||
color=getColor2(getTrimInc(g_model1),getTrimInc(g_model2));
|
||||
@@ -928,82 +951,176 @@ void CompareDialog::printMixers()
|
||||
|
||||
void CompareDialog::printCurves()
|
||||
{
|
||||
#if 0
|
||||
int i,r,g,b,c;
|
||||
int i,r,g,b,c,count1,count2,usedcurves=0;
|
||||
QString cm1y,cm1x, cm2y,cm2x;
|
||||
char buffer [16];
|
||||
QString color;
|
||||
QColor * qplot_color[8];
|
||||
qplot_color[0]=new QColor(0,0,127);
|
||||
qplot_color[1]=new QColor(0,127,0);
|
||||
qplot_color[2]=new QColor(127,0,0);
|
||||
qplot_color[3]=new QColor(127,127,0);
|
||||
qplot_color[4]=new QColor(0,0,255);
|
||||
qplot_color[5]=new QColor(0,255,0);
|
||||
qplot_color[6]=new QColor(255,0,0);
|
||||
qplot_color[7]=new QColor(255,255,0);
|
||||
QPen pen(Qt::black, 2, Qt::SolidLine);
|
||||
int numcurves=firmware->getCapability(NumCurves);
|
||||
if (numcurves==0) {
|
||||
numcurves=16;
|
||||
}
|
||||
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-after:always;\" width=\"100%\"><tr><td><h2>";
|
||||
str.append(tr("Curves"));
|
||||
str.append("</h2></td></tr><tr><td>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=11><b>"+tr("5 Point Curves")+"</b></td></tr><tr>");
|
||||
for(i=0; i<5; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("<td></td>");
|
||||
for(i=0; i<5; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("</tr>");
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">");
|
||||
QImage qi1(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
|
||||
QPainter painter1(&qi1);
|
||||
QImage qi2(ISIZE+1,ISIZE+1,QImage::Format_RGB32);
|
||||
QPainter painter2(&qi2);
|
||||
painter1.setBrush(QBrush("#FFFFFF"));
|
||||
painter2.setBrush(QBrush("#FFFFFF"));
|
||||
painter1.setPen(QColor(0,0,0));
|
||||
painter2.setPen(QColor(0,0,0));
|
||||
painter1.drawRect(0,0,ISIZE,ISIZE);
|
||||
painter2.drawRect(0,0,ISIZE,ISIZE);
|
||||
|
||||
for(i=0; i<numcurves; i++) {
|
||||
count1=0;
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
if (g_model1->curves[i].points[j].y!=0)
|
||||
count1++;
|
||||
}
|
||||
count2=0;
|
||||
for(int j=0; j<g_model2->curves[i].count; j++) {
|
||||
if (g_model2->curves[i].points[j].y!=0)
|
||||
count2++;
|
||||
}
|
||||
if ((count1>0) || (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model1->curves[i].count !=5) ||
|
||||
(count2>0) || (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model2->curves[i].count !=5)) {
|
||||
pen.setColor(colors[usedcurves]);
|
||||
painter1.setPen(pen);
|
||||
painter2.setPen(pen);
|
||||
|
||||
for(i=0; i<MAX_CURVE5; i++) {
|
||||
qplot_color[i]->getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
for(int j=0; j<5; j++) {
|
||||
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
|
||||
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
for(int j=0; j<5; j++) {
|
||||
color=getColor1(g_model2->curves5[i][j],g_model2->curves5[i][j]);
|
||||
str.append(doTR(QString::number(g_model2->curves5[i][j]),color));
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table></td></tr><tr><td>");
|
||||
colors[usedcurves].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
// curves are different in number of points or curve type so makes little sense to compare they are just different
|
||||
if ((g_model1->curves[i].count!=g_model2->curves[i].count) || (g_model1->curves[i].type!=g_model2->curves[i].type)) {
|
||||
cm1y="[";
|
||||
cm1x="[";
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
cm1y.append(QString("%1").arg(g_model1->curves[i].points[j].y));
|
||||
cm1x.append(QString("%1").arg(g_model1->curves[i].points[j].x));
|
||||
if (j<(g_model1->curves[i].count-1)) {
|
||||
cm1y.append(",");
|
||||
cm1x.append(",");
|
||||
}
|
||||
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
|
||||
}
|
||||
cm1y.append("]");
|
||||
cm1x.append("]");
|
||||
cm2y="[";
|
||||
cm2x="[";
|
||||
for(int j=0; j<g_model2->curves[i].count; j++) {
|
||||
cm2y.append(QString("%1").arg(g_model2->curves[i].points[j].y));
|
||||
cm2x.append(QString("%1").arg(g_model2->curves[i].points[j].x));
|
||||
if (j<(g_model2->curves[i].count-1)) {
|
||||
cm2y.append(",");
|
||||
cm2x.append(",");
|
||||
}
|
||||
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
|
||||
}
|
||||
cm2y.append("]");
|
||||
cm2x.append("]");
|
||||
str.append("<tr><td nowrap width=\"45%\"><font color=green>");
|
||||
str.append(cm1y);
|
||||
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm1x+QString("</font></td>"));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
str.append("<td nowrap width=\"45%\"><font color=red>");
|
||||
str.append(cm2y);
|
||||
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm2x+QString("</font></td></tr>"));
|
||||
}
|
||||
} else {
|
||||
// curves have the same number of points and the same type, we can compare them point by point
|
||||
cm1y="[";
|
||||
cm1x="[";
|
||||
cm2y="[";
|
||||
cm2x="[";
|
||||
for(int j=0; j<g_model1->curves[i].count; j++) {
|
||||
if (g_model1->curves[i].points[j].y!=g_model2->curves[i].points[j].y) {
|
||||
cm1y.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].y));
|
||||
cm2y.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].y));
|
||||
} else {
|
||||
cm1y.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].y));
|
||||
cm2y.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].y));
|
||||
}
|
||||
if (g_model1->curves[i].points[j].x!=g_model2->curves[i].points[j].x) {
|
||||
cm1x.append(QString("<font color=green>%1</font>").arg(g_model1->curves[i].points[j].x));
|
||||
cm2x.append(QString("<font color=red>%1</font>").arg(g_model2->curves[i].points[j].x));
|
||||
} else {
|
||||
cm1x.append(QString("<font color=grey>%1</font>").arg(g_model1->curves[i].points[j].x));
|
||||
cm2x.append(QString("<font color=grey>%1</font>").arg(g_model2->curves[i].points[j].x));
|
||||
}
|
||||
if (j<(g_model1->curves[i].count-1)) {
|
||||
cm1y.append(",");
|
||||
cm1x.append(",");
|
||||
cm2y.append(",");
|
||||
cm2x.append(",");
|
||||
}
|
||||
if (g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter1.drawLine(ISIZE/2+(ISIZE*g_model1->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model1->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter1.drawLine(ISIZE*(j-1)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model1->curves[i].count-1),ISIZE/2-(ISIZE*g_model1->curves[i].points[j].y)/200);
|
||||
if (g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter2.drawLine(ISIZE/2+(ISIZE*g_model2->curves[i].points[j-1].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE/2+(ISIZE*g_model2->curves[i].points[j].x)/200,ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter2.drawLine(ISIZE*(j-1)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j-1].y)/200,ISIZE*(j)/(g_model2->curves[i].count-1),ISIZE/2-(ISIZE*g_model2->curves[i].points[j].y)/200);
|
||||
}
|
||||
painter1.setPen(QColor(0,0,0));
|
||||
painter2.setPen(QColor(0,0,0));
|
||||
painter1.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
|
||||
painter2.drawLine(0,ISIZE/2,ISIZE,ISIZE/2);
|
||||
painter1.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
|
||||
painter2.drawLine(ISIZE/2,0,ISIZE/2,ISIZE);
|
||||
for(int k=0; k<21; k++) {
|
||||
painter1.drawLine(ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5,(ISIZE*k)/(20));
|
||||
painter2.drawLine(ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5,(ISIZE*k)/(20));
|
||||
painter1.drawLine((ISIZE*k)/(20),ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5);
|
||||
painter2.drawLine((ISIZE*k)/(20),ISIZE/2-5,(ISIZE*k)/(20),ISIZE/2+5);
|
||||
}
|
||||
|
||||
str.append("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=19><b>"+tr("9 Point Curves")+"</b></td></tr><tr>");
|
||||
for(i=0; i<9; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("<td></td>");
|
||||
for(i=0; i<9; i++)
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("</tr>");
|
||||
for(i=0; i<MAX_CURVE9; i++) {
|
||||
qplot_color[i]->getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
for(int j=0; j<9; j++) {
|
||||
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
|
||||
str.append(doTR(QString::number(g_model1->curves5[i][j]),color));
|
||||
cm1y.append("]");
|
||||
cm1x.append("]");
|
||||
cm2y.append("]");
|
||||
cm2x.append("]");
|
||||
str.append("<tr><td nowrap width=\"45%\">");
|
||||
str.append(cm1y);
|
||||
if ((g_model1->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm1x+QString("</td>"));
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
str.append("<td nowrap width=\"45%\">");
|
||||
str.append(cm2y);
|
||||
if ((g_model2->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
str.append(QString("<br>")+cm2x+QString("</td></tr>"));
|
||||
}
|
||||
}
|
||||
usedcurves++;
|
||||
}
|
||||
str.append(QString("<td width=\"10%\" align=\"center\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1+MAX_CURVE5));
|
||||
for(int j=0; j<9; j++) {
|
||||
color=getColor1(g_model2->curves9[i][j],g_model2->curves9[i][j]);
|
||||
str.append(doTR(QString::number(g_model2->curves9[i][j]),color));
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table></td></tr></table>");
|
||||
te->append(str);
|
||||
#endif
|
||||
if (usedcurves>0) {
|
||||
str.append(QString("<tr><td width=45 align=center><img src=\"%1\" border=0></td><td> </td><td width=45 align=center><img src=\"%2\" border=0></td>").arg(curvefile1).arg(curvefile2));
|
||||
str.append("</table></td></tr></table>");
|
||||
qi1.save(curvefile1, "png",100);
|
||||
qi2.save(curvefile2, "png",100);
|
||||
te->append(str);
|
||||
}
|
||||
}
|
||||
|
||||
void CompareDialog::printSwitches()
|
||||
@@ -1056,7 +1173,7 @@ void CompareDialog::printFSwitches()
|
||||
for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
|
||||
{
|
||||
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
|
||||
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
|
||||
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param) || (g_model1->funcSw[i].enabled != g_model2->funcSw[i].enabled) || (g_model1->funcSw[i].repeatParam != g_model2->funcSw[i].repeatParam)) {
|
||||
color1="green";
|
||||
color2="red";
|
||||
} else {
|
||||
|
||||
@@ -15,8 +15,9 @@ class CompareDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CompareDialog(QWidget *parent);
|
||||
CompareDialog(QWidget *parent, FirmwareInterface * firmware);
|
||||
~CompareDialog();
|
||||
FirmwareInterface * firmware;
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
@@ -64,8 +65,8 @@ class CompareDialog : public QDialog
|
||||
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
|
||||
|
||||
QTextEdit * te;
|
||||
QString curvefile5;
|
||||
QString curvefile9;
|
||||
QString curvefile1;
|
||||
QString curvefile2;
|
||||
QDir *qd;
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -85,6 +85,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu
|
||||
QFile file(":/releasenotes.txt");
|
||||
if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) {
|
||||
ui->textEditor->setHtml(file.readAll());
|
||||
ui->textEditor->setOpenExternalLinks(true);
|
||||
}
|
||||
ui->textEditor->scroll(0,0);
|
||||
setWindowTitle(tr("Companion Release Notes"));
|
||||
@@ -124,6 +125,7 @@ contributorsDialog::~contributorsDialog()
|
||||
void contributorsDialog::replyFinished(QNetworkReply * reply)
|
||||
{
|
||||
ui->textEditor->setHtml(reply->readAll());
|
||||
ui->textEditor->setOpenExternalLinks(true);
|
||||
}
|
||||
|
||||
void contributorsDialog::forceClose()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTextEdit" name="textEditor">
|
||||
<widget class="QTextBrowser" name="textEditor">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
@@ -229,7 +229,15 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
|
||||
case TELEMETRY_SOURCE_DIST_MAX:
|
||||
result.step = singleprec ? 8 : 1;
|
||||
result.max = singleprec ? 2040 : 10000;
|
||||
result.unit = QObject::tr("m");
|
||||
if (firmware->getCapability(Imperial) || settings.imperial) {
|
||||
result.step = (result.step * 105) / 32;
|
||||
result.min = (result.min * 105) / 32;
|
||||
result.max = (result.max * 105) / 32;
|
||||
result.unit = QObject::tr("ft");
|
||||
}
|
||||
else {
|
||||
result.unit = QObject::tr("m");
|
||||
}
|
||||
break;
|
||||
case TELEMETRY_SOURCE_CELL:
|
||||
case TELEMETRY_SOURCE_CELL_MIN:
|
||||
@@ -358,7 +366,7 @@ QString RawSource::toString(const ModelData & model)
|
||||
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
|
||||
QObject::tr("L31"), QObject::tr("L32")
|
||||
};
|
||||
|
||||
|
||||
if (index<0) {
|
||||
return QObject::tr("----");
|
||||
}
|
||||
@@ -394,7 +402,7 @@ QString RawSource::toString(const ModelData & model)
|
||||
case SOURCE_TYPE_TELEMETRY:
|
||||
return CHECK_IN_ARRAY(telemetry, index);
|
||||
case SOURCE_TYPE_GVAR:
|
||||
return QObject::tr("GV%1").arg(index+1);
|
||||
return QObject::tr("GV%1").arg(index+1);
|
||||
default:
|
||||
return QObject::tr("----");
|
||||
}
|
||||
@@ -756,7 +764,7 @@ QString FuncSwData::funcToString()
|
||||
else if (func == FuncPlayScript)
|
||||
return QObject::tr("Play Script");
|
||||
else if (func == FuncLogs)
|
||||
return QObject::tr("Start Logs");
|
||||
return QObject::tr("SD Logs");
|
||||
else if (func == FuncVolume)
|
||||
return QObject::tr("Volume");
|
||||
else if (func == FuncBacklight)
|
||||
@@ -1147,7 +1155,7 @@ void ModelData::clear()
|
||||
}
|
||||
else {
|
||||
moduleData[0].protocol=PPM;
|
||||
moduleData[1].protocol=OFF;
|
||||
moduleData[1].protocol=OFF;
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
flightModeData[i].clear();
|
||||
@@ -1328,7 +1336,7 @@ void RegisterEepromInterfaces()
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_9XRPRO));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
|
||||
eepromInterfaces.push_back(new Ersky9xInterface());
|
||||
@@ -1341,7 +1349,7 @@ void UnregisterEepromInterfaces()
|
||||
foreach(EEPROMInterface * intf, eepromInterfaces) {
|
||||
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
|
||||
delete intf;
|
||||
}
|
||||
}
|
||||
OpenTxEepromCleanup();
|
||||
}
|
||||
|
||||
@@ -1349,42 +1357,119 @@ QList<FirmwareInterface *> firmwares;
|
||||
FirmwareInterface * default_firmware_variant;
|
||||
FirmwareInterface * current_firmware_variant;
|
||||
|
||||
void UnregisterFirmwares()
|
||||
void UnregisterFirmwares()
|
||||
{
|
||||
foreach (FirmwareInterface * f, firmwares) {
|
||||
delete f;
|
||||
}
|
||||
}
|
||||
|
||||
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
|
||||
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
|
||||
{
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->load(radioData, eeprom, size))
|
||||
return true;
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
|
||||
QStringList errorsList;
|
||||
|
||||
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Possible causes for this:");
|
||||
|
||||
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a newer version of OpenTX"); }
|
||||
if (errors.test(NOT_OPENTX)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from OpenTX"); }
|
||||
if (errors.test(NOT_TH9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Th9X"); }
|
||||
if (errors.test(NOT_GRUVIN9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Gruvin9X"); }
|
||||
if (errors.test(NOT_ERSKY9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from ErSky9X"); }
|
||||
if (errors.test(NOT_ER9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Er9X"); }
|
||||
if (errors.test(WRONG_SIZE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom size is invalid"); }
|
||||
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom file system is invalid"); }
|
||||
if (errors.test(UNKNOWN_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a unknown board"); }
|
||||
if (errors.test(WRONG_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from the wrong board"); }
|
||||
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom backup not supported"); }
|
||||
|
||||
if (errors.test(UNKNOWN_ERROR)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Something that couldn't be guessed, sorry"); }
|
||||
|
||||
if (errors.test(HAS_WARNINGS)) {
|
||||
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Warning:");
|
||||
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
|
||||
}
|
||||
|
||||
return false;
|
||||
QMessageBox msgBox(parent);
|
||||
msgBox.setWindowTitle(title);
|
||||
msgBox.setIcon(QMessageBox::Critical);
|
||||
msgBox.setText(mainMessage);
|
||||
msgBox.setInformativeText(errorsList.join("\n"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
|
||||
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
|
||||
QStringList warningsList;
|
||||
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
|
||||
|
||||
QMessageBox msgBox(parent);
|
||||
msgBox.setWindowTitle(title);
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setText(QT_TRANSLATE_NOOP("EepromInterface", "Warnings!"));
|
||||
msgBox.setInformativeText(warningsList.join("\n"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->loadBackup(radioData, eeprom, size, index))
|
||||
return true;
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
} else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
} else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->loadxml(radioData, doc))
|
||||
return true;
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
} else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
QString getBoardName(BoardEnum board)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -25,6 +25,8 @@
|
||||
#include <QtXml>
|
||||
#include <iostream>
|
||||
|
||||
#include <bitset>
|
||||
|
||||
#if __GNUC__
|
||||
#define PACK( __Declaration__ ) __Declaration__ __attribute__((__packed__))
|
||||
#else
|
||||
@@ -361,9 +363,9 @@ class RawSource {
|
||||
}
|
||||
|
||||
QString toString(const ModelData & model);
|
||||
|
||||
|
||||
RawSourceRange getRange(const ModelData & model, const GeneralSettings & settings, unsigned int flags=0) const;
|
||||
|
||||
|
||||
bool operator == ( const RawSource & other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
}
|
||||
@@ -1053,9 +1055,9 @@ class ModelData {
|
||||
};
|
||||
|
||||
class RadioData {
|
||||
public:
|
||||
public:
|
||||
GeneralSettings generalSettings;
|
||||
ModelData models[C9X_MAX_MODELS];
|
||||
ModelData models[C9X_MAX_MODELS];
|
||||
};
|
||||
|
||||
// TODO rename FlightPhase to FlightMode
|
||||
@@ -1161,6 +1163,8 @@ enum Capability {
|
||||
MavlinkTelemetry,
|
||||
HasInputDiff,
|
||||
HasMixerExpo,
|
||||
MixersMonitor,
|
||||
HasBatMeterRange
|
||||
};
|
||||
|
||||
class SimulatorInterface;
|
||||
@@ -1177,18 +1181,18 @@ class EEPROMInterface
|
||||
|
||||
inline BoardEnum getBoard() { return board; }
|
||||
|
||||
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||
virtual unsigned long load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||
|
||||
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
||||
virtual unsigned long loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
|
||||
|
||||
virtual int getSize(ModelData &) = 0;
|
||||
|
||||
|
||||
virtual int getSize(GeneralSettings &) = 0;
|
||||
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
||||
|
||||
virtual const int getEEpromSize() = 0;
|
||||
@@ -1303,9 +1307,34 @@ void RegisterEepromInterfaces();
|
||||
void UnregisterFirmwares();
|
||||
void registerOpenTxFirmwares();
|
||||
|
||||
bool LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
|
||||
bool LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
|
||||
bool LoadEepromXml(RadioData &radioData, QDomDocument &doc);
|
||||
enum EepromLoadErrors {
|
||||
NO_ERROR,
|
||||
|
||||
UNKNOWN_ERROR,
|
||||
UNSUPPORTED_NEWER_VERSION,
|
||||
WRONG_SIZE,
|
||||
WRONG_FILE_SYSTEM,
|
||||
NOT_OPENTX,
|
||||
NOT_TH9X,
|
||||
NOT_GRUVIN9X,
|
||||
NOT_ERSKY9X,
|
||||
NOT_ER9X,
|
||||
UNKNOWN_BOARD,
|
||||
WRONG_BOARD,
|
||||
BACKUP_NOT_SUPPORTED,
|
||||
|
||||
HAS_WARNINGS,
|
||||
WARNING_WRONG_FIRMWARE,
|
||||
|
||||
NUM_ERRORS
|
||||
};
|
||||
|
||||
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
|
||||
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
|
||||
|
||||
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
|
||||
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
|
||||
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
struct Option {
|
||||
const char * name;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -89,14 +89,17 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying er9x xml import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
Er9xGeneral er9xGeneral;
|
||||
memset(&er9xGeneral,0,sizeof(er9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
} else {
|
||||
radioData.generalSettings=er9xGeneral;
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
@@ -111,29 +114,35 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying er9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
Er9xGeneral er9xGeneral;
|
||||
|
||||
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
@@ -151,16 +160,19 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
break;
|
||||
default:
|
||||
std::cout << "not er9x\n";
|
||||
return false;
|
||||
errors.set(NOT_ER9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
|
||||
}
|
||||
radioData.generalSettings = er9xGeneral;
|
||||
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
Er9xModelData er9xModel;
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
@@ -170,16 +182,19 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
else {
|
||||
applyStickModeToModel(er9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = er9xModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -29,21 +29,21 @@ class Er9xInterface : public EEPROMInterface
|
||||
virtual ~Er9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
@@ -54,17 +54,17 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
|
||||
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
|
||||
|
||||
|
||||
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
|
||||
|
||||
|
||||
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
|
||||
|
||||
|
||||
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
|
||||
|
||||
|
||||
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
|
||||
|
||||
|
||||
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
|
||||
|
||||
};
|
||||
|
||||
@@ -54,6 +54,10 @@ class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
protected:
|
||||
|
||||
Er9xInterface * er9xInterface;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <QMessageBox>
|
||||
#include "ersky9xinterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include "ersky9xsimulator.h"
|
||||
@@ -120,14 +119,17 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying ersky9x xml import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
Ersky9xGeneral ersky9xGeneral;
|
||||
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
else {
|
||||
radioData.generalSettings=ersky9xGeneral;
|
||||
@@ -137,40 +139,48 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
if (ersky9xGeneral.myVers == 10) {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying ersky9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != EESIZE_SKY9X) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
Ersky9xGeneral ersky9xGeneral;
|
||||
|
||||
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
|
||||
@@ -182,21 +192,23 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
|
||||
break;
|
||||
default:
|
||||
std::cout << "not ersky9x\n";
|
||||
return false;
|
||||
errors.set(NOT_ERSKY9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
radioData.generalSettings = ersky9xGeneral;
|
||||
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
uint8_t buffer[4096];
|
||||
uint size;
|
||||
memset(buffer,0,sizeof(buffer));
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
|
||||
|
||||
// if (!efile->readRlc2((uint8_t*)&ersky9xModel, sizeof(Ersky9xModelData))) {
|
||||
size=efile->readRlc2(buffer, 4096);
|
||||
if (!size) {
|
||||
@@ -214,16 +226,19 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
|
||||
applyStickModeToModel(ersky9xModel, radioData.generalSettings.stickMode+1);
|
||||
radioData.models[i] = ersky9xModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -29,21 +29,21 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
virtual ~Ersky9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
@@ -54,17 +54,17 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
|
||||
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
|
||||
|
||||
|
||||
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
|
||||
|
||||
|
||||
QDomElement getGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); //parse out data to XML format
|
||||
|
||||
|
||||
QDomElement getModelDataXML(QDomDocument * qdoc, Ersky9xModelData_v11 * tmod, int modelNum, int mdver); //parse out data to XML format
|
||||
|
||||
|
||||
bool loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral * tgen); // get data from XML
|
||||
|
||||
|
||||
template <class T>
|
||||
bool loadModelDataXML(QDomDocument * qdoc, ModelData * model, int modelNum, int stickMode); // get data from XML
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
protected:
|
||||
|
||||
Ersky9xInterface * ersky9xInterface;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -93,24 +93,30 @@ bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != this->getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -118,14 +124,16 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (version == 0) {
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (efile->readRlc1(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,27 +153,35 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
break;
|
||||
default:
|
||||
std::cout << "not gruvin9x\n";
|
||||
return false;
|
||||
errors.set(NOT_GRUVIN9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (version == 5) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else if (version < 104) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else if (version <= 106) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
if (version == 5) {
|
||||
@@ -185,17 +201,21 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -30,21 +30,21 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
virtual ~Gruvin9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
#define FLAVOUR "gruvin9x"
|
||||
|
||||
#define EEPROM_VARIANT 3
|
||||
|
||||
@@ -67,6 +68,7 @@ namespace Open9xGruvin9x {
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
|
||||
@@ -56,6 +56,11 @@ class Open9xGruvin9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
#define FLAVOUR "9x128"
|
||||
|
||||
#define EEPROM_VARIANT SIMU_M128_VARIANTS
|
||||
#define GAUGES
|
||||
@@ -68,6 +69,7 @@ namespace OpenTxM128 {
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
|
||||
@@ -56,6 +56,11 @@ class OpenTxM128Simulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -52,10 +52,9 @@
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
#define FAS_OFFSET
|
||||
|
||||
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS
|
||||
#define GAUGES
|
||||
|
||||
#define FLAVOUR "9x"
|
||||
#define NUM_POTS 3
|
||||
|
||||
#undef min
|
||||
@@ -73,6 +72,7 @@ namespace OpenTxM64 {
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
|
||||
@@ -55,6 +55,11 @@ class OpenTxM64Simulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *)) {};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,9 +55,9 @@
|
||||
#define FAI_CHOICE
|
||||
#define FRSKY_STICKS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define EEPROM_VARIANT 3
|
||||
#define FLAVOUR "sky9x"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
@@ -76,9 +76,11 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
// #include "radio/src/debug.cpp" // only included once in Taranis simulator because functions are exported as C and don't support namespaces
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
@@ -98,6 +100,7 @@ namespace Open9xSky9x {
|
||||
#include "radio/src/logs.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/sdcard.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/templates.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
@@ -152,11 +155,9 @@ using namespace Open9xSky9x;
|
||||
Open9xSky9xSimulator::Open9xSky9xSimulator()
|
||||
{
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
}
|
||||
simuSdDirectory[i]=0;
|
||||
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
|
||||
}
|
||||
|
||||
bool Open9xSky9xSimulator::timer10ms()
|
||||
@@ -165,7 +166,7 @@ bool Open9xSky9xSimulator::timer10ms()
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Open9xSky9xSimulator::getLcd()
|
||||
::uint8_t * Open9xSky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
@@ -182,6 +183,7 @@ void Open9xSky9xSimulator::start(QByteArray & eeprom, bool tests)
|
||||
g_rotenc[0] = 0;
|
||||
memcpy(Open9xSky9x::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xSky9x::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartAudioThread(g.profile[g.id()].volumeGain());
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
@@ -189,12 +191,14 @@ void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(g.profile[g.id()].volumeGain());
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopAudioThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
@@ -216,27 +220,27 @@ void Open9xSky9xSimulator::setValues(TxInputs &inputs)
|
||||
void Open9xSky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xSky9x::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
::uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
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 = Open9xSky9x::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
::uint8_t idx = Open9xSky9x::modn12x3[4*getStickMode() + i];
|
||||
::int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::wheelEvent(uint8_t steps)
|
||||
void Open9xSky9xSimulator::wheelEvent(::uint8_t steps)
|
||||
{
|
||||
g_rotenc[0] += steps*4;
|
||||
}
|
||||
@@ -258,3 +262,13 @@ const char * Open9xSky9xSimulator::getError()
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Open9xSky9xSimulator::installTraceHook(void (*callback)(const char *)) {
|
||||
::traceCallback = callback;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,11 @@ class Open9xSky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *));
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,8 +55,9 @@
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 5
|
||||
#define FLAVOUR "taranis-plus"
|
||||
#define MIXERS_MONITOR
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
@@ -79,10 +80,12 @@ inline int geteepromsize() {
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/debug.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
@@ -109,10 +112,10 @@ inline int geteepromsize() {
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
// TODO Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
||||
#undef SDCARD
|
||||
#include "radio/src/sdcard.cpp"
|
||||
// Because FatFS in not C++ there cannot be namespaces there and the functions are defined several times!
|
||||
#define SKIP_FATFS_DECLARATION
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#define SDCARD
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/fonts.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
@@ -195,11 +198,8 @@ OpentxTaranisSimulator::OpentxTaranisSimulator()
|
||||
{
|
||||
taranisSimulatorBoard = GetEepromInterface()->getBoard();
|
||||
QString path=g.profile[g.id()].sdPath()+"/";
|
||||
int i=0;
|
||||
for (i=0; i< std::min(path.length(),1022); i++) {
|
||||
simuSdDirectory[i]=path.at(i).toAscii();
|
||||
}
|
||||
simuSdDirectory[i]=0;
|
||||
strncpy (simuSdDirectory, path.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
}
|
||||
|
||||
bool OpentxTaranisSimulator::timer10ms()
|
||||
@@ -208,7 +208,7 @@ bool OpentxTaranisSimulator::timer10ms()
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpentxTaranisSimulator::getLcd()
|
||||
::uint8_t * OpentxTaranisSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
@@ -224,18 +224,21 @@ void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartAudioThread(g.profile[g.id()].volumeGain());
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(g.profile[g.id()].volumeGain());
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopAudioThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
@@ -255,27 +258,27 @@ void OpentxTaranisSimulator::setValues(TxInputs &inputs)
|
||||
void OpentxTaranisSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = Open9xX9D::modn12x3[4*getStickMode() + idx];
|
||||
uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
uint8_t phase = getFlightMode();
|
||||
::uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (uint8_t idx=0; idx<4; idx++) {
|
||||
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 = Open9xX9D::modn12x3[4*getStickMode() + i];
|
||||
int16_t tmp = trims.values[i];
|
||||
::uint8_t idx = Open9xX9D::modn12x3[4*getStickMode() + i];
|
||||
::int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::wheelEvent(uint8_t steps)
|
||||
void OpentxTaranisSimulator::wheelEvent(::uint8_t steps)
|
||||
{
|
||||
// g_rotenc[0] += steps*4;
|
||||
}
|
||||
@@ -297,3 +300,18 @@ const char * OpentxTaranisSimulator::getError()
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
{
|
||||
frskySportProcessPacket(data);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::installTraceHook(void (*callback)(const char *)) {
|
||||
::traceCallback = callback;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,11 @@ class OpentxTaranisSimulator : public SimulatorInterface {
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len);
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *));
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -113,7 +113,7 @@ template <class T>
|
||||
bool OpenTxEepromInterface::loadModel(ModelData &model, uint8_t *data, int index, unsigned int stickMode)
|
||||
{
|
||||
T _model;
|
||||
|
||||
|
||||
if (!data) {
|
||||
// load from EEPROM
|
||||
efile->openRd(FILE_MODEL(index));
|
||||
@@ -300,16 +300,20 @@ bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, unsi
|
||||
return (sz == eeprom.size());
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import...";
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
if (size==4096) {
|
||||
int notnull=false;
|
||||
for (int i=2048; i<4096; i++) {
|
||||
@@ -319,52 +323,62 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
}
|
||||
if (notnull) {
|
||||
std::cout << " wrong size (" << size << ")\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
|
||||
errors.set(HAS_WARNINGS);
|
||||
errors.set(WARNING_WRONG_FIRMWARE);
|
||||
size=2048;
|
||||
}
|
||||
} else {
|
||||
std::cout << " wrong size (" << size << ")\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
|
||||
std::cout << " wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
|
||||
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << " version " << (unsigned int)version;
|
||||
|
||||
if (!checkVersion(version)) {
|
||||
EepromLoadErrors version_error = checkVersion(version);
|
||||
if (version_error != NO_ERROR) {
|
||||
std::cout << " not open9x\n";
|
||||
return false;
|
||||
errors.set(version_error);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!loadGeneral<OpenTxGeneralData>(radioData.generalSettings, version)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
std::cout << " variant " << radioData.generalSettings.variant;
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
if (!loadModel(version, radioData.models[i], NULL, i, radioData.generalSettings.variant, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
std::cout << " ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -399,7 +413,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
if (board == BOARD_M128) {
|
||||
variant |= M128_VARIANT;
|
||||
}
|
||||
|
||||
|
||||
int result = saveGeneral<OpenTxGeneralData>(radioData.generalSettings, board, version, variant);
|
||||
if (!result) {
|
||||
return 0;
|
||||
@@ -546,7 +560,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case FlightModesName:
|
||||
return (IS_TARANIS(board) ? 10 : 6);
|
||||
case GvarsName:
|
||||
return 6;
|
||||
return (IS_9X(board) ? 0 : 6);
|
||||
case HasChNames:
|
||||
return (IS_TARANIS(board) ? 1 : 0);
|
||||
case GvarsInCS:
|
||||
@@ -580,7 +594,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
else
|
||||
return 16;
|
||||
case SafetyChannelCustomFunction:
|
||||
return id.contains("noovveridech") ? 0 : 1;
|
||||
return id.contains("nooverridech") ? 0 : 1;
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
@@ -734,7 +748,11 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return id.contains("mavlink") ? 1 : 0;
|
||||
case HasInputDiff:
|
||||
case HasMixerExpo:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
return (IS_TARANIS(board) ? true : false);
|
||||
case MixersMonitor:
|
||||
return id.contains("mixersmon") ? 1 : 0;
|
||||
case HasBatMeterRange:
|
||||
return (IS_TARANIS(board) ? true : false);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -820,7 +838,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (proto) {
|
||||
@@ -843,7 +861,7 @@ size_t getSizeA(T (&)[SIZE]) {
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
{
|
||||
switch(version) {
|
||||
case 201:
|
||||
@@ -904,12 +922,13 @@ bool OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
break;
|
||||
case 217:
|
||||
// 3 logical switches removed on M128 / gruvin9x boards
|
||||
return UNSUPPORTED_NEWER_VERSION;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
return NOT_OPENTX;
|
||||
}
|
||||
|
||||
return true;
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
@@ -934,13 +953,16 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
|
||||
}
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
std::cout << "trying " << getName() << " backup import...";
|
||||
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
BoardEnum backupBoard = (BoardEnum)-1;
|
||||
@@ -956,12 +978,14 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
break;
|
||||
default:
|
||||
std::cout << " unknown board\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_BOARD);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (backupBoard != board) {
|
||||
std::cout << " not right board\n";
|
||||
return false;
|
||||
errors.set(WRONG_BOARD);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
uint8_t version = eeprom[4];
|
||||
@@ -971,29 +995,35 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
|
||||
std::cout << " version " << (unsigned int)version << " ";
|
||||
|
||||
if (!checkVersion(version)) {
|
||||
EepromLoadErrors version_error = checkVersion(version);
|
||||
if (version_error != NO_ERROR) {
|
||||
std::cout << " not open9x\n";
|
||||
return false;
|
||||
errors.set(version_error);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (size > esize-8) {
|
||||
std::cout << " wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (bcktype=='M') {
|
||||
if (!loadModel(version, radioData.models[index], &eeprom[8], size, variant)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << " backup type not supported\n";
|
||||
return false;
|
||||
errors.set(BACKUP_NOT_SUPPORTED);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << " ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
@@ -1241,7 +1271,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
|
||||
/* 9XR-Pro */
|
||||
openTx = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
|
||||
openTx->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
@@ -1260,7 +1290,7 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
|
||||
/* Taranis board */
|
||||
openTx = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
@@ -1268,15 +1298,19 @@ void registerOpenTxFirmwares()
|
||||
openTx->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
|
||||
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
|
||||
/* Taranis Plus board */
|
||||
openTx = new OpenTxFirmware("opentx-taranisplus", QObject::tr("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
openTx->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
openTx->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
openTx->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
openTx->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
openTx->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
|
||||
openTx->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use anymore on radios sold after Jan 1st, 2015"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -34,25 +34,25 @@ class OpenTxEepromInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &);
|
||||
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
const char * getName();
|
||||
|
||||
bool checkVersion(unsigned int version);
|
||||
EepromLoadErrors checkVersion(unsigned int version);
|
||||
|
||||
bool checkVariant(unsigned int version, unsigned int variant);
|
||||
|
||||
@@ -111,7 +111,7 @@ class OpenTxFirmware: public FirmwareInterface {
|
||||
}
|
||||
|
||||
virtual FirmwareInterface * getFirmwareVariant(const QString & id);
|
||||
|
||||
|
||||
virtual QString getStampUrl();
|
||||
|
||||
virtual QString getReleaseNotesUrl();
|
||||
@@ -123,7 +123,7 @@ class OpenTxFirmware: public FirmwareInterface {
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
virtual SimulatorInterface * getSimulator();
|
||||
|
||||
|
||||
};
|
||||
|
||||
void registerOpenTxFirmwares();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -57,31 +57,38 @@ const int Th9xInterface::getMaxModels()
|
||||
return 16;
|
||||
}
|
||||
|
||||
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying th9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
Th9xGeneral th9xGeneral;
|
||||
|
||||
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
|
||||
@@ -91,17 +98,19 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
break;
|
||||
default:
|
||||
std::cout << "not th9x\n";
|
||||
return false;
|
||||
errors.set(NOT_TH9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
|
||||
if (len != sizeof(Th9xGeneral)) {
|
||||
std::cout << "not th9x\n";
|
||||
return false;
|
||||
errors.set(NOT_TH9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
radioData.generalSettings = th9xGeneral;
|
||||
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
Th9xModelData th9xModel;
|
||||
efile->openRd(FILE_MODEL(i));
|
||||
@@ -110,16 +119,19 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
}
|
||||
else {
|
||||
radioData.models[i] = th9xModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* 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
|
||||
@@ -34,11 +34,11 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
|
||||
@@ -67,6 +67,11 @@ FlashInterface::FlashInterface(QString fileName):
|
||||
|
||||
if (flash_size > 0) {
|
||||
version = seekLabel(VERS_MARK);
|
||||
if (version.startsWith("opentx-")) {
|
||||
int index = version.lastIndexOf('-');
|
||||
flavour = version.mid(0, index);
|
||||
version = version.mid(index+1);
|
||||
}
|
||||
date = seekLabel(DATE_MARK);
|
||||
time = seekLabel(TIME_MARK);
|
||||
eepromId = seekLabel(EEPR_MARK);
|
||||
@@ -94,7 +99,7 @@ QString FlashInterface::seekString(const QString & string)
|
||||
if (start > 0) {
|
||||
start += string.length();
|
||||
int end = -1;
|
||||
for (int i=start; i<start+20; i++) {
|
||||
for (int i=start; i<start+50; i++) {
|
||||
char c = flash.at(i);
|
||||
if (c == '\0' || c == '\036') {
|
||||
end = i;
|
||||
@@ -305,6 +310,29 @@ bool FlashInterface::isValid()
|
||||
return isValidFlag;
|
||||
}
|
||||
|
||||
QString FlashInterface::getFlavour()
|
||||
{
|
||||
if (flavour == "opentx-x9dp")
|
||||
return "opentx-taranis-plus";
|
||||
else if (flavour == "opentx-x9d")
|
||||
return "opentx-taranis";
|
||||
else
|
||||
return flavour;
|
||||
}
|
||||
|
||||
bool FlashInterface::isHardwareCompatible(FlashInterface &previousFirmware)
|
||||
{
|
||||
QString newFlavour = getFlavour();
|
||||
if (newFlavour.isEmpty())
|
||||
return true;
|
||||
|
||||
QString previousFlavour = previousFirmware.getFlavour();
|
||||
if (previousFlavour.isEmpty())
|
||||
return true;
|
||||
|
||||
return (newFlavour == previousFlavour);
|
||||
}
|
||||
|
||||
uint FlashInterface::saveFlash(QString fileName)
|
||||
{
|
||||
uint8_t binflash[MAX_FSIZE];
|
||||
|
||||
@@ -47,6 +47,7 @@ class FlashInterface
|
||||
inline QString getDate() { return date; }
|
||||
inline QString getTime() { return time; }
|
||||
int getSize() { return flash_size; }
|
||||
QString getFlavour();
|
||||
inline QString getVersion() { return version; }
|
||||
unsigned int getVersionId() { return versionId; }
|
||||
inline int getEEpromVersion() { return eepromVersion; }
|
||||
@@ -60,6 +61,7 @@ class FlashInterface
|
||||
QImage::Format getSplashFormat();
|
||||
uint saveFlash(QString fileName);
|
||||
bool isValid();
|
||||
bool isHardwareCompatible(FlashInterface &previousFirmware);
|
||||
|
||||
private:
|
||||
QByteArray flash;
|
||||
@@ -72,6 +74,7 @@ class FlashInterface
|
||||
QString filename;
|
||||
QString date;
|
||||
QString time;
|
||||
QString flavour;
|
||||
QString version;
|
||||
int versionId;
|
||||
QString eepromId;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>416</width>
|
||||
<height>153</height>
|
||||
<height>154</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -177,6 +177,10 @@ May be different from firmware language</string>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>checkFWUpdates</tabstop>
|
||||
<tabstop>fw_dnld</tabstop>
|
||||
<tabstop>voiceCombo</tabstop>
|
||||
<tabstop>voice_dnld</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
+506
-474
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@ class GeneralEdit : public QDialog
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
|
||||
signals:
|
||||
void modelValuesChanged();
|
||||
|
||||
@@ -108,11 +108,11 @@ class GeneralEdit : public QDialog
|
||||
void on_bgVolume_SL_valueChanged();
|
||||
void on_varioVolume_SL_valueChanged();
|
||||
void on_wavVolume_SL_valueChanged();
|
||||
|
||||
|
||||
void on_varioP0_SB_editingFinished();
|
||||
void on_varioPMax_SB_editingFinished();
|
||||
void on_varioR0_SB_editingFinished();
|
||||
|
||||
|
||||
void on_pot1Type_currentIndexChanged(int index);
|
||||
void on_pot2Type_currentIndexChanged(int index);
|
||||
void on_pot3Type_currentIndexChanged(int index);
|
||||
@@ -128,6 +128,8 @@ class GeneralEdit : public QDialog
|
||||
void on_mavbaud_CB_currentIndexChanged(int index);
|
||||
void on_voiceLang_CB_currentIndexChanged(int index);
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_vBatMinDSB_editingFinished();
|
||||
void on_vBatMaxDSB_editingFinished();
|
||||
void on_battwarningDSB_editingFinished();
|
||||
void on_contrastSB_editingFinished();
|
||||
void on_calretrieve_PB_clicked();
|
||||
|
||||
+1517
-1372
File diff suppressed because it is too large
Load Diff
+117
-5
@@ -838,16 +838,40 @@ QString getTimerStr(TimerData & timer)
|
||||
return result;
|
||||
}
|
||||
|
||||
QString getProtocol(ModelData * g_model)
|
||||
QString getProtocol(ModuleData & module)
|
||||
{
|
||||
QString str = getProtocolStr(g_model->moduleData[0].protocol);
|
||||
|
||||
if (g_model->moduleData[0].protocol == PPM)
|
||||
str.append(QObject::tr(": %1 Channels, %2usec Delay").arg(g_model->moduleData[0].channelsCount).arg(g_model->moduleData[0].ppmDelay));
|
||||
QString str = getProtocolStr(module.protocol);
|
||||
|
||||
if (module.protocol == PPM)
|
||||
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
|
||||
else if (!module.protocol == OFF)
|
||||
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
|
||||
return str;
|
||||
}
|
||||
|
||||
QString getTrainerMode(const int trainermode, ModuleData & module)
|
||||
{
|
||||
QString result;
|
||||
switch (trainermode) {
|
||||
case 1:
|
||||
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
|
||||
break;
|
||||
case 2:
|
||||
result=QObject::tr("Master/SBUS Module");
|
||||
break;
|
||||
case 3:
|
||||
result=QObject::tr("Master/CPPM Module");
|
||||
break;
|
||||
case 4:
|
||||
result=QObject::tr("Master/SBUS in battery compartment");
|
||||
break;
|
||||
default:
|
||||
result=QObject::tr("Master/Jack");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
QString getPhasesStr(unsigned int phases, ModelData & model)
|
||||
{
|
||||
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
|
||||
@@ -1037,3 +1061,91 @@ QString generateProcessUniqueTempFileName(const QString & fileName)
|
||||
sanitizedFileName.remove('/');
|
||||
return QDir::tempPath() + QString("/%1-").arg(QCoreApplication::applicationPid()) + sanitizedFileName;
|
||||
}
|
||||
|
||||
bool isTempFileName(const QString & fileName)
|
||||
{
|
||||
return fileName.startsWith(QDir::tempPath());
|
||||
}
|
||||
|
||||
QString getSoundsPath(const GeneralSettings &generalSettings)
|
||||
{
|
||||
QString path = g.profile[g.id()].sdPath() + "/SOUNDS/";
|
||||
QString lang = generalSettings.ttsLanguage;
|
||||
if (lang.isEmpty())
|
||||
lang = "en";
|
||||
path.append(lang);
|
||||
return path;
|
||||
}
|
||||
|
||||
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen)
|
||||
{
|
||||
QSet<QString> result;
|
||||
QDir dir(path);
|
||||
if (dir.exists()) {
|
||||
foreach (QString filename, dir.entryList(filter, QDir::Files)) {
|
||||
QFileInfo file(filename);
|
||||
QString name = file.completeBaseName();
|
||||
if (name.length() <= maxLen) {
|
||||
result.insert(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool caseInsensitiveLessThan(const QString &s1, const QString &s2)
|
||||
{
|
||||
return s1.toLower() < s2.toLower();
|
||||
}
|
||||
|
||||
bool GpsGlitchFilter::isGlitch(double latitude, double longitude)
|
||||
{
|
||||
if ((fabs(latitude) < 0.1) && (fabs(longitude) < 0.1)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (lastValid) {
|
||||
if (fabs(latitude - lastLat) > 0.01) {
|
||||
// qDebug() << "GpsGlitchFilter(): latitude glitch " << latitude << lastLat;
|
||||
if ( ++glitchCount < 10) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (fabs(longitude - lastLon) > 0.01) {
|
||||
// qDebug() << "GpsGlitchFilter(): longitude glitch " << longitude << lastLon;
|
||||
if ( ++glitchCount < 10) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
lastLat = latitude;
|
||||
lastLon = longitude;
|
||||
lastValid = true;
|
||||
glitchCount = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GpsLatLonFilter::isValid(const QString & latitude, const QString & longitude)
|
||||
{
|
||||
if (lastLat == latitude) {
|
||||
return false;
|
||||
}
|
||||
if (lastLon == longitude) {
|
||||
return false;
|
||||
}
|
||||
lastLat = latitude;
|
||||
lastLon = longitude;
|
||||
return true;
|
||||
}
|
||||
|
||||
double toDecimalCoordinate(const QString & value)
|
||||
{
|
||||
if (value.isEmpty()) return 0.0;
|
||||
double temp = int(value.left(value.length()-1).toDouble() / 100);
|
||||
double result = temp + (value.left(value.length() - 1).toDouble() - temp * 100) / 60.0;
|
||||
QChar direction = value.at(value.size()-1);
|
||||
if ((direction == 'S') || (direction == 'W')) {
|
||||
result = -result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+35
-1
@@ -125,7 +125,8 @@ int findmult(float value, float base);
|
||||
|
||||
QString getTrimInc(ModelData * g_model);
|
||||
QString getTimerStr(TimerData & timer);
|
||||
QString getProtocol(ModelData * g_model);
|
||||
QString getProtocol(ModuleData & module);
|
||||
QString getTrainerMode(const int trainermode, ModuleData & module);
|
||||
QString getCenterBeepStr(ModelData * g_model);
|
||||
|
||||
/* FrSky helpers */
|
||||
@@ -154,5 +155,38 @@ class QTimeS : public QTime
|
||||
int qunlink(const QString & fileName);
|
||||
|
||||
QString generateProcessUniqueTempFileName(const QString & fileName);
|
||||
bool isTempFileName(const QString & fileName);
|
||||
|
||||
QString getSoundsPath(const GeneralSettings &generalSettings);
|
||||
QSet<QString> getFilesSet(const QString &path, const QStringList &filter, int maxLen);
|
||||
|
||||
bool caseInsensitiveLessThan(const QString &s1, const QString &s2);
|
||||
|
||||
|
||||
class GpsGlitchFilter
|
||||
{
|
||||
public:
|
||||
GpsGlitchFilter() : lastValid(false), glitchCount(0) {};
|
||||
bool isGlitch(double latitude, double longitude);
|
||||
|
||||
private:
|
||||
bool lastValid;
|
||||
int glitchCount;
|
||||
double lastLat;
|
||||
double lastLon;
|
||||
};
|
||||
|
||||
class GpsLatLonFilter
|
||||
{
|
||||
public:
|
||||
GpsLatLonFilter() {};
|
||||
bool isValid(const QString & latitude, const QString & longitude);
|
||||
|
||||
private:
|
||||
QString lastLat;
|
||||
QString lastLon;
|
||||
};
|
||||
|
||||
double toDecimalCoordinate(const QString & value);
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>685</width>
|
||||
<height>418</height>
|
||||
<height>432</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -441,6 +441,25 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>backLightColor</tabstop>
|
||||
<tabstop>joystickCB</tabstop>
|
||||
<tabstop>joystickChkB</tabstop>
|
||||
<tabstop>joystickcalButton</tabstop>
|
||||
<tabstop>simuSW</tabstop>
|
||||
<tabstop>snapshotPath</tabstop>
|
||||
<tabstop>snapshotPathButton</tabstop>
|
||||
<tabstop>snapshotClipboardCKB</tabstop>
|
||||
<tabstop>libraryPath</tabstop>
|
||||
<tabstop>libraryPathButton</tabstop>
|
||||
<tabstop>splashincludeCB</tabstop>
|
||||
<tabstop>SplashFileName</tabstop>
|
||||
<tabstop>SplashSelect</tabstop>
|
||||
<tabstop>splashLibraryButton</tabstop>
|
||||
<tabstop>clearImageButton</tabstop>
|
||||
<tabstop>InvertPixels</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
|
||||
+608
-486
File diff suppressed because it is too large
Load Diff
+50
-14
@@ -3,7 +3,38 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include "qcustomplot.h"
|
||||
#include "qcustomplot/qcustomplot.h"
|
||||
|
||||
#define INVALID_MIN 999999
|
||||
#define INVALID_MAX -999999
|
||||
|
||||
enum yaxes_t {
|
||||
firstLeft = 0,
|
||||
firstRight,
|
||||
secondLeft,
|
||||
secondRight,
|
||||
AXES_LIMIT // = 4
|
||||
};
|
||||
|
||||
struct coords {
|
||||
QVector<double> x, y;
|
||||
double min_y;
|
||||
double max_y;
|
||||
yaxes_t yaxis;
|
||||
QString name;
|
||||
};
|
||||
|
||||
struct minMax {
|
||||
double min;
|
||||
double max;
|
||||
};
|
||||
|
||||
struct plotsCollection {
|
||||
QVarLengthArray<struct coords> coords;
|
||||
double min_x;
|
||||
double max_x;
|
||||
bool tooManyRanges;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class logsDialog;
|
||||
@@ -12,38 +43,43 @@ namespace Ui {
|
||||
class logsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
|
||||
public:
|
||||
explicit logsDialog(QWidget *parent = 0);
|
||||
~logsDialog();
|
||||
|
||||
|
||||
private slots:
|
||||
void titleDoubleClick();
|
||||
void titleDoubleClick(QMouseEvent *evt, QCPPlotTitle *title);
|
||||
void axisLabelDoubleClick(QCPAxis* axis, QCPAxis::SelectablePart part);
|
||||
void legendDoubleClick(QCPLegend* legend, QCPAbstractLegendItem* item);
|
||||
void selectionChanged();
|
||||
void mousePress();
|
||||
void mouseWheel();
|
||||
void removeSelectedGraph();
|
||||
void removeAllGraphs();
|
||||
void moveLegend();
|
||||
void plotLogs();
|
||||
void plotValue(int index, int plot, int numplots);
|
||||
void plottableItemDoubleClick(QCPAbstractPlottable * plottable, QMouseEvent * event);
|
||||
// void graphClicked(QCPAbstractPlottable *plottable);
|
||||
void on_fileOpen_BT_clicked();
|
||||
void on_sessions_CB_currentIndexChanged(int index);
|
||||
void on_mapsButton_clicked();
|
||||
|
||||
void yAxisChangeRanges(QCPRange range);
|
||||
|
||||
private:
|
||||
QList<QStringList> csvlog;
|
||||
Ui::logsDialog *ui;
|
||||
bool cvsFileParse();
|
||||
double GetScale(QString channel);
|
||||
QList<QColor> palette;
|
||||
QCPAxisRect *axisRect;
|
||||
QCPLegend *rightLegend;
|
||||
bool plotLock;
|
||||
QString logFilename;
|
||||
|
||||
QVarLengthArray<Qt::GlobalColor> colors;
|
||||
QPen pen;
|
||||
|
||||
double yAxesRatios[AXES_LIMIT];
|
||||
minMax yAxesRanges[AXES_LIMIT];
|
||||
|
||||
bool cvsFileParse();
|
||||
QList<QStringList> filterGePoints(const QList<QStringList> & input);
|
||||
void exportToGoogleEarth();
|
||||
|
||||
};
|
||||
|
||||
#endif // LOGSDIALOG_H
|
||||
|
||||
@@ -283,10 +283,21 @@
|
||||
<customwidget>
|
||||
<class>QCustomPlot</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>./qcustomplot.h</header>
|
||||
<header>qcustomplot/qcustomplot.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>FileName_LE</tabstop>
|
||||
<tabstop>fileOpen_BT</tabstop>
|
||||
<tabstop>FieldsTW</tabstop>
|
||||
<tabstop>ZoomX_ChkB</tabstop>
|
||||
<tabstop>ZoomY_ChkB</tabstop>
|
||||
<tabstop>Reset_PB</tabstop>
|
||||
<tabstop>sessions_CB</tabstop>
|
||||
<tabstop>logTable</tabstop>
|
||||
<tabstop>mapsButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
|
||||
+198
-142
@@ -110,12 +110,12 @@ MainWindow::MainWindow():
|
||||
this->setIconSize(QSize(32, 32));
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
setAcceptDrops(true);
|
||||
|
||||
|
||||
// give time to the splash to disappear and main window to open before starting updates
|
||||
int updateDelay = 1000;
|
||||
bool showSplash = g.showSplash();
|
||||
if (showSplash) {
|
||||
updateDelay += (SPLASH_TIME*1000);
|
||||
updateDelay += (SPLASH_TIME*1000);
|
||||
}
|
||||
QTimer::singleShot(updateDelay, this, SLOT(doAutoUpdates()));
|
||||
QTimer::singleShot(updateDelay, this, SLOT(displayWarnings()));
|
||||
@@ -153,13 +153,13 @@ MainWindow::MainWindow():
|
||||
child->show();
|
||||
}
|
||||
else {
|
||||
child->show();
|
||||
child->show();
|
||||
child->print(model,printfilename);
|
||||
child->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (printing) {
|
||||
QTimer::singleShot(0, this, SLOT(autoClose()));
|
||||
}
|
||||
@@ -180,10 +180,48 @@ void MainWindow::displayWarnings()
|
||||
}
|
||||
}
|
||||
else if (warnId==0) {
|
||||
g.warningId(WARNING_ID);
|
||||
g.warningId(WARNING_ID);
|
||||
}
|
||||
}
|
||||
|
||||
QString MainWindow::getBackupPath() {
|
||||
QString backupPath;
|
||||
bool backupEnable = g.profile[g.id()].penableBackup();
|
||||
if (backupEnable) {
|
||||
backupPath=g.profile[g.id()].pBackupDir();
|
||||
if (!backupPath.isEmpty()) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
backupEnable = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
backupEnable = false;
|
||||
}
|
||||
}
|
||||
if (!backupEnable) {
|
||||
backupEnable=g.enableBackup();
|
||||
backupPath = g.backupDir();
|
||||
if (!backupPath.isEmpty()) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
backupEnable = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
backupEnable = false;
|
||||
}
|
||||
}
|
||||
if ((g.enableBackup() || g.profile[g.id()].penableBackup()) && !(backupEnable) && !IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
backupEnable=false;
|
||||
}
|
||||
if (!backupEnable) backupPath.clear();
|
||||
return backupPath;
|
||||
}
|
||||
|
||||
void MainWindow::doAutoUpdates()
|
||||
{
|
||||
if (g.autoCheckApp())
|
||||
@@ -278,15 +316,15 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
int c9xver = version2index(c9xversion);
|
||||
|
||||
if (c9xver < vnum) {
|
||||
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
|
||||
#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);
|
||||
|
||||
if (ret == QMessageBox::Yes) {
|
||||
#if defined __APPLE__
|
||||
#if defined __APPLE__
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version));
|
||||
#else
|
||||
#else
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.updatesDir() + QString(C9X_INSTALLER).arg(version), tr("Executable (*.exe)"));
|
||||
#endif
|
||||
if (!fileName.isEmpty()) {
|
||||
@@ -299,7 +337,7 @@ void MainWindow::checkForCompanionUpdateFinished(QNetworkReply * reply)
|
||||
}
|
||||
#else
|
||||
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available, please check the OpenTX website!"));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (downloadDialog_forWait && checkForUpdatesState==0) {
|
||||
@@ -409,7 +447,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setWindowTitle("Companion");
|
||||
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?").arg(current_firmware_variant->getId()).arg(versionString));
|
||||
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nRelease %2 is available.\nDo you want to download it now?\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()) {
|
||||
@@ -438,7 +476,7 @@ void MainWindow::checkForFirmwareUpdateFinished(QNetworkReply * reply)
|
||||
QString rn = GetCurrentFirmware()->getReleaseNotesUrl();
|
||||
QAbstractButton *rnButton = NULL;
|
||||
msgBox.setText("Companion");
|
||||
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now ?").arg(current_firmware_variant->getId()).arg(currentVersionString).arg(versionString));
|
||||
msgBox.setInformativeText(tr("A new version of %1 firmware is available:\n - current is %2\n - newer is %3\n\nDo you want to download it now?\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()) {
|
||||
@@ -526,9 +564,9 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||
}
|
||||
|
||||
void MainWindow::setLanguage(QString langString)
|
||||
{
|
||||
{
|
||||
g.locale( langString );
|
||||
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("The selected language will be used the next time you start Companion."));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
@@ -537,9 +575,9 @@ void MainWindow::setLanguage(QString langString)
|
||||
}
|
||||
|
||||
void MainWindow::setTheme(int index)
|
||||
{
|
||||
{
|
||||
g.theme( index );
|
||||
|
||||
|
||||
QMessageBox msgBox;
|
||||
msgBox.setText(tr("The new theme will be loaded the next time you start Companion."));
|
||||
msgBox.setIcon(QMessageBox::Information);
|
||||
@@ -548,7 +586,7 @@ void MainWindow::setTheme(int index)
|
||||
}
|
||||
|
||||
void MainWindow::setIconThemeSize(int index)
|
||||
{
|
||||
{
|
||||
g.iconSize( index );
|
||||
|
||||
QMessageBox msgBox;
|
||||
@@ -687,7 +725,7 @@ void MainWindow::fwchangelog()
|
||||
}
|
||||
|
||||
void MainWindow::customizeSplash()
|
||||
{
|
||||
{
|
||||
customizeSplashDialog *cd = new customizeSplashDialog(this);
|
||||
cd->exec();
|
||||
}
|
||||
@@ -863,7 +901,7 @@ QStringList MainWindow::GetSendFlashCommand(const QString &filename)
|
||||
QStringList ret;
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
ret=GetDFUUtilArguments("-D", filename);
|
||||
ret=GetDFUUtilArguments("-D", filename);
|
||||
}
|
||||
else if (eepromInterface->getBoard() == BOARD_SKY9X) {
|
||||
ret=GetSambaArguments(QString("send_file {Flash} \"") + filename + "\" 0x400000 0\n" + "FLASH::ScriptGPNMV 2\n");
|
||||
@@ -881,7 +919,7 @@ QStringList MainWindow::GetReceiveFlashCommand(const QString &filename)
|
||||
{
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (IS_TARANIS(eepromInterface->getBoard())) {
|
||||
return GetDFUUtilArguments("-U", filename);
|
||||
return GetDFUUtilArguments("-U", filename);
|
||||
}
|
||||
else if (eepromInterface->getBoard() == BOARD_SKY9X) {
|
||||
return GetSambaArguments(QString("receive_file {Flash} \"") + filename + "\" 0x400000 0x40000 0\n");
|
||||
@@ -950,7 +988,7 @@ void MainWindow::readEeprom()
|
||||
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
|
||||
if (IS_ARM(eepromInterface->getBoard()))
|
||||
if (IS_ARM(eepromInterface->getBoard()))
|
||||
tempFile = generateProcessUniqueTempFileName("temp.bin");
|
||||
else
|
||||
tempFile += generateProcessUniqueTempFileName("temp.hex");
|
||||
@@ -977,11 +1015,12 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
|
||||
file.remove();
|
||||
}
|
||||
|
||||
g.flashDir(QFileInfo(filename).dir().absolutePath());
|
||||
// g.flashDir(QFileInfo(filename).dir().absolutePath());
|
||||
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << path << "into" << filename;
|
||||
QStringList str;
|
||||
str << path << filename;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||
@@ -994,6 +1033,7 @@ bool MainWindow::readFirmwareFromRadio(const QString filename)
|
||||
|
||||
if (result == false) {
|
||||
QStringList str = GetReceiveFlashCommand(filename);
|
||||
qDebug() << "MainWindow::readFirmwareFromRadio(): reading" << filename << "with avrdude:" << str;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message);
|
||||
ad->setWindowIcon(CompanionIcon("read_flash.png"));
|
||||
ad->exec();
|
||||
@@ -1016,6 +1056,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard())) {
|
||||
QString path = FindMassstoragePath("FIRMWARE.BIN");
|
||||
if (!path.isEmpty()) {
|
||||
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << path << "from" << filename;
|
||||
QStringList str;
|
||||
str << filename << path;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, "", str, message);
|
||||
@@ -1028,6 +1069,7 @@ bool MainWindow::writeFirmwareToRadio(const QString filename)
|
||||
|
||||
if (result == false) {
|
||||
QStringList str = GetSendFlashCommand(filename);
|
||||
qDebug() << "MainWindow::writeFirmwareToRadio(): writing" << filename << "with avrdude:" << str;
|
||||
avrOutputDialog *ad = new avrOutputDialog(this, GetAvrdudeLocation(), str, message, AVR_DIALOG_CLOSE_IF_SUCCESSFUL);
|
||||
CompanionIcon iconw("write_flash.png");
|
||||
ad->setWindowIcon(iconw);
|
||||
@@ -1149,20 +1191,9 @@ void MainWindow::writeBackup()
|
||||
if (!isValidEEPROM(fileName))
|
||||
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret != QMessageBox::Yes) return;
|
||||
bool backupEnable = g.enableBackup();
|
||||
QString backupPath = g.backupDir();
|
||||
if (!backupPath.isEmpty()) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
if (backupEnable) {
|
||||
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
|
||||
}
|
||||
backupEnable = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
backupEnable = false;
|
||||
}
|
||||
|
||||
bool backupEnable=true;
|
||||
QString backupPath=getBackupPath();
|
||||
if (backupPath.isEmpty()) backupEnable=false;
|
||||
if (backup) {
|
||||
if (backupEnable) {
|
||||
QString backupFile = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
@@ -1171,7 +1202,6 @@ void MainWindow::writeBackup()
|
||||
}
|
||||
int oldrev = getEpromVersion(fileName);
|
||||
QString tempFlash = generateProcessUniqueTempFileName("flash.bin");
|
||||
|
||||
if (!readFirmwareFromRadio(tempFlash))
|
||||
return;
|
||||
|
||||
@@ -1217,7 +1247,7 @@ int MainWindow::getFileType(const QString &fullFileName)
|
||||
}
|
||||
|
||||
bool MainWindow::isValidEEPROM(QString eepromfile)
|
||||
{
|
||||
{
|
||||
int eeprom_size;
|
||||
QFile file(eepromfile);
|
||||
int fileType = getFileType(eepromfile);
|
||||
@@ -1232,10 +1262,12 @@ bool MainWindow::isValidEEPROM(QString eepromfile)
|
||||
return false;
|
||||
}
|
||||
file.close();
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
bool result = LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size);
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
delete radioData;
|
||||
return result;
|
||||
|
||||
return errors.test(NO_ERROR);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
@@ -1247,10 +1279,12 @@ bool MainWindow::isValidEEPROM(QString eepromfile)
|
||||
if (read != eeprom_size) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
bool result = LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size);
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
delete radioData;
|
||||
return result;
|
||||
|
||||
return errors.test(NO_ERROR);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1278,7 +1312,8 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
|
||||
file.close();
|
||||
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
if (!LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size) || !firmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR) || !firmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
|
||||
return false;
|
||||
|
||||
QFile file2(restoreFile);
|
||||
@@ -1295,79 +1330,95 @@ bool MainWindow::convertEEPROM(QString backupFile, QString restoreFile, QString
|
||||
|
||||
void MainWindow::writeFlash(QString fileToFlash)
|
||||
{
|
||||
QString fileName;
|
||||
bool backup = g.backupOnFlash();
|
||||
if(!fileToFlash.isEmpty())
|
||||
fileName = fileToFlash;
|
||||
burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);
|
||||
cd->exec();
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()))
|
||||
backup=false;
|
||||
if (!fileName.isEmpty()) {
|
||||
g.backupOnFlash(backup);
|
||||
if (backup) {
|
||||
QString backupFile = generateProcessUniqueTempFileName("backup.bin");
|
||||
bool backupEnable=g.enableBackup();
|
||||
QString backupPath=g.backupDir();
|
||||
if (!backupPath.isEmpty() && !IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
if (backupEnable) {
|
||||
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
|
||||
}
|
||||
backupEnable=false;
|
||||
qDebug() << "MainWindow::writeFlash(): started with" << fileToFlash;
|
||||
QString fileName;
|
||||
bool backup = g.backupOnFlash();
|
||||
if(!fileToFlash.isEmpty()) {
|
||||
fileName = fileToFlash;
|
||||
}
|
||||
|
||||
burnDialog *cd = new burnDialog(this, 2, &fileName, &backup);
|
||||
cd->exec();
|
||||
qDebug() << "MainWindow::writeFlash(): flashing " << fileName;
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
backup=false;
|
||||
}
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
if (g.checkHardwareCompatibility()) {
|
||||
QString tempFlash = generateProcessUniqueTempFileName("flash-check.bin");
|
||||
if (!readFirmwareFromRadio(tempFlash)) {
|
||||
QMessageBox::warning(this, tr("Firmware check failed"), tr("Could not check firmware from radio"));
|
||||
return;
|
||||
}
|
||||
FlashInterface previousFlash(tempFlash);
|
||||
qunlink(tempFlash);
|
||||
FlashInterface newFlash(fileName);
|
||||
qDebug() << "MainWindow::writeFlash(): checking firmware compatibility between " << tempFlash << "and" << fileName;
|
||||
if (!newFlash.isHardwareCompatible(previousFlash)) {
|
||||
QMessageBox::warning(this, tr("Firmware check failed"), tr("New firmware is not compatible with the one currently installed!"));
|
||||
if (isTempFileName(fileName)) {
|
||||
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
|
||||
qunlink(fileName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
g.backupOnFlash(backup);
|
||||
if (backup) {
|
||||
QString backupFile;
|
||||
QString backupPath=getBackupPath();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupFile = generateProcessUniqueTempFileName("backup.bin");
|
||||
}
|
||||
else {
|
||||
QDateTime datetime;
|
||||
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
}
|
||||
|
||||
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
|
||||
sleep(2);
|
||||
int res = writeFirmwareToRadio(fileName);
|
||||
if (res) {
|
||||
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
|
||||
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
|
||||
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
restoreFile = backupFile;
|
||||
}
|
||||
}
|
||||
else {
|
||||
backupEnable=false;
|
||||
}
|
||||
|
||||
if (backupEnable) {
|
||||
QDateTime datetime;
|
||||
backupFile.clear();
|
||||
backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
}
|
||||
|
||||
if (readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"))) {
|
||||
sleep(2);
|
||||
int res = writeFirmwareToRadio(fileName);
|
||||
if (res) {
|
||||
QString restoreFile = generateProcessUniqueTempFileName("restore.bin");
|
||||
if (!convertEEPROM(backupFile, restoreFile, fileName)) {
|
||||
QMessageBox::warning(this, tr("Conversion failed"), tr("Cannot convert Models and Settings for use with this firmware, original data will be used"));
|
||||
restoreFile = backupFile;
|
||||
}
|
||||
sleep(2);
|
||||
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
|
||||
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
|
||||
if (!writeEepromToRadio(restoreFile, tr("Restore Models and Settings To Radio"))) {
|
||||
QMessageBox::warning(this, tr("Restore failed"), tr("Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1").arg(backupFile));
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
|
||||
QMessageBox::warning(this, tr("Firmware write failed"), tr("Could not write firmware to radio. The models and settings data file can be found at: %1").arg(backupFile));
|
||||
}
|
||||
}
|
||||
else {
|
||||
bool backupEnable=g.enableBackup();
|
||||
QString backupPath=g.backupDir();
|
||||
if (!QDir(backupPath).exists()) {
|
||||
if (backupEnable) {
|
||||
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
|
||||
}
|
||||
backupEnable=false;
|
||||
}
|
||||
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
QDateTime datetime;
|
||||
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
writeFirmwareToRadio(fileName);
|
||||
QMessageBox::warning(this, tr("Backup failed"), tr("Cannot backup existing Models and Settings from Radio. Firmware write process aborted"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
bool backupEnable=true;
|
||||
QString backupPath=getBackupPath();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupEnable=false;
|
||||
}
|
||||
if (backupEnable && !IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
QDateTime datetime;
|
||||
QString backupFile = backupPath+"/backup-"+QDateTime().currentDateTime().toString("yyyy-MM-dd-hhmmss")+".bin";
|
||||
readEepromFromRadio(backupFile, tr("Backup Models and Settings From Radio"));
|
||||
sleep(2);
|
||||
}
|
||||
|
||||
writeFirmwareToRadio(fileName);
|
||||
}
|
||||
if (isTempFileName(fileName)) {
|
||||
qDebug() << "MainWindow::writeFlash(): removing temporary file" << fileName;
|
||||
qunlink(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::readBackup()
|
||||
@@ -1409,7 +1460,7 @@ void MainWindow::burnFuses()
|
||||
|
||||
void MainWindow::compare()
|
||||
{
|
||||
CompareDialog *fd = new CompareDialog(this);
|
||||
CompareDialog *fd = new CompareDialog(this,GetCurrentFirmware());
|
||||
fd->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
fd->show();
|
||||
}
|
||||
@@ -1433,7 +1484,7 @@ void MainWindow::about()
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(QString("Version %1, %2").arg(C9X_VERSION).arg(__DATE__));
|
||||
aboutStr.append("<br/><br/>");
|
||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2014<br/>");
|
||||
aboutStr.append(tr("Copyright OpenTX Team") + "<br/>© 2011-2015<br/>");
|
||||
QMessageBox msgBox(this);
|
||||
msgBox.setWindowIcon(CompanionIcon("information.png"));
|
||||
msgBox.setWindowTitle(tr("About Companion"));
|
||||
@@ -1449,7 +1500,7 @@ void MainWindow::updateMenus()
|
||||
pasteAct->setEnabled(hasMdiChild ? activeMdiChild()->hasPasteData() : false);
|
||||
writeEepromAct->setEnabled(hasMdiChild);
|
||||
separatorAct->setVisible(hasMdiChild);
|
||||
|
||||
|
||||
bool hasSelection = (activeMdiChild() && activeMdiChild()->hasSelection());
|
||||
cutAct->setEnabled(hasSelection);
|
||||
copyAct->setEnabled(hasSelection);
|
||||
@@ -1463,7 +1514,7 @@ void MainWindow::updateMenus()
|
||||
updateIconSizeActions();
|
||||
updateIconThemeActions();
|
||||
|
||||
setWindowTitle(tr("OpenTX Companion - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->getName()).arg( g.profile[g.id()].name() ));
|
||||
setWindowTitle(tr("OpenTX Companion 2.0 - FW: %1 - Profile: %2").arg(GetCurrentFirmware()->getName()).arg( g.profile[g.id()].name() ));
|
||||
}
|
||||
|
||||
MdiChild *MainWindow::createMdiChild()
|
||||
@@ -1492,7 +1543,7 @@ QAction * MainWindow::addAct(const QString & icon, const QString & sName, const
|
||||
QAction * newAction = new QAction( this );
|
||||
if (!icon.isEmpty())
|
||||
newAction->setIcon(CompanionIcon(icon));
|
||||
if (!sName.isEmpty())
|
||||
if (!sName.isEmpty())
|
||||
newAction->setText(sName);
|
||||
if (!lName.isEmpty())
|
||||
newAction->setStatusTip(lName);
|
||||
@@ -1513,7 +1564,7 @@ QAction * MainWindow::addAct(QActionGroup *aGroup, const QString & sName, const
|
||||
{
|
||||
QAction *action = addAct("", sName, lName, QKeySequence::UnknownKey, slot);
|
||||
action->setCheckable(true);
|
||||
aGroup->addAction(action);
|
||||
aGroup->addAction(action);
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -1547,7 +1598,7 @@ void MainWindow::createActions()
|
||||
cutAct = addAct("cut.png", tr("Cut Model"), tr("Cut current model to the clipboard"), QKeySequence::Cut, SLOT(cut()));
|
||||
copyAct = addAct("copy.png", tr("Copy Model"), tr("Copy current model to the clipboard"), QKeySequence::Copy, SLOT(copy()));
|
||||
pasteAct = addAct("paste.png", tr("Paste Model"), tr("Paste model from clipboard"), QKeySequence::Paste, SLOT(paste()));
|
||||
|
||||
|
||||
QActionGroup *themeAlignGroup = new QActionGroup(this);
|
||||
classicThemeAct = addAct( themeAlignGroup, tr("Classical"), tr("The classic companion9x icon theme"), SLOT(setClassicTheme()));
|
||||
yericoThemeAct = addAct( themeAlignGroup, tr("Yerico"), tr("Yellow round honey sweet icon theme"), SLOT(setYericoTheme()));
|
||||
@@ -1600,7 +1651,7 @@ void MainWindow::createActions()
|
||||
writeBackupToRadioAct = addAct("write_eeprom_file.png", tr("Write Backup to Radio"), tr("Write Backup from file to Radio"), SLOT(writeBackup()));
|
||||
readBackupToFileAct = addAct("read_eeprom_file.png", tr("Backup Radio to File"), tr("Save a complete backup file of all settings and model data in the Radio"), SLOT(readBackup()));
|
||||
contributorsAct = addAct("contributors.png", tr("Contributors..."), tr("A tribute to those who have contributed to OpenTX and Companion"), SLOT(contributors()));
|
||||
|
||||
|
||||
compareAct->setEnabled(false);
|
||||
simulateAct->setEnabled(false);
|
||||
printAct->setEnabled(false);
|
||||
@@ -1682,7 +1733,7 @@ void MainWindow::createMenus()
|
||||
burnMenu->addSeparator();
|
||||
burnMenu->addSeparator();
|
||||
EEPROMInterface *eepromInterface = GetEepromInterface();
|
||||
if (!IS_ARM(eepromInterface->getBoard())) {
|
||||
if (!IS_ARM(eepromInterface->getBoard())) {
|
||||
burnMenu->addAction(burnFusesAct);
|
||||
burnMenu->addAction(burnListAct);
|
||||
}
|
||||
@@ -1699,7 +1750,7 @@ void MainWindow::createMenus()
|
||||
helpMenu->addSeparator();
|
||||
helpMenu->addAction(contributorsAct);
|
||||
}
|
||||
|
||||
|
||||
QMenu *MainWindow::createRecentFileMenu()
|
||||
{
|
||||
QMenu *recentFileMenu = new QMenu(this);
|
||||
@@ -1740,7 +1791,7 @@ void MainWindow::createToolBars()
|
||||
break;
|
||||
default:
|
||||
size=QSize(24,24);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
fileToolBar = addToolBar(tr("File"));
|
||||
fileToolBar->setIconSize(size);
|
||||
@@ -1785,7 +1836,7 @@ void MainWindow::createToolBars()
|
||||
editToolBar->addAction(cutAct);
|
||||
editToolBar->addAction(copyAct);
|
||||
editToolBar->addAction(pasteAct);
|
||||
|
||||
|
||||
burnToolBar = new QToolBar(tr("Write"));
|
||||
addToolBar( Qt::LeftToolBarArea, burnToolBar );
|
||||
burnToolBar->setIconSize(size);
|
||||
@@ -1842,7 +1893,7 @@ void MainWindow::setActiveSubWindow(QWidget *window)
|
||||
void MainWindow::updateRecentFileActions()
|
||||
{
|
||||
int i, numRecentFiles;
|
||||
|
||||
|
||||
// Hide all document slots
|
||||
for ( i=0 ; i < g.historySize(); i++)
|
||||
recentFileActs[i]->setVisible(false);
|
||||
@@ -1850,7 +1901,7 @@ void MainWindow::updateRecentFileActions()
|
||||
// Fill slots with content and unhide them
|
||||
QStringList files = g.recentFiles();
|
||||
numRecentFiles = qMin(files.size(), g.historySize());
|
||||
|
||||
|
||||
for ( i = 0; i < numRecentFiles; i++) {
|
||||
QString text = strippedName(files[i]);
|
||||
if (!text.trimmed().isEmpty())
|
||||
@@ -1877,31 +1928,31 @@ void MainWindow::updateLanguageActions()
|
||||
{
|
||||
QString langId = g.locale();
|
||||
|
||||
if (langId=="")
|
||||
if (langId=="")
|
||||
sysLangAct->setChecked(true);
|
||||
else if (langId=="cs_CZ")
|
||||
else if (langId=="cs_CZ")
|
||||
czechLangAct->setChecked(true);
|
||||
else if (langId=="de_DE")
|
||||
else if (langId=="de_DE")
|
||||
germanLangAct->setChecked(true);
|
||||
else if (langId=="en")
|
||||
else if (langId=="en")
|
||||
englishLangAct->setChecked(true);
|
||||
else if (langId=="fi_FI")
|
||||
else if (langId=="fi_FI")
|
||||
finnishLangAct->setChecked(true);
|
||||
else if (langId=="fr_FR")
|
||||
else if (langId=="fr_FR")
|
||||
frenchLangAct->setChecked(true);
|
||||
else if (langId=="it_IT")
|
||||
else if (langId=="it_IT")
|
||||
italianLangAct->setChecked(true);
|
||||
else if (langId=="he_IL")
|
||||
else if (langId=="he_IL")
|
||||
hebrewLangAct->setChecked(true);
|
||||
else if (langId=="pl_PL")
|
||||
else if (langId=="pl_PL")
|
||||
polishLangAct->setChecked(true);
|
||||
else if (langId=="pt_PT")
|
||||
else if (langId=="pt_PT")
|
||||
portugueseLangAct->setChecked(true);
|
||||
else if (langId=="ru_RU")
|
||||
else if (langId=="ru_RU")
|
||||
russianLangAct->setChecked(true);
|
||||
else if (langId=="sv_SE")
|
||||
else if (langId=="sv_SE")
|
||||
swedishLangAct->setChecked(true);
|
||||
else if (langId=="nl_NL")
|
||||
else if (langId=="nl_NL")
|
||||
dutchLangAct->setChecked(true);
|
||||
}
|
||||
|
||||
@@ -1919,9 +1970,9 @@ void MainWindow::updateIconThemeActions()
|
||||
|
||||
void MainWindow::updateProfilesActions()
|
||||
{
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
{
|
||||
if (g.profile[i].existsOnDisk())
|
||||
if (g.profile[i].existsOnDisk())
|
||||
{
|
||||
QString text = tr("%2").arg(g.profile[i].name());
|
||||
profileActs[i]->setText(text);
|
||||
@@ -1929,8 +1980,8 @@ void MainWindow::updateProfilesActions()
|
||||
profileActs[i]->setVisible(true);
|
||||
if (i == g.id())
|
||||
profileActs[i]->setChecked(true);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
profileActs[i]->setVisible(false);
|
||||
}
|
||||
@@ -1944,7 +1995,7 @@ void MainWindow::createProfile()
|
||||
;
|
||||
if (i==MAX_PROFILES) //Failed to find free slot
|
||||
return;
|
||||
|
||||
|
||||
// Copy current profile to new and give it a new name
|
||||
g.profile[i] = g.profile[g.id()];
|
||||
g.profile[i].name(tr("New Radio"));
|
||||
@@ -1985,16 +2036,17 @@ int MainWindow::getEpromVersion(QString fileName)
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error opening file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
if (!LoadEepromXml(testData, doc)){
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(testData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
file.reset();
|
||||
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
QString hline = inputStream.readLine();
|
||||
@@ -2011,7 +2063,9 @@ int MainWindow::getEpromVersion(QString fileName)
|
||||
return -1;
|
||||
}
|
||||
file.close();
|
||||
if (!LoadEeprom(testData, eeprom, eeprom_size)) {
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(testData, eeprom, eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
QMessageBox::critical(this, tr("Error"),tr("Invalid Models and Settings File %1").arg(fileName));
|
||||
return -1;
|
||||
}
|
||||
@@ -2029,7 +2083,9 @@ int MainWindow::getEpromVersion(QString fileName)
|
||||
QMessageBox::critical(this, tr("Error"),tr("Error reading file %1:\n%2.").arg(fileName).arg(file.errorString()));
|
||||
return -1;
|
||||
}
|
||||
if (!LoadEeprom(testData, (uint8_t *)eeprom.data(), eeprom_size)) {
|
||||
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(testData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
QMessageBox::critical(this, tr("Error"),tr("Invalid binary Models and Settings File %1").arg(fileName));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ class MainWindow : public QMainWindow
|
||||
void closeEvent(QCloseEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dropEvent(QDropEvent *event);
|
||||
QString getBackupPath();
|
||||
|
||||
private slots:
|
||||
void openDocURL();
|
||||
|
||||
+39
-35
@@ -81,7 +81,7 @@ MdiChild::MdiChild():
|
||||
}
|
||||
}
|
||||
|
||||
MdiChild::~MdiChild()
|
||||
MdiChild::~MdiChild()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void MdiChild::modelEdit()
|
||||
|
||||
if (row == 0){
|
||||
generalEdit();
|
||||
}
|
||||
}
|
||||
else {
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
checkAndInitModel( row );
|
||||
@@ -251,7 +251,7 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
XmlInterface(inputStream).load(radioData);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
if (fileType==FILE_TYPE_HEX || fileType==FILE_TYPE_EEPE) { //read HEX file
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { //reading HEX TEXT file
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
@@ -260,18 +260,19 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
.arg(file.errorString()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
QDomDocument doc(ER9X_EEPROM_FILE_TYPE);
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if(xmlOK) {
|
||||
if (LoadEepromXml(radioData, doc)){
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(radioData, doc));
|
||||
if (errors.test(NO_ERROR)) {
|
||||
ui->modelsList->refreshList();
|
||||
if(resetCurrentFile) setCurrentFile(fileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
file.reset();
|
||||
|
||||
|
||||
QTextStream inputStream(&file);
|
||||
|
||||
if (fileType==FILE_TYPE_EEPE) { // read EEPE file header
|
||||
@@ -294,12 +295,14 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
|
||||
file.close();
|
||||
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size)) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Invalid EEPROM File %1")
|
||||
.arg(fileName));
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid EEPROM File %1").arg(fileName), errors.to_ulong());
|
||||
return false;
|
||||
}
|
||||
if (errors.test(HAS_WARNINGS)) {
|
||||
ShowEepromWarnings(this, tr("Warning"), errors.to_ulong());
|
||||
}
|
||||
|
||||
ui->modelsList->refreshList();
|
||||
if(resetCurrentFile) setCurrentFile(fileName);
|
||||
@@ -330,11 +333,18 @@ bool MdiChild::loadFile(const QString &fileName, bool resetCurrentFile)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LoadEeprom(radioData, eeprom, eeprom_size) && !LoadBackup(radioData, eeprom, eeprom_size, 0)) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Invalid binary EEPROM File %1")
|
||||
.arg(fileName));
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadEeprom(radioData, eeprom, eeprom_size));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
std::bitset<NUM_ERRORS> errorsBackup((unsigned long long)LoadBackup(radioData, eeprom, eeprom_size, 0));
|
||||
if (!errorsBackup.test(NO_ERROR)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary EEPROM File %1").arg(fileName), (errorsEeprom | errorsBackup).to_ulong());
|
||||
return false;
|
||||
}
|
||||
if (errorsBackup.test(HAS_WARNINGS)) {
|
||||
ShowEepromWarnings(this, tr("Warning"), errorsBackup.to_ulong());
|
||||
}
|
||||
} else if (errorsEeprom.test(HAS_WARNINGS)) {
|
||||
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
|
||||
}
|
||||
|
||||
ui->modelsList->refreshList();
|
||||
@@ -367,7 +377,7 @@ bool MdiChild::saveAs(bool isNew)
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
|
||||
#else
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(BIN_FILES_FILTER));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
QFileInfo fi(curFile);
|
||||
@@ -375,14 +385,14 @@ bool MdiChild::saveAs(bool isNew)
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName());
|
||||
#else
|
||||
fileName = QFileDialog::getSaveFileName(this, tr("Save As"), g.eepromDir() + "/" +fi.fileName(), tr(EEPROM_FILES_FILTER));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if (fileName.isEmpty())
|
||||
return false;
|
||||
g.eepromDir( QFileInfo(fileName).dir().absolutePath() );
|
||||
if (isNew)
|
||||
return saveFile(fileName);
|
||||
else
|
||||
else
|
||||
return saveFile(fileName,true);
|
||||
}
|
||||
|
||||
@@ -505,7 +515,7 @@ void MdiChild::setCurrentFile(const QString &fileName)
|
||||
files.prepend(fileName);
|
||||
while (files.size() > MaxRecentFiles)
|
||||
files.removeLast();
|
||||
|
||||
|
||||
g.recentFiles( files );
|
||||
}
|
||||
|
||||
@@ -516,17 +526,9 @@ QString MdiChild::strippedName(const QString &fullFileName)
|
||||
|
||||
void MdiChild::writeEeprom() // write to Tx
|
||||
{
|
||||
bool backupEnable=g.enableBackup();
|
||||
QString backupPath=g.backupDir();
|
||||
if (!backupPath.isEmpty()) {
|
||||
if (!QDir(backupPath).exists()) {
|
||||
if (backupEnable) {
|
||||
QMessageBox::warning(this, tr("Backup is impossible"), tr("The backup dir set in preferences does not exist"));
|
||||
}
|
||||
backupEnable=false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
bool backupEnable=true;
|
||||
QString backupPath=((MainWindow *)this->parent())->getBackupPath();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupEnable=false;
|
||||
}
|
||||
QString stickCal=g.profile[g.id()].stickPotCalib();
|
||||
@@ -602,7 +604,7 @@ void MdiChild::print(int model, QString filename)
|
||||
else if (ui->modelsList->currentRow() > 0) {
|
||||
pd = new PrintDialog(this, GetCurrentFirmware()/*firmware*/, &radioData.generalSettings, &radioData.models[ui->modelsList->currentRow()-1]);
|
||||
}
|
||||
|
||||
|
||||
if (pd) {
|
||||
pd->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
pd->show();
|
||||
@@ -654,12 +656,14 @@ bool MdiChild::loadBackup()
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index)) {
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
tr("Invalid binary backup File %1")
|
||||
.arg(fileName));
|
||||
std::bitset<NUM_ERRORS> errorsEeprom((unsigned long long)LoadBackup(radioData, (uint8_t *)eeprom.data(), eeprom_size, index));
|
||||
if (!errorsEeprom.test(NO_ERROR)) {
|
||||
ShowEepromErrors(this, tr("Error"), tr("Invalid binary backup File %1").arg(fileName), (errorsEeprom).to_ulong());
|
||||
return false;
|
||||
}
|
||||
if (errorsEeprom.test(HAS_WARNINGS)) {
|
||||
ShowEepromWarnings(this, tr("Warning"), errorsEeprom.to_ulong());
|
||||
}
|
||||
|
||||
ui->modelsList->refreshList();
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ class MdiChild : public QWidget
|
||||
void modelEdit();
|
||||
void wizardEdit();
|
||||
void openEditWindow();
|
||||
|
||||
|
||||
void cut();
|
||||
void copy();
|
||||
void paste();
|
||||
|
||||
@@ -109,19 +109,29 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
|
||||
QGraphicsScene *scene = new QGraphicsScene(ui->curvePreview);
|
||||
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
|
||||
ui->curvePreview->setScene(scene);
|
||||
|
||||
for (int i=0; i<firmware->getCapability(NumCurves); i++) {
|
||||
int numcurves=firmware->getCapability(NumCurves);
|
||||
int limit;
|
||||
if (numcurves>16) {
|
||||
limit=numcurves/2;
|
||||
} else {
|
||||
limit=numcurves;
|
||||
}
|
||||
for (int i=0; i<numcurves; i++) {
|
||||
visibleCurves[i] = false;
|
||||
|
||||
// The reset curve button
|
||||
QPushButton * reset = new QPushButton(this);
|
||||
reset->setProperty("index", i);
|
||||
reset->setMinimumSize(QSize(0, 0));
|
||||
reset->setMaximumSize(QSize(16, 16));
|
||||
reset->setIcon(CompanionIcon("clear.png"));
|
||||
reset->setIconSize(QSize(14, 14));
|
||||
connect(reset, SIGNAL(clicked()), this, SLOT(resetCurve()));
|
||||
ui->curvesLayout->addWidget(reset, i, 0, 1, 1);
|
||||
|
||||
if (i<limit) {
|
||||
ui->curvesLayout->addWidget(reset, i, 0, 1, 1);
|
||||
} else {
|
||||
ui->curvesLayout2->addWidget(reset, i-limit, 2, 1, 1);
|
||||
}
|
||||
// The edit curve button
|
||||
QPushButton * edit = new QPushButton(this);
|
||||
edit->setProperty("index", i);
|
||||
@@ -136,16 +146,31 @@ Curves::Curves(QWidget * parent, ModelData & model, GeneralSettings & generalSet
|
||||
edit->setPalette(palette);
|
||||
edit->setText(tr("Curve %1").arg(i+1));
|
||||
connect(edit, SIGNAL(clicked()), this, SLOT(editCurve()));
|
||||
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
|
||||
|
||||
if (i<limit) {
|
||||
ui->curvesLayout->addWidget(edit, i, 1, 1, 1);
|
||||
} else {
|
||||
ui->curvesLayout2->addWidget(edit, i-limit, 1, 1, 1);
|
||||
}
|
||||
|
||||
// The curve plot checkbox
|
||||
QCheckBox * plot = new QCheckBox(this);
|
||||
plot->setProperty("index", i);
|
||||
plot->setPalette(palette);
|
||||
connect(plot, SIGNAL(toggled(bool)), this, SLOT(plotCurve(bool)));
|
||||
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
|
||||
if (i<limit) {
|
||||
ui->curvesLayout->addWidget(plot, i, 2, 1, 1);
|
||||
} else {
|
||||
ui->curvesLayout2->addWidget(plot, i-limit, 0, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
QSpacerItem * item = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||
ui->curvesLayout->addItem(item,limit+1,1,1,1,0);
|
||||
if (limit!=numcurves) {
|
||||
QSpacerItem * item2 = new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding);
|
||||
ui->curvesLayout2->addItem(item2,limit+1,1,1,1,0);
|
||||
}
|
||||
|
||||
for (int i=0; i<C9X_MAX_POINTS; i++) {
|
||||
spnx[i] = new QSpinBox(this);
|
||||
spnx[i]->setProperty("index", i);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>718</width>
|
||||
<width>605</width>
|
||||
<height>539</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -125,6 +125,9 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="curvesLayout2"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
@@ -172,38 +175,25 @@
|
||||
<property name="title">
|
||||
<string>Curve Creator</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_76" rowstretch="0,0,0,0,0,0,0,0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="yMidLabel">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="curveTypeLabel_2">
|
||||
<property name="text">
|
||||
<string>Y at X=0</string>
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QComboBox" name="curveType"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="yMaxLabel">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="curveCoeffLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=100</string>
|
||||
<string>Coefficient</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="3">
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="curveCoeff">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -219,7 +209,83 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="yMinLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=-100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="yMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="yMidLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="yMid">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="yMaxLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="yMax">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="curveSideLabel">
|
||||
<property name="text">
|
||||
<string>Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QComboBox" name="curveSide">
|
||||
<item>
|
||||
<property name="text">
|
||||
@@ -238,77 +304,7 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMin">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="4">
|
||||
<widget class="QPushButton" name="curveApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="curveSideLabel">
|
||||
<property name="text">
|
||||
<string>Side</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="QSpinBox" name="yMid">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-100</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QComboBox" name="curveType"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="curveTypeLabel_2">
|
||||
<property name="text">
|
||||
<string>Curve type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="yMinLabel">
|
||||
<property name="text">
|
||||
<string>Y at X=-100</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="curveCoeffLabel">
|
||||
<property name="text">
|
||||
<string>Coefficient</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -321,6 +317,13 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="curveApply">
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -339,6 +342,19 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>curvePreview</tabstop>
|
||||
<tabstop>curvePoints</tabstop>
|
||||
<tabstop>curveCustom</tabstop>
|
||||
<tabstop>curveSmooth</tabstop>
|
||||
<tabstop>curveName</tabstop>
|
||||
<tabstop>curveCoeff</tabstop>
|
||||
<tabstop>yMin</tabstop>
|
||||
<tabstop>yMid</tabstop>
|
||||
<tabstop>yMax</tabstop>
|
||||
<tabstop>curveSide</tabstop>
|
||||
<tabstop>curveApply</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
#include "customfunctions.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
|
||||
@@ -69,36 +63,29 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
int num_fsw = firmware->getCapability(CustomFunctions);
|
||||
|
||||
if (!firmware->getCapability(VoicesAsNumbers)) {
|
||||
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
|
||||
QString temp = model.funcSw[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
if (!paramarmList.contains(temp)) {
|
||||
paramarmList.append(temp);
|
||||
}
|
||||
tracksSet.insert(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << tracksSet;
|
||||
}
|
||||
|
||||
QString path = g.profile[g.id()].sdPath();
|
||||
path.append("/SOUNDS/");
|
||||
QString lang = generalSettings.ttsLanguage;
|
||||
if (lang.isEmpty())
|
||||
lang="en";
|
||||
path.append(lang);
|
||||
QDir qd(path);
|
||||
int vml= firmware->getCapability(VoicesMaxLength);
|
||||
if (qd.exists()) {
|
||||
QStringList filters;
|
||||
filters << "*.wav" << "*.WAV";
|
||||
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
|
||||
QFileInfo fi(file);
|
||||
QString temp=fi.completeBaseName();
|
||||
if (!paramarmList.contains(temp) && temp.length()<=vml) {
|
||||
paramarmList.append(temp);
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
scriptsSet = getFilesSet(g.profile[g.id()].sdPath() + "/SCRIPTS", QStringList() << "*.lua", firmware->getCapability(VoicesMaxLength));
|
||||
for (int i=0; i<num_fsw; i++) {
|
||||
if (model.funcSw[i].func==FuncPlayScript) {
|
||||
QString temp = model.funcSw[i].paramarm;
|
||||
if (!temp.isEmpty()) {
|
||||
scriptsSet.insert(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
qDebug() << scriptsSet;
|
||||
}
|
||||
|
||||
CompanionIcon playIcon("play.png");
|
||||
@@ -124,7 +111,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
// The function
|
||||
fswtchFunc[i] = new QComboBox(this);
|
||||
fswtchFunc[i]->setProperty("index", i);
|
||||
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
|
||||
connect(fswtchFunc[i], SIGNAL(currentIndexChanged(int)), this, SLOT(functionEdited()));
|
||||
gridLayout->addWidget(fswtchFunc[i], i+1, 2);
|
||||
|
||||
QHBoxLayout *paramLayout = new QHBoxLayout();
|
||||
@@ -149,6 +136,13 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
connect(fswtchParam[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
|
||||
paramLayout->addWidget(fswtchParam[i]);
|
||||
|
||||
fswtchParamTime[i] = new QTimeEdit(this);
|
||||
fswtchParamTime[i]->setProperty("index", i);
|
||||
fswtchParamTime[i]->setAccelerated(true);
|
||||
fswtchParamTime[i]->setDisplayFormat("hh:mm:ss");
|
||||
connect(fswtchParamTime[i], SIGNAL(editingFinished()), this, SLOT(customFunctionEdited()));
|
||||
paramLayout->addWidget(fswtchParamTime[i]);
|
||||
|
||||
fswtchParamT[i] = new QComboBox(this);
|
||||
fswtchParamT[i]->setProperty("index", i);
|
||||
paramLayout->addWidget(fswtchParamT[i]);
|
||||
@@ -161,7 +155,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
|
||||
connect(fswtchParamArmT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited()));
|
||||
connect(fswtchParamArmT[i], SIGNAL(editTextChanged ( const QString)), this, SLOT(customFunctionEdited()));
|
||||
|
||||
|
||||
fswtchBLcolor[i] = new QSlider(this);
|
||||
fswtchBLcolor[i]->setProperty("index", i);
|
||||
fswtchBLcolor[i]->setMinimum(0);
|
||||
@@ -188,7 +182,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
fswtchEnable[i] = new QCheckBox(this);
|
||||
fswtchEnable[i]->setProperty("index", i);
|
||||
fswtchEnable[i]->setText(tr("ON"));
|
||||
fswtchEnable[i]->setFixedWidth( 50 );
|
||||
fswtchEnable[i]->setFixedWidth( 80 );
|
||||
repeatLayout->addWidget(fswtchEnable[i], i+1);
|
||||
connect(fswtchEnable[i], SIGNAL(stateChanged(int)), this, SLOT(customFunctionEdited()));
|
||||
}
|
||||
@@ -197,7 +191,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
|
||||
addDoubleSpring(gridLayout, 5, num_fsw+1);
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
|
||||
lock = false;
|
||||
}
|
||||
|
||||
@@ -264,6 +258,9 @@ void CustomFunctionsPanel::playMusic()
|
||||
phononCurrent = -1;
|
||||
}
|
||||
else {
|
||||
if (phononCurrent >= 0) {
|
||||
playBT[phononCurrent]->setIcon(CompanionIcon("play.png"));
|
||||
}
|
||||
phononCurrent = index;
|
||||
clickObject->clear();
|
||||
#ifdef __APPLE__
|
||||
@@ -281,21 +278,32 @@ void CustomFunctionsPanel::playMusic()
|
||||
#define CUSTOM_FUNCTION_NUMERIC_PARAM (1<<0)
|
||||
#define CUSTOM_FUNCTION_SOURCE_PARAM (1<<1)
|
||||
#define CUSTOM_FUNCTION_FILE_PARAM (1<<2)
|
||||
#define CUSTOM_FUNCTION_GV_MODE (1<<3)
|
||||
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<4)
|
||||
#define CUSTOM_FUNCTION_ENABLE (1<<5)
|
||||
#define CUSTOM_FUNCTION_REPEAT (1<<6)
|
||||
#define CUSTOM_FUNCTION_PLAY (1<<7)
|
||||
#define CUSTOM_FUNCTION_BL_COLOR (1<<8)
|
||||
#define CUSTOM_FUNCTION_TIME_PARAM (1<<3)
|
||||
#define CUSTOM_FUNCTION_GV_MODE (1<<4)
|
||||
#define CUSTOM_FUNCTION_GV_TOOGLE (1<<5)
|
||||
#define CUSTOM_FUNCTION_ENABLE (1<<6)
|
||||
#define CUSTOM_FUNCTION_REPEAT (1<<7)
|
||||
#define CUSTOM_FUNCTION_PLAY (1<<8)
|
||||
#define CUSTOM_FUNCTION_BL_COLOR (1<<9)
|
||||
|
||||
void CustomFunctionsPanel::customFunctionEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
|
||||
int index = sender()->property("index").toInt();
|
||||
refreshCustomFunction(index, true);
|
||||
emit modified();
|
||||
lock = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::functionEdited()
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
int index = sender()->property("index").toInt();
|
||||
fswtchParamArmT[index]->setCurrentIndex(0);
|
||||
refreshCustomFunction(index, true);
|
||||
emit modified();
|
||||
lock = false;
|
||||
}
|
||||
@@ -369,13 +377,11 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (index>=FuncSetTimer1 && index<=FuncSetTimer2) {
|
||||
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(0);
|
||||
fswtchParam[i]->setMaximum(59*60+59);
|
||||
fswtchParam[i]->setValue(model.funcSw[i].param);
|
||||
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM + CUSTOM_FUNCTION_ENABLE;
|
||||
if (modified) model.funcSw[i].param = QTimeS(fswtchParamTime[i]->time()).seconds();
|
||||
fswtchParamTime[i]->setMinimumTime(QTime(0, 0, 0));
|
||||
fswtchParamTime[i]->setMaximumTime(QTime(0, 59, 59));
|
||||
fswtchParamTime[i]->setTime(QTimeS(model.funcSw[i].param));
|
||||
widgetsMask |= CUSTOM_FUNCTION_TIME_PARAM + CUSTOM_FUNCTION_ENABLE;
|
||||
}
|
||||
else if (index==FuncVolume) {
|
||||
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
|
||||
@@ -438,11 +444,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
widgetsMask |= CUSTOM_FUNCTION_PLAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,6 +462,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
}
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, tracksSet);
|
||||
}
|
||||
else if (index==FuncPlaySound) {
|
||||
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
|
||||
@@ -481,6 +486,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
}
|
||||
}
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, scriptsSet);
|
||||
}
|
||||
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
|
||||
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
|
||||
@@ -498,6 +504,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
}
|
||||
|
||||
fswtchParam[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_NUMERIC_PARAM);
|
||||
fswtchParamTime[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_TIME_PARAM);
|
||||
fswtchParamGV[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_GV_TOOGLE);
|
||||
fswtchParamT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_SOURCE_PARAM);
|
||||
fswtchParamArmT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_FILE_PARAM);
|
||||
@@ -523,7 +530,6 @@ void CustomFunctionsPanel::update()
|
||||
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
|
||||
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
|
||||
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
|
||||
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
|
||||
}
|
||||
refreshCustomFunction(i);
|
||||
}
|
||||
@@ -544,7 +550,6 @@ void CustomFunctionsPanel::fswPaste()
|
||||
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
|
||||
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
|
||||
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
|
||||
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.funcSw[selectedFunction].paramarm, paramarmList);
|
||||
refreshCustomFunction(selectedFunction);
|
||||
lock = false;
|
||||
emit modified();
|
||||
@@ -630,14 +635,17 @@ void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList)
|
||||
void CustomFunctionsPanel::populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> ¶msList)
|
||||
{
|
||||
b->clear();
|
||||
b->addItem("----");
|
||||
|
||||
bool added = false;
|
||||
QString currentvalue(value);
|
||||
foreach ( QString entry, paramsList ) {
|
||||
// Convert set into list and sort it alphabetically case insensitive
|
||||
QStringList list = QStringList::fromSet(paramsList);
|
||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
foreach (QString entry, list) {
|
||||
b->addItem(entry);
|
||||
if (entry==currentvalue) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
@@ -683,7 +691,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
else if (function==FuncVolume) {
|
||||
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS);
|
||||
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS|POPULATE_SWITCHES);
|
||||
}
|
||||
else if (function==FuncPlayValue) {
|
||||
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QPushButton>
|
||||
#include <QTimeEdit>
|
||||
#ifdef PHONON
|
||||
#include <phonon/audiooutput.h>
|
||||
#include <phonon/mediaobject.h>
|
||||
@@ -43,6 +44,7 @@ class CustomFunctionsPanel : public ModelPanel
|
||||
|
||||
private slots:
|
||||
void customFunctionEdited();
|
||||
void functionEdited();
|
||||
void fsw_customContextMenuRequested(QPoint pos);
|
||||
void refreshCustomFunction(int index, bool modified=false);
|
||||
void onChildModified();
|
||||
@@ -59,15 +61,17 @@ class CustomFunctionsPanel : public ModelPanel
|
||||
void populateFuncCB(QComboBox *b, unsigned int value);
|
||||
void populateGVmodeCB(QComboBox *b, unsigned int value);
|
||||
void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0);
|
||||
void populateFuncParamArmTCB(QComboBox *b, char * value, QStringList & paramsList);
|
||||
void populateFuncParamArmTCB(QComboBox *b, char * value, const QSet<QString> & paramsList);
|
||||
|
||||
bool initialized;
|
||||
QStringList paramarmList;
|
||||
QSet<QString> tracksSet;
|
||||
QSet<QString> scriptsSet;
|
||||
int phononCurrent;
|
||||
QComboBox * fswtchSwtch[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchFunc[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QCheckBox * fswtchParamGV[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QDoubleSpinBox * fswtchParam[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QTimeEdit * fswtchParamTime[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QPushButton * playBT[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchParamT[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
QComboBox * fswtchParamArmT[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
#include "ui_expodialog.h"
|
||||
#include "helpers.h"
|
||||
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName) :
|
||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings,
|
||||
FirmwareInterface * firmware, QString & inputName) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ExpoDialog),
|
||||
model(model),
|
||||
@@ -62,6 +63,8 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
ui->inputName->setMaxLength(4);
|
||||
populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | POPULATE_TELEMETRY);
|
||||
ui->sourceCB->removeItem(0);
|
||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->inputName->setText(inputName);
|
||||
}
|
||||
else {
|
||||
ui->inputNameLabel->hide();
|
||||
@@ -87,9 +90,6 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
ui->lineName->setMaxLength(expolength);
|
||||
}
|
||||
|
||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->inputName->setText(inputName);
|
||||
|
||||
ui->lineName->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->lineName->setText(ed->name);
|
||||
|
||||
@@ -153,7 +153,8 @@ void ExpoDialog::valuesChanged()
|
||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||
|
||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||
strcpy(inputName, ui->inputName->text().toAscii().data());
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
inputName = ui->inputName->text();
|
||||
|
||||
ed->phases=0;
|
||||
for (int i=8; i>=0 ; i--) {
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace Ui {
|
||||
class ExpoDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings, FirmwareInterface * firmware, char * inputName);
|
||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, GeneralSettings & generalSettings,
|
||||
FirmwareInterface * firmware, QString & inputName);
|
||||
~ExpoDialog();
|
||||
|
||||
protected:
|
||||
@@ -30,7 +31,7 @@ class ExpoDialog : public QDialog {
|
||||
GeneralSettings & generalSettings;
|
||||
FirmwareInterface * firmware;
|
||||
ExpoData * ed;
|
||||
char * inputName;
|
||||
QString & inputName;
|
||||
GVarGroup * gvWeightGroup;
|
||||
GVarGroup * gvOffsetGroup;
|
||||
CurveGroup * curveGroup;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<height>414</height>
|
||||
<width>389</width>
|
||||
<height>488</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -481,6 +481,9 @@ If blank then the input is considered to be "ON" all the time.</string
|
||||
<tabstop>weightGV</tabstop>
|
||||
<tabstop>weightSB</tabstop>
|
||||
<tabstop>weightCB</tabstop>
|
||||
<tabstop>offsetGV</tabstop>
|
||||
<tabstop>offsetSB</tabstop>
|
||||
<tabstop>offsetCB</tabstop>
|
||||
<tabstop>curveTypeCB</tabstop>
|
||||
<tabstop>curveGVarCB</tabstop>
|
||||
<tabstop>curveValueCB</tabstop>
|
||||
|
||||
@@ -457,6 +457,24 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>name</tabstop>
|
||||
<tabstop>fadeIn</tabstop>
|
||||
<tabstop>swtch</tabstop>
|
||||
<tabstop>fadeOut</tabstop>
|
||||
<tabstop>trim2Use</tabstop>
|
||||
<tabstop>trim2Value</tabstop>
|
||||
<tabstop>trim1Use</tabstop>
|
||||
<tabstop>trim1Value</tabstop>
|
||||
<tabstop>trim3Use</tabstop>
|
||||
<tabstop>trim3Value</tabstop>
|
||||
<tabstop>trim4Use</tabstop>
|
||||
<tabstop>trim4Value</tabstop>
|
||||
<tabstop>trim2Slider</tabstop>
|
||||
<tabstop>trim3Slider</tabstop>
|
||||
<tabstop>trim1Slider</tabstop>
|
||||
<tabstop>trim4Slider</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -209,7 +209,9 @@ void FlightModePanel::update()
|
||||
|
||||
if (ui->gvGB->isVisible()) {
|
||||
for (int i=0; i<gvCount; i++) {
|
||||
gvNames[i]->setText(model.gvars_names[i]);
|
||||
if (firmware->getCapability(GvarsName) > 0) {
|
||||
gvNames[i]->setText(model.gvars_names[i]);
|
||||
}
|
||||
gvValues[i]->setDisabled(model.isGVarLinked(phaseIdx, i));
|
||||
gvValues[i]->setValue(model.getGVarValue(phaseIdx, i));
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard()) && phaseIdx == 0) {
|
||||
|
||||
@@ -216,18 +216,18 @@ void InputsPanel::gm_openExpo(int index)
|
||||
if(index<0 || index>=C9X_MAX_EXPOS) return;
|
||||
|
||||
ExpoData mixd(model.expoData[index]);
|
||||
char inputName[4+1];
|
||||
emit modified();
|
||||
update();
|
||||
|
||||
QString inputName;
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
strcpy(inputName, model.inputNames[mixd.chn]);
|
||||
inputName = model.inputNames[mixd.chn];
|
||||
|
||||
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings, firmware, inputName);
|
||||
if (g->exec()) {
|
||||
model.expoData[index] = mixd;
|
||||
if (firmware->getCapability(VirtualInputs))
|
||||
strcpy(model.inputNames[mixd.chn], inputName);
|
||||
strncpy(model.inputNames[mixd.chn], inputName.toAscii().data(), 4);
|
||||
emit modified();
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -213,7 +213,6 @@ void LogicalSwitchesPanel::edited()
|
||||
model.customSw[i].val1 = 0;
|
||||
model.customSw[i].val2 = 0;
|
||||
}
|
||||
model.customSw[i].andsw = 0;
|
||||
setSwitchWidgetVisibility(i);
|
||||
}
|
||||
|
||||
@@ -249,7 +248,7 @@ void LogicalSwitchesPanel::edited()
|
||||
else {
|
||||
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
|
||||
}
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix("(release)");
|
||||
}
|
||||
@@ -262,6 +261,7 @@ void LogicalSwitchesPanel::edited()
|
||||
}
|
||||
emit modified();
|
||||
lock = false;
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
mask &= ~DELAY_ENABLED;
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
|
||||
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, ValToTim(TimToVal(cswitchOffset[i]->value())-1));
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
|
||||
if (model.customSw[i].val3 == 0) {
|
||||
cswitchOffset2[i]->setSuffix(tr("(release)"));
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>364</width>
|
||||
<height>434</height>
|
||||
<width>412</width>
|
||||
<height>541</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -67,7 +67,7 @@
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay and slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
@@ -96,7 +96,7 @@ p, li { white-space: pre-wrap; }
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay and slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
@@ -125,7 +125,7 @@ p, li { white-space: pre-wrap; }
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay and slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
@@ -148,7 +148,7 @@ p, li { white-space: pre-wrap; }
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay ans Slow</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Delay and slow</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">These values control the speed and delay of the output of the mix. </p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
|
||||
@@ -611,6 +611,39 @@ If blank then the mix is considered to be "ON" all the time.</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>mixerName</tabstop>
|
||||
<tabstop>sourceCB</tabstop>
|
||||
<tabstop>weightGV</tabstop>
|
||||
<tabstop>weightCB</tabstop>
|
||||
<tabstop>weightSB</tabstop>
|
||||
<tabstop>offsetGV</tabstop>
|
||||
<tabstop>offsetCB</tabstop>
|
||||
<tabstop>offsetSB</tabstop>
|
||||
<tabstop>curveTypeCB</tabstop>
|
||||
<tabstop>curveGVarCB</tabstop>
|
||||
<tabstop>curveValueCB</tabstop>
|
||||
<tabstop>curveValueSB</tabstop>
|
||||
<tabstop>trimCB</tabstop>
|
||||
<tabstop>MixDR_CB</tabstop>
|
||||
<tabstop>cb_FP0</tabstop>
|
||||
<tabstop>cb_FP1</tabstop>
|
||||
<tabstop>cb_FP2</tabstop>
|
||||
<tabstop>cb_FP3</tabstop>
|
||||
<tabstop>cb_FP4</tabstop>
|
||||
<tabstop>cb_FP5</tabstop>
|
||||
<tabstop>cb_FP6</tabstop>
|
||||
<tabstop>cb_FP7</tabstop>
|
||||
<tabstop>cb_FP8</tabstop>
|
||||
<tabstop>switchesCB</tabstop>
|
||||
<tabstop>warningCB</tabstop>
|
||||
<tabstop>mltpxCB</tabstop>
|
||||
<tabstop>delayUpSB</tabstop>
|
||||
<tabstop>slowUpSB</tabstop>
|
||||
<tabstop>delayDownSB</tabstop>
|
||||
<tabstop>slowDownSB</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../companion.qrc"/>
|
||||
</resources>
|
||||
|
||||
@@ -92,6 +92,7 @@ void ModelEdit::addTab(ModelPanel *panel, QString text)
|
||||
panels << panel;
|
||||
QWidget * widget = new QWidget(ui->tabWidget);
|
||||
QVBoxLayout *baseLayout = new QVBoxLayout(widget);
|
||||
panel->update();
|
||||
VerticalScrollArea * area = new VerticalScrollArea(widget, panel);
|
||||
baseLayout->addWidget(area);
|
||||
ui->tabWidget->addTab(widget, text);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "helpers.h"
|
||||
#include "appdata.h"
|
||||
|
||||
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus):
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
timer(timer),
|
||||
ui(new Ui::Timer)
|
||||
@@ -35,6 +35,11 @@ TimerPanel::TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, Ge
|
||||
ui->persistent->addItem(tr("Persistent (manual reset)"), 2);
|
||||
|
||||
disableMouseScrolling();
|
||||
QWidget::setTabOrder(prevFocus, ui->value);
|
||||
QWidget::setTabOrder(ui->value, ui->mode);
|
||||
QWidget::setTabOrder(ui->mode, ui->countdownBeep);
|
||||
QWidget::setTabOrder(ui->countdownBeep, ui->minuteBeep);
|
||||
QWidget::setTabOrder(ui->minuteBeep, ui->persistent);
|
||||
|
||||
lock = false;
|
||||
}
|
||||
@@ -67,6 +72,11 @@ void TimerPanel::update()
|
||||
ui->minuteBeep->setChecked(timer.minuteBeep);
|
||||
}
|
||||
|
||||
QWidget * TimerPanel::getLastFocus()
|
||||
{
|
||||
return ui->persistent;
|
||||
}
|
||||
|
||||
void TimerPanel::on_value_editingFinished()
|
||||
{
|
||||
timer.val = ui->value->time().minute()*60 + ui->value->time().second();
|
||||
@@ -250,6 +260,11 @@ void ModulePanel::update()
|
||||
|
||||
ui->failsafesLayoutLabel->setVisible(mask & MASK_FAILSAFES);
|
||||
ui->failsafesFrame->setVisible(mask & MASK_FAILSAFES);
|
||||
|
||||
if (mask & MASK_CHANNELS_RANGE) {
|
||||
ui->channelsStart->setMaximum(32 - ui->channelsCount->value());
|
||||
ui->channelsCount->setMaximum(qMin(16, 32-ui->channelsStart->value()));
|
||||
}
|
||||
}
|
||||
|
||||
void ModulePanel::on_trainerMode_currentIndexChanged(int index)
|
||||
@@ -345,25 +360,10 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
QRegExp rx(CHAR_FOR_NAMES_REGEX);
|
||||
ui->name->setValidator(new QRegExpValidator(rx, this));
|
||||
ui->name->setMaxLength(IS_TARANIS(firmware->getBoard()) ? 12 : 10);
|
||||
|
||||
for (int i=0; i<C9X_MAX_TIMERS; i++) {
|
||||
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware);
|
||||
ui->gridLayout->addWidget(timers[i], 1+i, 1);
|
||||
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
}
|
||||
|
||||
for (int i=0; i<firmware->getCapability(NumModules); i++) {
|
||||
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
|
||||
ui->modulesLayout->addWidget(modules[i]);
|
||||
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
}
|
||||
|
||||
if (firmware->getCapability(ModelTrainerEnable)) {
|
||||
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
|
||||
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
|
||||
}
|
||||
|
||||
if (firmware->getCapability(ModelImage)) {
|
||||
QStringList items;
|
||||
items.append("");
|
||||
@@ -410,12 +410,21 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->modelImage_label->hide();
|
||||
ui->imagePreview->hide();
|
||||
}
|
||||
|
||||
QWidget *prevFocus = ui->image;
|
||||
for (int i=0; i<C9X_MAX_TIMERS; i++) {
|
||||
timers[i] = new TimerPanel(this, model, model.timers[i], generalSettings, firmware, prevFocus);
|
||||
ui->gridLayout->addWidget(timers[i], 1+i, 1);
|
||||
connect(timers[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
prevFocus = timers[i]->getLastFocus();
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(HasDisplayText)) {
|
||||
ui->displayText->hide();
|
||||
}
|
||||
|
||||
// Beep Center checkboxes
|
||||
prevFocus = ui->displayText;
|
||||
int analogs = 4 + firmware->getCapability(Pots);
|
||||
for (int i=0; i<analogs+firmware->getCapability(RotaryEncoders); i++) {
|
||||
QCheckBox * checkbox = new QCheckBox(this);
|
||||
@@ -424,9 +433,11 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->centerBeepLayout->addWidget(checkbox, 0, i+1);
|
||||
connect(checkbox, SIGNAL(toggled(bool)), this, SLOT(onBeepCenterToggled(bool)));
|
||||
centerBeepCheckboxes << checkbox;
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
|
||||
checkbox->hide();
|
||||
if (firmware->getBoard()==BOARD_TARANIS && i==6) {
|
||||
checkbox->hide();
|
||||
}
|
||||
QWidget::setTabOrder(prevFocus, checkbox);
|
||||
prevFocus = checkbox;
|
||||
}
|
||||
|
||||
// Startup switches warnings
|
||||
@@ -463,10 +474,14 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
connect(cb, SIGNAL(toggled(bool)), this, SLOT(startupSwitchToggled(bool)));
|
||||
startupSwitchesSliders << slider;
|
||||
startupSwitchesCheckboxes << cb;
|
||||
QWidget::setTabOrder(prevFocus, slider);
|
||||
QWidget::setTabOrder(slider, cb);
|
||||
prevFocus = cb;
|
||||
}
|
||||
ui->switchesStartupLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, firmware->getCapability(Switches));
|
||||
|
||||
// Pot warnings
|
||||
prevFocus = ui->potWarningMode;
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
for (int i=0; i<firmware->getCapability(Pots); i++) {
|
||||
QCheckBox * cb = new QCheckBox(this);
|
||||
@@ -478,6 +493,8 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==2) {
|
||||
cb->hide();
|
||||
}
|
||||
QWidget::setTabOrder(prevFocus, cb);
|
||||
prevFocus = cb;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -485,6 +502,17 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
ui->potWarningMode->hide();
|
||||
}
|
||||
|
||||
for (int i=0; i<firmware->getCapability(NumModules); i++) {
|
||||
modules[i] = new ModulePanel(this, model, model.moduleData[i], generalSettings, firmware, i);
|
||||
ui->modulesLayout->addWidget(modules[i]);
|
||||
connect(modules[i], SIGNAL(modified()), this, SLOT(onChildModified()));
|
||||
}
|
||||
|
||||
if (firmware->getCapability(ModelTrainerEnable)) {
|
||||
modules[C9X_NUM_MODULES] = new ModulePanel(this, model, model.moduleData[C9X_NUM_MODULES], generalSettings, firmware, -1);
|
||||
ui->modulesLayout->addWidget(modules[C9X_NUM_MODULES]);
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
lock = false;
|
||||
|
||||
@@ -20,10 +20,11 @@ class TimerPanel : public ModelPanel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware);
|
||||
TimerPanel(QWidget *parent, ModelData & model, TimerData & timer, GeneralSettings & generalSettings, FirmwareInterface * firmware, QWidget *prevFocus);
|
||||
virtual ~TimerPanel();
|
||||
|
||||
virtual void update();
|
||||
QWidget * getLastFocus();
|
||||
|
||||
private slots:
|
||||
void on_mode_currentIndexChanged(int index);
|
||||
|
||||
@@ -532,6 +532,19 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>name</tabstop>
|
||||
<tabstop>image</tabstop>
|
||||
<tabstop>throttleSource</tabstop>
|
||||
<tabstop>throttleTrim</tabstop>
|
||||
<tabstop>throttleWarning</tabstop>
|
||||
<tabstop>throttleReverse</tabstop>
|
||||
<tabstop>trimIncrement</tabstop>
|
||||
<tabstop>extendedLimits</tabstop>
|
||||
<tabstop>extendedTrims</tabstop>
|
||||
<tabstop>displayText</tabstop>
|
||||
<tabstop>potWarningMode</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>16</number>
|
||||
@@ -541,6 +541,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>trainerMode</tabstop>
|
||||
<tabstop>protocol</tabstop>
|
||||
<tabstop>channelsStart</tabstop>
|
||||
<tabstop>channelsCount</tabstop>
|
||||
<tabstop>ppmFrameLength</tabstop>
|
||||
<tabstop>ppmPolarity</tabstop>
|
||||
<tabstop>ppmDelay</tabstop>
|
||||
<tabstop>failsafeMode</tabstop>
|
||||
<tabstop>rxNumber</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -488,19 +488,6 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
||||
model.frsky.usrProto = 1;
|
||||
}
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
|
||||
if (IS_9XRPRO(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocolLabel->hide();
|
||||
ui->telemetryProtocol->hide();
|
||||
}
|
||||
|
||||
analogs[0] = new TelemetryAnalog(this, model.frsky.channels[0], model, generalSettings, firmware);
|
||||
ui->A1Layout->addWidget(analogs[0]);
|
||||
connect(analogs[0], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||
@@ -563,6 +550,19 @@ void TelemetryPanel::setup()
|
||||
|
||||
lock = true;
|
||||
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky S.PORT"), 0);
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D"), 1);
|
||||
if (IS_9XRPRO(firmware->getBoard())) {
|
||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||
}
|
||||
ui->telemetryProtocol->setCurrentIndex(model.telemetryProtocol);
|
||||
}
|
||||
else {
|
||||
ui->telemetryProtocolLabel->hide();
|
||||
ui->telemetryProtocol->hide();
|
||||
}
|
||||
|
||||
ui->rssiAlarm1SB->setValue(model.frsky.rssiAlarms[0].value);
|
||||
ui->rssiAlarm2SB->setValue(model.frsky.rssiAlarms[1].value);
|
||||
if (!IS_TARANIS(firmware->getBoard())) {
|
||||
@@ -709,8 +709,10 @@ void TelemetryPanel::populateCurrentSource()
|
||||
|
||||
void TelemetryPanel::on_telemetryProtocol_currentIndexChanged(int index)
|
||||
{
|
||||
model.telemetryProtocol = index;
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
model.telemetryProtocol = index;
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::onAnalogModified()
|
||||
@@ -720,16 +722,20 @@ void TelemetryPanel::onAnalogModified()
|
||||
|
||||
void TelemetryPanel::on_bladesCount_editingFinished()
|
||||
{
|
||||
model.frsky.blades = ui->bladesCount->value();
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
model.frsky.blades = ui->bladesCount->value();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_frskyProtoCB_currentIndexChanged(int index)
|
||||
{
|
||||
model.frsky.usrProto = index;
|
||||
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
|
||||
telemetryCustomScreens[i]->update();
|
||||
emit modified();
|
||||
if (!lock) {
|
||||
model.frsky.usrProto = index;
|
||||
for (int i=0; i<firmware->getCapability(TelemetryCustomScreens); i++)
|
||||
telemetryCustomScreens[i]->update();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_rssiAlarm1CB_currentIndexChanged(int index)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>850</width>
|
||||
<height>457</height>
|
||||
<width>749</width>
|
||||
<height>424</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -252,7 +252,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QGridLayout" name="gridLayout_66" columnstretch="1,0,0,0">
|
||||
<layout class="QGridLayout" name="gridLayout_66" columnstretch="0,0,0,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="VarioLabel_1">
|
||||
<property name="sizePolicy">
|
||||
@@ -277,6 +277,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
@@ -302,6 +305,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
@@ -327,6 +333,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -349,6 +358,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -500,21 +512,50 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0" columnstretch="1,0,1,0,1">
|
||||
<property name="horizontalSpacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="3" column="1">
|
||||
<widget class="QUnsignedAutoComboBox" name="frskyVoltCB">
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="frskyProtoCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FrSky Sensor Hub</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
@@ -530,49 +571,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QUnsignedAutoComboBox" name="frskyCurrentCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="current_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="bladesCount">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -580,6 +579,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -594,7 +596,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="blades_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
@@ -622,6 +624,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> mAh</string>
|
||||
</property>
|
||||
@@ -638,6 +643,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string> A</string>
|
||||
</property>
|
||||
@@ -675,25 +683,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
@@ -707,24 +696,43 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="frskyProtoCB">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="current_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current source</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QUnsignedAutoComboBox" name="frskyVoltCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<widget class="QUnsignedAutoComboBox" name="frskyCurrentCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>FrSky Sensor Hub</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -756,19 +764,20 @@
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="rssiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="rssiAlarm1Label">
|
||||
<property name="sizePolicy">
|
||||
@@ -832,6 +841,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -909,6 +921,9 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -926,19 +941,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="rssiLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>RSSI</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
@@ -1005,6 +1007,27 @@
|
||||
<header>qautocombobox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>telemetryProtocol</tabstop>
|
||||
<tabstop>rssiAlarm1CB</tabstop>
|
||||
<tabstop>rssiAlarm1SB</tabstop>
|
||||
<tabstop>rssiAlarm2CB</tabstop>
|
||||
<tabstop>rssiAlarm2SB</tabstop>
|
||||
<tabstop>varioSourceCB</tabstop>
|
||||
<tabstop>varioLimitMin_DSB</tabstop>
|
||||
<tabstop>varioLimitCenterMin_DSB</tabstop>
|
||||
<tabstop>varioLimitCenterMax_DSB</tabstop>
|
||||
<tabstop>varioLimitMax_DSB</tabstop>
|
||||
<tabstop>AltitudeGPS_ChkB</tabstop>
|
||||
<tabstop>AltitudeToolbar_ChkB</tabstop>
|
||||
<tabstop>frskyProtoCB</tabstop>
|
||||
<tabstop>fasOffset_DSB</tabstop>
|
||||
<tabstop>mahCount_SB</tabstop>
|
||||
<tabstop>mahCount_ChkB</tabstop>
|
||||
<tabstop>frskyVoltCB</tabstop>
|
||||
<tabstop>bladesCount</tabstop>
|
||||
<tabstop>customScreens</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>276</width>
|
||||
<height>118</height>
|
||||
<height>106</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -21,252 +21,8 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_11" columnstretch="1,1,1,1" columnminimumwidth="0,0,0,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_918">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_Max">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max Value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="alarm1Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 1 </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="alarm1LevelCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="alarm1GreaterCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>></string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="alarm2Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="alarm2LevelCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QComboBox" name="alarm2GreaterCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>></string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="RatioSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QDoubleSpinBox" name="CalibSB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-12.800000000000001</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>12.699999999999999</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QDoubleSpinBox" name="alarm1ValueSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QDoubleSpinBox" name="alarm2ValueSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="CalibLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<layout class="QGridLayout" name="gridLayout_11" columnstretch="0,0,0,0,0">
|
||||
<item row="0" column="1" colspan="4">
|
||||
<widget class="QComboBox" name="UnitCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -321,10 +77,342 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="alarm2Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QComboBox" name="alarm1LevelCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="alarm1GreaterCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>></string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="alarm1ValueSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_Max">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Max Value</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0,1">
|
||||
<item>
|
||||
<widget class="QComboBox" name="alarm2LevelCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>----</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Yellow</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Orange</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Red</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="alarm2GreaterCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string><</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>></string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDoubleSpinBox" name="alarm2ValueSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="alarm1Label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Alarm 1 </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_918">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="RatioSB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>255.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QDoubleSpinBox" name="CalibSB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>70</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-12.800000000000001</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>12.699999999999999</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="CalibLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>UnitCB</tabstop>
|
||||
<tabstop>RatioSB</tabstop>
|
||||
<tabstop>CalibSB</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1625,22 +1625,91 @@ May be different from firmware language</string>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>InvertPixels</tabstop>
|
||||
<tabstop>clearImageButton</tabstop>
|
||||
<tabstop>showSplash</tabstop>
|
||||
<tabstop>startupCheck_companion9x</tabstop>
|
||||
<tabstop>startupCheck_fw</tabstop>
|
||||
<tabstop>historySize</tabstop>
|
||||
<tabstop>wizardEnable_ChkB</tabstop>
|
||||
<tabstop>backupPath</tabstop>
|
||||
<tabstop>backupPathButton</tabstop>
|
||||
<tabstop>backupEnable</tabstop>
|
||||
<tabstop>ge_lineedit</tabstop>
|
||||
<tabstop>ge_pathButton</tabstop>
|
||||
<tabstop>SplashFileName</tabstop>
|
||||
<tabstop>splashLibraryButton</tabstop>
|
||||
<tabstop>SplashSelect</tabstop>
|
||||
<tabstop>splashincludeCB</tabstop>
|
||||
<tabstop>libraryPath</tabstop>
|
||||
<tabstop>libraryPathButton</tabstop>
|
||||
<tabstop>downloadVerCB</tabstop>
|
||||
<tabstop>fw_dnld</tabstop>
|
||||
<tabstop>optionCheckBox_1</tabstop>
|
||||
<tabstop>optionCheckBox_2</tabstop>
|
||||
<tabstop>checkFWUpdates</tabstop>
|
||||
<tabstop>channelorderCB</tabstop>
|
||||
<tabstop>InvertPixels</tabstop>
|
||||
<tabstop>clearImageButton</tabstop>
|
||||
<tabstop>backLightColor</tabstop>
|
||||
<tabstop>simuSW</tabstop>
|
||||
<tabstop>joystickChkB</tabstop>
|
||||
<tabstop>joystickCB</tabstop>
|
||||
<tabstop>joystickcalButton</tabstop>
|
||||
<tabstop>snapshotClipboardCKB</tabstop>
|
||||
<tabstop>snapshotPath</tabstop>
|
||||
<tabstop>snapshotPathButton</tabstop>
|
||||
<tabstop>downloadVerCB</tabstop>
|
||||
<tabstop>langCombo</tabstop>
|
||||
<tabstop>fw_dnld</tabstop>
|
||||
<tabstop>sdPath</tabstop>
|
||||
<tabstop>sdPathButton</tabstop>
|
||||
<tabstop>voiceCombo</tabstop>
|
||||
<tabstop>voice_dnld</tabstop>
|
||||
<tabstop>optionCheckBox_1</tabstop>
|
||||
<tabstop>optionCheckBox_2</tabstop>
|
||||
<tabstop>optionCheckBox_3</tabstop>
|
||||
<tabstop>optionCheckBox_4</tabstop>
|
||||
<tabstop>optionCheckBox_5</tabstop>
|
||||
<tabstop>optionCheckBox_6</tabstop>
|
||||
<tabstop>optionCheckBox_7</tabstop>
|
||||
<tabstop>optionCheckBox_8</tabstop>
|
||||
<tabstop>optionCheckBox_9</tabstop>
|
||||
<tabstop>optionCheckBox_10</tabstop>
|
||||
<tabstop>optionCheckBox_11</tabstop>
|
||||
<tabstop>optionCheckBox_12</tabstop>
|
||||
<tabstop>optionCheckBox_13</tabstop>
|
||||
<tabstop>optionCheckBox_14</tabstop>
|
||||
<tabstop>optionCheckBox_15</tabstop>
|
||||
<tabstop>optionCheckBox_16</tabstop>
|
||||
<tabstop>optionCheckBox_17</tabstop>
|
||||
<tabstop>optionCheckBox_18</tabstop>
|
||||
<tabstop>optionCheckBox_19</tabstop>
|
||||
<tabstop>optionCheckBox_20</tabstop>
|
||||
<tabstop>optionCheckBox_21</tabstop>
|
||||
<tabstop>optionCheckBox_22</tabstop>
|
||||
<tabstop>optionCheckBox_23</tabstop>
|
||||
<tabstop>optionCheckBox_24</tabstop>
|
||||
<tabstop>optionCheckBox_25</tabstop>
|
||||
<tabstop>optionCheckBox_26</tabstop>
|
||||
<tabstop>optionCheckBox_27</tabstop>
|
||||
<tabstop>optionCheckBox_28</tabstop>
|
||||
<tabstop>optionCheckBox_29</tabstop>
|
||||
<tabstop>optionCheckBox_30</tabstop>
|
||||
<tabstop>optionCheckBox_31</tabstop>
|
||||
<tabstop>optionCheckBox_32</tabstop>
|
||||
<tabstop>optionCheckBox_33</tabstop>
|
||||
<tabstop>optionCheckBox_34</tabstop>
|
||||
<tabstop>optionCheckBox_35</tabstop>
|
||||
<tabstop>optionCheckBox_36</tabstop>
|
||||
<tabstop>optionCheckBox_37</tabstop>
|
||||
<tabstop>optionCheckBox_38</tabstop>
|
||||
<tabstop>optionCheckBox_39</tabstop>
|
||||
<tabstop>optionCheckBox_40</tabstop>
|
||||
<tabstop>optionCheckBox_41</tabstop>
|
||||
<tabstop>optionCheckBox_42</tabstop>
|
||||
<tabstop>checkFWUpdates</tabstop>
|
||||
<tabstop>renameFirmware</tabstop>
|
||||
<tabstop>burnFirmware</tabstop>
|
||||
<tabstop>stickmodeCB</tabstop>
|
||||
<tabstop>channelorderCB</tabstop>
|
||||
<tabstop>ProfSlot_SB</tabstop>
|
||||
<tabstop>ProfName_LE</tabstop>
|
||||
<tabstop>ProfSave_PB</tabstop>
|
||||
<tabstop>import_PB</tabstop>
|
||||
<tabstop>export_PB</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
|
||||
+106
-75
@@ -113,8 +113,17 @@ void PrintDialog::printSetup()
|
||||
str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model))));
|
||||
str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down
|
||||
str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay,
|
||||
str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString()));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("Internal Radio System") : tr("Radio System") )+"</b><br> "); //proto, numch, delay,
|
||||
}
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[0])));
|
||||
if (firmware->getCapability(NumModules)>1) {
|
||||
str.append("<b>"+(IS_TARANIS(firmware->getBoard()) ? tr("External Radio Module") : tr("Extra Radio System"))+"</b><br> "); //proto, numch, delay,
|
||||
str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[1])));
|
||||
}
|
||||
if (IS_TARANIS(firmware->getBoard())){
|
||||
str.append(fv(tr("Trainer port mode"), getTrainerMode(g_model->trainerMode, g_model->moduleData[2])));
|
||||
}
|
||||
str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled")));
|
||||
str.append(fv(tr("Trim Increment"), getTrimInc(g_model)));
|
||||
str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep
|
||||
@@ -130,7 +139,7 @@ void PrintDialog::printSetup()
|
||||
|
||||
QString PrintDialog::printFlightModes()
|
||||
{
|
||||
QString str="";
|
||||
QString str = "";
|
||||
str.append(QString("<table border=1 cellspacing=0 cellpadding=3 width=\"100%\"><tr><td colspan=%1><h2>").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvars+firmware->getCapability(RotaryEncoders)));
|
||||
str.append(tr("Flight modes"));
|
||||
str.append("</h2></td></tr><tr><td style=\"border-style:none;\"> </td><td colspan=2 align=center><b>");
|
||||
@@ -147,7 +156,7 @@ QString PrintDialog::printFlightModes()
|
||||
QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure
|
||||
for (int i=0; i<4; i++) {
|
||||
GeneralSettings generalSettings = *g_eeGeneral;
|
||||
str.append(QString("<td align=\"center\" nowrap><b>%1</b></td>").arg(labels[CONVERT_MODE(i+1)-1]));
|
||||
str.append(QString("<td align=\"center\" nowrap><b>%1</b></td>").arg((QString)labels[CONVERT_MODE(i+1)-1]));
|
||||
}
|
||||
for (unsigned int i=0; i<gvars; i++) {
|
||||
str.append(QString("<td align=\"center\" nowrap><b>GV%1</b><br>%2</td>").arg(i+1).arg(g_model->gvars_names[i]));
|
||||
@@ -158,38 +167,46 @@ QString PrintDialog::printFlightModes()
|
||||
str.append("</tr>");
|
||||
for (int i=0; i<firmware->getCapability(FlightModes); i++) {
|
||||
FlightModeData *pd=&g_model->flightModeData[i];
|
||||
str.append("<tr><td><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td>").arg(i).arg(pd->name));
|
||||
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale)));
|
||||
str.append(QString("<td width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale)));
|
||||
str.append("<tr><td valign=\"middle\"><b>"+tr("FM")+QString("%1</b> <font size=+1 face='Courier New' color=green>%2</font></td>").arg(i).arg(pd->name));
|
||||
str.append(QString("<td valign=\"middle\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale)));
|
||||
str.append(QString("<td valign=\"middle\" width=\"30\" align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale)));
|
||||
for (int k=0; k<4; k++) {
|
||||
//TODO trim values
|
||||
if (pd->trimRef[k]==-1) {
|
||||
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->trim[k]));
|
||||
//Almost done trim values
|
||||
if (pd->trimMode[k]==-1) {
|
||||
str.append(QString("<td valign=\"middle\" align=\"center\"><font size=+1 face='Courier New' color=grey>")+tr("Off")+QString("</font></td>"));
|
||||
} else {
|
||||
str.append("<td align=\"right\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(pd->trimRef[k]));
|
||||
if (pd->trimRef[k]==i) {
|
||||
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+QString("%1").arg(pd->trim[k])+QString("</font></td>"));
|
||||
} else {
|
||||
if (pd->trimMode[k]==0) {
|
||||
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1").arg(pd->trimRef[k])+QString("</font></td>"));
|
||||
} else {
|
||||
str.append("<td valign=\"middle\" align=\"center\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1+").arg(pd->trimRef[k])+QString("<br>%1").arg(pd->trim[k])+QString("</font></td>"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (unsigned int k=0; k<gvars; k++) {
|
||||
if (pd->gvars[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->gvars[k])+"</font></td>");
|
||||
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>%1").arg(pd->gvars[k])+"</font></td>");
|
||||
}
|
||||
else {
|
||||
int num = pd->gvars[k] - 1025;
|
||||
if (num>=i) num++;
|
||||
str.append("<td align=\"right\" ><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(num));
|
||||
str.append("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>"+tr("FM")+QString("%1</font></td>").arg(num));
|
||||
}
|
||||
}
|
||||
for (int k=0; k<firmware->getCapability(RotaryEncoders); k++) {
|
||||
if (pd->rotaryEncoders[k]<=1024) {
|
||||
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>");
|
||||
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>%1").arg(pd->rotaryEncoders[k])+"</font></td>");
|
||||
}
|
||||
else {
|
||||
int num = pd->rotaryEncoders[k] - 1025;
|
||||
if (num>=i) num++;
|
||||
str.append(QString("<td align=\"right\"><font size=+1 face='Courier New' color=green>")+tr("FM")+QString("%1</font></td>").arg(num));
|
||||
str.append(QString("<td align=\"right\" valign=\"middle\"><font size=+1 face='Courier New' color=green>")+tr("FM")+QString("%1</font></td>").arg(num));
|
||||
}
|
||||
}
|
||||
str.append(QString("<td align=center><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->swtch.toString()));
|
||||
str.append(QString("<td align=center valign=\"middle\"><font size=+1 face='Courier New' color=green>%1</font></td>").arg(pd->swtch.toString()));
|
||||
str.append("</tr>");
|
||||
}
|
||||
str.append("</table>");
|
||||
@@ -464,7 +481,7 @@ void PrintDialog::printLimits()
|
||||
|
||||
void PrintDialog::printCurves()
|
||||
{
|
||||
int i,r,g,b,c,count;
|
||||
int i,r,g,b,c,count,usedcurves=0;
|
||||
char buffer[16];
|
||||
QPen pen(Qt::black, 2, Qt::SolidLine);
|
||||
|
||||
@@ -475,27 +492,38 @@ void PrintDialog::printCurves()
|
||||
if (numcurves==0) {
|
||||
numcurves=16;
|
||||
}
|
||||
{
|
||||
QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32);
|
||||
QPainter painter(&qi);
|
||||
painter.setBrush(QBrush("#FFFFFF"));
|
||||
painter.setPen(QColor(0,0,0));
|
||||
painter.drawRect(0,0,ISIZEW,ISIZEW);
|
||||
str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5));
|
||||
for(i=0; i<numcurves; i++) {
|
||||
pen.setColor(colors[i]);
|
||||
painter.setPen(pen);
|
||||
colors[i].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
if(i%2 == 0) str.append("<tr>");
|
||||
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
if(i%2) str.append("</tr>");
|
||||
|
||||
QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32);
|
||||
QPainter painter(&qi);
|
||||
painter.setBrush(QBrush("#FFFFFF"));
|
||||
painter.setPen(QColor(0,0,0));
|
||||
painter.drawRect(0,0,ISIZEW,ISIZEW);
|
||||
str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5));
|
||||
for(i=0; i<numcurves; i++) {
|
||||
pen.setColor(colors[usedcurves]);
|
||||
painter.setPen(pen);
|
||||
colors[usedcurves].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
int curvepoints=g_model->curves[i].count;
|
||||
count=0;
|
||||
for(int j=0; j<curvepoints; j++) {
|
||||
if (g_model->curves[i].points[j].y!=0)
|
||||
count++;
|
||||
}
|
||||
if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model->curves[i].count !=5)) {
|
||||
if(usedcurves%2 == 0) str.append("<tr>");
|
||||
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td>").arg(i+1));
|
||||
if(usedcurves%2) str.append("</tr>");
|
||||
usedcurves++;
|
||||
}
|
||||
}
|
||||
if (!(usedcurves%2)) str.append("</tr>");
|
||||
if (usedcurves!=0) {
|
||||
str.append("</table></td></tr><tr><td colspan=2><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">");
|
||||
str.append("<tr>");
|
||||
str.append(doTC(" "));
|
||||
@@ -509,48 +537,50 @@ void PrintDialog::printCurves()
|
||||
str.append(doTC(tr("pt %1").arg(i+1), "", true));
|
||||
str.append("</tr>");
|
||||
for(i=0; i<numcurves; i++) {
|
||||
pen.setColor(colors[i]);
|
||||
painter.setPen(pen);
|
||||
colors[i].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
int curvepoints=g_model->curves[i].count;
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
str.append(QString("<td width=\"70\" rowspan=2 valign=middle><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
|
||||
else
|
||||
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
|
||||
count=0;
|
||||
for(int j=0; j<curvepoints; j++) {
|
||||
if (g_model->curves[i].points[j].y!=0)
|
||||
count++;
|
||||
}
|
||||
for(int j=0; j<curvepoints; j++) {
|
||||
str.append(doTR(QString::number(g_model->curves[i].points[j].y),"green"));
|
||||
if (j>0 && count!=0) {
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
|
||||
}
|
||||
}
|
||||
for(int j=curvepoints; j<numpoint; j++) {
|
||||
str.append(doTR("","green"));
|
||||
}
|
||||
str.append("</tr>");
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
str.append("<tr><td width=5>X</td>");
|
||||
if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) {
|
||||
pen.setColor(colors[i]);
|
||||
painter.setPen(pen);
|
||||
colors[i].getRgb(&r,&g,&b);
|
||||
c=r;
|
||||
c*=256;
|
||||
c+=g;
|
||||
c*=256;
|
||||
c+=b;
|
||||
sprintf(buffer,"%06x",c);
|
||||
str.append("<tr>");
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
str.append(QString("<td width=\"70\" rowspan=2 valign=middle><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
|
||||
else
|
||||
str.append(QString("<td width=\"70\"><font color=#%1><b>").arg(buffer)+tr("Curve")+QString(" %1</b></font></td><td width=5>Y</td>").arg(i+1));
|
||||
for(int j=0; j<curvepoints; j++) {
|
||||
str.append(doTR(QString::number(g_model->curves[i].points[j].x),"green"));
|
||||
str.append(doTR(QString::number(g_model->curves[i].points[j].y),"green"));
|
||||
if (j>0 && (count!=0 ||(g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM))) {
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)
|
||||
painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
|
||||
else
|
||||
painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200);
|
||||
}
|
||||
}
|
||||
for(int j=curvepoints; j<numpoint; j++) {
|
||||
str.append(doTR("","green"));
|
||||
}
|
||||
str.append("</tr>");
|
||||
str.append("</tr>");
|
||||
if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) {
|
||||
str.append("<tr><td width=5>X</td>");
|
||||
for(int j=0; j<curvepoints; j++) {
|
||||
str.append(doTR(QString::number(g_model->curves[i].points[j].x),"green"));
|
||||
}
|
||||
for(int j=curvepoints; j<numpoint; j++) {
|
||||
str.append(doTR("","green"));
|
||||
}
|
||||
str.append("</tr>");
|
||||
}
|
||||
}
|
||||
}
|
||||
str.append("</table></td></tr></table></td></tr></table>");
|
||||
@@ -562,11 +592,9 @@ void PrintDialog::printCurves()
|
||||
painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20));
|
||||
painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5);
|
||||
}
|
||||
|
||||
qi.save(curvefile5, "png",100);
|
||||
|
||||
te->append(str);
|
||||
}
|
||||
te->append(str);
|
||||
}
|
||||
|
||||
void PrintDialog::printSwitches()
|
||||
@@ -662,6 +690,10 @@ void PrintDialog::printFrSky()
|
||||
{
|
||||
int tc=0;
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
int analog=2;
|
||||
if (IS_ARM(firmware->getBoard())) {
|
||||
analog=4;
|
||||
}
|
||||
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
str.append("<tr><td colspan=3><h2>"+tr("Telemetry Settings")+"</h2></td></tr>");
|
||||
@@ -670,9 +702,8 @@ void PrintDialog::printFrSky()
|
||||
str.append(doTC(tr("Range"),"", true));
|
||||
str.append(doTC(tr("Offset"),"", true));
|
||||
str.append("</tr>");
|
||||
|
||||
FrSkyData *fd=&g_model->frsky;
|
||||
for (int i=0; i<2; i++) {
|
||||
for (int i=0; i<analog; i++) {
|
||||
if (fd->channels[i].ratio!=0) {
|
||||
tc++;
|
||||
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
|
||||
@@ -722,7 +753,7 @@ void PrintDialog::printFrSky()
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td>");
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+tr("Type")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Condition")+"</b></td><td width=\"40\" align=\"center\"><b>"+tr("Value")+"</b></td></tr>");
|
||||
FrSkyData *fd=&g_model->frsky;
|
||||
for (int i=0; i<2; i++) {
|
||||
for (int i=0; i<analog; i++) {
|
||||
if (fd->channels[i].ratio!=0) {
|
||||
tc++;
|
||||
float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1));
|
||||
@@ -746,7 +777,7 @@ void PrintDialog::printFrSky()
|
||||
str.append("<td width=\"40\" align=\"center\"><b>"+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"</b></td><td width=\"40\" align=\"center\"><b><</b></td><td width=\"40\" align=\"center\"><b>"+QString::number(fd->rssiAlarms[1].value,10)+"</b></td></tr>");
|
||||
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Frsky serial protocol")+"</b></td><td colspan=8 align=\"left\">"+getFrSkyProtocol(fd->usrProto)+"</td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+fd->blades+"</td></tr>");
|
||||
str.append("<tr><td colspan=2 align=\"Left\"><b>"+tr("Blades")+"</b></td><td colspan=8 align=\"left\">"+QString("%1").arg(fd->blades)+"</td></tr>");
|
||||
str.append("<tr><td colspan=10 align=\"Left\" height=\"4px\"></td></tr></table>");
|
||||
}
|
||||
#if 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
set(qcustomplot_SRCS
|
||||
qcustomplot.cpp
|
||||
)
|
||||
|
||||
set(qcustomplot_HDRS
|
||||
qcustomplot.h
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(qcustomplot_SRCS ${qcustomplot_HDRS})
|
||||
|
||||
add_library(qcustomplot ${qcustomplot_SRCS})
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -0,0 +1,416 @@
|
||||
#### Version 1.3.1 released on 25.04.15 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug that prevented automatic axis rescaling when some graphs/curves had only NaN data points
|
||||
- Improved QCPItemBracket selection boundaries, especially bsCurly and bsCalligraphic
|
||||
- Fixed bug of axis rect and colorscale background shifted downward by one logical pixel (visible in scaled png and pdf export)
|
||||
- Replot upon mouse release is now only performed if a selection change has actually happened (improves responsivity on particularly complex plots)
|
||||
- Fixed bug that allowed scatter-only graphs to be selected by clicking the non-existent line between scatters
|
||||
- Fixed crash when trying to select a scatter-only QCPGraph whose only points in the visible key range are at identical key coordinates and vertically off-screen, with adaptive sampling enabled
|
||||
- Fixed pdf export of QCPColorMap with enabled interpolation (didn't appear interpolated in pdf)
|
||||
- Reduced QCPColorMap jitter of internal cell boundaries for small sized maps when viewed with high zoom, by applying oversampling factors dependant on map size
|
||||
- Fixed bug of QCPColorMap::fill() not causing the buffered internal image map to be updated, and thus the change didn't become visible immediately
|
||||
- Axis labels with size set in pixels (setPixelSize) instead of points now correctly calculate the exponent's font size if beautifully typeset powers are enabled
|
||||
- Fixed QCPColorMap appearing at the wrong position for logarithmic axes and color map spanning larger ranges
|
||||
|
||||
Other:
|
||||
- Pdf export used to embed entire QCPColorMaps, potentially leading to large files. Now only the visible portion of the map is embedded in the pdf
|
||||
- Many documentation fixes and extensions, style modernization
|
||||
- Reduced documentation file size (and thus full package size) by automatically reducing image palettes during package build
|
||||
- Fixed MSVC warning message (at warning level 4) due to temporary QLists in some foreach statements
|
||||
|
||||
#### Version 1.3.0 released on 27.12.14 ####
|
||||
|
||||
Added features:
|
||||
- New plottable class QCPFinancial allows display of candlestick/ohlc data
|
||||
- New class QCPBarsGroup allows horizontal grouping of multiple QCPBars plottables
|
||||
- Added QCPBars feature allowing non-zero base values (see property QCPBars::setBaseValue)
|
||||
- Added QCPBars width type, for more flexible bar widths (see property QCPBars::setWidthType)
|
||||
- New QCPCurve optimization algorithm, fixes bug which caused line flicker at deep zoom into curve segment
|
||||
- Item positions can now have different position types and anchors for their x and y coordinates (QCPItemPosition::setTypeX/Y, setParentAnchorX/Y)
|
||||
- QCPGraph and QCPCurve can now display gaps in their lines, when inserting quiet NaNs as values (std::numeric_limits<double>::quiet_NaN())
|
||||
- QCPAxis now supports placing the tick labels inside the axis rect, for particularly space saving plots (QCPAxis::setTickLabelSide)
|
||||
Added features after beta:
|
||||
- Made code compatible with QT_NO_CAST_FROM_ASCII, QT_NO_CAST_TO_ASCII
|
||||
- Added compatibility with QT_NO_KEYWORDS after sending code files through a simple reg-ex script
|
||||
- Added possibility to inject own QCPAxis(-subclasses) via second, optional QCPAxisRect::addAxis parameter
|
||||
- Added parameter to QCPItemPixmap::setScaled to specify transformation mode
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug in QCPCurve rendering of very zoomed-in curves (via new optimization algorithm)
|
||||
- Fixed conflict with MSVC-specific keyword "interface" in text-document-integration example
|
||||
- Fixed QCPScatterStyle bug ignoring the specified pen in the custom scatter shape constructor
|
||||
- Fixed bug (possible crash) during QCustomPlot teardown, when a QCPLegend that has no parent layout (i.e. was removed from layout manually) gets deleted
|
||||
Bugfixes after beta:
|
||||
- Fixed bug of QCPColorMap/QCPColorGradient colors being off by one color sampling step (only noticeable in special cases)
|
||||
- Fixed bug of QCPGraph adaptive sampling on vertical key axis, causing staggered look
|
||||
- Fixed low (float) precision in QCPCurve optimization algorithm, by not using QVector2D anymore
|
||||
|
||||
Other:
|
||||
- Qt 5.3 and Qt 5.4 compatibility
|
||||
|
||||
#### Version 1.2.1 released on 07.04.14 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed regression which garbled date-time tick labels on axes, if setTickLabelType is ltDateTime and setNumberFormat contains the "b" option
|
||||
|
||||
#### Version 1.2.0 released on 14.03.14 ####
|
||||
|
||||
Added features:
|
||||
- Adaptive Sampling for QCPGraph greatly improves performance for high data densities (see QCPGraph::setAdaptiveSampling)
|
||||
- QCPColorMap plottable with QCPColorScale layout element allows plotting of 2D color maps
|
||||
- QCustomPlot::savePdf now has additional optional parameters pdfCreator and pdfTitle to set according PDF metadata fields
|
||||
- QCustomPlot::replot now allows specifying whether the widget update is immediate (repaint) or queued (update)
|
||||
- QCPRange operators +, -, *, / with double operand for range shifting and scaling, and ==, != for range comparison
|
||||
- Layers now have a visibility property (QCPLayer::setVisible)
|
||||
- static functions QCPAxis::opposite and QCPAxis::orientation now offer more convenience when handling axis types
|
||||
- added notification signals for selectability change (selectableChanged) on all objects that have a selected/selectable property
|
||||
- added notification signal for QCPAxis scaleType property
|
||||
- added notification signal QCPLayerable::layerChanged
|
||||
|
||||
Bugfixes:
|
||||
- Fixed assert halt, when QCPAxis auto tick labels not disabled but nevertheless a custom non-number tick label ending in "e" given
|
||||
- Fixed painting glitches when QCustomPlot resized inside a QMdiArea or under certain conditions inside a QLayout
|
||||
- If changing QCPAxis::scaleType and thus causing range sanitizing and a range modification, rangeChanged wouldn't be emitted
|
||||
- Fixed documentation bug that caused indentation to be lost in code examples
|
||||
Bugfixes after beta:
|
||||
- Fixed bug that caused crash if clicked-on legend item is removed in mousePressEvent.
|
||||
- On some systems, font size defaults to -1, which used to cause a debug output in QCPAxisPainterPrivate::TickLabelDataQCP. Now it's checked before setting values based on the default font size.
|
||||
- When using multiple axes on one side, setting one to invisible didn't properly compress the freed space.
|
||||
- Fixed bug that allowed selection of plottables when clicking in the bottom or top margin of a QCPAxisRect (outside the inner rect)
|
||||
|
||||
Other:
|
||||
- In method QCPAbstractPlottable::getKeyRange/getValueRange, renamed parameter "validRange" to "foundRange", to better reflect its meaning (and contrast it from QCPRange::validRange)
|
||||
- QCPAxis low-level axis painting methods exported to QCPAxisPainterPrivate
|
||||
|
||||
#### Version 1.1.1 released on 09.12.13 ####
|
||||
|
||||
Bugfixes:
|
||||
- Fixed bug causing legends blocking input events from reaching underlying axis rect even if legend is invisible
|
||||
- Added missing Q_PROPERTY for QCPAxis::setDateTimeSpec
|
||||
- Fixed behaviour of QCPAxisRect::setupFullAxesBox (now transfers more properties from bottom/left to top/right axes and sets visibility of bottom/left axes to true)
|
||||
- Made sure PDF export doesn't default to grayscale output on some systems
|
||||
|
||||
Other:
|
||||
- Plotting hint QCP::phForceRepaint is now enabled on all systems (and not only on windows) by default
|
||||
- Documentation improvements
|
||||
|
||||
#### Version 1.1.0 released on 04.11.13 ####
|
||||
|
||||
Added features:
|
||||
- Added QCPRange::expand and QCPRange::expanded
|
||||
- Added QCPAxis::rescale to rescale axis to all associated plottables
|
||||
- Added QCPAxis::setDateTimeSpec/dateTimeSpec to allow axis labels either in UTC or local time
|
||||
- QCPAxis now additionally emits a rangeChanged signal overload that provides the old range as second parameter
|
||||
|
||||
Bugfixes:
|
||||
- Fixed QCustomPlot::rescaleAxes not rescaling properly if first plottable has an empty range
|
||||
- QCPGraph::rescaleAxes/rescaleKeyAxis/rescaleValueAxis are no longer virtual (never were in base class, was a mistake)
|
||||
- Fixed bugs in QCPAxis::items and QCPAxisRect::items not properly returning associated items and potentially stalling
|
||||
|
||||
Other:
|
||||
- Internal change from QWeakPointer to QPointer, thus got rid of deprecated Qt functionality
|
||||
- Qt5.1 and Qt5.2 (beta1) compatibility
|
||||
- Release packages now extract to single subdirectory and don't place multiple files in current working directory
|
||||
|
||||
#### Version 1.0.1 released on 05.09.13 ####
|
||||
|
||||
Bugfixes:
|
||||
- using define flag QCUSTOMPLOT_CHECK_DATA caused debug output when data was correct, instead of invalid (fixed QCP::isInvalidData)
|
||||
- documentation images are now properly shown when viewed with Qt Assistant
|
||||
- fixed various documentation mistakes
|
||||
|
||||
Other:
|
||||
- Adapted documentation style sheet to better match Qt5 documentation
|
||||
|
||||
#### Version 1.0.0 released on 01.08.13 ####
|
||||
|
||||
Quick Summary:
|
||||
- Layout system for multiple axis rects in one plot
|
||||
- Multiple axes per side
|
||||
- Qt5 compatibility
|
||||
- More flexible and consistent scatter configuration with QCPScatterStyle
|
||||
- Various interface cleanups/refactoring
|
||||
- Pixmap-cached axis labels for improved replot performance
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- QCustomPlot::axisRect() changed meaning due to the extensive changes to how axes and axis rects are handled
|
||||
it now returns a pointer to a QCPAxisRect and takes an integer index as parameter.
|
||||
- QCPAxis constructor changed to now take QCPAxisRect* as parent
|
||||
- setAutoMargin, setMarginLeft/Right/Top/Bottom removed due to the axis rect changes (see QCPAxisRect::setMargins/setAutoMargins)
|
||||
- setAxisRect removed due to the axis rect changes
|
||||
- setAxisBackground(-Scaled/-ScaledMode) now moved to QCPAxisRect as setBackground(-Scaled/ScaledMode) (access via QCustomPlot::axisRects())
|
||||
- QCPLegend now is a QCPLayoutElement
|
||||
- QCPAbstractPlottable::drawLegendIcon parameter "rect" changed from QRect to QRectF
|
||||
- QCPAbstractLegendItem::draw second parameter removed (position/size now handled via QCPLayoutElement base class)
|
||||
- removed QCPLegend::setMargin/setMarginLeft/Right/Top/Bottom (now inherits the capability from QCPLayoutElement::setMargins)
|
||||
- removed QCPLegend::setMinimumSize (now inherits the capability from QCPLayoutElement::setMinimumSize)
|
||||
- removed enum QCPLegend::PositionStyle, QCPLegend::positionStyle/setPositionStyle/position/setPosition (replaced by capabilities of QCPLayoutInset)
|
||||
- QCPLegend transformed to work with new layout system (almost everything changed)
|
||||
- removed entire title interface: QCustomPlot::setTitle/setTitleFont/setTitleColor/setTitleSelected/setTitleSelectedFont/setTitleSelectedColor and
|
||||
the QCustomPlot::iSelectTitle interaction flag (all functionality is now given by the layout element "QCPPlotTitle" which can be added to the plot layout)
|
||||
- selectTest functions now take two additional parameters: bool onlySelectable and QVariant *details=0
|
||||
- selectTest functions now ignores visibility of objects and (if parameter onlySelectable is true) does not anymore ignore selectability of the object
|
||||
- moved QCustomPlot::Interaction/Interactions to QCP namespace as QCP::Interaction/Interactions
|
||||
- moved QCustomPlot::setupFullAxesBox() to QCPAxisRect::setupFullAxesBox. Now also accepts parameter to decide whether to connect opposite axis ranges
|
||||
- moved range dragging/zooming interface from QCustomPlot to QCPAxisRect (setRangeDrag, setRangeZoom, setRangeDragAxes, setRangeZoomAxes,...)
|
||||
- rangeDrag/Zoom is now set to Qt::Horizontal|Qt::Vertical instead of 0 by default, on the other hand, iRangeDrag/Zoom is unset in interactions by
|
||||
default (this makes enabling dragging/zooming easier by just adding the interaction flags)
|
||||
- QCPScatterStyle takes over everything related to handling scatters in all plottables
|
||||
- removed setScatterPen/Size on QCPGraph and QCPCurve, removed setOutlierPen/Size on QCPStatisticalBox (now handled via QCPScatterStyle)
|
||||
- modified setScatterStyle on QCPGraph and QCPCurve, and setOutlierStyle on QCPStatisticalBox, to take QCPScatterStyle
|
||||
- axis grid and subgrid are now reachable via the QCPGrid *QCPAxis::grid() method. (e.g. instead of xAxis->setGrid(true), write xAxis->grid()->setVisible(true))
|
||||
|
||||
Added features:
|
||||
- Axis tick labels are now pixmap-cached, thus increasing replot performance (in usual setups by about 24%). See plotting hint phCacheLabels which is set by default
|
||||
- Advanced layout system, including the classes QCPLayoutElement, QCPLayout, QCPLayoutGrid, QCPLayoutInset, QCPAxisRect
|
||||
- QCustomPlot::axisRects() returns all the axis rects in the QCustomPlot.
|
||||
- QCustomPlot::plotLayout() returns the top level layout (initially a QCPLayoutGrid with one QCPAxisRect inside)
|
||||
- QCPAxis now may have an offset to the axis rect (setOffset)
|
||||
- Multiple axes per QCPAxisRect side are now supported (see QCPAxisRect::addAxis)
|
||||
- QCustomPlot::toPixmap renders the plot into a pixmap and returns it
|
||||
- When setting tick label rotation to +90 or -90 degrees on a vertical axis, the labels are now centered vertically on the tick height
|
||||
(This allows space saving vertical tick labels by having the text direction parallel to the axis)
|
||||
- Substantially increased replot performance when using very large manual tick vectors (> 10000 ticks) via QCPAxis::setTickVector
|
||||
- QCPAxis and QCPAxisRect now allow easy access to all plottables(), graphs() and items() that are associated with them
|
||||
- Added QCustomPlot::hasItem method for consistency with plottable interface, hasPlottable
|
||||
- Added QCPAxisRect::setMinimumMargins as replacement for hardcoded minimum axis margin (15 px) when auto margin is enabled
|
||||
- Added Flags type QCPAxis::AxisTypes (from QCPAxis::AxisType), used in QCPAxisRect interface
|
||||
- Automatic margin calculation can now be enabled/disabled on a per-side basis, see QCPAxisRect::setAutoMargins
|
||||
- QCPAxisRect margins of multiple axis rects can be coupled via QCPMarginGroup
|
||||
- Added new default layers "background" and "legend" (QCPAxisRect draws its background on the "background" layer, QCPLegend is on the "legend" layer by default)
|
||||
- Custom scatter style via QCP::ssCustom and respective setCustomScatter functions that take a QPainterPath
|
||||
- Filled scatters via QCPScatterStyle::setBrush
|
||||
Added features after beta:
|
||||
- Added QCustomPlot::toPainter method, to allow rendering with existing painter
|
||||
- QCPItemEllipse now provides a center anchor
|
||||
|
||||
Bugfixes:
|
||||
- Fixed compile error on ARM
|
||||
- Wrong legend icons were displayed if using pixmaps for scatters that are smaller than the legend icon rect
|
||||
- Fixed clipping inaccuracy for rotated tick labels (were hidden too early, because the non-rotated bounding box was used)
|
||||
- Fixed bug that caused wrong clipping of axis ticks and subticks when the ticks were given manually by QCPAxis::setTickVector
|
||||
- Fixed Qt5 crash when dragging graph out of view (iterator out of bounds in QCPGraph::getVisibleDataBounds)
|
||||
- Fixed QCPItemText not scaling properly when using scaled raster export
|
||||
Bugfixes after beta:
|
||||
- Fixed bug that clipped the rightmost pixel column of tick labels when caching activated (only visible on windows for superscript exponents)
|
||||
- Restored compatibility to Qt4.6
|
||||
- Restored support for -no-RTTI compilation
|
||||
- Empty manual tick labels are handled more gracefully (no QPainter qDebug messages anymore)
|
||||
- Fixed type ambiguity in QCPLineEnding::draw causing compile error on ARM
|
||||
- Fixed bug of grid layouts not propagating the minimum size from their child elements to the parent layout correctly
|
||||
- Fixed bug of child elements (e.g. axis rects) of inset layouts not properly receiving mouse events
|
||||
|
||||
Other:
|
||||
- Opened up non-amalgamated project structure to public via git repository
|
||||
|
||||
#### Version released on 09.06.12 ####
|
||||
|
||||
Quick Summary:
|
||||
- Items (arrows, text,...)
|
||||
- Layers (easier control over rendering order)
|
||||
- New antialiasing system (Each objects controls own antialiasing with setAntialiased)
|
||||
- Performance Improvements
|
||||
- improved pixel-precise drawing
|
||||
- easier shared library creation/usage
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- enum QCPGraph::ScatterSymbol was moved to QCP namespace (now QCP::ScatterSymbol).
|
||||
This replace should fix your code: "QCPGraph::ss" -> "QCP::ss"
|
||||
- enum QCustomPlot::AntialiasedElement and flag QCustomPlot::AntialiasedElements was moved to QCP namespace
|
||||
This replace should fix your code: "QCustomPlot::ae" -> "QCP::ae"
|
||||
- the meaning of QCustomPlot::setAntialiasedElements has changed slightly: It is now an override to force elements to be antialiased. If you want to force
|
||||
elements to not be drawn antialiased, use the new setNotAntialiasedElements. If an element is mentioned in neither of those functions, it now controls
|
||||
its antialiasing itself via its "setAntialiased" function(s). (e.g. QCPAxis::setAntialiased(bool), QCPAbstractPlottable::setAntialiased(bool),
|
||||
QCPAbstractPlottable::setAntialiasedScatters(bool), etc.)
|
||||
- QCPAxis::setTickVector and QCPAxis::setTickVectorLabels no longer take a pointer but a const reference of the respective QVector as parameter.
|
||||
(handing over a pointer didn't give any noticeable performance benefits but was inconsistent with the rest of the interface)
|
||||
- Equally QCPAxis::tickVector and QCPAxis::tickVectorLabels don't return by pointer but by value now
|
||||
- QCustomPlot::savePngScaled was removed, its purpose is now included as optional parameter "scale" of savePng.
|
||||
- If you have derived from QCPAbstractPlottable: all selectTest functions now consistently take the argument "const QPointF &pos" which is the test point in pixel coordinates.
|
||||
(the argument there was "double key, double value" in plot coordinates, before).
|
||||
- QCPAbstractPlottable, QCPAxis and QCPLegend now inherit from QCPLayerable
|
||||
- If you have derived from QCPAbstractPlottable: the draw method signature has changed from "draw (..) const" to "draw (..)", i.e. the method
|
||||
is not const anymore. This allows the draw function of your plottable to perform buffering/caching operations, if necessary.
|
||||
|
||||
Added features:
|
||||
- Item system: QCPAbstractItem, QCPItemAnchor, QCPItemPosition, QCPLineEnding. Allows placing of lines, arrows, text, pixmaps etc.
|
||||
- New Items: QCPItemStraightLine, QCPItemLine, QCPItemCurve, QCPItemEllipse, QCPItemRect, QCPItemPixmap, QCPItemText, QCPItemBracket, QCPItemTracer
|
||||
- QCustomPlot::addItem/itemCount/item/removeItem/selectedItems
|
||||
- signals QCustomPlot::itemClicked/itemDoubleClicked
|
||||
- the QCustomPlot interactions property now includes iSelectItems (for selection of QCPAbstractItem)
|
||||
- QCPLineEnding. Represents the different styles a line/curve can end (e.g. different arrows, circle, square, bar, etc.), see e.g. QCPItemCurve::setHead
|
||||
- Layer system: QCPLayerable, QCPLayer. Allows more sophisticated control over drawing order and a kind of grouping.
|
||||
- QCPAbstractPlottable, QCPAbstractItem, QCPAxis, QCPGrid, QCPLegend are layerables and derive from QCPLayerable
|
||||
- QCustomPlot::addLayer/moveLayer/removeLayer/setCurrentLayer/layer/currentLayer/layerCount
|
||||
- Initially there are three layers: "grid", "main", and "axes". The "main" layer is initially empty and set as current layer, so new plottables/items are put there.
|
||||
- QCustomPlot::viewport now makes the previously inaccessible viewport rect read-only-accessible (needed that for item-interface)
|
||||
- PNG export now allows transparent background by calling QCustomPlot::setColor(Qt::transparent) before savePng
|
||||
- QCPStatisticalBox outlier symbols may now be all scatter symbols, not only hardcoded circles.
|
||||
- perfect precision of scatter symbol/error bar drawing and clipping in both antialiased and non-antialiased mode, by introducing QCPPainter
|
||||
that works around some QPainter bugs/inconveniences. Further, more complex symbols like ssCrossSquare used to look crooked, now they look good.
|
||||
- new antialiasing control system: Each drawing element now has its own "setAntialiased" function to control whether it is drawn antialiased.
|
||||
- QCustomPlot::setAntialiasedElements and QCustomPlot::setNotAntialiasedElements can be used to override the individual settings.
|
||||
- Subclasses of QCPAbstractPlottable can now use the convenience functions like applyFillAntialiasingHint or applyScattersAntialiasingHint to
|
||||
easily make their drawing code comply with the overall antialiasing system.
|
||||
- QCustomPlot::setNoAntialiasingOnDrag allows greatly improved performance and responsiveness by temporarily disabling all antialiasing while
|
||||
the user is dragging axis ranges
|
||||
- QCPGraph can now show scatter symbols at data points and hide its line (see QCPGraph::setScatterStyle, setScatterSize, setScatterPixmap, setLineStyle)
|
||||
- Grid drawing code was sourced out from QCPAxis to QCPGrid. QCPGrid is mainly an internal class and every QCPAxis owns one. The grid interface still
|
||||
works through QCPAxis and hasn't changed. The separation allows the grid to be drawn on a different layer as the axes, such that e.g. a graph can
|
||||
be above the grid but below the axes.
|
||||
- QCustomPlot::hasPlottable(plottable), returns whether the QCustomPlot contains the plottable
|
||||
- QCustomPlot::setPlottingHint/setPlottingHints, plotting hints control details about the plotting quality/speed
|
||||
- export to jpg and bmp added (QCustomPlot::saveJpg/saveBmp), as well as control over compression quality for png and jpg
|
||||
- multi-select-modifier may now be specified with QCustomPlot::setMultiSelectModifier and is not fixed to Ctrl anymore
|
||||
|
||||
Bugfixes:
|
||||
- fixed QCustomPlot ignores replot after it had size (0,0) even if size becomes valid again
|
||||
- on Windows, a repaint used to be delayed during dragging/zooming of a complex plot, until the drag operation was done.
|
||||
This was fixed, i.e. repaints are forced after a replot() call. See QCP::phForceRepaint and setPlottingHints.
|
||||
- when using the raster paintengine and exporting to scaled PNG, pen widths are now scaled correctly (QPainter bug workaround via QCPPainter)
|
||||
- PDF export now respects QCustomPlot background color (QCustomPlot::setColor), also Qt::transparent
|
||||
- fixed a bug on QCPBars and QCPStatisticalBox where auto-rescaling of axis would fail when all data is very small (< 1e-11)
|
||||
- fixed mouse event propagation bug that prevented range dragging from working on KDE (GNU/Linux)
|
||||
- fixed a compiler warning on 64-bit systems due to pointer cast to int instead of quintptr in a qDebug output
|
||||
|
||||
Other:
|
||||
- Added support for easier shared library creation (including examples for compiling and using QCustomPlot as shared library)
|
||||
- QCustomPlot now has the Qt::WA_OpaquePaintEvent widget attribute (gives slightly improved performance).
|
||||
- QCP::aeGraphs (enum QCP::AntialiasedElement, previously QCustomPlot::aeGraphs) has been marked deprecated since version 02.02.12 and
|
||||
was now removed. Use QCP::aePlottables instead.
|
||||
- optional performance-quality-tradeoff for solid graph lines (see QCustomPlot::setPlottingHints).
|
||||
- marked data classes and QCPRange as Q_MOVABLE_TYPE
|
||||
- replaced usage of own macro FUNCNAME with Qt macro Q_FUNC_INFO
|
||||
- QCustomPlot now returns a minimum size hint of 50*50
|
||||
|
||||
#### Version released on 31.03.12 ####
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- QCPAbstractLegendItem now inherits from QObject
|
||||
- mousePress, mouseMove and mouseRelease signals are now emitted before and not after any QCustomPlot processing (range dragging, selecting, etc.)
|
||||
|
||||
Added features:
|
||||
- Interaction system: now allows selecting of objects like plottables, axes, legend and plot title, see QCustomPlot::setInteractions documentation
|
||||
- Interaction system for plottables:
|
||||
- setSelectable, setSelected, setSelectedPen, setSelectedBrush, selectTest on QCPAbstractPlottable and all derived plottables
|
||||
- setSelectionTolerance on QCustomPlot
|
||||
- selectedPlottables and selectedGraphs on QCustomPlot (returns the list of currently selected plottables/graphs)
|
||||
- Interaction system for axes:
|
||||
- setSelectable, setSelected, setSelectedBasePen, setSelectedTickPen, setSelectedSubTickPen, setSelectedLabelFont, setSelectedTickLabelFont,
|
||||
setSelectedLabelColor, setSelectedTickLabelColor, selectTest on QCPAxis
|
||||
- selectedAxes on QCustomPlot (returns a list of the axes that currently have selected parts)
|
||||
- Interaction system for legend:
|
||||
- setSelectable, setSelected, setSelectedBorderPen, setSelectedIconBorderPen, setSelectedBrush, setSelectedFont, setSelectedTextColor, selectedItems on QCPLegend
|
||||
- setSelectedFont, setSelectedTextColor, setSelectable, setSelected on QCPAbstractLegendItem
|
||||
- selectedLegends on QCustomPlot
|
||||
- Interaction system for title:
|
||||
- setSelectedTitleFont, setSelectedTitleColor, setTitleSelected on QCustomPlot
|
||||
- new signals in accordance with the interaction system:
|
||||
- selectionChangedByUser on QCustomPlot
|
||||
- selectionChanged on QCPAbstractPlottable
|
||||
- selectionChanged on QCPAxis
|
||||
- selectionChanged on QCPLegend and QCPAbstractLegendItem
|
||||
- plottableClick, legendClick, axisClick, titleClick, plottableDoubleClick, legendDoubleClick, axisDoubleClick, titleDoubleClick on QCustomPlot
|
||||
- QCustomPlot::deselectAll (deselects everything, i.e. axes and plottables)
|
||||
- QCPAbstractPlottable::pixelsToCoords (inverse function to the already existing coordsToPixels function)
|
||||
- QCPRange::contains(double value)
|
||||
- QCPAxis::setLabelColor and setTickLabelColor
|
||||
- QCustomPlot::setTitleColor
|
||||
- QCustomPlot now emits beforeReplot and afterReplot signals. Note that it is safe to make two customPlots mutually call eachothers replot functions
|
||||
in one of these slots, it will not cause an infinite loop. (usefull for synchronizing axes ranges between two customPlots, because setRange alone doesn't replot)
|
||||
- If the Qt version is 4.7 or greater, the tick label strings in date-time-mode now support sub-second accuracy (e.g. with format like "hh:mm:ss.zzz").
|
||||
|
||||
Bugfixes:
|
||||
- tick labels/margins should no longer oscillate by one pixel when dragging range or replotting repeatedly while changing e.g. data. This
|
||||
was caused by a bug in Qt's QFontMetrics::boundingRect function when the font has an integer point size (probably some rounding problem).
|
||||
The fix hence consists of creating a temporary font (only for bounding-box calculation) which is 0.05pt larger and thus avoiding the
|
||||
jittering rounding outcome.
|
||||
- tick label, axis label and plot title colors used to be undefined. This was fixed by providing explicit color properties.
|
||||
|
||||
Other:
|
||||
- fixed some glitches in the documentation
|
||||
- QCustomPlot::replot and QCustomPlot::rescaleAxes are now slots
|
||||
|
||||
#### Version released on 02.02.12 ####
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- renamed all secondary classes from QCustomPlot[...] to QCP[...]:
|
||||
QCustomPlotAxis -> QCPAxis
|
||||
QCustomPlotGraph -> QCPGraph
|
||||
QCustomPlotRange -> QCPRange
|
||||
QCustomPlotData -> QCPData
|
||||
QCustomPlotDataMap -> QCPDataMap
|
||||
QCustomPlotLegend -> QCPLegend
|
||||
QCustomPlotDataMapIterator -> QCPDataMapIterator
|
||||
QCustomPlotDataMutableMapIterator -> QCPDataMutableMapIterator
|
||||
A simple search and replace on all code files should make your code run again, e.g. consider the regex "QCustomPlot(?=[AGRDL])" -> "QCP".
|
||||
Make sure not to just replace "QCustomPlot" with "QCP" because the main class QCustomPlot hasn't changed to QCP.
|
||||
This change was necessary because class names became unhandy, pardon my bad naming decision in the beginning.
|
||||
- QCPAxis::tickLength() and QCPAxis::subTickLength() now each split into two functions for inward and outward ticks (tickLengthIn/tickLengthOut).
|
||||
- QCPLegend now uses QCPAbstractLegendItem to carry item data (before, the legend was passed QCPGraphs directly)
|
||||
- QCustomPlot::addGraph() now doesn't return the index of the created graph anymore, but a pointer to the created QCPGraph.
|
||||
- QCustomPlot::setAutoAddGraphToLegend is replaced by setAutoAddPlottableToLegend
|
||||
|
||||
Added features:
|
||||
- Reversed axis range with QCPAxis::setRangeReversed(bool)
|
||||
- Tick labels are now only drawn if not clipped by the viewport (widget border) on the sides (e.g. left and right on a horizontal axis).
|
||||
- Zerolines. Like grid lines only with a separate pen (QCPAxis::setZeroLinePen), at tick position zero.
|
||||
- Outward ticks. QCPAxis::setTickLength/setSubTickLength now accepts two arguments for inward and outward tick length. This doesn't break
|
||||
backward compatibility because the second argument (outward) has default value zero and thereby a call with one argument hasn't changed its meaning.
|
||||
- QCPGraph now inherits from QCPAbstractPlottable
|
||||
- QCustomPlot::addPlottable/plottable/removePlottable/clearPlottables added to interface with the new QCPAbstractPlottable-based system. The simpler interface
|
||||
which only acts on QCPGraphs (addGraph, graph, removeGraph, etc.) was adapted internally and is kept for backward compatibility and ease of use.
|
||||
- QCPLegend items for plottables (e.g. graphs) can automatically wrap their texts to fit the widths, see QCPLegend::setMinimumSize and QCPPlottableLegendItem::setTextWrap.
|
||||
- QCustomPlot::rescaleAxes. Adapts axis ranges to show all plottables/graphs, by calling QCPAbstractPlottable::rescaleAxes on all plottables in the plot.
|
||||
- QCPCurve. For plotting of parametric curves.
|
||||
- QCPBars. For plotting of bar charts.
|
||||
- QCPStatisticalBox. For statistical box plots.
|
||||
|
||||
Bugfixes:
|
||||
- Fixed QCustomPlot::removeGraph(int) not being able to remove graph index 0
|
||||
- made QCustomPlot::replot() abort painting when painter initialization fails (e.g. because width/height of QCustomPlot is zero)
|
||||
- The distance of the axis label from the axis ignored the tick label padding, this could have caused overlapping axis labels and tick labels
|
||||
- fixed memory leak in QCustomPlot (dtor didn't delete legend)
|
||||
- fixed bug that prevented QCPAxis::setRangeLower/Upper from setting the value to exactly 0.
|
||||
|
||||
Other:
|
||||
- Changed default error bar handle size (QCustomPlotGraph::setErrorBarSize) from 4 to 6.
|
||||
- Removed QCustomPlotDataFetcher. Was deprecated and not used class.
|
||||
- Extended documentation, especially class descriptions.
|
||||
|
||||
#### Version released on 15.01.12 ####
|
||||
|
||||
Changes that (might) break backward compatibility:
|
||||
- QCustomPlotGraph now inherits from QObject
|
||||
|
||||
Added features:
|
||||
- Added axis background pixmap (QCustomPlot::setAxisBackground, setAxisBackgroundScaled, setAxisBackgroundScaledMode)
|
||||
- Added width and height parameter on PDF export function QCustomPlot::savePdf(). This now allows PDF export to
|
||||
have arbitrary dimensions, independent of the current geometry of the QCustomPlot.
|
||||
- Added overload of QCustomPlot::removeGraph that takes QCustomPlotGraph* as parameter, instead the index of the graph
|
||||
- Added all enums to the Qt meta system via Q_ENUMS(). The enums can now be transformed
|
||||
to QString values easily with the Qt meta system, which makes saving state e.g. as XML
|
||||
significantly nicer.
|
||||
- added typedef QMapIterator<double,QCustomPlotData> QCustomPlotDataMapIterator
|
||||
and typedef QMutableMapIterator<double,QCustomPlotData> QCustomPlotDataMutableMapIterator
|
||||
for improved information hiding, when using iterators outside QCustomPlot code
|
||||
|
||||
Bugfixes:
|
||||
- Fixed savePngScaled. Axis/label drawing functions used to reset the painter transform
|
||||
and thereby break savePngScaled. Now they buffer the current transform and restore it afterwards.
|
||||
- Fixed some glitches in the doxygen comments (affects documentation only)
|
||||
|
||||
Other:
|
||||
- Changed the default tickLabelPadding of top axis from 3 to 6 pixels. Looks better.
|
||||
- Changed the default QCustomPlot::setAntialiasedElements setting: Graph fills are now antialiased
|
||||
by default. That's a bit slower, but makes fill borders look better.
|
||||
|
||||
#### Version released on 19.11.11 ####
|
||||
|
||||
Changes that break backward compatibility:
|
||||
- QCustomPlotAxis: tickFont and setTickFont renamed to tickLabelFont and setTickLabelFont (for naming consistency)
|
||||
|
||||
Other:
|
||||
- QCustomPlotAxis: Added rotated tick labels, see setTickLabelRotation
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,16 @@
|
||||
set(simulation_SRCS
|
||||
simulatordialog.cpp
|
||||
telemetrysimu.cpp
|
||||
trainersimu.cpp
|
||||
debugoutput.cpp
|
||||
)
|
||||
|
||||
set(simulation_UIS
|
||||
simulatordialog-9x.ui
|
||||
simulatordialog-taranis.ui
|
||||
telemetrysimu.ui
|
||||
trainersimu.ui
|
||||
debugoutput.ui
|
||||
)
|
||||
|
||||
set(simulation_HDRS
|
||||
@@ -14,6 +20,9 @@ set(simulation_HDRS
|
||||
xcursorwidget.h
|
||||
xmenuwidget.h
|
||||
myslider.h
|
||||
telemetrysimu.h
|
||||
trainersimu.h
|
||||
debugoutput.h
|
||||
)
|
||||
|
||||
if(SDL_FOUND)
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#include <QtGui>
|
||||
#include <stdint.h>
|
||||
#include "debugoutput.h"
|
||||
#include "ui_debugoutput.h"
|
||||
|
||||
DebugOutput::DebugOutput(QWidget * parent):
|
||||
QDialog(parent),
|
||||
ui(new Ui::DebugOutput)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
#ifdef __APPLE__
|
||||
QFont newFont("Courier", 13);
|
||||
ui->Output->setFont(newFont);
|
||||
ui->Output->setAttribute(Qt::WA_MacNormalSize);
|
||||
#endif
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
QFont newFont("Courier", 9);
|
||||
ui->Output->setFont(newFont);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
DebugOutput::~DebugOutput()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DebugOutput::traceCallback(const QString & text)
|
||||
{
|
||||
// ui->Output->appendPlainText(text);
|
||||
QTextCursor cursor(ui->Output->textCursor());
|
||||
|
||||
// is the scrollbar at the end?
|
||||
bool atEnd = (ui->Output->verticalScrollBar()->value() == ui->Output->verticalScrollBar()->maximum());
|
||||
|
||||
cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
|
||||
cursor.insertText(text);
|
||||
|
||||
if (atEnd) {
|
||||
ui->Output->verticalScrollBar()->triggerAction(QAbstractSlider::SliderToMaximum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef debugoutput_h
|
||||
#define debugoutput_h
|
||||
|
||||
|
||||
#include <QDialog>
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
namespace Ui {
|
||||
class DebugOutput;
|
||||
}
|
||||
|
||||
|
||||
class DebugOutput : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DebugOutput(QWidget * parent);
|
||||
virtual ~DebugOutput();
|
||||
void traceCallback(const QString & text);
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
Ui::DebugOutput * ui;
|
||||
|
||||
private slots:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DebugOutput</class>
|
||||
<widget class="QDialog" name="DebugOutput">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>711</width>
|
||||
<height>470</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Debug Output</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="../companion.qrc">
|
||||
<normaloff>:/icon.png</normaloff>:/icon.png</iconset>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="Output">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOn</enum>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../companion.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -3,13 +3,13 @@
|
||||
Joystick::Joystick(QObject *parent, int joystickEventTimeout, bool doAutoRepeat, int repeatDelay)
|
||||
: QObject(parent)
|
||||
{
|
||||
if ( SDL_Init(SDL_INIT_JOYSTICK) == 0 ) {
|
||||
if ( SDL_WasInit(SDL_INIT_JOYSTICK) ) {
|
||||
int i;
|
||||
for (i = 0; i < SDL_NumJoysticks(); i++)
|
||||
joystickNames.append(SDL_JoystickName(i));
|
||||
connect(&joystickTimer, SIGNAL(timeout()), this, SLOT(processEvents()));
|
||||
} else {
|
||||
fprintf(stderr, "ERROR: couldn't initialize SDL joystick support");
|
||||
fprintf(stderr, "ERROR: couldn't initialize SDL joystick support\n");
|
||||
}
|
||||
|
||||
joystick = NULL;
|
||||
@@ -23,8 +23,6 @@ Joystick::~Joystick()
|
||||
{
|
||||
if ( isOpen() )
|
||||
close();
|
||||
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
bool Joystick::open(int stick)
|
||||
@@ -62,8 +60,7 @@ void Joystick::processEvents()
|
||||
|
||||
SDL_JoystickUpdate();
|
||||
|
||||
int i;
|
||||
for (i = 0; i < numAxes; i++) {
|
||||
for (int i = 0; i < numAxes; i++) {
|
||||
Sint16 moved = SDL_JoystickGetAxis(joystick, i);
|
||||
if ( abs(moved) >= deadzones[i] ) {
|
||||
if ( (moved != axes[i]) ) {
|
||||
@@ -72,46 +69,55 @@ 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++) {
|
||||
for (int i = 0; i < numButtons; i++) {
|
||||
Uint8 changed = SDL_JoystickGetButton(joystick, i);
|
||||
if ( (changed != buttons[i]) ) {
|
||||
emit buttonValueChanged(i, (bool) changed);
|
||||
buttons[i] = changed;
|
||||
buttonRepeatTimers[i].restart();
|
||||
} else if (autoRepeat && changed != 0) {
|
||||
}
|
||||
else if (autoRepeat && changed != 0) {
|
||||
if ( buttonRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
|
||||
emit buttonValueChanged(i, (bool) changed);
|
||||
buttons[i] = changed;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else {
|
||||
buttonRepeatTimers[i].restart();
|
||||
}
|
||||
}
|
||||
for (i = 0; i < numHats; i++) {
|
||||
for (int i = 0; i < numHats; i++) {
|
||||
Uint8 changed = SDL_JoystickGetHat(joystick, i);
|
||||
if ( (changed != hats[i]) ) {
|
||||
emit hatValueChanged(i, changed);
|
||||
hats[i] = changed;
|
||||
hatRepeatTimers[i].restart();
|
||||
} else if (autoRepeat && changed != 0) {
|
||||
}
|
||||
else if (autoRepeat && changed != 0) {
|
||||
if ( hatRepeatTimers[i].elapsed() >= autoRepeatDelay ) {
|
||||
emit hatValueChanged(i, changed);
|
||||
hats[i] = changed;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else {
|
||||
hatRepeatTimers[i].restart();
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < numTrackballs; i++) {
|
||||
for (int i = 0; i < numTrackballs; i++) {
|
||||
int dx, dy;
|
||||
SDL_JoystickGetBall(joystick, i, &dx, &dy);
|
||||
if ( dx != 0 || dy != 0 )
|
||||
|
||||
@@ -3,21 +3,16 @@
|
||||
#include "appdata.h"
|
||||
#include <QtGui>
|
||||
|
||||
joystickDialog::joystickDialog(QWidget *parent, int stick) :
|
||||
JoystickDialog::JoystickDialog(QWidget *parent, int stick) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::joystickDialog) {
|
||||
ui(new Ui::JoystickDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
int jscaltmp[8][3] = {
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767},
|
||||
{32767, 0, -32767}
|
||||
};
|
||||
memcpy(jscal, jscaltmp, sizeof (jscal));
|
||||
for (int i=0; i<8; ++i) {
|
||||
jscal[i][0] = 32767;
|
||||
jscal[i][1] = 0;
|
||||
jscal[i][2] = -32767;
|
||||
}
|
||||
ui->okButton->setDisabled(true);
|
||||
ui->howtoLabel->setText(tr("Move sticks and pots in every direction making full movement\nPress next when finished"));
|
||||
step = 0;
|
||||
@@ -32,23 +27,24 @@ ui(new Ui::joystickDialog) {
|
||||
connect(joystick, SIGNAL(axisValueChanged(int, int)), this, SLOT(onjoystickAxisValueChanged(int, int)));
|
||||
}
|
||||
|
||||
joystickDialog::~joystickDialog() {
|
||||
JoystickDialog::~JoystickDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void joystickDialog::joystickOpen(int stick) {
|
||||
void JoystickDialog::joystickOpen(int stick)
|
||||
{
|
||||
if (stick == -1) {
|
||||
this->close();
|
||||
return;
|
||||
}
|
||||
joystick = new Joystick(this, 1, false, 0);
|
||||
int numAxes=std::min(joystick->numAxes,8);
|
||||
int numAxes = std::min(joystick->numAxes, 8);
|
||||
if (joystick) {
|
||||
joystick->open(stick);
|
||||
|
||||
for (int j=0; j<numAxes; j++) {
|
||||
joystick->sensitivities[j] = 0;
|
||||
joystick->deadzones[j]=20;
|
||||
joystick->sensitivities[j] = 0;
|
||||
joystick->deadzones[j] = 20;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -57,27 +53,25 @@ void joystickDialog::joystickOpen(int stick) {
|
||||
}
|
||||
}
|
||||
|
||||
void joystickDialog::onjoystickAxisValueChanged(int axis, int value) {
|
||||
void JoystickDialog::onjoystickAxisValueChanged(int axis, int value)
|
||||
{
|
||||
if (value > jscal[axis][2]) {
|
||||
jscal[axis][2] = value;
|
||||
}
|
||||
if (value < jscal[axis][0]) {
|
||||
jscal[axis][0] = value;
|
||||
}
|
||||
QSlider * sl[]= {ui->Ch_1, ui->Ch_2, ui->Ch_3, ui->Ch_4, ui->Ch_5, ui->Ch_6, ui->Ch_7, ui->Ch_8};
|
||||
QCheckBox * ib[]={ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
|
||||
if (ib[axis]->isChecked()) {
|
||||
sl[axis]->setInvertedAppearance(true);
|
||||
} else {
|
||||
sl[axis]->setInvertedAppearance(false);
|
||||
}
|
||||
QSlider * sl[] = {ui->Ch_1, ui->Ch_2, ui->Ch_3, ui->Ch_4, ui->Ch_5, ui->Ch_6, ui->Ch_7, ui->Ch_8};
|
||||
QCheckBox * ib[] = {ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
|
||||
sl[axis]->setInvertedAppearance(ib[axis]->isChecked());
|
||||
sl[axis]->setMinimum(jscal[axis][0]);
|
||||
sl[axis]->setMaximum(jscal[axis][2]);
|
||||
sl[axis]->setValue(value);
|
||||
}
|
||||
|
||||
void joystickDialog::on_nextButton_clicked() {
|
||||
int numAxes=std::min(joystick->numAxes,8);
|
||||
void JoystickDialog::on_nextButton_clicked()
|
||||
{
|
||||
int numAxes = std::min(joystick->numAxes,8);
|
||||
switch (step) {
|
||||
case 0:
|
||||
ui->howtoLabel->setText(tr("Place sticks and pots in middle position.\nPress next when done"));
|
||||
@@ -85,11 +79,11 @@ void joystickDialog::on_nextButton_clicked() {
|
||||
break;
|
||||
case 1:
|
||||
for (int i=0; i<numAxes; i++) {
|
||||
jscal[i][1]=0;
|
||||
for (int j=0; j<100;j++) {
|
||||
jscal[i][1]+=joystick->getAxisValue(i);
|
||||
jscal[i][1] = 0;
|
||||
for (int j=0; j<100; j++) {
|
||||
jscal[i][1] += joystick->getAxisValue(i);
|
||||
}
|
||||
jscal[i][1]/=100;
|
||||
jscal[i][1] /= 100;
|
||||
}
|
||||
ui->howtoLabel->setText(tr("Map joystick channels to controls using comboboxes.\nPress next when done"));
|
||||
step++;
|
||||
@@ -110,28 +104,32 @@ void joystickDialog::on_nextButton_clicked() {
|
||||
}
|
||||
}
|
||||
|
||||
void joystickDialog::on_cancelButton_clicked() {
|
||||
void JoystickDialog::on_cancelButton_clicked()
|
||||
{
|
||||
joystick->close();
|
||||
this->close();
|
||||
}
|
||||
|
||||
void joystickDialog::on_okButton_clicked() {
|
||||
int sticks[8]={0,0,0,0,0,0,0,0};
|
||||
void JoystickDialog::on_okButton_clicked()
|
||||
{
|
||||
int stickAssignments[MAX_JOYSTICKS] = {0};
|
||||
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
|
||||
sticks[cb->currentIndex()]++;
|
||||
}
|
||||
bool duplicated=false;
|
||||
for (int i=1; i<8;i++) {
|
||||
if (sticks[i]>1) {
|
||||
duplicated=true;
|
||||
int mappedValue = cb->currentIndex() - 1;
|
||||
// qDebug() << "cb->currentIndex()" << mappedValue;
|
||||
if (mappedValue >= 0 && mappedValue < MAX_JOYSTICKS) {
|
||||
stickAssignments[mappedValue]++;
|
||||
}
|
||||
}
|
||||
if (duplicated) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Duplicated stick assignement"));
|
||||
return;
|
||||
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++) {
|
||||
if (stickAssignments[i] > 1) {
|
||||
QMessageBox::critical(this, tr("Error"), tr("Duplicated stick assignment"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
joystick->close();
|
||||
for (int i=0; i<8;i++) {
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++) {
|
||||
g.joystick[i].remove();
|
||||
}
|
||||
QCheckBox * ib[]={ui->ChInv_1, ui->ChInv_2, ui->ChInv_3, ui->ChInv_4, ui->ChInv_5, ui->ChInv_6, ui->ChInv_7, ui->ChInv_8};
|
||||
@@ -139,7 +137,7 @@ void joystickDialog::on_okButton_clicked() {
|
||||
int axe=cb->objectName().mid(cb->objectName().lastIndexOf("_")+1).toInt()-1;
|
||||
int stick=cb->currentIndex() - 1;
|
||||
qDebug() << "joystick mapping " << cb->objectName() <<"axe:" << axe << "stick:" << stick;
|
||||
if (stick >= 0) {
|
||||
if (stick >= 0 && stick < MAX_JOYSTICKS) {
|
||||
g.joystick[stick].stick_axe( axe );
|
||||
g.joystick[stick].stick_max( jscal[axe][2] );
|
||||
g.joystick[stick].stick_med( jscal[axe][1] );
|
||||
|
||||
@@ -5,23 +5,23 @@
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class joystickDialog;
|
||||
class JoystickDialog;
|
||||
}
|
||||
|
||||
class joystickDialog : public QDialog
|
||||
class JoystickDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit joystickDialog(QWidget *parent = 0, int stick=-1);
|
||||
~joystickDialog();
|
||||
explicit JoystickDialog(QWidget *parent = 0, int stick=-1);
|
||||
~JoystickDialog();
|
||||
Joystick *joystick;
|
||||
|
||||
public slots:
|
||||
void onjoystickAxisValueChanged(int axis, int value);
|
||||
|
||||
private:
|
||||
Ui::joystickDialog *ui;
|
||||
Ui::JoystickDialog *ui;
|
||||
void joystickOpen(int stick);
|
||||
int jscal[8][3];
|
||||
int step;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>joystickDialog</class>
|
||||
<widget class="QDialog" name="joystickDialog">
|
||||
<class>JoystickDialog</class>
|
||||
<widget class="QDialog" name="JoystickDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>418</width>
|
||||
<height>301</height>
|
||||
<width>505</width>
|
||||
<height>398</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -908,6 +908,35 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>Ch_1</tabstop>
|
||||
<tabstop>ChInv_1</tabstop>
|
||||
<tabstop>jsmapCB_1</tabstop>
|
||||
<tabstop>Ch_2</tabstop>
|
||||
<tabstop>ChInv_2</tabstop>
|
||||
<tabstop>jsmapCB_2</tabstop>
|
||||
<tabstop>Ch_3</tabstop>
|
||||
<tabstop>ChInv_3</tabstop>
|
||||
<tabstop>jsmapCB_3</tabstop>
|
||||
<tabstop>Ch_4</tabstop>
|
||||
<tabstop>ChInv_4</tabstop>
|
||||
<tabstop>jsmapCB_4</tabstop>
|
||||
<tabstop>Ch_5</tabstop>
|
||||
<tabstop>ChInv_5</tabstop>
|
||||
<tabstop>jsmapCB_5</tabstop>
|
||||
<tabstop>Ch_6</tabstop>
|
||||
<tabstop>ChInv_6</tabstop>
|
||||
<tabstop>jsmapCB_6</tabstop>
|
||||
<tabstop>Ch_7</tabstop>
|
||||
<tabstop>ChInv_7</tabstop>
|
||||
<tabstop>jsmapCB_7</tabstop>
|
||||
<tabstop>Ch_8</tabstop>
|
||||
<tabstop>ChInv_8</tabstop>
|
||||
<tabstop>jsmapCB_8</tabstop>
|
||||
<tabstop>cancelButton</tabstop>
|
||||
<tabstop>nextButton</tabstop>
|
||||
<tabstop>okButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
</resources>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef MYQDIAL_H
|
||||
#define MYQDIAL_H
|
||||
|
||||
|
||||
class myQDial : public QDial
|
||||
{
|
||||
public:
|
||||
explicit myQDial(QWidget *parent = 0) : QDial(parent) {}
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::RightButton && event->type() == QEvent::MouseButtonDblClick) {
|
||||
setValue(0);
|
||||
event->accept();
|
||||
}
|
||||
QDial::mousePressEvent(event);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -974,8 +974,8 @@ QPushButton:checked {
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9" stretch="0,1,0,0,1,0,0,1,0,0,1">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="beep_frame">
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
@@ -1006,7 +1006,7 @@ QPushButton:checked {
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -1019,8 +1019,8 @@ QPushButton:checked {
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="dialP_1">
|
||||
<item row="2" column="0">
|
||||
<widget class="myQDial" name="dialP_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1053,7 +1053,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="dialP_1value">
|
||||
<property name="text">
|
||||
<string notr="true">0 %</string>
|
||||
@@ -1063,7 +1063,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -1076,8 +1076,8 @@ QPushButton:checked {
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="dialP_2">
|
||||
<item row="5" column="0">
|
||||
<widget class="myQDial" name="dialP_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1113,7 +1113,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="dialP_2value">
|
||||
<property name="text">
|
||||
<string notr="true">0 %</string>
|
||||
@@ -1123,7 +1123,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -1136,8 +1136,8 @@ QPushButton:checked {
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDial" name="dialP_3">
|
||||
<item row="8" column="0">
|
||||
<widget class="myQDial" name="dialP_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1170,7 +1170,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="dialP_3value">
|
||||
<property name="text">
|
||||
<string notr="true">0 %</string>
|
||||
@@ -1180,7 +1180,7 @@ QPushButton:checked {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="10" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -1232,7 +1232,7 @@ QPushButton:checked {
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="simu">
|
||||
<attribute name="title">
|
||||
@@ -1457,17 +1457,11 @@ QPushButton:checked {
|
||||
<attribute name="title">
|
||||
<string>Gvars</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>711</width>
|
||||
<height>211</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gvarsLayout"/>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gvarsLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1497,6 +1491,11 @@ QPushButton:checked {
|
||||
<header>menuwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>myQDial</class>
|
||||
<extends>QDial</extends>
|
||||
<header location="global">myqdial.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../companion.qrc"/>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>726</width>
|
||||
<height>688</height>
|
||||
<height>653</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -70,7 +70,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="simu">
|
||||
<attribute name="title">
|
||||
@@ -257,17 +257,11 @@
|
||||
<attribute name="title">
|
||||
<string>Gvars</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>691</width>
|
||||
<height>231</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gvarsLayout"/>
|
||||
</widget>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gvarsLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -576,7 +570,7 @@ QPushButton:checked {
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="10">
|
||||
<widget class="QDial" name="dialP_1">
|
||||
<widget class="myQDial" name="dialP_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -832,7 +826,7 @@ QPushButton:checked {
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QDial" name="dialP_3">
|
||||
<widget class="myQDial" name="dialP_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1071,7 +1065,7 @@ QPushButton:checked {
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDial" name="dialP_2">
|
||||
<widget class="myQDial" name="dialP_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1436,7 +1430,7 @@ QPushButton:checked {
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="8">
|
||||
<widget class="QDial" name="dialP_4">
|
||||
<widget class="myQDial" name="dialP_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -1693,7 +1687,49 @@ QPushButton:checked {
|
||||
<header>xmenuwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>myQDial</class>
|
||||
<extends>QDial</extends>
|
||||
<header location="global">myqdial.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>switchF</tabstop>
|
||||
<tabstop>dialP_3</tabstop>
|
||||
<tabstop>switchE</tabstop>
|
||||
<tabstop>switchA</tabstop>
|
||||
<tabstop>switchB</tabstop>
|
||||
<tabstop>dialP_1</tabstop>
|
||||
<tabstop>dialP_2</tabstop>
|
||||
<tabstop>switchC</tabstop>
|
||||
<tabstop>switchD</tabstop>
|
||||
<tabstop>switchG</tabstop>
|
||||
<tabstop>dialP_4</tabstop>
|
||||
<tabstop>switchH</tabstop>
|
||||
<tabstop>holdLeftY</tabstop>
|
||||
<tabstop>FixLeftY</tabstop>
|
||||
<tabstop>FixLeftX</tabstop>
|
||||
<tabstop>holdLeftX</tabstop>
|
||||
<tabstop>leftStick</tabstop>
|
||||
<tabstop>trimHL_L</tabstop>
|
||||
<tabstop>trimHLeft</tabstop>
|
||||
<tabstop>trimHL_R</tabstop>
|
||||
<tabstop>trimVL_D</tabstop>
|
||||
<tabstop>trimVLeft</tabstop>
|
||||
<tabstop>trimVL_U</tabstop>
|
||||
<tabstop>trimVR_U</tabstop>
|
||||
<tabstop>trimVRight</tabstop>
|
||||
<tabstop>trimVR_D</tabstop>
|
||||
<tabstop>trimHR_L</tabstop>
|
||||
<tabstop>trimHRight</tabstop>
|
||||
<tabstop>trimHR_R</tabstop>
|
||||
<tabstop>rightStick</tabstop>
|
||||
<tabstop>holdRightY</tabstop>
|
||||
<tabstop>FixRightY</tabstop>
|
||||
<tabstop>FixRightX</tabstop>
|
||||
<tabstop>holdRightX</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../companion.qrc"/>
|
||||
</resources>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user