Compare commits
565 Commits
multipatchv4
...
2.0.17
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| b359aa12ba | |||
| 5f81444ccb | |||
| e8aba51edb | |||
| 6393f10ae4 | |||
| 8a16b63b31 | |||
| a5d334b11d | |||
| b51060f8f8 | |||
| 0db8fc5ab2 | |||
| 1c696c28fd | |||
| f29d2074c1 | |||
| c12bc7326c | |||
| 6365292bfe | |||
| d74bdef2ea | |||
| 884698c7f7 | |||
| 1454764987 | |||
| fb35ff098d | |||
| 681064b11c | |||
| 87ebf0b90a | |||
| 1f63108753 | |||
| 649fffa439 | |||
| e3d08e9bab | |||
| b4cc92b3f0 | |||
| 9691d9f648 | |||
| f02b9699d5 | |||
| b78556275b | |||
| 1effa17204 | |||
| ff69164400 | |||
| 86e8687d32 | |||
| 85755312e4 | |||
| f826d77f18 | |||
| 9dc4756789 | |||
| afd04e0c44 | |||
| d718ca03db | |||
| ca4028cc7e | |||
| 9c0b13eb6b | |||
| 5a10d85ee0 | |||
| 2d80327ffd | |||
| 2a5ff5244f | |||
| 2ce1ec16fb | |||
| 607a93b604 | |||
| 75b7a0517b | |||
| cf54d28f35 | |||
| ffe8ee5a29 | |||
| 552e3d468a | |||
| 949369d6a8 | |||
| 3b2cf5d738 | |||
| 5468bacad7 | |||
| b8fea4d652 | |||
| 734480cc56 | |||
| 30e0d441e4 | |||
| 784238252a | |||
| 403a62478a | |||
| c73ab26bc4 | |||
| c0783948e6 | |||
| dc3ca96a2f | |||
| 5664b4a141 | |||
| 7e18f53cbe | |||
| 611e26d0bf | |||
| ae7a36deeb | |||
| 7c37277364 | |||
| 2230fbaa94 | |||
| 97bb1a4b4d | |||
| 82d385bcef | |||
| 34f9367e25 | |||
| 205e510468 | |||
| 414a482ce4 | |||
| b24d071493 | |||
| a50e2472e9 | |||
| 29c95fd2a3 | |||
| c9875525a4 | |||
| 6df7575ad8 | |||
| 86c8d4a878 | |||
| 6abc26c36a | |||
| 966398426a | |||
| d43a48f088 | |||
| 56b4698655 | |||
| 57f0c1b6f6 | |||
| b89e16e627 | |||
| 9e4e990d33 | |||
| a7c893607a | |||
| e477183026 | |||
| a4698287f8 | |||
| b035a8df64 | |||
| 223be49c5d | |||
| ac8312de36 | |||
| 46a9151bcf | |||
| 0e9536fea9 | |||
| 64d86c4c74 | |||
| 151a09149d | |||
| fd53eba65f | |||
| 393f599ecf | |||
| 1fbb4effed | |||
| fe95488a83 | |||
| c9b9de2c99 | |||
| 3adc4c20a6 | |||
| 227a886122 | |||
| de625fde01 | |||
| daad477250 | |||
| 334a718a8a | |||
| 5baaec1868 | |||
| c2ad82eb35 | |||
| c61c417f13 | |||
| 98f156301a | |||
| ef6fe0006e | |||
| 23358c254c | |||
| 6114245229 | |||
| e76880cf26 | |||
| f30dfa3365 | |||
| f4aa92ec20 | |||
| 2640ca9fea | |||
| f6a1420ce3 | |||
| 6c0f65411a | |||
| a7f1ace55b | |||
| b8dedd7940 | |||
| 2703118c56 | |||
| 8bfc7a497a | |||
| 87870c24a5 | |||
| 7610fb43d5 | |||
| 0263784e65 | |||
| 6f74624371 | |||
| 1c721b3817 | |||
| 67d97046bb | |||
| 19d9e6ab19 | |||
| 5d9883d47f | |||
| bb5f1d7d79 | |||
| 30087b4a3a | |||
| 61aa01b9b3 | |||
| 16e06cff70 | |||
| 2073a1f033 | |||
| 563b817b46 | |||
| 8b540a66f6 | |||
| b0b7657756 | |||
| 74d22b623f | |||
| bee01d9999 | |||
| d2055edf62 | |||
| c926ac557b | |||
| 3e2092e32f | |||
| 21054ffc54 | |||
| 350ece0b60 | |||
| 01a103f2e6 | |||
| 2e8e439d27 | |||
| 98e6a3dc21 | |||
| 3b324d076a | |||
| 91c922d5fb | |||
| eac918c2da | |||
| b5f9c0ec84 | |||
| d1f54b099b | |||
| 7b98ad55c0 | |||
| d2cb7cb3dd | |||
| be190b8bb1 | |||
| 4b2c02b2c5 | |||
| 142d3fee1a | |||
| 6a5e938ead | |||
| 2d9ae108ff | |||
| bae84e4e8c | |||
| f4944eefdb | |||
| 5d598cc6a1 | |||
| 945808d69b | |||
| dbe512e45a | |||
| 11efb5121e | |||
| f6274f38aa | |||
| cd1f20b8a0 | |||
| e61b931ddb | |||
| a7a9b61234 | |||
| 5ee95673d1 | |||
| 98c5b5e7bd | |||
| 6d434c0bf9 | |||
| ade7151796 | |||
| a7cd1f9aa0 | |||
| cb2c922542 | |||
| 8159a559da | |||
| ed826d8c62 | |||
| b57f5ab2ce | |||
| 8fbafa6f05 | |||
| 9243a59426 | |||
| ccf66831c7 | |||
| 06792b5696 | |||
| 6d4d871849 | |||
| 5a634a7991 | |||
| 69e504212e | |||
| 03e049c360 | |||
| 4ca893da1f | |||
| 66670cf713 | |||
| 271bb4a82e | |||
| e0eab648ef | |||
| 3235f43db9 | |||
| c12b0cfebe | |||
| 3e590d44f0 | |||
| 1f6d1799af | |||
| 8c813a87c9 | |||
| 5bdeedbd0e | |||
| e33f4cf415 | |||
| 61d745011a | |||
| 3e269a04ae | |||
| 341feaf78f | |||
| 19ddf6fc23 | |||
| 9b4b0d3c83 | |||
| dc1eebf40d | |||
| 752e13b9ab | |||
| b988bec5bd | |||
| 3c72afed20 | |||
| e7586f47c3 | |||
| f126b149f0 | |||
| 6b15c0c985 | |||
| db85f39ebc | |||
| dee1e4ce8d | |||
| df96504a85 | |||
| 0112a1e3e9 |
+185
@@ -566,3 +566,188 @@ Bertrand Condevaux Lanloy
|
||||
Henri Mirra
|
||||
Aurélien Planiol
|
||||
Kevin Caldwell
|
||||
Andrew Garello
|
||||
Tomasz Maziarz
|
||||
Russell Flack
|
||||
Fernando Rimoldi
|
||||
Greg Reid
|
||||
Dietmar Drees
|
||||
Holger Landwehr
|
||||
Arno Loehdorf
|
||||
Boon Sripattha
|
||||
Patrik Åkerfeldt
|
||||
Alonzo Fretwell
|
||||
Renjith Chandrasekharan
|
||||
Ruben Gomez Hernandez
|
||||
Michael Gardner
|
||||
Judith Green
|
||||
Timo Ruppell
|
||||
John Lipscomb
|
||||
Norbert Wenke
|
||||
Erik Frieberg
|
||||
Raimo Ruotsalainen
|
||||
Brian Harris
|
||||
Sebastian Blüml
|
||||
Efisio Maxia
|
||||
Jeff Theobald
|
||||
Anthony Rizzo
|
||||
Rodney Huddleston
|
||||
Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
Patrizio Simoncini (monthly)
|
||||
Harald Gabler
|
||||
Michael Brown
|
||||
Julien Gérard
|
||||
Alexandre d'Alton
|
||||
Peter Mergaerts
|
||||
Jan Houwers
|
||||
Gordon Stahl
|
||||
Christian Grandjean
|
||||
Roger Bergevin
|
||||
NorthSide
|
||||
Sigmund Martinsen
|
||||
Lionel Lafraise
|
||||
Gisli Ofeigsson
|
||||
The Gruvin9x Project
|
||||
Manuel McLure
|
||||
Fernando Rimoldi
|
||||
Hiltenkamp Stephan
|
||||
Sandeep Kishore Jain
|
||||
Sebastien Charpentier
|
||||
Greg Parker
|
||||
Norman Maaß
|
||||
Adriano Del Ben
|
||||
Justin Poole
|
||||
Kenneth Harrison
|
||||
Eugene LaFaille
|
||||
John O'Shaughnessy
|
||||
Uwe Jordt
|
||||
Stuart Olson
|
||||
Frédéric Devillard
|
||||
Cheung Leo
|
||||
Peter Webster
|
||||
Jean-Claude Bachetta
|
||||
Delfin Perena
|
||||
Sae-wook Yoon
|
||||
Focus on Excellence
|
||||
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
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
##OpenTX Next Branch
|
||||
##OpenTX Master Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
|
||||
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 stable release code is not here, it is in the master branch.
|
||||
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
|
||||
The ongoing development is not done in this branch. It is performed in the branch called next.
|
||||
|
||||
Refer to the opentx.wiki for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
|
||||
@@ -1,9 +1,92 @@
|
||||
<h2>Version 2.0.9</h2>
|
||||
<h2>Version 2.0.17 / 2015-05-04</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>Simulator crash (<a href=https://github.com/opentx/opentx/issues/2253>#2253</a>)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8</h2>
|
||||
|
||||
<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>
|
||||
<li>Fixed vario limits</li>
|
||||
<li>Fixes in compare dialog</li>
|
||||
<li>Fixed receiver number range</li>
|
||||
<li>Virtual inputs not selectable in SF Volume and heli Collective Source</li>
|
||||
<li>Joystick calibration crash after channel assignment</li>
|
||||
<li>Gvar import error for limits</li>
|
||||
<li>Companion shows too many curve types in input/mixer for 9x</li>
|
||||
<li>NOT curves removed from inputs (for non ARM platforms)</li>
|
||||
<li>Companion again builds on OS X (Mac)</li>
|
||||
<li>Companion simulator Lua crash on OS X 64bit (Mac)</li>
|
||||
<li>Companion didn't take care of PlayScript functions</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.12 / 2014-09-15</h2>
|
||||
<ul>
|
||||
<li>Typos & Translations updated</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.11 / 2014-09-10</h2>
|
||||
<ul>
|
||||
<li>Limits EEPROM export was broken (all boards except Taranis)</li>
|
||||
<li>Fix issue when a GVAR was used as Offset</li>
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.10 / 2014-09-08</h2>
|
||||
<ul>
|
||||
<li>Taranis is now the default board in General Settings</li>
|
||||
<li>GVARS allowed in Limits min/max/offset</li>
|
||||
<li>Limits displayed in us when ppmus option selected
|
||||
</ul>
|
||||
|
||||
<h2>Version 2.0.8 / 2014-07-23</h2>
|
||||
<ul>
|
||||
<li>Compare dialog bugfixes</li>
|
||||
<li>Curve index correctly resetted when type changed</li>
|
||||
@@ -39,13 +122,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>
|
||||
@@ -219,4 +302,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 "9" )
|
||||
SET( C9X_VERSION_REVISION "17" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
@@ -33,8 +33,9 @@ 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)
|
||||
@@ -89,7 +90,7 @@ add_custom_command(
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/lua_exports.inc
|
||||
COMMAND make lua_exports.cpp
|
||||
COMMAND make PCB=TARANIS lua_exports.cpp
|
||||
DEPENDS ${RADIO_SRC_DIRECTORY}/myeeprom.h
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
@@ -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)
|
||||
|
||||
+64
-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,10 @@ QString Profile::fwName() const { return _fwName; }
|
||||
QString Profile::fwType() const { return _fwType; }
|
||||
QString Profile::name() const { return _name; }
|
||||
QString Profile::sdPath() const { return _sdPath; }
|
||||
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 +315,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 +324,11 @@ 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::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 +344,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 +354,18 @@ 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() );
|
||||
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 +379,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 +389,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 +400,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 +425,8 @@ void Profile::initFwVariables()
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_vBatMin = 0;
|
||||
_vBatMax = 0;
|
||||
_vBatWarn = 0;
|
||||
}
|
||||
|
||||
@@ -424,9 +438,11 @@ void Profile::init(int newIndex)
|
||||
_fwType = "";
|
||||
_name = "";
|
||||
_sdPath = "";
|
||||
_pBackupDir = "";
|
||||
_splashFile = "";
|
||||
_burnFirmware = false;
|
||||
_renameFwFiles = false;
|
||||
_penableBackup = false;
|
||||
_channelOrder = 0;
|
||||
_defaultMode = 1;
|
||||
|
||||
@@ -446,8 +462,10 @@ 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( _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 +482,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 +519,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 +571,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 +603,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 +669,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 +685,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 +715,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 );
|
||||
|
||||
+21
-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,10 @@ class Profile: protected CompStoreObj
|
||||
QString _fwType;
|
||||
QString _name;
|
||||
QString _sdPath;
|
||||
QString _pBackupDir;
|
||||
QString _splashFile;
|
||||
bool _burnFirmware;
|
||||
bool _penableBackup;
|
||||
bool _renameFwFiles;
|
||||
int _channelOrder;
|
||||
int _defaultMode;
|
||||
@@ -126,6 +128,8 @@ class Profile: protected CompStoreObj
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _vBatMin;
|
||||
int _vBatMax;
|
||||
int _vBatWarn;
|
||||
|
||||
public:
|
||||
@@ -134,9 +138,11 @@ class Profile: protected CompStoreObj
|
||||
QString fwType() const;
|
||||
QString name() const;
|
||||
QString sdPath() const;
|
||||
QString pBackupDir() const;
|
||||
QString splashFile() const;
|
||||
bool burnFirmware() const;
|
||||
bool renameFwFiles() const;
|
||||
bool penableBackup() const;
|
||||
int channelOrder() const;
|
||||
int defaultMode() const;
|
||||
|
||||
@@ -152,6 +158,8 @@ 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
|
||||
@@ -159,9 +167,11 @@ class Profile: protected CompStoreObj
|
||||
void fwName (const QString);
|
||||
void fwType (const QString);
|
||||
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 +187,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 +238,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
bool _enableBackup;
|
||||
bool _backupOnFlash;
|
||||
bool _checkHardwareCompatibility;
|
||||
bool _maximized;
|
||||
bool _jsSupport;
|
||||
bool _showSplash;
|
||||
@@ -259,7 +272,7 @@ class AppData: protected CompStoreObj
|
||||
QString avrdudeLocation();
|
||||
QString dfuArguments();
|
||||
QString dfuLocation();
|
||||
QString lastFw();
|
||||
QString lastFw();
|
||||
QString locale();
|
||||
QString mcu();
|
||||
QString programmer();
|
||||
@@ -278,6 +291,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
bool enableBackup();
|
||||
bool backupOnFlash();
|
||||
bool checkHardwareCompatibility();
|
||||
bool jsSupport();
|
||||
bool maximized();
|
||||
bool showSplash();
|
||||
@@ -329,6 +343,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);
|
||||
|
||||
@@ -66,6 +66,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
|
||||
@@ -164,6 +166,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 +238,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 +286,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 +458,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 +466,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 +480,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();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>685</width>
|
||||
<width>686</width>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -26,13 +26,7 @@
|
||||
<string>Edit Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="verticalSpacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -42,7 +36,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
@@ -51,110 +45,8 @@
|
||||
<attribute name="title">
|
||||
<string>Radio Profile</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0,1,0,0,0,0,0">
|
||||
<item row="21" column="7">
|
||||
<widget class="QPushButton" name="sdPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="25" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Channel Order</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Build Options</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="langLabel">
|
||||
<property name="text">
|
||||
<string>Menu Language</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Stick Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="7">
|
||||
<widget class="QPushButton" name="SplashSelect">
|
||||
<property name="text">
|
||||
<string>Select Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="1">
|
||||
<widget class="QLabel" name="lblGeneralSettings">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">General Settings Label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0" colspan="8">
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1" colspan="7">
|
||||
<layout class="QGridLayout" name="optionsLayout"/>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Splash Screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1,0,0">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
@@ -167,51 +59,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="7">
|
||||
<widget class="QPushButton" name="clearImageButton">
|
||||
<property name="text">
|
||||
<string>Clear Image</string>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="profileNameLE"/>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="4">
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="1">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -234,57 +92,24 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="0" colspan="8">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="downloadVerCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="8">
|
||||
<widget class="Line" name="line_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="20" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="langLabel">
|
||||
<property name="text">
|
||||
<string>Other Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="22" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>General Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="0">
|
||||
<widget class="QLabel" name="sdPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SD Structure path</string>
|
||||
<string>Menu Language</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="7">
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
@@ -338,14 +163,46 @@ May be different from firmware language</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="7">
|
||||
<widget class="QComboBox" name="downloadVerCB">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Build Options</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1" colspan="6">
|
||||
<item row="4" column="1">
|
||||
<layout class="QGridLayout" name="optionsLayout"/>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="4">
|
||||
<widget class="Line" name="line_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Splash Screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="SplashFileName">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -355,17 +212,150 @@ May be different from firmware language</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" column="1" colspan="6">
|
||||
<item row="7" column="1">
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>128</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>212</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="4">
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Other Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="sdPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>SD Structure path</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLineEdit" name="sdPath">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="23" column="1" colspan="6">
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="profilebackupPathLabel">
|
||||
<property name="toolTip">
|
||||
<string>The profile specific folder, if set, will override general Backup folder</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QLineEdit" name="profilebackupPath">
|
||||
<property name="toolTip">
|
||||
<string>If set it will override the application general setting</string>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QCheckBox" name="pbackupEnable">
|
||||
<property name="toolTip">
|
||||
<string>if set, will override general backup enable</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Enable automatic backup before writing firmware</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>General Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QLabel" name="lblGeneralSettings">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">General Settings Label</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Stick Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QComboBox" name="stickmodeCB">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
@@ -419,7 +409,23 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="25" column="1" colspan="6">
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Default Channel Order</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<widget class="QComboBox" name="channelorderCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
@@ -567,31 +573,21 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="6">
|
||||
<widget class="QLineEdit" name="profileNameLE"/>
|
||||
</item>
|
||||
<item row="1" column="7">
|
||||
<widget class="QPushButton" name="removeProfileButton">
|
||||
<property name="text">
|
||||
<string>Remove Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="26" column="1" colspan="7">
|
||||
<item row="16" column="1">
|
||||
<widget class="QCheckBox" name="renameFirmware">
|
||||
<property name="text">
|
||||
<string>Append version number to FW file name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="27" column="1" colspan="7">
|
||||
<item row="17" column="1">
|
||||
<widget class="QCheckBox" name="burnFirmware">
|
||||
<property name="text">
|
||||
<string>Offer to write FW to Tx after download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="28" column="1">
|
||||
<item row="18" column="1">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -604,6 +600,44 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="clearImageButton">
|
||||
<property name="text">
|
||||
<string>Clear Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="SplashSelect">
|
||||
<property name="text">
|
||||
<string>Select Image</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="removeProfileButton">
|
||||
<property name="text">
|
||||
<string>Remove Profile</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="sdPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="ProfilebackupPathButton">
|
||||
<property name="toolTip">
|
||||
<string>The profile specific folder, if set, will override general Backup folder</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="applicationTab">
|
||||
@@ -611,17 +645,7 @@ Mode 4:
|
||||
<string>Application Settings</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="4" column="1" colspan="4">
|
||||
<widget class="QCheckBox" name="showSplash">
|
||||
<property name="text">
|
||||
<string>Show splash screen when Companion starts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1" colspan="4">
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_companion9x">
|
||||
<property name="text">
|
||||
<string>Automatic check for Companion updates</string>
|
||||
@@ -631,28 +655,38 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="4">
|
||||
<item row="4" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="showSplash">
|
||||
<property name="text">
|
||||
<string>Show splash screen when Companion starts</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="backupEnable">
|
||||
<property name="text">
|
||||
<string>Enable automatic backup before writing firmware</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="4">
|
||||
<item row="3" column="1" colspan="3">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="4">
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="4">
|
||||
<item row="6" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_fw">
|
||||
<property name="text">
|
||||
<string>Automatic check for OpenTX firmware updates</string>
|
||||
@@ -668,23 +702,10 @@ Mode 4:
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<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="15" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
@@ -698,13 +719,6 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="9" column="4">
|
||||
<widget class="QPushButton" name="backupPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
@@ -731,27 +745,13 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="ge_pathButton">
|
||||
<property name="text">
|
||||
<string>Find Executable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="Line" name="line_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="4">
|
||||
<widget class="QPushButton" name="libraryPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLineEdit" name="backupPath">
|
||||
<property name="minimumSize">
|
||||
@@ -761,7 +761,7 @@ Mode 4:
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -772,26 +772,6 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QComboBox" name="splashincludeCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Only show user splash images</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Show user and companion splash images</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
@@ -834,18 +814,39 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<item row="11" column="1" colspan="3">
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="modelWizard_CB">
|
||||
<property name="text">
|
||||
<string>Use model wizard when creating a new model</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QComboBox" name="splashincludeCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Only show user splash images</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Show user and companion splash images</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="ge_lineedit">
|
||||
@@ -860,17 +861,24 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1" colspan="4">
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="ge_pathButton">
|
||||
<property name="text">
|
||||
<string>Find Executable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1" colspan="4">
|
||||
<widget class="QCheckBox" name="modelWizard_CB">
|
||||
<item row="9" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="backupPathButton">
|
||||
<property name="text">
|
||||
<string>Use model wizard when creating a new model</string>
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="libraryPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1049,10 +1057,25 @@ Mode 4:
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>removeProfileButton</tabstop>
|
||||
<tabstop>downloadVerCB</tabstop>
|
||||
<tabstop>langCombo</tabstop>
|
||||
<tabstop>voiceCombo</tabstop>
|
||||
<tabstop>SplashFileName</tabstop>
|
||||
<tabstop>SplashSelect</tabstop>
|
||||
<tabstop>clearImageButton</tabstop>
|
||||
<tabstop>sdPath</tabstop>
|
||||
<tabstop>sdPathButton</tabstop>
|
||||
<tabstop>stickmodeCB</tabstop>
|
||||
<tabstop>channelorderCB</tabstop>
|
||||
<tabstop>renameFirmware</tabstop>
|
||||
<tabstop>burnFirmware</tabstop>
|
||||
<tabstop>ge_lineedit</tabstop>
|
||||
<tabstop>ge_pathButton</tabstop>
|
||||
<tabstop>historySize</tabstop>
|
||||
<tabstop>showSplash</tabstop>
|
||||
<tabstop>modelWizard_CB</tabstop>
|
||||
<tabstop>startupCheck_fw</tabstop>
|
||||
<tabstop>startupCheck_companion9x</tabstop>
|
||||
<tabstop>backupPath</tabstop>
|
||||
@@ -1061,7 +1084,6 @@ Mode 4:
|
||||
<tabstop>splashincludeCB</tabstop>
|
||||
<tabstop>libraryPath</tabstop>
|
||||
<tabstop>libraryPathButton</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
<tabstop>snapshotPath</tabstop>
|
||||
<tabstop>snapshotPathButton</tabstop>
|
||||
<tabstop>snapshotClipboardCKB</tabstop>
|
||||
@@ -1070,11 +1092,7 @@ Mode 4:
|
||||
<tabstop>joystickCB</tabstop>
|
||||
<tabstop>joystickChkB</tabstop>
|
||||
<tabstop>joystickcalButton</tabstop>
|
||||
<tabstop>SplashFileName</tabstop>
|
||||
<tabstop>stickmodeCB</tabstop>
|
||||
<tabstop>channelorderCB</tabstop>
|
||||
<tabstop>renameFirmware</tabstop>
|
||||
<tabstop>burnFirmware</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="companion.qrc"/>
|
||||
|
||||
@@ -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();
|
||||
@@ -408,6 +410,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 +426,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) {
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
+200
-87
@@ -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));
|
||||
@@ -797,7 +820,7 @@ void CompareDialog::printMixers()
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
if (md->curve.value) str += " " + md->curve.toString().replace("<", "<").replace(">", ">");
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
|
||||
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
|
||||
@@ -875,7 +898,7 @@ void CompareDialog::printMixers()
|
||||
if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString());
|
||||
if (md->carryTrim) str += " " + tr("noTrim");
|
||||
if (md->sOffset) str += " "+ tr("Offset") + QString(" (%1%)").arg(getGVarString(md->sOffset));
|
||||
if (md->curve.value) str += " " + md->curve.toString().replace("<", "<").replace(">", ">");
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale);
|
||||
if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale);
|
||||
if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn);
|
||||
@@ -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(i=0; i<21; i++) {
|
||||
painter1.drawLine(ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5,(ISIZE*i)/(20));
|
||||
painter2.drawLine(ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5,(ISIZE*i)/(20));
|
||||
painter1.drawLine((ISIZE*i)/(20),ISIZE/2-5,(ISIZE*i)/(20),ISIZE/2+5);
|
||||
painter2.drawLine((ISIZE*i)/(20),ISIZE/2-5,(ISIZE*i)/(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()
|
||||
@@ -1021,11 +1138,7 @@ void CompareDialog::printSwitches()
|
||||
str.append("<tr>");
|
||||
color=getColor1(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw1+"</font></td>");
|
||||
if (i<9) {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+QString("%1</b></td>").arg(i+1));
|
||||
} else {
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("LS")+('A'+(i-9))+"</b></td>");
|
||||
}
|
||||
str.append("<td align=\"center\" width=\"10%\"><b>"+tr("L%1").arg(i+1)+QString("</b></td>"));
|
||||
color=getColor2(sw1,sw2);
|
||||
str.append(QString("<td width=\"45%\"><font color=%1>").arg(color)+sw2+"</font></td>");
|
||||
str.append("</tr>");
|
||||
@@ -1060,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:
|
||||
@@ -301,7 +309,7 @@ RawSourceRange RawSource::getRange(const ModelData & model, const GeneralSetting
|
||||
break;
|
||||
|
||||
default:
|
||||
result.max = (model.extendedLimits ? 125 : 100);
|
||||
result.max = model.getChannelsMax(true);
|
||||
result.min = -result.max;
|
||||
break;
|
||||
}
|
||||
@@ -460,7 +468,7 @@ QString RawSwitch::toString()
|
||||
};
|
||||
|
||||
static const QString timerModes[] = {
|
||||
QObject::tr("OFF"), QObject::tr("ABS"),
|
||||
QObject::tr("OFF"), QObject::tr("ON"),
|
||||
QObject::tr("THs"), QObject::tr("TH%"), QObject::tr("THt")
|
||||
};
|
||||
|
||||
@@ -723,7 +731,7 @@ void FuncSwData::clear()
|
||||
QString FuncSwData::funcToString()
|
||||
{
|
||||
ModelData model;
|
||||
if (func >= FuncSafetyCh1 && func <= FuncSafetyCh32)
|
||||
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
|
||||
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString(model));
|
||||
else if (func == FuncTrainer)
|
||||
return QObject::tr("Trainer");
|
||||
@@ -753,8 +761,10 @@ QString FuncSwData::funcToString()
|
||||
return QObject::tr("Play Both");
|
||||
else if (func == FuncPlayValue)
|
||||
return QObject::tr("Play Value");
|
||||
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)
|
||||
@@ -1309,9 +1319,9 @@ ModelData ModelData::removeGlobalVars()
|
||||
return result;
|
||||
}
|
||||
|
||||
int ModelData::getChannelsMax()
|
||||
int ModelData::getChannelsMax(bool forceExtendedLimits) const
|
||||
{
|
||||
if (extendedLimits)
|
||||
if (forceExtendedLimits || extendedLimits)
|
||||
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
|
||||
else
|
||||
return 100;
|
||||
|
||||
@@ -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
|
||||
@@ -361,9 +361,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);
|
||||
}
|
||||
@@ -526,6 +526,8 @@ class GeneralSettings {
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
unsigned int mAhWarn;
|
||||
unsigned int mAhUsed;
|
||||
unsigned int globalTimer;
|
||||
unsigned int btBaudrate;
|
||||
unsigned int sticksGain;
|
||||
unsigned int rotarySteps;
|
||||
@@ -725,8 +727,8 @@ class LogicalSwitchData { // Logical Switches data
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
FuncSafetyCh1 = 0,
|
||||
FuncSafetyCh32 = FuncSafetyCh1+C9X_NUM_CHNOUT-1,
|
||||
FuncOverrideCH1 = 0,
|
||||
FuncOverrideCH32 = FuncOverrideCH1+C9X_NUM_CHNOUT-1,
|
||||
FuncTrainer,
|
||||
FuncTrainerRUD,
|
||||
FuncTrainerELE,
|
||||
@@ -742,6 +744,7 @@ enum AssignFunc {
|
||||
FuncPlayPrompt,
|
||||
FuncPlayBoth,
|
||||
FuncPlayValue,
|
||||
FuncPlayScript,
|
||||
FuncLogs,
|
||||
FuncVolume,
|
||||
FuncBacklight,
|
||||
@@ -755,7 +758,7 @@ enum AssignFunc {
|
||||
|
||||
class FuncSwData { // Function Switches data
|
||||
public:
|
||||
FuncSwData(AssignFunc func=FuncSafetyCh1) { clear(); this->func = func; }
|
||||
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
|
||||
RawSwitch swtch;
|
||||
AssignFunc func;
|
||||
int param;
|
||||
@@ -1043,16 +1046,16 @@ class ModelData {
|
||||
void clearMixes();
|
||||
void clearInputs();
|
||||
|
||||
int getChannelsMax();
|
||||
int getChannelsMax(bool forceExtendedLimits=false) const;
|
||||
|
||||
protected:
|
||||
void removeGlobalVar(int & var);
|
||||
};
|
||||
|
||||
class RadioData {
|
||||
public:
|
||||
public:
|
||||
GeneralSettings generalSettings;
|
||||
ModelData models[C9X_MAX_MODELS];
|
||||
ModelData models[C9X_MAX_MODELS];
|
||||
};
|
||||
|
||||
// TODO rename FlightPhase to FlightMode
|
||||
@@ -1129,6 +1132,7 @@ enum Capability {
|
||||
HasSoundMixer,
|
||||
NumModules,
|
||||
PPMCenter,
|
||||
PPMUnitMicroseconds,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
HasVolume,
|
||||
@@ -1155,6 +1159,10 @@ enum Capability {
|
||||
MultiposPotsPositions,
|
||||
SimulatorVariant,
|
||||
MavlinkTelemetry,
|
||||
HasInputDiff,
|
||||
HasMixerExpo,
|
||||
MixersMonitor,
|
||||
HasBatMeterRange
|
||||
};
|
||||
|
||||
class SimulatorInterface;
|
||||
@@ -1174,15 +1182,15 @@ class EEPROMInterface
|
||||
virtual bool 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 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -576,7 +576,7 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
|
||||
FuncSwData c9x;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.func = (AssignFunc)(func);
|
||||
if (c9x.func <= FuncSafetyCh32) {
|
||||
if (c9x.func <= FuncOverrideCH32) {
|
||||
c9x.enabled=param & 0x01;
|
||||
c9x.param = (param>>1)<<1;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
@@ -189,12 +191,14 @@ void Open9xSky9xSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
g_rotenc[0] = 0;
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread();
|
||||
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,8 @@
|
||||
#define HAPTIC
|
||||
#define REVPLUS
|
||||
#define OVERRIDE_CHANNEL_FUNCTION
|
||||
|
||||
#define NUM_POTS 5
|
||||
#define FLAVOUR "taranis-plus"
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
@@ -79,10 +79,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 +111,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"
|
||||
@@ -149,6 +151,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/lua/src/lstate.c"
|
||||
#include "radio/src/lua/src/lstring.c"
|
||||
#include "radio/src/lua/src/ltable.c"
|
||||
#include "radio/src/lua/src/lrotable.c"
|
||||
#include "radio/src/lua/src/ltm.c"
|
||||
#include "radio/src/lua/src/lundump.c"
|
||||
#include "radio/src/lua/src/lvm.c"
|
||||
@@ -156,6 +159,7 @@ inline int geteepromsize() {
|
||||
#include "radio/src/lua/src/lbaselib.c"
|
||||
#include "radio/src/lua/src/linit.c"
|
||||
#include "radio/src/lua/src/lmathlib.c"
|
||||
#include "radio/src/lua/src/lbitlib.c"
|
||||
#include "radio/src/lua/src/loadlib.c"
|
||||
#include "radio/src/lua/src/lauxlib.c"
|
||||
#include "radio/src/lua/src/ltablib.c"
|
||||
@@ -193,11 +197,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()
|
||||
@@ -206,7 +207,7 @@ bool OpentxTaranisSimulator::timer10ms()
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * OpentxTaranisSimulator::getLcd()
|
||||
::uint8_t * OpentxTaranisSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
@@ -222,18 +223,21 @@ void OpentxTaranisSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(Open9xX9D::eeprom, eeprom.data(), std::min<int>(sizeof(Open9xX9D::eeprom), eeprom.size()));
|
||||
StartEepromThread(NULL);
|
||||
StartAudioThread();
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread();
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpentxTaranisSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopAudioThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
@@ -253,27 +257,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;
|
||||
}
|
||||
@@ -295,3 +299,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
|
||||
|
||||
@@ -202,8 +202,8 @@ class SourcesConversionTable: public ConversionTable {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++)
|
||||
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(LuaScripts); i++) {
|
||||
for (int j=0; j<GetCurrentFirmware()->getCapability(LuaOutputsPerScript); j++) {
|
||||
for (int i=0; i<7; i++) {
|
||||
for (int j=0; j<6; j++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
|
||||
}
|
||||
}
|
||||
@@ -991,7 +991,12 @@ class MixField: public TransformedField {
|
||||
_destCh = mix.destCh - 1;
|
||||
if (mix.curve.type == CurveReference::CURVE_REF_CUSTOM) {
|
||||
_curveMode = true;
|
||||
_curveParam = 6 + mix.curve.value;
|
||||
if (mix.curve.value > 0) {
|
||||
_curveParam = 6 + mix.curve.value;
|
||||
}
|
||||
else {
|
||||
_curveParam = mix.curve.value;
|
||||
}
|
||||
}
|
||||
else if (mix.curve.type == CurveReference::CURVE_REF_FUNC) {
|
||||
_curveMode = true;
|
||||
@@ -1039,6 +1044,8 @@ class MixField: public TransformedField {
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_DIFF, smallGvarToC9x(_curveParam));
|
||||
else if (_curveParam > 6)
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam-6);
|
||||
else if (_curveParam < 0)
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, _curveParam);
|
||||
else
|
||||
mix.curve = CurveReference(CurveReference::CURVE_REF_FUNC, _curveParam);
|
||||
}
|
||||
@@ -1098,7 +1105,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
internalField.Append(new ZCharField<8>(expo.name));
|
||||
internalField.Append(new SignedField<8>(expo.offset, "Offset"));
|
||||
internalField.Append(new SignedField<8>(_offset, "Offset"));
|
||||
internalField.Append(new CurveReferenceField(expo.curve, board, version));
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
}
|
||||
@@ -1151,7 +1158,11 @@ class InputField: public TransformedField {
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
_weight = smallGvarToEEPROM(expo.weight);
|
||||
_weight = smallGvarToEEPROM(expo.weight);
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
_offset = smallGvarToEEPROM(expo.offset);
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
if (expo.curve.type==CurveReference::CURVE_REF_FUNC && expo.curve.value) {
|
||||
@@ -1184,6 +1195,10 @@ class InputField: public TransformedField {
|
||||
|
||||
expo.weight = smallGvarToC9x(_weight);
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
expo.offset = smallGvarToC9x(_offset);
|
||||
}
|
||||
|
||||
if (!IS_TARANIS(board) || version < 216) {
|
||||
if (!_curveMode)
|
||||
expo.curve = CurveReference(CurveReference::CURVE_REF_EXPO, smallGvarToC9x(_curveParam));
|
||||
@@ -1201,24 +1216,65 @@ class InputField: public TransformedField {
|
||||
unsigned int version;
|
||||
bool _curveMode;
|
||||
int _weight;
|
||||
int _offset;
|
||||
int _curveParam;
|
||||
};
|
||||
|
||||
class LimitField: public StructField {
|
||||
public:
|
||||
template <int shift>
|
||||
static int exportLimitValue(int value)
|
||||
{
|
||||
const int GV1 = 4096;
|
||||
if (value > 10000) {
|
||||
return -GV1 + value - 10001;
|
||||
}
|
||||
if (value < -10000) {
|
||||
return GV1 + value + 10000;
|
||||
}
|
||||
return value + shift;
|
||||
}
|
||||
|
||||
template <int shift>
|
||||
static int importLimitValue(int value)
|
||||
{
|
||||
/* GVARS mapping on radio:
|
||||
GV1 = -4096
|
||||
GV9 = -4088
|
||||
-GV1 = 4095
|
||||
-GV9 = 4087
|
||||
*/
|
||||
const int GV1 = 4096;
|
||||
if (value >= GV1) {
|
||||
return 10001 + value - GV1;
|
||||
}
|
||||
if (value >= GV1-9) {
|
||||
return -10000 + value - GV1;
|
||||
}
|
||||
if (value < -GV1) {
|
||||
return -10000 + value + GV1 + 1;
|
||||
}
|
||||
if (value < -GV1+9) {
|
||||
return 10000 + value + GV1 + 1;
|
||||
}
|
||||
return value - shift;
|
||||
}
|
||||
|
||||
LimitField(LimitData & limit, BoardEnum board, unsigned int version):
|
||||
StructField("Limit")
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, +1000));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, -1000));
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
|
||||
Append(new SignedField<8>(limit.ppmCenter));
|
||||
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
|
||||
Append(new ConversionField< SignedField<8> >(limit.max, -100, 10));
|
||||
Append(new SignedField<8>(limit.ppmCenter));
|
||||
Append(new SignedField<14>(limit.offset));
|
||||
}
|
||||
Append(new SignedField<8>(limit.ppmCenter));
|
||||
Append(new SignedField<14>(limit.offset));
|
||||
Append(new BoolField<1>(limit.symetrical));
|
||||
Append(new BoolField<1>(limit.revert));
|
||||
if (HAS_LARGE_LCD(board)) {
|
||||
@@ -1711,7 +1767,10 @@ class CustomFunctionsConversionTable: public ConversionTable {
|
||||
addConversion(FuncPlayValue, val++);
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncReserve, val++);
|
||||
if (IS_TARANIS(board))
|
||||
addConversion(FuncPlayScript, val++);
|
||||
else
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncBackgroundMusic, val++);
|
||||
addConversion(FuncBackgroundMusicPause, val++);
|
||||
@@ -1833,10 +1892,10 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
else
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216) {
|
||||
*((uint16_t *)_param) = fn.param;
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncSafetyCh1;
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncOverrideCH1;
|
||||
}
|
||||
else {
|
||||
*((uint32_t *)_param) = fn.param;
|
||||
@@ -1852,7 +1911,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
|
||||
}
|
||||
}
|
||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
|
||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
|
||||
memcpy(_param, fn.paramarm, sizeof(_param));
|
||||
}
|
||||
else if (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast) {
|
||||
@@ -1915,7 +1974,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
value = *((uint32_t *)_param);
|
||||
}
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = (int8_t)value;
|
||||
}
|
||||
@@ -1927,7 +1986,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
fn.func = AssignFunc(fn.func + index);
|
||||
fn.param = value;
|
||||
}
|
||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic) {
|
||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
|
||||
memcpy(fn.paramarm, _param, sizeof(fn.paramarm));
|
||||
}
|
||||
else if (fn.func == FuncVolume) {
|
||||
@@ -2020,9 +2079,9 @@ class AvrCustomFunctionField: public TransformedField {
|
||||
_param = fn.param;
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216)
|
||||
_union_param = fn.func - FuncSafetyCh1;
|
||||
_union_param = fn.func - FuncOverrideCH1;
|
||||
else if (version >= 213)
|
||||
_active += ((fn.func % 4) << 1);
|
||||
}
|
||||
@@ -2080,7 +2139,7 @@ class AvrCustomFunctionField: public TransformedField {
|
||||
fn.enabled = (_active & 0x01);
|
||||
}
|
||||
|
||||
if (fn.func >= FuncSafetyCh1 && fn.func <= FuncSafetyCh32) {
|
||||
if (fn.func >= FuncOverrideCH1 && fn.func <= FuncOverrideCH32) {
|
||||
if (version >= 216)
|
||||
fn.func = AssignFunc(fn.func + _union_param);
|
||||
else if (version >= 213)
|
||||
@@ -2790,8 +2849,8 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
if (version >= 213) {
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
internalField.Append(new SpareBitsField<16>()); // mAhUsed
|
||||
internalField.Append(new SpareBitsField<32>()); // globalTimer
|
||||
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
|
||||
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
|
||||
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
|
||||
|
||||
@@ -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));
|
||||
@@ -309,7 +309,7 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
{
|
||||
std::cout << "trying " << getName() << " import...";
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
if (size != getEEpromSize()) {
|
||||
if (size==4096) {
|
||||
int notnull=false;
|
||||
for (int i=2048; i<4096; i++) {
|
||||
@@ -337,7 +337,7 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
|
||||
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << " no\n";
|
||||
@@ -355,7 +355,7 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
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)) {
|
||||
@@ -399,7 +399,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 +546,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 +580,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;
|
||||
@@ -663,7 +663,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case TelemetryMaxMultiplier:
|
||||
return (IS_ARM(board) ? 32 : 8);
|
||||
case PPMCenter:
|
||||
return 1;
|
||||
return (IS_TARANIS(board) || id.contains("ppmca")) ? 1 : 0;
|
||||
case PPMUnitMicroseconds:
|
||||
return id.contains("ppmus") ? 1 : 0;
|
||||
case SYMLimits:
|
||||
return 1;
|
||||
case OptrexDisplay:
|
||||
@@ -730,6 +732,13 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return 0;
|
||||
case MavlinkTelemetry:
|
||||
return id.contains("mavlink") ? 1 : 0;
|
||||
case HasInputDiff:
|
||||
case HasMixerExpo:
|
||||
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;
|
||||
}
|
||||
@@ -815,7 +824,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (proto) {
|
||||
@@ -1236,7 +1245,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"));
|
||||
@@ -1255,7 +1264,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"));
|
||||
@@ -1263,15 +1272,17 @@ 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"));
|
||||
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"));
|
||||
addOpenTxCommonOptions(openTx);
|
||||
firmwares.push_back(openTx);
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
+1516
-1371
File diff suppressed because it is too large
Load Diff
+115
-33
@@ -147,18 +147,18 @@ void populatePhasesCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
|
||||
QObject(),
|
||||
weightGV(weightGV),
|
||||
weightSB(weightSB),
|
||||
sb(dynamic_cast<QSpinBox *>(weightSB)),
|
||||
dsb(dynamic_cast<QDoubleSpinBox *>(weightSB)),
|
||||
weightCB(weightCB),
|
||||
weight(weight),
|
||||
flags(flags),
|
||||
lock(false)
|
||||
step(step),
|
||||
lock(true)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
populateGVCB(weightCB, weight);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
@@ -170,21 +170,32 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
|
||||
}
|
||||
}
|
||||
|
||||
weightSB->setMinimum(mini);
|
||||
weightSB->setMaximum(maxi);
|
||||
int val;
|
||||
|
||||
if (weight>maxi || weight<mini) {
|
||||
val = deflt;
|
||||
weightGV->setChecked(true);
|
||||
weightSB->hide();
|
||||
weightCB->show();
|
||||
}
|
||||
else {
|
||||
val = weight;
|
||||
weightGV->setChecked(false);
|
||||
weightSB->setValue(weight);
|
||||
weightSB->show();
|
||||
weightCB->hide();
|
||||
}
|
||||
|
||||
if (sb) {
|
||||
sb->setMinimum(mini);
|
||||
sb->setMaximum(maxi);
|
||||
sb->setValue(val);
|
||||
}
|
||||
else {
|
||||
dsb->setMinimum(mini*step);
|
||||
dsb->setMaximum(maxi*step);
|
||||
dsb->setValue(val*step);
|
||||
}
|
||||
|
||||
connect(weightSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
|
||||
|
||||
lock = false;
|
||||
@@ -193,16 +204,23 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
|
||||
void GVarGroup::gvarCBChanged(int state)
|
||||
{
|
||||
weightCB->setVisible(state);
|
||||
weightSB->setVisible(!state);
|
||||
if (weightSB)
|
||||
weightSB->setVisible(!state);
|
||||
else
|
||||
weightSB->setVisible(!state);
|
||||
valuesChanged();
|
||||
}
|
||||
|
||||
void GVarGroup::valuesChanged()
|
||||
{
|
||||
if (weightGV->isChecked())
|
||||
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
|
||||
else
|
||||
weight = weightSB->value();
|
||||
if (!lock) {
|
||||
if (weightGV->isChecked())
|
||||
weight = weightCB->itemData(weightCB->currentIndex()).toInt();
|
||||
else if (sb)
|
||||
weight = sb->value();
|
||||
else
|
||||
weight = dsb->value()/step;
|
||||
}
|
||||
}
|
||||
|
||||
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
|
||||
@@ -216,10 +234,10 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
|
||||
lock(false),
|
||||
lastType(-1)
|
||||
{
|
||||
curveTypeCB->addItem(tr("Diff"));
|
||||
curveTypeCB->addItem(tr("Expo"));
|
||||
curveTypeCB->addItem(tr("Func"));
|
||||
curveTypeCB->addItem(tr("Curve"));
|
||||
if (!(flags & HIDE_DIFF)) curveTypeCB->addItem(tr("Diff"), 0);
|
||||
if (!(flags & HIDE_EXPO)) curveTypeCB->addItem(tr("Expo"), 1);
|
||||
curveTypeCB->addItem(tr("Func"), 2);
|
||||
curveTypeCB->addItem(tr("Curve"), 3);
|
||||
|
||||
curveValueCB->setMaxVisibleItems(10);
|
||||
|
||||
@@ -235,10 +253,12 @@ void CurveGroup::update()
|
||||
{
|
||||
lock = true;
|
||||
|
||||
curveTypeCB->setCurrentIndex(curve.type);
|
||||
int found = curveTypeCB->findData(curve.type);
|
||||
if (found < 0) found = 0;
|
||||
curveTypeCB->setCurrentIndex(found);
|
||||
|
||||
if (curve.type == CurveReference::CURVE_REF_DIFF || curve.type == CurveReference::CURVE_REF_EXPO) {
|
||||
curveGVarCB->show();
|
||||
curveGVarCB->setVisible(GetCurrentFirmware()->getCapability(Gvars));
|
||||
if (curve.value > 100 || curve.value < -100) {
|
||||
curveGVarCB->setChecked(true);
|
||||
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
|
||||
@@ -278,11 +298,13 @@ void CurveGroup::update()
|
||||
if (lastType != curve.type) {
|
||||
lastType = curve.type;
|
||||
curveValueCB->clear();
|
||||
for (int i=-numcurves; i<=numcurves; i++) {
|
||||
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString());
|
||||
for (int i= ((flags & HIDE_NEGATIVE_CURVES) ? 0 : -numcurves); i<=numcurves; i++) {
|
||||
curveValueCB->addItem(CurveReference(CurveReference::CURVE_REF_CUSTOM, i).toString(), i);
|
||||
if (i == curve.value) {
|
||||
curveValueCB->setCurrentIndex(curveValueCB->count() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
curveValueCB->setCurrentIndex(curve.value+numcurves);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -310,7 +332,8 @@ void CurveGroup::gvarCBChanged(int state)
|
||||
void CurveGroup::typeChanged(int value)
|
||||
{
|
||||
if (!lock) {
|
||||
switch (value) {
|
||||
int type = curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt();
|
||||
switch (type) {
|
||||
case 0:
|
||||
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
|
||||
break;
|
||||
@@ -332,7 +355,7 @@ void CurveGroup::typeChanged(int value)
|
||||
void CurveGroup::valuesChanged()
|
||||
{
|
||||
if (!lock) {
|
||||
switch (curveTypeCB->currentIndex()) {
|
||||
switch (curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt()) {
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
@@ -341,14 +364,14 @@ void CurveGroup::valuesChanged()
|
||||
value = curveValueCB->itemData(curveValueCB->currentIndex()).toInt();
|
||||
else
|
||||
value = curveValueSB->value();
|
||||
curve = CurveReference(curveTypeCB->currentIndex() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
|
||||
curve = CurveReference(curveTypeCB->itemData(curveTypeCB->currentIndex()).toInt() == 0 ? CurveReference::CURVE_REF_DIFF : CurveReference::CURVE_REF_EXPO, value);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
curve = CurveReference(CurveReference::CURVE_REF_FUNC, curveValueCB->currentIndex());
|
||||
break;
|
||||
case 3:
|
||||
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->currentIndex() - GetCurrentFirmware()->getCapability(NumCurves));
|
||||
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, curveValueCB->itemData(curveValueCB->currentIndex()).toInt());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -815,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);
|
||||
@@ -1004,7 +1051,6 @@ QString index2version(int index)
|
||||
|
||||
int qunlink(const QString & fileName)
|
||||
{
|
||||
qDebug() << "unlinking "<< fileName;
|
||||
QByteArray ba = fileName.toLatin1();
|
||||
return unlink(ba.constData());
|
||||
}
|
||||
@@ -1015,3 +1061,39 @@ 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();
|
||||
}
|
||||
|
||||
+18
-5
@@ -37,12 +37,12 @@ class CompanionIcon: public QIcon {
|
||||
CompanionIcon(QString baseimage);
|
||||
};
|
||||
|
||||
class GVarGroup : public QObject {
|
||||
class GVarGroup: public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags=0);
|
||||
GVarGroup(QCheckBox *weightGV, QAbstractSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
|
||||
|
||||
protected slots:
|
||||
void gvarCBChanged(int);
|
||||
@@ -50,13 +50,19 @@ class GVarGroup : public QObject {
|
||||
|
||||
protected:
|
||||
QCheckBox *weightGV;
|
||||
QSpinBox *weightSB;
|
||||
QAbstractSpinBox *weightSB;
|
||||
QSpinBox *sb;
|
||||
QDoubleSpinBox *dsb;
|
||||
QComboBox *weightCB;
|
||||
int & weight;
|
||||
const unsigned int flags;
|
||||
double step;
|
||||
bool lock;
|
||||
};
|
||||
|
||||
#define HIDE_DIFF 0x01
|
||||
#define HIDE_EXPO 0x02
|
||||
#define HIDE_NEGATIVE_CURVES 0x04
|
||||
|
||||
class CurveGroup : public QObject {
|
||||
|
||||
Q_OBJECT
|
||||
@@ -119,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 */
|
||||
@@ -148,5 +155,11 @@ 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);
|
||||
|
||||
#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>
|
||||
|
||||
+374
-413
File diff suppressed because it is too large
Load Diff
+36
-12
@@ -3,7 +3,27 @@
|
||||
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include "qcustomplot.h"
|
||||
#include "qcustomplot/qcustomplot.h"
|
||||
|
||||
struct coords {
|
||||
QVector<double> x, y;
|
||||
double min_y;
|
||||
double max_y;
|
||||
bool secondRange;
|
||||
QString name;
|
||||
};
|
||||
|
||||
struct plotsCollection {
|
||||
QVarLengthArray<struct coords> coords;
|
||||
double min_x;
|
||||
double max_x;
|
||||
bool twoRanges;
|
||||
bool tooManyRanges;
|
||||
double rangeOneMin;
|
||||
double rangeOneMax;
|
||||
double rangeTwoMin;
|
||||
double rangeTwoMax;
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class logsDialog;
|
||||
@@ -12,14 +32,13 @@ 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();
|
||||
@@ -27,23 +46,28 @@ private slots:
|
||||
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 setRangeyAxis2(QCPRange range);
|
||||
|
||||
private:
|
||||
QList<QStringList> csvlog;
|
||||
Ui::logsDialog *ui;
|
||||
bool cvsFileParse();
|
||||
double GetScale(QString channel);
|
||||
QList<QColor> palette;
|
||||
bool plotLock;
|
||||
QString logFilename;
|
||||
|
||||
QVarLengthArray<Qt::GlobalColor> colors;
|
||||
QPen pen;
|
||||
|
||||
bool hasyAxis2;
|
||||
double rangeRatio;
|
||||
double rangeyAxisMin;
|
||||
double rangeyAxisMax;
|
||||
double rangeyAxis2Min;
|
||||
double rangeyAxis2Max;
|
||||
};
|
||||
|
||||
#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>
|
||||
|
||||
+132
-84
@@ -184,6 +184,44 @@ void MainWindow::displayWarnings()
|
||||
}
|
||||
}
|
||||
|
||||
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())
|
||||
@@ -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()) {
|
||||
@@ -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;
|
||||
|
||||
@@ -1295,79 +1325,97 @@ 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) {
|
||||
bool backupEnable=true;
|
||||
QString backupFile;
|
||||
QString backupPath=getBackupPath();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupEnable=false;
|
||||
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 +1457,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 +1481,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"));
|
||||
@@ -1463,7 +1511,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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -516,17 +516,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();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "channels.h"
|
||||
#include "helpers.h"
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
@@ -6,6 +7,70 @@
|
||||
#include <QCheckBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
LimitsGroup::LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt):
|
||||
firmware(firmware),
|
||||
spinbox(new QDoubleSpinBox()),
|
||||
value(value),
|
||||
displayStep(0.1)
|
||||
{
|
||||
bool allowGVars = false;
|
||||
int internalStep = 1;
|
||||
|
||||
spinbox->setProperty("index", row);
|
||||
spinbox->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
spinbox->setAccelerated(true);
|
||||
|
||||
if (firmware->getCapability(PPMUnitMicroseconds)) {
|
||||
displayStep = 0.512;
|
||||
spinbox->setDecimals(1);
|
||||
spinbox->setSuffix("us");
|
||||
}
|
||||
else {
|
||||
spinbox->setDecimals(0);
|
||||
spinbox->setSuffix("%");
|
||||
}
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard()) || deflt == 0 /*it's the offset*/) {
|
||||
spinbox->setDecimals(1);
|
||||
allowGVars = true;
|
||||
}
|
||||
else {
|
||||
internalStep *= 10;
|
||||
}
|
||||
|
||||
spinbox->setSingleStep(displayStep*internalStep);
|
||||
|
||||
QHBoxLayout * horizontalLayout = new QHBoxLayout();
|
||||
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
|
||||
horizontalLayout->addWidget(gv);
|
||||
QComboBox * cb = new QComboBox();
|
||||
horizontalLayout->addWidget(cb);
|
||||
horizontalLayout->addWidget(spinbox);
|
||||
gridLayout->addLayout(horizontalLayout, row, col, 1, 1);
|
||||
gvarGroup = new GVarGroup(gv, spinbox, cb, value, deflt, min, max, displayStep, allowGVars);
|
||||
}
|
||||
|
||||
LimitsGroup::~LimitsGroup()
|
||||
{
|
||||
delete gvarGroup;
|
||||
}
|
||||
|
||||
void LimitsGroup::updateMinMax(int max)
|
||||
{
|
||||
if (spinbox->maximum() == 0) {
|
||||
spinbox->setMinimum(-max*displayStep);
|
||||
if (value < -max) {
|
||||
value = -max;
|
||||
}
|
||||
}
|
||||
if (spinbox->minimum() == 0) {
|
||||
spinbox->setMaximum(max*displayStep);
|
||||
if (value > max) {
|
||||
value = max;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware):
|
||||
ModelPanel(parent, model, generalSettings, firmware)
|
||||
{
|
||||
@@ -13,8 +78,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
bool minimize = false;
|
||||
|
||||
int col = 1;
|
||||
if (firmware->getCapability(ChannelsName))
|
||||
{
|
||||
if (firmware->getCapability(ChannelsName)) {
|
||||
minimize=true;
|
||||
addLabel(gridLayout, tr("Name"), col++);
|
||||
}
|
||||
@@ -52,44 +116,13 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
}
|
||||
|
||||
// Channel offset
|
||||
QDoubleSpinBox * offset = new QDoubleSpinBox(this);
|
||||
offset->setProperty("index", i);
|
||||
offset->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
offset->setAccelerated(true);
|
||||
offset->setDecimals(1);
|
||||
offset->setMinimum(-100);
|
||||
offset->setSingleStep(0.1);
|
||||
offset->setValue(float(model.limitData[i].offset) / 10);
|
||||
connect(offset, SIGNAL(editingFinished()), this, SLOT(offsetEdited()));
|
||||
gridLayout->addWidget(offset, i+1, col++, 1, 1);
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].offset, -1000, 1000, 0);
|
||||
|
||||
// Channel min
|
||||
QDoubleSpinBox * minSB = new QDoubleSpinBox(this);
|
||||
minSB->setProperty("index", i);
|
||||
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
minSB->setAccelerated(true);
|
||||
minSB->setDecimals(1);
|
||||
minSB->setMinimum(-model.getChannelsMax());
|
||||
minSB->setSingleStep(0.1);
|
||||
minSB->setMaximum(0);
|
||||
minSB->setValue(float(model.limitData[i].min) / 10);
|
||||
connect(minSB, SIGNAL(editingFinished()), this, SLOT(minEdited()));
|
||||
gridLayout->addWidget(minSB, i+1, col++, 1, 1);
|
||||
minSpins << minSB;
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].min, -model.getChannelsMax()*10, 0, -1000);
|
||||
|
||||
// Channel max
|
||||
QDoubleSpinBox * maxSB = new QDoubleSpinBox(this);
|
||||
maxSB->setProperty("index", i);
|
||||
maxSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
maxSB->setAccelerated(true);
|
||||
maxSB->setDecimals(1);
|
||||
maxSB->setMinimum(0);
|
||||
maxSB->setSingleStep(0.1);
|
||||
maxSB->setMaximum(model.getChannelsMax());
|
||||
maxSB->setValue(float(model.limitData[i].max) / 10);
|
||||
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
|
||||
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
|
||||
maxSpins << maxSB;
|
||||
limitsGroups << new LimitsGroup(firmware, gridLayout, i+1, col++, model.limitData[i].max, 0, model.getChannelsMax()*10, 1000);
|
||||
|
||||
// Channel inversion
|
||||
QComboBox * invCB = new QComboBox(this);
|
||||
@@ -117,6 +150,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
QSpinBox * center = new QSpinBox(this);
|
||||
center->setProperty("index", i);
|
||||
center->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
center->setSuffix("us");
|
||||
center->setMinimum(1375);
|
||||
center->setMaximum(1625);
|
||||
center->setValue(1500);
|
||||
@@ -134,6 +168,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
gridLayout->addWidget(symlimits, i+1, col++, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Push the rows up
|
||||
addVSpring(gridLayout, 0,firmware->getCapability(Outputs)+1);
|
||||
|
||||
@@ -142,6 +177,9 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||
|
||||
Channels::~Channels()
|
||||
{
|
||||
foreach(LimitsGroup *group, limitsGroups) {
|
||||
delete group;
|
||||
}
|
||||
}
|
||||
|
||||
void Channels::symlimitsEdited()
|
||||
@@ -164,46 +202,14 @@ void Channels::nameEdited()
|
||||
}
|
||||
}
|
||||
|
||||
void Channels::offsetEdited()
|
||||
{
|
||||
QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
int index = dsb->property("index").toInt();
|
||||
model.limitData[index].offset = round(dsb->value() * 10);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::minEdited()
|
||||
{
|
||||
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
int index = sb->property("index").toInt();
|
||||
model.limitData[index].min = round(sb->value() * 10);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::maxEdited()
|
||||
{
|
||||
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
int index = sb->property("index").toInt();
|
||||
model.limitData[index].max = round(sb->value() * 10);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void Channels::refreshExtendedLimits()
|
||||
{
|
||||
int channelMax = model.getChannelsMax();
|
||||
int channelMaxValue = channelMax * 10;
|
||||
|
||||
for (int i=0; i<firmware->getCapability(Outputs); i++) {
|
||||
QDoubleSpinBox * minDSB = minSpins[i];
|
||||
QDoubleSpinBox * maxDSB = maxSpins[i];
|
||||
|
||||
minDSB->setMinimum(-channelMax);
|
||||
maxDSB->setMaximum(+channelMax);
|
||||
|
||||
//reset any limit that is bigger than current maximum (dependent on extended limits setting)
|
||||
if ( model.limitData[i].min < -channelMaxValue ) model.limitData[i].min = -channelMaxValue;
|
||||
if ( model.limitData[i].max > +channelMaxValue ) model.limitData[i].max = +channelMaxValue;
|
||||
foreach(LimitsGroup *group, limitsGroups) {
|
||||
group->updateMinMax(10*channelMax);
|
||||
}
|
||||
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,24 @@
|
||||
#include "modelpanel.h"
|
||||
#include <QSpinBox>
|
||||
|
||||
class GVarGroup;
|
||||
|
||||
class LimitsGroup
|
||||
{
|
||||
public:
|
||||
LimitsGroup(FirmwareInterface * firmware, QGridLayout *gridLayout, int row, int col, int & value, int min, int max, int deflt);
|
||||
~LimitsGroup();
|
||||
|
||||
void updateMinMax(int max);
|
||||
|
||||
protected:
|
||||
FirmwareInterface * firmware;
|
||||
QDoubleSpinBox * spinbox;
|
||||
GVarGroup * gvarGroup;
|
||||
int & value;
|
||||
double displayStep;
|
||||
};
|
||||
|
||||
class Channels : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -13,8 +31,7 @@ class Channels : public ModelPanel
|
||||
~Channels();
|
||||
|
||||
private:
|
||||
QVector<QDoubleSpinBox *> minSpins;
|
||||
QVector<QDoubleSpinBox *> maxSpins;
|
||||
QVector<LimitsGroup *> limitsGroups;
|
||||
|
||||
public slots:
|
||||
void refreshExtendedLimits();
|
||||
@@ -22,9 +39,6 @@ class Channels : public ModelPanel
|
||||
private slots:
|
||||
void symlimitsEdited();
|
||||
void nameEdited();
|
||||
void offsetEdited();
|
||||
void minEdited();
|
||||
void maxEdited();
|
||||
void invEdited();
|
||||
void curveEdited();
|
||||
void ppmcenterEdited();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -318,11 +326,12 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
|
||||
int index = fswtchFunc[i]->currentIndex();
|
||||
|
||||
if (index>=FuncSafetyCh1 && index<=FuncSafetyCh32) {
|
||||
if (index>=FuncOverrideCH1 && index<=FuncOverrideCH32) {
|
||||
int channelsMax = model.getChannelsMax(true);
|
||||
fswtchParam[i]->setDecimals(0);
|
||||
fswtchParam[i]->setSingleStep(1);
|
||||
fswtchParam[i]->setMinimum(-125);
|
||||
fswtchParam[i]->setMaximum(125);
|
||||
fswtchParam[i]->setMinimum(-channelsMax);
|
||||
fswtchParam[i]->setMaximum(channelsMax);
|
||||
if (modified) {
|
||||
model.funcSw[i].param = fswtchParam[i]->value();
|
||||
}
|
||||
@@ -368,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();
|
||||
@@ -437,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -457,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();
|
||||
@@ -469,6 +475,19 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
|
||||
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
|
||||
}
|
||||
}
|
||||
else if (index==FuncPlayScript) {
|
||||
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
|
||||
if (modified) {
|
||||
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
|
||||
int vml = 8/*TODO*/;
|
||||
if (fswtchParamArmT[i]->currentText() != "----") {
|
||||
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
|
||||
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
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();
|
||||
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
|
||||
@@ -485,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);
|
||||
@@ -510,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);
|
||||
}
|
||||
@@ -531,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();
|
||||
@@ -590,8 +608,9 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
|
||||
b->clear();
|
||||
for (unsigned int i=0; i<FuncCount; i++) {
|
||||
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
|
||||
if (((i>=FuncSafetyCh1 && i<=FuncSafetyCh32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
|
||||
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
|
||||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
|
||||
((i==FuncPlayScript && !IS_TARANIS(firmware->getBoard()))) ||
|
||||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
|
||||
((i==FuncPlayBoth) && !firmware->getCapability(HasBeeper)) ||
|
||||
((i==FuncLogs) && !firmware->getCapability(HasSDLogs)) ||
|
||||
@@ -616,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);
|
||||
@@ -669,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_TRIMS);
|
||||
populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS);
|
||||
}
|
||||
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];
|
||||
|
||||
@@ -31,7 +31,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
|
||||
ui->offsetCB->hide();
|
||||
}
|
||||
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
|
||||
|
||||
populateSwitchCB(ui->switchesCB, ed->swtch, generalSettings, MixesContext);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -28,7 +28,7 @@ void HeliPanel::update()
|
||||
lock = true;
|
||||
|
||||
ui->swashTypeCB->setCurrentIndex(model.swashRingData.type);
|
||||
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS);
|
||||
populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS);
|
||||
ui->swashRingValSB->setValue(model.swashRingData.value);
|
||||
ui->swashInvertELE->setChecked(model.swashRingData.invertELE);
|
||||
ui->swashInvertAIL->setChecked(model.swashRingData.invertAIL);
|
||||
|
||||
@@ -174,7 +174,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
|
||||
}
|
||||
}
|
||||
|
||||
if (md->curve.value) str += " " + Qt::escape(md->curve.toString());
|
||||
if (md->curve.value) str += " " + md->curve.toString();
|
||||
|
||||
QString phasesStr = getPhasesStr(md->phases, model);
|
||||
if (!phasesStr.isEmpty()) str += " " + phasesStr;
|
||||
|
||||
@@ -11,6 +11,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
ModelPanel(parent, model, generalSettings, firmware),
|
||||
selectedSwitch(0)
|
||||
{
|
||||
int channelsMax = model.getChannelsMax(true);
|
||||
|
||||
QGridLayout * gridLayout = new QGridLayout(this);
|
||||
|
||||
int col = 1;
|
||||
@@ -48,8 +50,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
gridLayout->addWidget(cswitchSource1[i], i+1, 2);
|
||||
cswitchSource1[i]->setVisible(false);
|
||||
cswitchValue[i] = new QDoubleSpinBox(this);
|
||||
cswitchValue[i]->setMaximum(125);
|
||||
cswitchValue[i]->setMinimum(-125);
|
||||
cswitchValue[i]->setMaximum(channelsMax);
|
||||
cswitchValue[i]->setMinimum(-channelsMax);
|
||||
cswitchValue[i]->setAccelerated(true);
|
||||
cswitchValue[i]->setDecimals(0);
|
||||
cswitchValue[i]->setProperty("index", i);
|
||||
@@ -66,8 +68,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchOffset[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset[i]->setProperty("index",i);
|
||||
cswitchOffset[i]->setMaximum(125);
|
||||
cswitchOffset[i]->setMinimum(-125);
|
||||
cswitchOffset[i]->setMaximum(channelsMax);
|
||||
cswitchOffset[i]->setMinimum(-channelsMax);
|
||||
cswitchOffset[i]->setAccelerated(true);
|
||||
cswitchOffset[i]->setDecimals(0);
|
||||
connect(cswitchOffset[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
@@ -75,8 +77,8 @@ LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model,
|
||||
v2Layout->addWidget(cswitchOffset[i]);
|
||||
cswitchOffset2[i] = new QDoubleSpinBox(this);
|
||||
cswitchOffset2[i]->setProperty("index",i);
|
||||
cswitchOffset2[i]->setMaximum(125);
|
||||
cswitchOffset2[i]->setMinimum(-125);
|
||||
cswitchOffset2[i]->setMaximum(channelsMax);
|
||||
cswitchOffset2[i]->setMinimum(-channelsMax);
|
||||
cswitchOffset2[i]->setAccelerated(true);
|
||||
cswitchOffset2[i]->setDecimals(0);
|
||||
connect(cswitchOffset2[i], SIGNAL(valueChanged(double)), this, SLOT(edited()));
|
||||
@@ -211,7 +213,6 @@ void LogicalSwitchesPanel::edited()
|
||||
model.customSw[i].val1 = 0;
|
||||
model.customSw[i].val2 = 0;
|
||||
}
|
||||
model.customSw[i].andsw = 0;
|
||||
setSwitchWidgetVisibility(i);
|
||||
}
|
||||
|
||||
@@ -239,6 +240,7 @@ void LogicalSwitchesPanel::edited()
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
cswitchOffset2[i]->setSpecialValueText(tr("(instant)"));
|
||||
if (sender() == cswitchOffset[i]) {
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
|
||||
@@ -246,10 +248,12 @@ 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());
|
||||
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(tr("(infinite)"));
|
||||
cswitchOffset2[i]->clear();
|
||||
cswitchOffset2[i]->setSuffix("(release)");
|
||||
}
|
||||
else {
|
||||
cswitchOffset2[i]->setSuffix("");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -257,6 +261,7 @@ void LogicalSwitchesPanel::edited()
|
||||
}
|
||||
emit modified();
|
||||
lock = false;
|
||||
updateLine(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +279,6 @@ void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, doubl
|
||||
else
|
||||
sb->setSingleStep(0.1);
|
||||
sb->setValue(value);
|
||||
sb->setSuffix("");
|
||||
}
|
||||
|
||||
#define SOURCE1_VISIBLE 0x1
|
||||
@@ -320,7 +324,6 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
}
|
||||
break;
|
||||
case LS_FAMILY_STICKY:
|
||||
mask &= ~DELAY_ENABLED;
|
||||
// no break
|
||||
case LS_FAMILY_VBOOL:
|
||||
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
|
||||
@@ -329,12 +332,16 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
break;
|
||||
case LS_FAMILY_STAY:
|
||||
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
|
||||
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());
|
||||
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("(infinite)"));
|
||||
cswitchOffset2[i]->clear();
|
||||
cswitchOffset2[i]->setSuffix(tr("(release)"));
|
||||
}
|
||||
else {
|
||||
cswitchOffset2[i]->setSuffix("");
|
||||
}
|
||||
break;
|
||||
case LS_FAMILY_VCOMP:
|
||||
|
||||
@@ -26,7 +26,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G
|
||||
|
||||
gvWeightGroup = new GVarGroup(ui->weightGV, ui->weightSB, ui->weightCB, md->weight, 100, -limit, limit);
|
||||
gvOffsetGroup = new GVarGroup(ui->offsetGV, ui->offsetSB, ui->offsetCB, md->sOffset, 0, -limit, limit);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve);
|
||||
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, md->curve, firmware->getCapability(HasMixerExpo) ? 0 : HIDE_EXPO);
|
||||
|
||||
ui->MixDR_CB->setChecked(md->noExpo==0);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -122,6 +122,15 @@ qreal Node::getX()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Node::setX(qreal newX)
|
||||
{
|
||||
if(scene())
|
||||
{
|
||||
QRectF rect = scene()->sceneRect();
|
||||
QGraphicsObject::setX(rect.left() + (newX+1) * rect.width()/2);
|
||||
}
|
||||
}
|
||||
|
||||
qreal Node::getY()
|
||||
{
|
||||
if(scene())
|
||||
@@ -132,6 +141,15 @@ qreal Node::getY()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Node::setY(qreal newY)
|
||||
{
|
||||
if(scene())
|
||||
{
|
||||
QRectF rect = scene()->sceneRect();
|
||||
QGraphicsObject::setY(rect.top() + (newY+1) * rect.height()/2);
|
||||
}
|
||||
}
|
||||
|
||||
QList<Edge *> Node::edges() const
|
||||
{
|
||||
return edgeList;
|
||||
|
||||
@@ -72,6 +72,8 @@ class Node : public QGraphicsObject
|
||||
int getBallSize() {return ballSize;}
|
||||
qreal getX();
|
||||
qreal getY();
|
||||
void setX(qreal newX);
|
||||
void setY(qreal newX);
|
||||
|
||||
void setCenteringX(bool val) {centerX = val;}
|
||||
void setCenteringY(bool val) {centerY = val;}
|
||||
|
||||
@@ -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();
|
||||
@@ -179,6 +189,7 @@ void ModulePanel::update()
|
||||
{
|
||||
unsigned int mask = 0;
|
||||
Protocol protocol = (Protocol)module.protocol;
|
||||
unsigned int max_rx_num = 63;
|
||||
|
||||
if (moduleIdx >= 0) {
|
||||
mask |= MASK_PROTOCOL;
|
||||
@@ -195,6 +206,7 @@ void ModulePanel::update()
|
||||
case DSMX:
|
||||
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
|
||||
module.channelsCount = 6;
|
||||
max_rx_num = 20;
|
||||
break;
|
||||
case PPM:
|
||||
mask |= MASK_PPM_FIELDS | MASK_CHANNELS_RANGE| MASK_CHANNELS_COUNT;
|
||||
@@ -210,8 +222,9 @@ void ModulePanel::update()
|
||||
|
||||
ui->label_protocol->setVisible(mask & MASK_PROTOCOL);
|
||||
ui->protocol->setVisible(mask & MASK_PROTOCOL);
|
||||
ui->label_rxNumber->setVisible(mask & MASK_FAILSAFES);
|
||||
ui->rxNumber->setVisible(mask & MASK_FAILSAFES);
|
||||
ui->label_rxNumber->setVisible(mask & MASK_RX_NUMBER);
|
||||
ui->rxNumber->setVisible(mask & MASK_RX_NUMBER);
|
||||
ui->rxNumber->setMaximum(max_rx_num);
|
||||
ui->rxNumber->setValue(model.modelId);
|
||||
ui->label_channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
|
||||
ui->channelsStart->setVisible(mask & MASK_CHANNELS_RANGE);
|
||||
@@ -342,25 +355,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("");
|
||||
@@ -407,12 +405,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,6 +431,8 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
|
||||
if (!IS_TARANIS_PLUS(firmware->getBoard()) && i==6) {
|
||||
checkbox->hide();
|
||||
}
|
||||
QWidget::setTabOrder(prevFocus, checkbox);
|
||||
prevFocus = checkbox;
|
||||
}
|
||||
|
||||
// Startup switches warnings
|
||||
@@ -460,10 +469,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);
|
||||
@@ -475,6 +488,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 {
|
||||
@@ -482,6 +497,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>
|
||||
|
||||
@@ -507,16 +507,16 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>125</number>
|
||||
<number>63</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>1</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -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())) {
|
||||
@@ -593,7 +593,6 @@ void TelemetryPanel::setup()
|
||||
int varioCap = firmware->getCapability(HasVario);
|
||||
if (!varioCap) {
|
||||
ui->varioLimitMax_DSB->hide();
|
||||
ui->varioLimitMinOff_ChkB->hide();
|
||||
ui->varioLimitMin_DSB->hide();
|
||||
ui->varioLimitCenterMin_DSB->hide();
|
||||
ui->varioLimitCenterMax_DSB->hide();
|
||||
@@ -607,7 +606,6 @@ void TelemetryPanel::setup()
|
||||
}
|
||||
else {
|
||||
if (!firmware->getCapability(HasVarioSink)) {
|
||||
ui->varioLimitMinOff_ChkB->hide();
|
||||
ui->varioLimitMin_DSB->hide();
|
||||
ui->varioLimitCenterMin_DSB->hide();
|
||||
ui->VarioLabel_1->hide();
|
||||
@@ -616,15 +614,7 @@ void TelemetryPanel::setup()
|
||||
ui->varioLimitMin_DSB->setValue(model.frsky.varioMin-10);
|
||||
ui->varioLimitMax_DSB->setValue(model.frsky.varioMax+10);
|
||||
ui->varioLimitCenterMax_DSB->setValue((model.frsky.varioCenterMax/10.0)+0.5);
|
||||
if (model.frsky.varioCenterMin==-16) {
|
||||
ui->varioLimitMinOff_ChkB->setChecked(true);
|
||||
ui->varioLimitCenterMin_DSB->setValue(-2.0);
|
||||
ui->varioLimitCenterMin_DSB->setDisabled(true);
|
||||
}
|
||||
else {
|
||||
ui->varioLimitMinOff_ChkB->setChecked(false);
|
||||
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
|
||||
}
|
||||
ui->varioLimitCenterMin_DSB->setValue((model.frsky.varioCenterMin/10.0)-0.5);
|
||||
}
|
||||
|
||||
ui->altimetryGB->setVisible(firmware->getCapability(HasAltitudeSel) || firmware->getCapability(HasVario)),
|
||||
@@ -719,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()
|
||||
@@ -730,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)
|
||||
@@ -801,24 +797,6 @@ void TelemetryPanel::on_varioLimitCenterMin_DSB_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_varioLimitMinOff_ChkB_toggled(bool checked)
|
||||
{
|
||||
if (!lock) {
|
||||
model.frsky.varioCenterMin = -16;
|
||||
if (!checked) {
|
||||
lock=true;
|
||||
ui->varioLimitCenterMin_DSB->setValue(-2.0);
|
||||
ui->varioLimitCenterMin_DSB->setEnabled(true);
|
||||
lock=false;
|
||||
}
|
||||
else {
|
||||
ui->varioLimitCenterMin_DSB->setValue(-2.0);
|
||||
ui->varioLimitCenterMin_DSB->setDisabled(true);
|
||||
}
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
|
||||
@@ -97,7 +97,6 @@ class TelemetryPanel : public ModelPanel
|
||||
void on_varioLimitMin_DSB_editingFinished();
|
||||
void on_varioLimitMax_DSB_editingFinished();
|
||||
void on_varioLimitCenterMin_DSB_editingFinished();
|
||||
void on_varioLimitMinOff_ChkB_toggled(bool checked);
|
||||
void on_varioLimitCenterMax_DSB_editingFinished();
|
||||
void on_fasOffset_DSB_editingFinished();
|
||||
void on_mahCount_SB_editingFinished();
|
||||
|
||||
@@ -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,14 +277,17 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-2.000000000000000</double>
|
||||
<double>-2.100000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>0.000000000000000</double>
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
@@ -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>
|
||||
@@ -363,19 +375,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="varioLimitMinOff_ChkB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Off</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="VarioLabel_2">
|
||||
<property name="sizePolicy">
|
||||
@@ -513,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">
|
||||
@@ -543,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">
|
||||
@@ -593,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>
|
||||
@@ -607,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">
|
||||
@@ -635,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>
|
||||
@@ -651,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>
|
||||
@@ -688,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">
|
||||
@@ -720,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>
|
||||
@@ -769,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">
|
||||
@@ -845,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>
|
||||
@@ -922,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>
|
||||
@@ -939,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">
|
||||
@@ -1018,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,395 @@
|
||||
#### 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
@@ -37,7 +37,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>No Radio was found!</p><p>Make sure that you hold the lower trim buttons towards the center while you turn it on.</p><p>Then connect the USB wire.</p></body></html></string>
|
||||
<string><html><head/><body><p>No Radio was found!</p><p>Make sure that you hold the lower trim buttons towards the center while you turn it on.</p><p>Then connect the USB wire.</p><p><span style=" font-family:'arial,sans-serif'; font-size:13px; font-style:italic; color:#222222; background-color:#ffffff;">Note: if you have a Taranis that has not had the firmware upgraded to 2.0 then this version of Companion will not work.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
||||
@@ -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,20 +104,22 @@ 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 sticks[8] = {0,0,0,0,0,0,0,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;
|
||||
duplicated = true;
|
||||
}
|
||||
}
|
||||
if (duplicated) {
|
||||
@@ -131,14 +127,15 @@ void joystickDialog::on_okButton_clicked() {
|
||||
return;
|
||||
}
|
||||
joystick->close();
|
||||
for (int i=0; i<8;i++) {
|
||||
for (int i=0; i<8; 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};
|
||||
foreach(QComboBox *cb, findChildren<QComboBox *>(QRegExp("jsmapCB_[0-9]+"))) {
|
||||
int axe=cb->objectName().mid(cb->objectName().lastIndexOf("_")+1).toInt()-1;
|
||||
int stick=cb->currentIndex();
|
||||
if (stick > 0) {
|
||||
int stick=cb->currentIndex() - 1;
|
||||
qDebug() << "joystick mapping " << cb->objectName() <<"axe:" << axe << "stick:" << stick;
|
||||
if (stick >= 0) {
|
||||
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>
|
||||
|
||||
@@ -9,6 +9,42 @@
|
||||
#define RESX 1024
|
||||
|
||||
int SimulatorDialog::screenshotIdx = 0;
|
||||
SimulatorDialog * traceCallbackInstance = 0;
|
||||
|
||||
void traceCb(const char * text) {
|
||||
// divert C callback into simulator instance
|
||||
if (traceCallbackInstance) {
|
||||
traceCallbackInstance->traceCallback(text);
|
||||
}
|
||||
}
|
||||
|
||||
void SimulatorDialog::traceCallback(const char * text)
|
||||
{
|
||||
// this function is called from other threads
|
||||
traceMutex.lock();
|
||||
// limit the size of list
|
||||
if (traceList.size() < 1000) {
|
||||
traceList.append(QString(text));
|
||||
}
|
||||
traceMutex.unlock();
|
||||
}
|
||||
|
||||
void SimulatorDialog::updateDebugOutput()
|
||||
{
|
||||
traceMutex.lock();
|
||||
while (!traceList.isEmpty()) {
|
||||
QString text = traceList.takeFirst();
|
||||
traceBuffer.append(text);
|
||||
// limit the size of traceBuffer
|
||||
if (traceBuffer.size() > 10*1024) {
|
||||
traceBuffer.remove(0, 1*1024);
|
||||
}
|
||||
if (DebugOut) {
|
||||
DebugOut->traceCallback(QString(text));
|
||||
}
|
||||
}
|
||||
traceMutex.unlock();
|
||||
}
|
||||
|
||||
SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
|
||||
QDialog(parent),
|
||||
@@ -19,10 +55,19 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags):
|
||||
simulator(NULL),
|
||||
lastPhase(-1),
|
||||
beepVal(0),
|
||||
TelemetrySimu(0),
|
||||
TrainerSimu(0),
|
||||
DebugOut(0),
|
||||
buttonPressed(0),
|
||||
trimPressed (TRIM_NONE),
|
||||
middleButtonPressed(false)
|
||||
{
|
||||
//shorcut for telemetry simulator
|
||||
// new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_T), this, SLOT(openTelemetrySimulator()));
|
||||
new QShortcut(QKeySequence(Qt::Key_F4), this, SLOT(openTelemetrySimulator()));
|
||||
new QShortcut(QKeySequence(Qt::Key_F5), this, SLOT(openTrainerSimulator()));
|
||||
new QShortcut(QKeySequence(Qt::Key_F6), this, SLOT(openDebugOutput()));
|
||||
traceCallbackInstance = this;
|
||||
}
|
||||
|
||||
uint32_t SimulatorDialog9X::switchstatus = 0;
|
||||
@@ -37,6 +82,9 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags):
|
||||
|
||||
initUi<Ui::SimulatorDialog9X>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
backLight = g.backLight();
|
||||
if (backLight > 4) backLight = 0;
|
||||
switch (backLight) {
|
||||
@@ -109,6 +157,10 @@ SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int fl
|
||||
lcdDepth = 4;
|
||||
|
||||
initUi<Ui::SimulatorDialogTaranis>(ui);
|
||||
|
||||
// install simulator TRACE hook
|
||||
simulator->installTraceHook(traceCb);
|
||||
|
||||
dialP_4 = ui->dialP_4;
|
||||
|
||||
ui->lcd->setBackgroundColor(47, 123, 227);
|
||||
@@ -154,6 +206,7 @@ SimulatorDialogTaranis::~SimulatorDialogTaranis()
|
||||
|
||||
SimulatorDialog::~SimulatorDialog()
|
||||
{
|
||||
traceCallbackInstance = 0;
|
||||
delete timer;
|
||||
delete simulator;
|
||||
}
|
||||
@@ -215,6 +268,49 @@ void SimulatorDialog::onTrimReleased()
|
||||
trimPressed = TRIM_NONE;
|
||||
}
|
||||
|
||||
void SimulatorDialog::openTelemetrySimulator()
|
||||
{
|
||||
// allow only one instance
|
||||
if (TelemetrySimu == 0) {
|
||||
TelemetrySimu = new TelemetrySimulator(this, simulator);
|
||||
TelemetrySimu->show();
|
||||
}
|
||||
else if (!TelemetrySimu->isVisible()) {
|
||||
TelemetrySimu->show();
|
||||
}
|
||||
}
|
||||
|
||||
void SimulatorDialog::openTrainerSimulator()
|
||||
{
|
||||
// allow only one instance
|
||||
if (TrainerSimu == 0) {
|
||||
TrainerSimu = new TrainerSimulator(this, simulator);
|
||||
TrainerSimu->show();
|
||||
}
|
||||
else if (!TrainerSimu->isVisible()) {
|
||||
TrainerSimu->show();
|
||||
}
|
||||
}
|
||||
|
||||
void SimulatorDialog::openDebugOutput()
|
||||
{
|
||||
// allow only one instance, but install signal handler to catch dialog destruction just in case
|
||||
if (DebugOut == 0) {
|
||||
DebugOut = new DebugOutput(this);
|
||||
QObject::connect(DebugOut, SIGNAL(destroyed()), this, SLOT(onDebugOutputClose()));
|
||||
DebugOut->traceCallback(traceBuffer);
|
||||
DebugOut->show();
|
||||
}
|
||||
else if (!DebugOut->isVisible()) {
|
||||
DebugOut->show();
|
||||
}
|
||||
}
|
||||
|
||||
void SimulatorDialog::onDebugOutputClose()
|
||||
{
|
||||
DebugOut = 0;
|
||||
}
|
||||
|
||||
void SimulatorDialog::keyPressEvent (QKeyEvent *event)
|
||||
{
|
||||
switch (event->key()) {
|
||||
@@ -298,7 +394,7 @@ void SimulatorDialog::initUi(T * ui)
|
||||
for (int j=0; j<8; j++){
|
||||
int axe = g.joystick[j].stick_axe();
|
||||
if (axe>=0 && axe<8) {
|
||||
jsmap[axe]=j;
|
||||
jsmap[axe]=j+1;
|
||||
jscal[axe][0] = g.joystick[j].stick_min();
|
||||
jscal[axe][1] = g.joystick[j].stick_med();
|
||||
jscal[axe][2] = g.joystick[j].stick_max();
|
||||
@@ -426,14 +522,24 @@ void SimulatorDialog::initUi(T * ui)
|
||||
for (int fm=0; fm<fmodes; fm++) {
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
label->setText(QString("FM%1").arg(fm));
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
ui->gvarsLayout->addWidget(label, 0, fm+1);
|
||||
}
|
||||
for (int i=0; i<gvars; i++) {
|
||||
QLabel * label = new QLabel(tabWidget);
|
||||
label->setText(QString("GV%1").arg(i+1));
|
||||
label->setAutoFillBackground(true);
|
||||
if ((i % 2) ==0 ) {
|
||||
label->setStyleSheet("QLabel { background-color: rgb(220, 220, 220) }");
|
||||
}
|
||||
ui->gvarsLayout->addWidget(label, i+1, 0);
|
||||
for (int fm=0; fm<fmodes; fm++) {
|
||||
QLabel * value = new QLabel(tabWidget);
|
||||
value->setAutoFillBackground(true);
|
||||
value->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
||||
if ((i % 2) ==0 ) {
|
||||
value->setStyleSheet("QLabel { background-color: rgb(220, 220, 220) }");
|
||||
}
|
||||
gvarValues << value;
|
||||
ui->gvarsLayout->addWidget(value, i+1, fm+1);
|
||||
}
|
||||
@@ -559,6 +665,8 @@ void SimulatorDialog::onTimerEvent()
|
||||
QApplication::beep();
|
||||
}
|
||||
}
|
||||
|
||||
updateDebugOutput();
|
||||
}
|
||||
|
||||
void SimulatorDialog::centerSticks()
|
||||
@@ -971,8 +1079,8 @@ void SimulatorDialog::on_FixRightY_clicked(bool checked)
|
||||
void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
|
||||
{
|
||||
int stick;
|
||||
if (axis>=0 && axis<=8) {
|
||||
stick=jsmap[axis];
|
||||
if (axis>=0 && axis<8) {
|
||||
stick = jsmap[axis];
|
||||
int stickval;
|
||||
if (value>jscal[axis][1]) {
|
||||
if ((jscal[axis][2]-jscal[axis][1])==0)
|
||||
@@ -987,37 +1095,28 @@ void SimulatorDialog::onjoystickAxisValueChanged(int axis, int value)
|
||||
if (jscal[axis][3]==1) {
|
||||
stickval*=-1;
|
||||
}
|
||||
if (stick==1 || stick==2) {
|
||||
float currX=nodeRight->getX();
|
||||
float currY=nodeRight->getY();
|
||||
if (stick==1 ) {
|
||||
nodeRight->setPos(currX*100-10,-stickval*100/1024-10);
|
||||
}
|
||||
if (stick==2) {
|
||||
nodeRight->setPos(stickval*100/1024-10,currY*100-10);
|
||||
}
|
||||
}
|
||||
else if (stick==3 || stick==4) {
|
||||
float currX=nodeLeft->getX();
|
||||
float currY=nodeLeft->getY();
|
||||
if (stick==3) {
|
||||
nodeLeft->setPos(currX*100-10,-stickval*100/1024-10);
|
||||
}
|
||||
if (stick==4) {
|
||||
nodeLeft->setPos(stickval*100/1024-10,currY*100-10);
|
||||
}
|
||||
}
|
||||
|
||||
if (stick==5) {
|
||||
if (stick==1 ) {
|
||||
nodeRight->setY(-stickval/1024.0);
|
||||
}
|
||||
else if (stick==2) {
|
||||
nodeRight->setX(stickval/1024.0);
|
||||
}
|
||||
else if (stick==3) {
|
||||
nodeLeft->setY(-stickval/1024.0);
|
||||
}
|
||||
else if (stick==4) {
|
||||
nodeLeft->setX(stickval/1024.0);
|
||||
}
|
||||
else if (stick==5) {
|
||||
dialP_1->setValue(stickval);
|
||||
}
|
||||
if (stick==6) {
|
||||
else if (stick==6) {
|
||||
dialP_2->setValue(stickval);
|
||||
}
|
||||
if (stick==7) {
|
||||
else if (stick==7) {
|
||||
dialP_3->setValue(stickval);
|
||||
}
|
||||
if (stick==8 && dialP_4) {
|
||||
else if (stick==8 && dialP_4) {
|
||||
dialP_4->setValue(stickval);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include <QDialog>
|
||||
#include "modeledit/node.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "telemetrysimu.h"
|
||||
#include "trainersimu.h"
|
||||
#include "debugoutput.h"
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
#include "joystick.h"
|
||||
@@ -38,6 +41,7 @@ class SimulatorDialog : public QDialog
|
||||
|
||||
void start(const char * filename);
|
||||
void start(QByteArray & eeprom);
|
||||
virtual void traceCallback(const char * text);
|
||||
|
||||
protected:
|
||||
template <class T> void initUi(T * ui);
|
||||
@@ -95,6 +99,14 @@ class SimulatorDialog : public QDialog
|
||||
|
||||
int lcdWidth;
|
||||
int lcdDepth;
|
||||
TelemetrySimulator * TelemetrySimu;
|
||||
TrainerSimulator * TrainerSimu;
|
||||
DebugOutput * DebugOut;
|
||||
|
||||
QString traceBuffer;
|
||||
QMutex traceMutex;
|
||||
QList<QString> traceList;
|
||||
void updateDebugOutput();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent *);
|
||||
@@ -125,6 +137,10 @@ class SimulatorDialog : public QDialog
|
||||
void onTimerEvent();
|
||||
void onTrimPressed();
|
||||
void onTrimReleased();
|
||||
void openTelemetrySimulator();
|
||||
void openTrainerSimulator();
|
||||
void openDebugOutput();
|
||||
void onDebugOutputClose();
|
||||
|
||||
#ifdef JOYSTICKS
|
||||
void onjoystickAxisValueChanged(int axis, int value);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user