Compare commits
626 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1599e85820 | |||
| cc89285a4c | |||
| 79792dfd7b | |||
| e4f00e867f | |||
| 250730789c | |||
| 0807edfc20 | |||
| 5c107aeece | |||
| 050c1b5a7f | |||
| e9bcb05a93 | |||
| 691f4aa0ae | |||
| 0045d8bcc8 | |||
| 7adccc23dc | |||
| 13657587b1 | |||
| ccb4db4c70 | |||
| b6e8b73589 | |||
| 88ca7fcc68 | |||
| 3f3af01cca | |||
| 7ec2c2c5a9 | |||
| 92c208c003 | |||
| a1e0b550fd | |||
| d5db9b7410 | |||
| 129b46ed2b | |||
| 7f3dbd0b57 | |||
| 6443c49285 | |||
| 9fa354779c | |||
| 3134b601d4 | |||
| b5c59368ca | |||
| a575709088 | |||
| a0132fc4e7 | |||
| ddac3ea5e0 | |||
| f4174e6756 | |||
| 958c51b374 | |||
| 8d1121dcc1 | |||
| 47f949c491 | |||
| 5790716a0b | |||
| c141554fc1 | |||
| 560a297680 | |||
| b86f45e15b | |||
| 80bc6f2d1a | |||
| 2b39d703a1 | |||
| 03988a3a62 | |||
| 5b7853029c | |||
| 4daf15869b | |||
| ba736a6a64 | |||
| 086204aed5 | |||
| 44d4e93ad1 | |||
| 2e57549982 | |||
| 946c17770a | |||
| eb9e6d3c80 | |||
| e1a865650f | |||
| 3d3e077fae | |||
| 13f33e38f8 | |||
| e0d5989bef | |||
| 41a6e7c4ab | |||
| 64cd872055 | |||
| 0341b9ffce | |||
| 75e613331b | |||
| c521fce20b | |||
| 62df9831d8 | |||
| 051ec88bee | |||
| f1f6bbfc24 | |||
| 02fdede06b | |||
| aec2170e7e | |||
| d7a9710a9c | |||
| d4be000ccc | |||
| be531b77f0 | |||
| 9263dde231 | |||
| 473e69b3c3 | |||
| 10d0c56b08 | |||
| c68e91c004 | |||
| e11eb2480e | |||
| 6b318e1383 | |||
| 382e4d2d4b | |||
| 3b2524dcbb | |||
| f75fedcb0d | |||
| 797b4d9f1e | |||
| 77d892a5de | |||
| 0b163ba067 | |||
| 4ebca98cdf | |||
| 1147db45a4 | |||
| 4a6a20a2aa | |||
| 7e0c78e2b7 | |||
| 7cfb1b24a1 | |||
| 0615fa780c | |||
| e43afd8001 | |||
| 04966868eb | |||
| 52ebba3802 | |||
| 3b8c5bbeb1 | |||
| 8e2c280e4a | |||
| e0544e2d1e | |||
| f76a368497 | |||
| 0c5f5695cc | |||
| 863272bc52 | |||
| 15912854e8 | |||
| ad33bff31c | |||
| b8195e1372 | |||
| 97a8dc33be | |||
| ff4f914d34 | |||
| 4104efbb17 | |||
| a7d0816ac7 | |||
| 7cf66c56c2 | |||
| 55f71f053b | |||
| 7a45b3f71b | |||
| 4ef981e914 | |||
| 338c34427e | |||
| f41ac20051 | |||
| dee5a510f5 | |||
| 917b114b49 | |||
| 2a5ab33d67 | |||
| 59b457650a | |||
| 72a15318be | |||
| 3e1d87d5b3 | |||
| b5f6618238 | |||
| 23e597fffe | |||
| 2f9ae3750d | |||
| dcc9dcbe99 | |||
| bfd2e2c538 | |||
| 638648a0a4 | |||
| d6c7b63f90 | |||
| 9f29003553 | |||
| 4b4522f2ee | |||
| 54343be57e | |||
| d449075a54 | |||
| 9a615adff7 | |||
| 8427e6ed04 | |||
| c5e8dcff38 | |||
| d7909e7dbc | |||
| 1fd1e141f2 | |||
| f65e42833e | |||
| cc4e28857d | |||
| 52a52fdb8a | |||
| 19f392131c | |||
| fb3dd1303c | |||
| c6a04394c5 | |||
| 301cd0538b | |||
| d28c71db86 | |||
| 56fb01a958 | |||
| 5e96d02120 | |||
| 9a23c3fcc6 | |||
| fe901dabdf | |||
| 806d547ced | |||
| a495885472 | |||
| 946fda5705 | |||
| cefc78dbe8 | |||
| 6acfabeaf0 | |||
| 9a40830f8a | |||
| 3004a61695 | |||
| 3660101e37 | |||
| acb7f1e17f | |||
| 75e1bead3f | |||
| 81a7a554c3 | |||
| c5c92c012b | |||
| 5f951abc15 | |||
| 017f64a7a4 | |||
| dfde65f397 | |||
| bdb50052ba | |||
| 5cc8f41bce | |||
| 08cb4550f6 | |||
| 4c342a1883 | |||
| de96f607e2 | |||
| 927c511556 | |||
| 95fe7ad197 | |||
| 1b93340319 | |||
| ca0e58e923 | |||
| 43b8ee361b | |||
| ee533c7950 | |||
| 2b9242fac2 | |||
| 83887f1532 | |||
| 1734ca6919 | |||
| f299a5bfdf | |||
| 95201db642 | |||
| 103fea7b98 | |||
| 358badfed9 | |||
| 63713578fe | |||
| 22a8a5cc80 | |||
| 5827b0fd6c | |||
| cfe1a3777f | |||
| d5396f8377 | |||
| dcf7cd2c65 | |||
| 71e54b3072 | |||
| fdca5a11b0 | |||
| 8223cd907d | |||
| c2f8ef83c7 | |||
| 7fceed4f5f | |||
| 2519df3b59 | |||
| 6e30373f86 | |||
| b29d8c50ba | |||
| fe3efb9483 | |||
| f926b85611 | |||
| 401f0f2a4f | |||
| 701d02ba8e | |||
| 67a599e0b9 | |||
| 0f4f49b64e | |||
| 84bf31f908 | |||
| 1d9056fe8d | |||
| 5c175bfd7f | |||
| b74a3987c0 | |||
| d1be1b4ea0 | |||
| 01ef176173 | |||
| 3e0a314307 | |||
| 6622324483 | |||
| 286a865d30 | |||
| 5d72bbdc90 | |||
| a44d0ddc14 | |||
| 97ef3fa916 | |||
| f9f7ddd639 | |||
| 33910c8721 | |||
| e72a049683 | |||
| f7fafc0948 | |||
| 1d867a0daa | |||
| 3c56ea0122 | |||
| 6db97c573b | |||
| 5853ac635f | |||
| fad9710012 | |||
| 9abeb15360 | |||
| 29b8b2685c | |||
| 79a5f65a2c | |||
| c07e965542 | |||
| 9e4f9bb7ed | |||
| 32f278ee3f | |||
| 860409de29 | |||
| 48081db9f6 | |||
| 02f06706c2 | |||
| 1da4df143c | |||
| 6ce34c511c | |||
| 27fe5c198f | |||
| cd821116c5 | |||
| 65fc20ddde | |||
| 2037c33ce1 | |||
| 2e76be5b0b | |||
| cdcf64e38c | |||
| fd1181dc09 | |||
| c7bd968586 | |||
| 11cc82a7ac | |||
| 1ba6a56641 | |||
| 366c286e73 | |||
| afddad9396 | |||
| 110c5da1e7 | |||
| fda4cac1ed | |||
| 7d0f5a9d9b | |||
| e64866244d | |||
| 1c38ccaa12 | |||
| 40ae1879e8 | |||
| 979a86f24e | |||
| 992897a5a7 | |||
| 8733915634 | |||
| 643e449f52 | |||
| c36acc5372 | |||
| 3913a36aeb | |||
| 2a4bc2cf6a | |||
| fe865dfdae | |||
| 45cdfac22b | |||
| c07a2d338a | |||
| 16a37db86f | |||
| 695e05c713 | |||
| 29eafb4fba | |||
| 7599d22c83 | |||
| 027f442079 | |||
| 56fd1e8039 | |||
| 0e1ab00ed3 | |||
| 7ebebb312a | |||
| 364bf6ac23 | |||
| b7e4a3c63b | |||
| d6c17a7ead | |||
| 3854e05f26 | |||
| 087e606021 | |||
| 4c8789106d | |||
| 5ff4d8829a | |||
| a313d541dc | |||
| a8300715a9 | |||
| d118acdf20 | |||
| 9f60e3c909 | |||
| 9d7e38aeff | |||
| 5c71d74aab | |||
| e738293a52 | |||
| 870002ab79 | |||
| 07d62e39db | |||
| 48365f36a5 | |||
| b43d336978 | |||
| e5ae58d4d7 | |||
| b141203bc1 | |||
| 16eaa0347d | |||
| c0c7968fc4 | |||
| e1463b99e6 | |||
| e8318cd8de | |||
| 0eb71cb4f2 | |||
| c5f3010295 | |||
| 641b6a321a | |||
| a42b63ff34 | |||
| d2ec99513c | |||
| 8eb3480acc | |||
| c9ae964428 | |||
| c51a85f376 | |||
| 6c54374ed8 | |||
| da76106465 | |||
| 3b3555df48 | |||
| c8ae36997e | |||
| 30bf6f7530 | |||
| 1786d998f8 | |||
| 708ef3bc98 | |||
| 4aa6bd12ca | |||
| c46c1f887a | |||
| a8172e3588 | |||
| 91341fa759 | |||
| 0bad169008 | |||
| aa7c320821 | |||
| 5c67e20fa5 | |||
| aa62f0d6f1 | |||
| c86ace9976 | |||
| b11d45dbb5 | |||
| 50b76183da | |||
| 1a7fb12f15 | |||
| cbfdf9b9f5 | |||
| 3f7b289ebe | |||
| 295491f965 | |||
| 16f465b147 | |||
| c91511565e | |||
| b6759d5434 | |||
| 1771a47637 | |||
| 677995205d | |||
| a6a71b8650 | |||
| ab4efe89cc | |||
| efb37a4419 | |||
| d85ee61cb3 | |||
| eecdef3c5a | |||
| a1883db889 | |||
| 0dd15ebbab | |||
| 3ad57cf3ff | |||
| f27c092ba4 | |||
| e8aaa67450 | |||
| 43b84385d8 | |||
| 7fe39791ff | |||
| a3fac6049f | |||
| e3eb236e7b | |||
| a57053e390 | |||
| f2362bb748 | |||
| 8780535ff9 | |||
| 12af6a8a19 | |||
| 7faa7c79bf | |||
| 0ac9998e6b | |||
| a76fc4c88c | |||
| 26469b8627 | |||
| ba4dd66891 | |||
| be67637ec6 | |||
| 595a191be4 | |||
| 1ff32c64f5 | |||
| 87f8ea516b | |||
| 86df9fee4a | |||
| bd7769e717 | |||
| c42696102a | |||
| 82a4ad4103 | |||
| 685dece185 | |||
| a43271c7a6 | |||
| bbe4e7d4c3 | |||
| 3d9553d5f3 | |||
| 5e02140ac7 | |||
| d54525fe7a | |||
| 8a819dbed5 | |||
| b4cffbcce1 | |||
| 9a5bd48712 | |||
| d8bc752291 | |||
| f6740c4583 | |||
| 5f0bfc50e9 | |||
| f61bb941dc | |||
| 0600122102 | |||
| a4e6c90d1d | |||
| c5e0eb84b8 | |||
| b045b979cd | |||
| 93fde17526 | |||
| dc6d9aca3a | |||
| 77772287fe | |||
| bfd385115f | |||
| d7112b5dd7 | |||
| acaa77daab | |||
| 03c9b2c4a2 | |||
| 826eb2569c | |||
| 8809a64d57 | |||
| 1b177ba8b8 | |||
| 450bd77f67 | |||
| 3e409a0371 | |||
| b778c5e469 | |||
| 86c5c31293 | |||
| 400a6c2034 | |||
| 9db8005f71 | |||
| ba2d03b3ad | |||
| e3281ddade | |||
| a4343d8e8c | |||
| 2518ed9a74 | |||
| 117e28db16 | |||
| d734e3465d | |||
| e9f23b2109 | |||
| 2d9aa72c23 | |||
| 49d8242faf | |||
| c5c1475bc9 | |||
| e01d5a31c1 | |||
| c70236cbad | |||
| 908fce110b | |||
| b2b09b4b04 | |||
| 4c8b760022 | |||
| e41ef3fa5d | |||
| d5cbf57e1b | |||
| cc40d1e611 | |||
| 316d42b5b6 | |||
| d82cf058f7 | |||
| 2df68d1579 | |||
| 1e15b711bb | |||
| 97d59cfa56 | |||
| 0f1ccc993e | |||
| b818c0df6b | |||
| 42473d6868 | |||
| 31d4340ce7 | |||
| 2d4d6ffe48 | |||
| 1a308b0a53 | |||
| d02d0f26db | |||
| 356faefb6d | |||
| 0c78c60dc9 | |||
| 88841f63ca | |||
| c8358d7e37 | |||
| c819814d94 | |||
| bccea3594c | |||
| 05c29d320c | |||
| 7789fd0b38 | |||
| b00ef6a9b3 | |||
| 739f19d450 | |||
| cc8bd03d8a | |||
| 816b22fd9d | |||
| 0504e848ed | |||
| 5250f5eb4c | |||
| 91e80d446a | |||
| e8983250ca | |||
| 493130504b | |||
| 0db5072bed | |||
| cf4fa51019 | |||
| 8942115f33 | |||
| d7cbd78edf | |||
| 90a62b00f0 | |||
| d165a22a54 | |||
| 1f59f04070 | |||
| 01fa6471c7 | |||
| a60522df18 | |||
| 9e237c9e46 | |||
| 9a114c903c | |||
| 551ef10d6f | |||
| 92704687cf | |||
| 3cab898225 | |||
| e103d6fc24 | |||
| 4bd90d79d0 | |||
| 82c3230981 | |||
| 5f698d2b17 | |||
| 4bfcfd0fc8 | |||
| bcc7982b3b | |||
| 0743785126 | |||
| 196dbb1d39 | |||
| fa0ded50fe | |||
| 2968b25cfa | |||
| 39ee317190 | |||
| 710482e821 | |||
| 73f9dac120 | |||
| 7dcd96d258 | |||
| 9d13484291 | |||
| be154140b3 | |||
| 054952edcb | |||
| 3d6533c88b | |||
| a0f6b0e913 | |||
| 50d8e21533 | |||
| b8800ed30e | |||
| 5efa5d47d3 | |||
| b3d52e3525 | |||
| aa2ca4f729 | |||
| 034221a78e | |||
| f63dcfb778 | |||
| 3ebc6bb86c | |||
| b8ac51564e | |||
| 5554540630 | |||
| 1edc1fe316 | |||
| 00100c0c86 | |||
| 8bdce4e213 | |||
| 4edbfcb834 | |||
| 9eeb2dd6a2 | |||
| 49016498a3 | |||
| e37dcabd95 | |||
| 191e37f29c | |||
| 1dcc660f31 | |||
| 618dd279fc | |||
| 13927800e2 | |||
| 384bfea9f9 | |||
| 1e2130de53 | |||
| 9d29b483c5 | |||
| 75c1f9f3f7 | |||
| af6ea012bb | |||
| 5492c18a01 | |||
| fd554cf013 | |||
| 9bc63c7421 | |||
| 5169892d39 | |||
| bca9866675 | |||
| 787d2ffa92 | |||
| d2155ef089 | |||
| f80a788754 | |||
| 7c1634c00d | |||
| 1cbd0ec4b4 | |||
| dc2d2e1f2e | |||
| 98d5966946 | |||
| f184e9bed3 | |||
| cbe244fc6c | |||
| f8201844d7 | |||
| 51b8f9b054 | |||
| ab99740e1b | |||
| f19815ee26 | |||
| 84bd62bdce | |||
| efc57d4cf2 | |||
| d101a6d181 | |||
| 71f08998dd | |||
| 791b1173e3 | |||
| 7538fcfb51 | |||
| 7e6dc610ac | |||
| 765ff269f9 | |||
| 01187e60c2 | |||
| f92b71c0b8 | |||
| edab80e6af | |||
| 18e36657f8 | |||
| 683f6e22e2 | |||
| 0db2013d24 | |||
| 6f0de32ba8 | |||
| 170a2b2612 | |||
| f05058252f | |||
| 32d0e3890a | |||
| ee95c973e9 | |||
| a1bb31b521 | |||
| e1cf90d6d4 | |||
| cc836a049b | |||
| d66b55707d | |||
| fd73adc68b | |||
| b7c09d703c | |||
| 22a24d67c9 | |||
| 821cdff3e6 | |||
| e979768445 | |||
| f238e4d737 | |||
| e3825ed542 | |||
| 788035b0e3 | |||
| d1e9bf8e98 | |||
| 86b5e36925 | |||
| 072204756c | |||
| e76478f27a | |||
| db4ac954ba | |||
| 6f230c4fc7 | |||
| de733579d5 | |||
| d3915a78fd | |||
| f8f5dde24e | |||
| e76cebbc66 | |||
| 8ba13e5685 | |||
| 116dcf93e0 | |||
| 18e128ef55 | |||
| 11fe3d41f8 | |||
| 404a1934c5 | |||
| 77ebe3caec | |||
| e71b53964b | |||
| 11cff7a63b | |||
| 07ca8319ad | |||
| 2f54e85421 | |||
| edf1dbc0b7 | |||
| 7f991ea7f9 | |||
| f0753fe51c | |||
| 7f4abd7c83 | |||
| ed2f66aedd | |||
| f32231cab2 | |||
| 86f1363d0a | |||
| c4d7feaa9b | |||
| 312c370162 | |||
| a9603cbdb7 | |||
| 922141fcf7 | |||
| 34fef4fefe | |||
| d74092d6eb | |||
| 5445e506a6 | |||
| 3a740907bb | |||
| b1f5ea115c | |||
| bca18f5938 | |||
| 62e6e30481 | |||
| a556c50956 | |||
| 8f4c161dc0 | |||
| a2c50ce2f8 | |||
| 03fabd95ac | |||
| 7e5374f31d | |||
| 4605f9d61d | |||
| fcb845a6b2 | |||
| 0e34c24d96 | |||
| 543123a169 | |||
| b96f882866 | |||
| f0039129e9 | |||
| 9cd0cbf417 | |||
| 0673663427 | |||
| 6f774eb61a | |||
| ab0272c16c | |||
| fb371cf5b7 | |||
| e18e6f9c41 | |||
| c8f77fceec | |||
| d353f3c388 | |||
| cad1cc4432 | |||
| 8a3de9184b | |||
| 4f5ce6b0f0 | |||
| 719ecc8473 | |||
| 76b5143dd4 | |||
| b458b79bed | |||
| b3979d9fff | |||
| 8c337b721b | |||
| 7982c9d5c7 | |||
| 06c0ccf86a | |||
| 8dc402d119 | |||
| 8c0f69746f | |||
| 8f5b844e23 | |||
| df698e9ff2 | |||
| 907336722d | |||
| e0fa546b10 | |||
| ddaf6237b9 | |||
| ce2f7b61e9 | |||
| e25115b104 | |||
| c92909f7c5 | |||
| 2902ae1887 | |||
| 34be811622 | |||
| aeed0e34a9 | |||
| c2dade2133 | |||
| 3d74f2b437 | |||
| 78bcc4d582 | |||
| 1df45cbfc2 | |||
| 0bf2a204e2 | |||
| d0f6c59b8a | |||
| 3083269f30 |
@@ -1,3 +1,4 @@
|
||||
/.idea/
|
||||
/.*project
|
||||
/.settings
|
||||
/.autotools
|
||||
@@ -6,4 +7,6 @@ radio/src/bootloader/bootloader_ramBoot*
|
||||
*.lbm
|
||||
*.o
|
||||
/doc/
|
||||
*.inc
|
||||
*.stamp
|
||||
radio/src/lua/lua_fields_*.txt
|
||||
radio/src/lua/lua_exports_*.txt
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
language: cpp
|
||||
|
||||
before_install:
|
||||
- sudo apt-get remove cmake cmake-data --yes
|
||||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo apt-get update
|
||||
- sudo apt-get remove cmake cmake-data --yes
|
||||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test --yes
|
||||
- sudo add-apt-repository ppa:beineri/opt-qt551 --yes
|
||||
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' --yes
|
||||
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
- sudo apt-get update -qq
|
||||
- rsync -av firmware.diydrones.com::Tools/Travis/*.deb ExtraPackages
|
||||
|
||||
install:
|
||||
- sudo apt-get install --yes --force-yes lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi qt-latest g++-5 libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libfox-1.6-dev libgtest-dev python-clang-3.8 libclang-3.8-dev python-qt4
|
||||
- sudo dpkg -i ExtraPackages/*.deb || echo "FAILED INSTALL OF EXTRA DEBS"
|
||||
- export CXX="g++-5" CC="gcc-5"
|
||||
|
||||
script:
|
||||
- radio/util/commit-tests.sh
|
||||
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug ../companion/src && cmake --build .
|
||||
- ./radio/util/commit-tests.sh .
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
project(OpenTX)
|
||||
|
||||
set(VERSION_MAJOR "2")
|
||||
set(VERSION_MINOR "2")
|
||||
set(VERSION_REVISION "0")
|
||||
set(VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
set(VERSION_FAMILY ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}${VERSION_SUFFIX})
|
||||
message(STATUS "OpenTX ${VERSION}")
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_policy(SET CMP0020 NEW)
|
||||
cmake_policy(SET CMP0023 OLD)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
set(RADIO_DIRECTORY ${PROJECT_SOURCE_DIR}/radio)
|
||||
set(RADIO_SRC_DIRECTORY ${RADIO_DIRECTORY}/src)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
|
||||
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
|
||||
|
||||
find_package(Qt5Widgets)
|
||||
find_package(Qt5Xml)
|
||||
find_package(Qt5LinguistTools)
|
||||
find_package(Qt5PrintSupport)
|
||||
find_package(Qt5Multimedia)
|
||||
|
||||
include(Macros)
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
git_id(GIT_STR)
|
||||
|
||||
add_subdirectory(${RADIO_SRC_DIRECTORY})
|
||||
|
||||
if(Qt5Widgets_FOUND)
|
||||
add_subdirectory(${COMPANION_SRC_DIRECTORY})
|
||||
endif()
|
||||
@@ -9,7 +9,6 @@
|
||||
<a href="http://openpilot.com">David Ankers (OpenPilot)</a>
|
||||
<a href="http://3drobotics.com">3D Robotics</a>
|
||||
<a href="http://rcstudio.cz">RC Studio (monthly)</a>
|
||||
<a href="http://www.craftandtheoryllc.com">Craft & Theory (monthly)</a>
|
||||
|
||||
Mario Sette
|
||||
Felice Baratto
|
||||
@@ -49,9 +48,11 @@ R. Scott Page
|
||||
Johan Cronje
|
||||
Renato Aranghelovici
|
||||
Jeffrey Irvin
|
||||
John Rodgers
|
||||
Kenneth Crump
|
||||
Damjan Adamic
|
||||
Martin Wilson
|
||||
Joe Street
|
||||
John Holdsworth
|
||||
Daniel Schwartz
|
||||
Dean Church (monthly)
|
||||
@@ -147,6 +148,7 @@ Mike Matheny
|
||||
Martin Sniedze
|
||||
Fernando Rimoldi
|
||||
Sidney Fisher
|
||||
Bruce Anderson
|
||||
John Rodgers
|
||||
Ed Pare
|
||||
Thomas Kilduff
|
||||
@@ -333,6 +335,7 @@ Jose Sobral
|
||||
Heung Jin Choi
|
||||
Tomasz Janiak
|
||||
Fabien Gagné
|
||||
Joe Street
|
||||
Micha Ronen
|
||||
Albert Blondin
|
||||
Klaus Schuebel
|
||||
@@ -847,167 +850,3 @@ Tadeusz Adamowski
|
||||
Andrew Newton
|
||||
Neil Horne
|
||||
Kerstin Appelqvist
|
||||
John Curran
|
||||
Gerald Thiel
|
||||
Jürg Bingisser
|
||||
George Emer
|
||||
Jerzy Manarczyk
|
||||
Gerard Braakhuis
|
||||
Nicolas Leblond
|
||||
Burt Pickard-Richardson
|
||||
Jiri Petrzelka
|
||||
RK Custom Homes
|
||||
David Semeria
|
||||
Philip Lewis
|
||||
William Kim
|
||||
Dean Berg
|
||||
Tim Spurr
|
||||
Clifton Hipsher
|
||||
Mike Frizell
|
||||
Oliver Jacob
|
||||
Pawel Stepien
|
||||
Thomas Kilduff
|
||||
Barry Fox
|
||||
Anatoly Bakalenko
|
||||
Bruce Anderson
|
||||
Jeremy Cowgar
|
||||
Edward Hauser
|
||||
Stuart Brown
|
||||
Anton Glock
|
||||
Roger Ritchie
|
||||
George Carnie
|
||||
Philippe Stofleth
|
||||
Tim Dzugan
|
||||
Illia Izotov
|
||||
Richard Miles (monthly)
|
||||
Attila Kapolnai
|
||||
Gilles Dando
|
||||
Denis Roussille
|
||||
Olivier Anken
|
||||
Michel Motte
|
||||
David McDonald
|
||||
Tauno Rautakorpi
|
||||
Carsten Schlassa
|
||||
Angel de la Dehesa Calles
|
||||
Michel Garbarin
|
||||
Algirdas Tamosiunas
|
||||
Petr Kysela
|
||||
Pascal Roux
|
||||
Robert Whitfield
|
||||
InTheTubeDeep
|
||||
Jaromir Malek
|
||||
Joe Street
|
||||
Regin Poulsen
|
||||
Hervé Laveyssiere
|
||||
Walter Fowler
|
||||
Richard Wagner
|
||||
Kevin Hyman
|
||||
Herald Reichel
|
||||
Frederic Rouyre
|
||||
David Libby
|
||||
Hans Timmermans
|
||||
Adrian De Zee
|
||||
John Hanagan
|
||||
Didier van Steensel
|
||||
Julius Vicze
|
||||
Cristiano Merighi
|
||||
James Holley
|
||||
Chris Merry
|
||||
Jiri Fojtasek
|
||||
Thierry Laligand
|
||||
Hassouna Cherif
|
||||
Fred Thijssen
|
||||
Andrew Gardiner
|
||||
Christian Niß
|
||||
Douglas Penney
|
||||
Starck Associates
|
||||
Johannes Wollenweber
|
||||
Fred Page
|
||||
Jean Trouche
|
||||
Patrick Blanc
|
||||
Jean-Louis Tonnellier
|
||||
Masoud
|
||||
Mustafa Güven
|
||||
William Waters
|
||||
Joël Allamy
|
||||
William Mckinstry
|
||||
Jean-Jacques Pointel
|
||||
Frédéric Rouyre
|
||||
Jonathan Pruett
|
||||
Jörg Zieren
|
||||
Christopher Rhodes
|
||||
Marco Strack
|
||||
Stefano Boggia
|
||||
Dwayne Myers
|
||||
Stavros Papathanasiou
|
||||
Roland Nittby
|
||||
Courtney Puskas
|
||||
NorthSide
|
||||
Martin Polák
|
||||
Ulf Reinhardt
|
||||
Wolfgang Renisch
|
||||
Trevor Hinze
|
||||
Mohammad Zargari
|
||||
Dr. Willutzki
|
||||
Jean Pierre Bernard
|
||||
Patrick Castellan
|
||||
Udo Tödter
|
||||
Marc J Merlin
|
||||
Paul Chitonu
|
||||
Wolfgang Rauser
|
||||
Emmanuel Dallery
|
||||
James Lyons
|
||||
Tauno Rautakorpi
|
||||
Gerald Peklar
|
||||
Fabien Gagné
|
||||
David Cox
|
||||
Philip Cork
|
||||
Kevin Wright
|
||||
John Scott
|
||||
Yves Berger
|
||||
Otto Fröhlich
|
||||
Kenneth Lilja
|
||||
Benjamin Johnson
|
||||
Brad Kelley
|
||||
Michel Biancki
|
||||
Lynn Laycock
|
||||
Claude Godefroy
|
||||
Gérald Joubert
|
||||
Wayne J Podaima
|
||||
Philippe Peyron
|
||||
Julien Kieffer
|
||||
Gregor Walter
|
||||
Carlos Viegas
|
||||
Roberto Orsello
|
||||
Steve Murray (monthly)
|
||||
Marcel Schäfer
|
||||
Sean Cull
|
||||
Holger Bothmer
|
||||
Michael Manning
|
||||
Martin Risik
|
||||
ZEN Computer Services
|
||||
Egbert Stohlmann
|
||||
Martin Peryea
|
||||
Nathan James
|
||||
Luis Suarez
|
||||
Artur Uzieblo
|
||||
InTheTubeDeep
|
||||
Jaap Greve
|
||||
Peter Glassey
|
||||
David Reynolds
|
||||
David Frazier
|
||||
Donald L Singer
|
||||
George Carnie
|
||||
Susan Holbert
|
||||
Richard Garrett
|
||||
Paco Galván
|
||||
Matthew Sylvester
|
||||
Robert Bates
|
||||
Hans-Peter Endres
|
||||
Axel Stöckle
|
||||
Leonard MacKey
|
||||
Andrew Fernie
|
||||
Mark McCoy
|
||||
Damir Pooshs
|
||||
Jeff Dillingham
|
||||
Brent Hampton
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
##OpenTX 2.1 Branch
|
||||
##OpenTX 2.2 Branch
|
||||
|
||||
[](https://travis-ci.org/opentx/opentx)
|
||||
[](https://opentx.rocket.chat)
|
||||
[](https://travis-ci.org/opentx/opentx)
|
||||
[](https://gitter.im/opentx/opentx?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DJ9MASSKVW8WN)
|
||||
|
||||
The ongoing development on 2.1.x is done in this branch.
|
||||
The ongoing development on 2.2.x is done in this branch.
|
||||
|
||||
Refer to the [OpenTX wiki](https://github.com/opentx/opentx/wiki) for information about setting up the tool chains for building OpenTX and OpenTX Companion as well as other development related issues.
|
||||
|
||||
Useful links:
|
||||
* OpenTX Blog http://blog.open-tx.org/
|
||||
* OpenTX Main Site http://www.open-tx.org/
|
||||
* OpenTx University http://open-txu.org/
|
||||
* OpenTX User Manual https://www.gitbook.com/book/opentx/opentx-taranis-manual/details
|
||||
* OpenTX Lua Reference Guide https://www.gitbook.com/book/opentx/opentx-lua-reference-guide/details
|
||||
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.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
macro(add_bitmaps_target targetname filter width format)
|
||||
file(GLOB bitmaps ${filter})
|
||||
foreach(bitmap ${bitmaps})
|
||||
get_filename_component(target ${bitmap} NAME_WE)
|
||||
set(target ${target}.lbm)
|
||||
add_custom_command(
|
||||
OUTPUT ${target}
|
||||
COMMAND python ${RADIO_DIRECTORY}/util/img2lbm.py ${bitmap} ${target} ${width} ${format} ${ARGN}
|
||||
DEPENDS ${bitmap}
|
||||
)
|
||||
list(APPEND bitmaps_files ${target})
|
||||
endforeach()
|
||||
add_custom_target(${targetname} DEPENDS ${bitmaps_files})
|
||||
endmacro(add_bitmaps_target)
|
||||
|
||||
macro(add_truetype_font_target radio name font size bold)
|
||||
set(target ${RADIO_SRC_DIRECTORY}/fonts/${radio}/font_${name})
|
||||
add_custom_target(ttf_${radio}_${name}
|
||||
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
endmacro(add_truetype_font_target)
|
||||
@@ -4,25 +4,25 @@
|
||||
# SDL_FOUND, if false, do not try to link to SDL
|
||||
# SDL_INCLUDE_DIR, where to find SDL.h
|
||||
#
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
||||
# OS X framework based version. (Other versions link to -lSDLmain which
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# this module will try to find on your behalf.) Also for OS X, this
|
||||
# module will automatically add the -framework Cocoa on your behalf.
|
||||
# $SDLDIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$SDLDIR
|
||||
# used in building SDL.
|
||||
# l.e.galup 9-20-02
|
||||
#
|
||||
# Modified by Eric Wing.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Modified by Eric Wing.
|
||||
# Added new modifications to recognize OS X frameworks and
|
||||
# additional Unix paths (FreeBSD, etc).
|
||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
||||
# Added a search for SDLmain which is needed by some platforms.
|
||||
# Added a search for threads which is needed by some platforms.
|
||||
# Added needed compile switches for MinGW.
|
||||
#
|
||||
# On OSX, this will prefer the Framework version (if found) over others.
|
||||
# People will have to manually change the cache values of
|
||||
# People will have to manually change the cache values of
|
||||
# SDL_LIBRARY to override this selection.
|
||||
#
|
||||
# Note that the header path has changed from SDL/SDL.h to just SDL.h
|
||||
@@ -46,14 +46,14 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
|
||||
/opt/local/include/SDL # DarwinPorts
|
||||
/opt/local/include
|
||||
/opt/csw/include/SDL # Blastwave
|
||||
/opt/csw/include
|
||||
/opt/csw/include
|
||||
/opt/include/SDL
|
||||
/opt/include
|
||||
C:/Programs/SDL/include
|
||||
)
|
||||
# I'm not sure if I should do a special casing for Apple. It is
|
||||
# I'm not sure if I should do a special casing for Apple. It is
|
||||
# unlikely that other Unix systems will find the framework path.
|
||||
# But if they do ([Next|Open|GNU]Step?),
|
||||
# But if they do ([Next|Open|GNU]Step?),
|
||||
# do they want the -framework option also?
|
||||
IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# The Cocoa framework must be linked into SDL because SDL is Cocoa based.
|
||||
@@ -83,7 +83,7 @@ IF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
# SDL-1.1 is the name used by FreeBSD ports...
|
||||
# don't confuse it for the version number.
|
||||
FIND_LIBRARY(SDL_LIBRARY_TEMP
|
||||
FIND_LIBRARY(SDL_LIBRARY_TEMP
|
||||
NAMES SDL SDL-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
@@ -93,13 +93,13 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
C:/Programs/SDL/lib/x86
|
||||
)
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDLmain. This is mainly for Windows and OS X. Other platforms
|
||||
# seem to provide SDLmain for compatibility even though they don't
|
||||
# necessarily need it.
|
||||
FIND_LIBRARY(SDLMAIN_LIBRARY
|
||||
FIND_LIBRARY(SDLMAIN_LIBRARY
|
||||
NAMES SDLmain SDLmain-1.1
|
||||
PATHS
|
||||
$ENV{SDLDIR}/lib
|
||||
@@ -109,13 +109,12 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
/opt/local/lib
|
||||
/opt/csw/lib
|
||||
/opt/lib
|
||||
C:/Programs/SDL/lib
|
||||
)
|
||||
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
|
||||
|
||||
# SDL may require threads on your system.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# The Apple build may not need an explicit flag because one of the
|
||||
# frameworks may already provide it.
|
||||
# But for non-OSX systems, I will use the CMake Threads package.
|
||||
IF(NOT APPLE)
|
||||
FIND_PACKAGE(Threads)
|
||||
@@ -136,14 +135,14 @@ IF(SDL_LIBRARY_TEMP)
|
||||
ENDIF(SDLMAIN_LIBRARY)
|
||||
|
||||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there. I think it has something to do
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there. I think it has something to do
|
||||
# with the CACHE STRING. Maybe somebody else knows how to fix this.
|
||||
# The problem is mainly cosmetic, and not a functional issue.
|
||||
IF(APPLE)
|
||||
SET(SDL_LIBRARY_TEMP ${SDL_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if Find the threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
@@ -162,4 +161,4 @@ IF(SDL_LIBRARY_TEMP)
|
||||
SET(SDL_FOUND "YES")
|
||||
ENDIF(SDL_LIBRARY_TEMP)
|
||||
|
||||
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
|
||||
MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)
|
||||
@@ -0,0 +1,39 @@
|
||||
macro(today RESULT)
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
string(SUBSTRING ${${RESULT}} 0 10 ${RESULT})
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND "date" "+%Y-%m-%d" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(....)-(..)-(..).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
|
||||
else(WIN32)
|
||||
message(SEND_ERROR "date not implemented")
|
||||
set(${RESULT} 00.00.0000)
|
||||
endif(WIN32)
|
||||
endmacro(today)
|
||||
|
||||
macro(now RESULT)
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
|
||||
else(WIN32)
|
||||
message(SEND_ERROR "time not implemented")
|
||||
set(${RESULT} 00:00:00)
|
||||
endif(WIN32)
|
||||
endmacro(now)
|
||||
|
||||
macro(git_id RESULT)
|
||||
if(WIN32)
|
||||
execute_process(COMMAND "cmd" " /C git --git-dir=${PROJECT_SOURCE_DIR}/.git rev-parse HEAD" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
|
||||
elseif(UNIX)
|
||||
execute_process(COMMAND "git" "--git-dir=${PROJECT_SOURCE_DIR}/.git" "rev-parse" "HEAD" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(.*)\n" "\\1" ${RESULT} ${${RESULT}})
|
||||
else(WIN32)
|
||||
message(SEND_ERROR "Git ID implemented")
|
||||
set(${RESULT} 0)
|
||||
endif(WIN32)
|
||||
endmacro(git_id)
|
||||
@@ -1,70 +1,5 @@
|
||||
<h2>Version 2.1.9 / 2016-09-14</h2>
|
||||
|
||||
<ul>
|
||||
<li>SD sync fixes (<a href=https://github.com/opentx/opentx/issues/3351>#3351</a>)</li>
|
||||
<li>Fixed: Telemetry mode "FrSky D (cable)" choice was missing for Taranis (<a href=https://github.com/opentx/opentx/issues/3372>#3372</a>)</li>
|
||||
<li>Show persistent option only for calculated sensors (<a href=https://github.com/opentx/opentx/issues/3454>#3454</a>)</li>
|
||||
<li>Fixed Flight mode clear command (<a href=https://github.com/opentx/opentx/issues/3214>#3214</a>)</li>
|
||||
<li>Fixed a problem with Rotary encoders linked to flight mode (could freeze Companion) (<a href=https://github.com/opentx/opentx/issues/3459>#3459</a>, <a href=https://github.com/opentx/opentx/issues/3470>#3470</a>)</li>
|
||||
<li>Telemetry simulator improvements: added fuel quantity sensor, increased RPM range (<a href=https://github.com/opentx/opentx/issues/3505>#3505</a>, <a href=https://github.com/opentx/opentx/issues/3506>#3506</a>)</li>
|
||||
<li>Implemented minimal support for the DYI Multimodule (<a href=https://github.com/opentx/opentx/issues/3526>#3526</a>)</li>
|
||||
<li>Fixed: GVar combo-box not being refreshed when GV check-box (re-)selected (<a href=https://github.com/opentx/opentx/issues/3518>#3518</a>)</li>
|
||||
<li>Fixed: Heli inversion not correctly shown/saved from Companion on Radios without virtual inputs (<a href=https://github.com/opentx/opentx/issues/3510>#3510</a>)</li>
|
||||
<li>Implemented print functions for the Heli setup screen (<a href=https://github.com/opentx/opentx/issues/3554>#3554</a>)</li>
|
||||
<li>Fixed: Flight modes linked trims display value (<a href=https://github.com/opentx/opentx/issues/3547>#3547</a>, <a href=https://github.com/opentx/opentx/issues/3568>#3568</a>)</li>
|
||||
<li>Fixed: New model global variables and rotary encoders initialisation (<a href=https://github.com/opentx/opentx/issues/3473>#3473</a>)</li>
|
||||
<li>Fixed: Prevent circular linked global variables and rotary encoders (<a href=https://github.com/opentx/opentx/issues/3472>#3472</a>)</li>
|
||||
<li>Fixed wrong log replay speed issue in Telemetry simulator (<a href=https://github.com/opentx/opentx/issues/3708>#3708</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.8 / 2016-04-14</h2>
|
||||
|
||||
<ul>
|
||||
<li>Telemetry Simulator sensor instance number fixed (<a href=https://github.com/opentx/opentx/issues/3207>#3207</a>)</li>
|
||||
<li>Fixed: Throttle Source combo-box was populated multiple times (<a href=https://github.com/opentx/opentx/issues/3222>#3222</a>)</li>
|
||||
<li>RTC option tool-tip corrected (<a href=https://github.com/opentx/opentx/issues/3225>#3225</a>)</li>
|
||||
<li>Fixed: Companion was looking for custom scripts at the wrong place (<a href=https://github.com/opentx/opentx/issues/3237>#3237</a>)</li>
|
||||
<li>Offset displayed in inputs screen (<a href=https://github.com/opentx/opentx/issues/3248>#3248</a>)</li>
|
||||
<li>Import/export handling was broken for Average formula telemetry sensors (<a href=https://github.com/opentx/opentx/issues/3262>#3262</a>)</li>
|
||||
<li>Fixed: Hardware Setup control types and names were not stored in profile (<a href=https://github.com/opentx/opentx/issues/3260>#3260</a>)</li>
|
||||
<li>Fixed voice language list (<a href=https://github.com/opentx/opentx/issues/3338>#3338</a>)</li>
|
||||
<li>Fixed data overflow in Special Functions Override Channel (<a href=https://github.com/opentx/opentx/issues/3347>#3347</a>)</li>
|
||||
<li>Fixed: Sync dialog new line problem (only present for some UI languages) (<a href=https://github.com/opentx/opentx/issues/3350>#3350</a>)</li>
|
||||
<li>Removed a few legacy timer limitations, fix non-working limit (<a href=https://github.com/opentx/opentx/issues/3301>#3301</a>)</li>
|
||||
<li>Default AVR fuse settings changed to disable JTAG interface (<a href=https://github.com/opentx/opentx/issues/3379>#3379</a>)</li>
|
||||
<li>Channel range fix (Start, Channels) in Model Settings, Setup page, int/ext module settings</li>
|
||||
<li>Use friendly GVAR names in dialogs (if available) (<a href=https://github.com/opentx/opentx/issues/3353>#3353</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.7 / 2016-01-04</h2>
|
||||
|
||||
<ul>
|
||||
<li>Lua 'execute' failed in non-root directory (in Simulator) (<a href=https://github.com/opentx/opentx/issues/3024>#3024</a>)</li>
|
||||
<!-- this is disabled until the speed problem is fixed <li>Header line always visible in Outputs, Logical Switches and Special Functions (<a href=https://github.com/opentx/opentx/issues/2861>#2861</a>)</li> -->
|
||||
<li>LR12 changes: removed option for remote failsafe configuration, added in EU firmware variant</li>
|
||||
<li>Added Clear option to the flight mode context menu (right click on the Name label) (<a href=https://github.com/opentx/opentx/issues/3026>#3026</a>)</li>
|
||||
<li>New features for Telemetry Simulator: log replay, user friendly sensor values (<a href=https://github.com/opentx/opentx/issues/3124>#3124</a>)</li>
|
||||
<li>Added F7 key to reload LUA permanent scripts in radio simulator (<a href=https://github.com/opentx/opentx/issues/3141>#3141</a>)</li>
|
||||
<li>AR9X firmware flashing fall-back was wrong</li>
|
||||
<li>Command line options support added to standalone simulator (try "./simulator21 --help" on Linux and "simulator.exe /help" on Windows for usage) (<a href=https://github.com/opentx/opentx/issues/3160>#3160</a>)</li>
|
||||
<li>Various rounding problem fixed: Telemetry sensor Ratio parameter (<a href=https://github.com/opentx/opentx/issues/3117>#3117</a>),
|
||||
Outputs Sub-trim, Min and Max values (<a href=https://github.com/opentx/opentx/issues/3156>#3156</a>)</li>
|
||||
<li>Fixed: telemetry sensors Ratio and Offset value increment/decrement step (<a href=https://github.com/opentx/opentx/issues/3121>#3121</a>)</li>
|
||||
<li>Hardware/Calibration tab split int two tabs (<a href=https://github.com/opentx/opentx/issues/2974>#2974</a>)</li>
|
||||
<li>Fixed Fahrenheit temperature conversion error (if PREC was not 0) (<a href=https://github.com/opentx/opentx/issues/3146>#3146</a>)</li>
|
||||
<li>Application Setting 'Enable automatic backup before writing firmware' was not saved (<a href=https://github.com/opentx/opentx/issues/3040>#3040</a>)</li>
|
||||
<li>Fixed RPM package problem on Fedora (<a href=https://github.com/opentx/opentx/issues/3130>#3130</a>)</li>
|
||||
<li>Fixed conversion errors when loading 2.0.x EEPE (<a href=https://github.com/opentx/opentx/issues/3177>#3177</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.6 / 2015-11-11</h2>
|
||||
|
||||
[Taranis]
|
||||
<ul>
|
||||
<li>Telemetry custom screen changes didn't emit modified signal (<a href=https://github.com/opentx/opentx/issues/3029>#3029</a>)</li>
|
||||
<li>Hide D8/LR12 when eu firmware option is selected</li>
|
||||
|
||||
@@ -1,139 +1,79 @@
|
||||
PROJECT( companion )
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(C9X_NAME_SUFFIX ${VERSION_MAJOR}${VERSION_MINOR})
|
||||
set(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
set(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
|
||||
set(SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX})
|
||||
else(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set(COMPANION_NAME "companion")
|
||||
set(SIMULATOR_NAME "simulator")
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
SET(C9X_VERSION_MAJOR "2")
|
||||
SET(C9X_VERSION_MINOR "1")
|
||||
SET(C9X_VERSION_REVISION "9")
|
||||
SET(C9X_VERSION_SUFFIX $ENV{OPENTX_VERSION_SUFFIX})
|
||||
option(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
|
||||
if(ALLOW_NIGHTLY_BUILDS)
|
||||
add_definitions(-DALLOW_NIGHTLY_BUILDS)
|
||||
endif(ALLOW_NIGHTLY_BUILDS)
|
||||
|
||||
SET(C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION}${C9X_VERSION_SUFFIX})
|
||||
MESSAGE(STATUS "OpenTX Companion ${C9X_VERSION}")
|
||||
option(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
|
||||
if(DEBUG_IMPORT)
|
||||
add_definitions(-DDEBUG_MODEL_IMPORT)
|
||||
message(STATUS "EEPROM import debugging enabled")
|
||||
endif(DEBUG_IMPORT)
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 )
|
||||
option(TABLE_LAYOUT "Use QTableWidget for grid layouts") # Disabled by default
|
||||
if(TABLE_LAYOUT)
|
||||
add_definitions(-DTABLE_LAYOUT)
|
||||
message(STATUS "Using QTableWidget")
|
||||
endif(TABLE_LAYOUT)
|
||||
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
message(STATUS "Looking for SDL ")
|
||||
find_package(Sdl)
|
||||
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. Simulator audio will not work.")
|
||||
endif()
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
SET(C9X_NAME_SUFFIX ${C9X_VERSION_MAJOR}${C9X_VERSION_MINOR})
|
||||
SET(COMPANION_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
SET(SIMULATOR_NAME "simulator${C9X_NAME_SUFFIX}")
|
||||
SET( SIMULATOR_LIB_PATH ${CMAKE_INSTALL_PREFIX}/lib/companion${C9X_NAME_SUFFIX} )
|
||||
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
SET(COMPANION_NAME "companion")
|
||||
SET(SIMULATOR_NAME "simulator")
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
message(STATUS "Looking for QT lupdate ")
|
||||
find_package(Lupdate)
|
||||
if(LUPDATE_FOUND)
|
||||
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
|
||||
else()
|
||||
message("QT lupdate not found!")
|
||||
endif()
|
||||
|
||||
OPTION(ALLOW_NIGHTLY_BUILDS "Allow nightly builds download / update") # Disabled by default
|
||||
IF(ALLOW_NIGHTLY_BUILDS)
|
||||
ADD_DEFINITIONS(-DALLOW_NIGHTLY_BUILDS)
|
||||
ENDIF(ALLOW_NIGHTLY_BUILDS)
|
||||
add_definitions(-DQXT_STATIC)
|
||||
|
||||
OPTION(DEBUG_IMPORT "Turn on debug output for EEPROM import") # Disabled by default
|
||||
IF(DEBUG_IMPORT)
|
||||
ADD_DEFINITIONS( -DDEBUG_MODEL_IMPORT)
|
||||
MESSAGE( STATUS "EEPROM import debugging enabled" )
|
||||
ENDIF(DEBUG_IMPORT)
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "/EHsc /LD")
|
||||
include_directories(${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes C:/Programs/dirent/include)
|
||||
link_directories(C:/Programs/pthreads/Pre-built.2/lib/)
|
||||
set(PTHREAD_LIBRARY pthreadVC2.lib)
|
||||
else()
|
||||
set(PTHREAD_LIBRARY pthread)
|
||||
add_definitions(-Wall)
|
||||
link_directories(/usr/local/lib)
|
||||
endif()
|
||||
|
||||
OPTION(TABLE_LAYOUT "Use QTableWidget for grid layouts") # Disabled by default
|
||||
IF(TABLE_LAYOUT)
|
||||
ADD_DEFINITIONS( -DTABLE_LAYOUT)
|
||||
MESSAGE( STATUS "Using QTableWidget" )
|
||||
ENDIF(TABLE_LAYOUT)
|
||||
|
||||
MESSAGE( STATUS "Looking for XercesC " )
|
||||
FIND_PACKAGE(XercesC)
|
||||
IF ( XERCESC_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${XERCESC_INCLUDE_DIR} )
|
||||
SET(LidarFormat_LIBRAIRIES ${LidarFormat_LIBRAIRIES} ${XERCESC_LIBRARIES})
|
||||
ELSE()
|
||||
MESSAGE( FATAL_ERROR "XercesC not found! Please set XercesC path ..." )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for Xsd " )
|
||||
FIND_PACKAGE(Xsd)
|
||||
IF ( XSD_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} )
|
||||
MESSAGE("XSD Include Path: " ${XSD_INCLUDE_DIR} )
|
||||
ELSE()
|
||||
MESSAGE( FATAL_ERROR "XSD not found! Please set XSD path ..." )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for SDL " )
|
||||
FIND_PACKAGE(Sdl)
|
||||
IF ( SDL_FOUND )
|
||||
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. Simulator audio will not work." )
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Qt4 4.8.1 REQUIRED)
|
||||
SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
|
||||
MESSAGE( STATUS "Looking for PHONON " )
|
||||
FIND_PACKAGE(Phonon)
|
||||
IF ( PHONON_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${PHONO_INCLUDE_DIR} )
|
||||
MESSAGE("PHONON Include Path: " ${PHONON_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DPHONON )
|
||||
ELSE()
|
||||
MESSAGE( "PHONON not found!" )
|
||||
ENDIF()
|
||||
|
||||
MESSAGE( STATUS "Looking for QT lupdate " )
|
||||
FIND_PACKAGE(Lupdate)
|
||||
if( LUPDATE_FOUND )
|
||||
MESSAGE( "QT lupdate: " ${LUPDATE_EXECUTABLE} )
|
||||
ELSE()
|
||||
MESSAGE( "QT lupdate not found!" )
|
||||
ENDIF()
|
||||
|
||||
ADD_DEFINITIONS(-DQXT_STATIC)
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
)
|
||||
|
||||
IF( MSVC )
|
||||
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
|
||||
set(INTTYPES_INCLUDE_OPTION -IC:/Programs/msinttypes)
|
||||
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
|
||||
LINK_DIRECTORIES( C:/Programs/pthreads/Pre-built.2/lib/ )
|
||||
SET( PTHREAD_LIBRARY pthreadVC2.lib )
|
||||
ELSE( )
|
||||
SET( PTHREAD_LIBRARY pthread )
|
||||
ADD_DEFINITIONS( -Wall )
|
||||
LINK_DIRECTORIES( /usr/local/lib )
|
||||
ENDIF( )
|
||||
|
||||
IF( MSVC )
|
||||
MESSAGE( STATUS "Adding include C:/Programs/dirent/include for dirent.h" )
|
||||
INCLUDE_DIRECTORIES( C:/programs/dirent/include )
|
||||
ENDIF( )
|
||||
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/simulation)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR})
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/radio/src)
|
||||
set(SIMU_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src/simulation)
|
||||
set(COMPANION_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/companion/src)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}/../..
|
||||
${PROJECT_SOURCE_DIR}/shared
|
||||
${COMPANION_SRC_DIRECTORY}
|
||||
${COMPANION_SRC_DIRECTORY}/shared
|
||||
${SIMU_SRC_DIRECTORY}
|
||||
${XSD_INCLUDE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/qxtcommandoptions
|
||||
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
|
||||
)
|
||||
|
||||
add_subdirectory(shared)
|
||||
add_subdirectory(modeledit)
|
||||
add_subdirectory(generaledit)
|
||||
add_subdirectory(simulation)
|
||||
add_subdirectory(firmwares/opentx/simulator)
|
||||
add_subdirectory(qcustomplot)
|
||||
add_subdirectory(qxtcommandoptions)
|
||||
|
||||
@@ -154,11 +94,12 @@ set(common_SRCS
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
file.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
qt5_wrap_cpp(common_SRCS)
|
||||
|
||||
add_library(common ${common_SRCS})
|
||||
qt5_use_modules(common Core Xml Widgets)
|
||||
|
||||
set(companion_SRCS
|
||||
hexinterface.cpp
|
||||
@@ -199,7 +140,7 @@ set(companion_SRCS
|
||||
radionotfound.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
)
|
||||
|
||||
set(companion_MOC_HDRS
|
||||
apppreferencesdialog.h
|
||||
@@ -231,7 +172,7 @@ set(companion_MOC_HDRS
|
||||
wizarddialog.h
|
||||
modelprinter.h
|
||||
multimodelprinter.h
|
||||
)
|
||||
)
|
||||
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
@@ -251,79 +192,50 @@ set(companion_UIS
|
||||
flashfirmwaredialog.ui
|
||||
flasheepromdialog.ui
|
||||
radionotfound.ui
|
||||
)
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
set(companion_RESOURCES
|
||||
companion.qrc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/translations.qrc
|
||||
)
|
||||
)
|
||||
|
||||
MACRO (TODAY RESULT)
|
||||
IF (WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
ELSEIF(UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..)/(..)/(....).*" "\\1.\\2.\\3" ${RESULT} ${${RESULT}})
|
||||
ELSE (WIN32)
|
||||
MESSAGE(SEND_ERROR "date not implemented")
|
||||
SET(${RESULT} 00.00.0000)
|
||||
ENDIF (WIN32)
|
||||
ENDMACRO (TODAY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
|
||||
configure_file(${COMPANION_SRC_DIRECTORY}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
|
||||
|
||||
MACRO (NOW RESULT)
|
||||
IF (WIN32)
|
||||
EXECUTE_PROCESS(COMMAND "cmd" " /C time /T" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..).*" "\\1:\\2:00" ${RESULT} ${${RESULT}})
|
||||
ELSEIF(UNIX)
|
||||
EXECUTE_PROCESS(COMMAND "date" "+%H:%M:%S" OUTPUT_VARIABLE ${RESULT})
|
||||
string(REGEX REPLACE "(..):(..):(..).*" "\\1:\\2:\\3" ${RESULT} ${${RESULT}})
|
||||
ELSE (WIN32)
|
||||
MESSAGE(SEND_ERROR "time not implemented")
|
||||
SET(${RESULT} 00:00:00)
|
||||
ENDIF (WIN32)
|
||||
ENDMACRO (NOW)
|
||||
if(WIN32)
|
||||
set(companion_SRCS ${companion_SRCS} icon.rc)
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
TODAY(DATE)
|
||||
NOW(TIME)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/translations.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/companion.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simulator.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop @ONLY)
|
||||
set(LANGUAGES he pl pt ru de fr es it sv cs fi nl)
|
||||
foreach(language ${LANGUAGES})
|
||||
set(companion_TS ${companion_TS} translations/companion_${language}.ts)
|
||||
endforeach(language)
|
||||
|
||||
IF( WIN32 )
|
||||
SET( companion_SRCS ${companion_SRCS} icon.rc )
|
||||
IF ( NOT MSVC )
|
||||
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
|
||||
ENDIF( )
|
||||
ENDIF( )
|
||||
qt5_wrap_ui(companion_SRCS ${companion_UIS})
|
||||
qt5_wrap_cpp(companion_SRCS ${companion_MOC_HDRS})
|
||||
qt5_add_translation(companion_QM ${companion_TS})
|
||||
qt5_add_resources(companion_RCC ${companion_RESOURCES})
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
||||
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
|
||||
|
||||
SET( LANGUAGES he pl pt ru de fr es it sv cs fi nl)
|
||||
FOREACH( language ${LANGUAGES} )
|
||||
SET( companion_TS ${companion_TS} translations/companion_${language}.ts )
|
||||
ENDFOREACH( language )
|
||||
if(APPLE)
|
||||
add_executable(${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_RCC} ${companion_QM})
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
set(CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks)
|
||||
else()
|
||||
add_executable(${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_RCC} ${companion_QM})
|
||||
endif()
|
||||
|
||||
set( companion_SRCS ${companion_SRCS} )
|
||||
QT4_WRAP_UI( companion_SRCS ${companion_UIS} )
|
||||
QT4_WRAP_CPP( companion_SRCS ${companion_MOC_HDRS} )
|
||||
QT4_ADD_TRANSLATION( companion_QM ${companion_TS} )
|
||||
QT4_ADD_RESOURCES( companion_SRCS ${companion_RCS} )
|
||||
|
||||
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${COMPANION_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
|
||||
ELSE( )
|
||||
ADD_EXECUTABLE( ${COMPANION_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ENDIF( )
|
||||
|
||||
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
qt5_use_modules(${COMPANION_NAME} Core Widgets Network)
|
||||
target_link_libraries(${COMPANION_NAME} PRIVATE generaledit modeledit simulation common qcustomplot shared ${PTHREAD_LIBRARY} ${SDL_LIBRARY})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -331,161 +243,159 @@ set(simu_SRCS
|
||||
modeledit/node.cpp
|
||||
modeledit/edge.cpp # TODO not needed
|
||||
simulator.cpp
|
||||
)
|
||||
)
|
||||
|
||||
set(simu_MOC_HDRS
|
||||
modeledit/node.h
|
||||
)
|
||||
)
|
||||
|
||||
set( simu_SRCS ${simu_SRCS} )
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
qt5_wrap_cpp(simu_SRCS ${simu_MOC_HDRS} )
|
||||
|
||||
if(WIN32)
|
||||
set(simu_SRCS ${simu_SRCS} icon.rc)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS} ${companion_RCC})
|
||||
else()
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS} ${companion_RCC})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${SIMULATOR_NAME} simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
# TODO not the same link command than companion?
|
||||
target_link_libraries(${SIMULATOR_NAME} PRIVATE simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${OPENTX_SIMULATOR_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
|
||||
INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR} )
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${COMPANION_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(TARGETS ${SIMULATOR_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/companion.desktop DESTINATION share/applications RENAME companion${C9X_NAME_SUFFIX}.desktop)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simulator.desktop DESTINATION share/applications RENAME simulator${C9X_NAME_SUFFIX}.desktop)
|
||||
install(FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps RENAME companion${C9X_NAME_SUFFIX}.png)
|
||||
install(FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps RENAME companion${C9X_NAME_SUFFIX}.svg)
|
||||
install(FILES ../targets/linux/45-companion-taranis.rules DESTINATION /lib/udev/rules.d RENAME 45-companion${C9X_NAME_SUFFIX}-taranis.rules)
|
||||
# Linux specific code
|
||||
set(OperatingSystem "Linux")
|
||||
else()
|
||||
get_target_property(QtCore_LOCATION Qt5::Core LOCATION)
|
||||
get_filename_component(QT_DLL_DIR ${QtCore_LOCATION} PATH)
|
||||
get_filename_component(SDL_DIR ${SDL_LIBRARY} PATH)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Core.dll ${QT_DLL_DIR}/Qt5Gui.dll ${QT_DLL_DIR}/Qt5Widgets.dll ${QT_DLL_DIR}/Qt5Xml.dll ${QT_DLL_DIR}/Qt5Network.dll ${QT_DLL_DIR}/Qt5PrintSupport.dll ${QT_DLL_DIR}/Qt5Multimedia.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
install(FILES ${QT_DLL_DIR}/icudt54.dll ${QT_DLL_DIR}/icuin54.dll ${QT_DLL_DIR}/icuuc54.dll ${QT_DLL_DIR}/Qt5Cored.dll ${QT_DLL_DIR}/Qt5Guid.dll ${QT_DLL_DIR}/Qt5Widgetsd.dll ${QT_DLL_DIR}/Qt5Xmld.dll ${QT_DLL_DIR}/Qt5Networkd.dll ${QT_DLL_DIR}/Qt5PrintSupportd.dll ${QT_DLL_DIR}/Qt5Multimediad.dll ${SDL_DIR}/SDL.dll DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
|
||||
endif()
|
||||
|
||||
IF( WIN32 )
|
||||
IF( MSVC )
|
||||
SET(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
|
||||
SET(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
|
||||
ELSE( )
|
||||
SET(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
|
||||
SET(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
|
||||
ENDIF( )
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(COMPANION_NSI_IN_FILE companion-vs.nsi.in)
|
||||
set(SIMULATOR_NSI_IN_FILE simulator-vs.nsi.in)
|
||||
else()
|
||||
set(COMPANION_NSI_IN_FILE companion-msys.nsi.in)
|
||||
set(SIMULATOR_NSI_IN_FILE simulator-msys.nsi.in)
|
||||
endif()
|
||||
|
||||
SET( SYSDIR "$ENV{windir}/system32" )
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/companion.nsi @ONLY)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${CMAKE_CURRENT_BINARY_DIR}/simulator.nsi @ONLY)
|
||||
set(SYSDIR "$ENV{windir}/system32")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${COMPANION_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/companion.nsi @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../targets/windows/${SIMULATOR_NSI_IN_FILE} ${PROJECT_BINARY_DIR}/companion/simulator.nsi @ONLY)
|
||||
|
||||
FIND_PROGRAM(NSIS_EXE makensis.exe PATHS
|
||||
find_program(NSIS_EXE makensis.exe PATHS
|
||||
"C:/Program Files/NSIS"
|
||||
"C:/Program Files (x86)/NSIS"
|
||||
"C:/Programs/NSIS"
|
||||
)
|
||||
)
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/companion-windows.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS companion.nsi
|
||||
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
COMMENT "Companion Windows NSIS Installer")
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/companion.nsi
|
||||
DEPENDS companion simulator opentx-simulators ${PROJECT_BINARY_DIR}/companion/companion.nsi
|
||||
COMMENT "Companion Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/simulator-install.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS simulator.nsi
|
||||
DEPENDS simulator opentx-simulators ${PROJECT_BINARY_DIR}/simulator.nsi
|
||||
COMMENT "Simulator Windows NSIS Installer")
|
||||
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/companion/simulator-install.exe
|
||||
COMMAND "${NSIS_EXE}" ARGS ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
DEPENDS simulator ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
COMMENT "Simulator Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_TARGET( installer
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companion-windows.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/simulator-windows.exe
|
||||
SOURCES ${PROJECT_BINARY_DIR}/companion.nsi
|
||||
SOURCES ${PROJECT_BINARY_DIR}/simulator.nsi
|
||||
)
|
||||
ENDIF( )
|
||||
add_custom_target(installer
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companion/companion-windows.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companion/simulator-windows.exe
|
||||
SOURCES ${PROJECT_BINARY_DIR}/companion/companion.nsi
|
||||
SOURCES ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
)
|
||||
endif()
|
||||
|
||||
IF( APPLE )
|
||||
SET(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
|
||||
IF( CMAKE_GENERATOR STREQUAL Xcode )
|
||||
SET( WORK_DIR ${CMAKE_BINARY_DIR}/Debug )
|
||||
ELSE( )
|
||||
SET( WORK_DIR ${PROJECT_BINARY_DIR} )
|
||||
ENDIF()
|
||||
if(APPLE)
|
||||
set(MACOSX_BUNDLE_ICON_FILE iconmac.icns)
|
||||
if(CMAKE_GENERATOR STREQUAL Xcode)
|
||||
set(WORK_DIR ${CMAKE_BINARY_DIR}/Debug)
|
||||
else()
|
||||
set(WORK_DIR ${PROJECT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
ADD_CUSTOM_TARGET( addframeworks
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync -r ${XSD_INCLUDE_DIR}/.. companion.app/Contents/Frameworks/
|
||||
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${COMPANION_NAME} )
|
||||
add_custom_target(addframeworks
|
||||
COMMAND mkdir -p companion.app/Contents/Frameworks
|
||||
COMMAND mkdir -p companion.app/Contents/Resources
|
||||
COMMAND mkdir -p companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_SOURCE_DIR}/images/${MACOSX_BUNDLE_ICON_FILE} companion.app/Contents/Resources/${MACOSX_BUNDLE_ICON_FILE} # Copy the icon files
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND rsync -r /Library/Frameworks/SDL.framework companion.app/Contents/Frameworks/
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL companion.app/Contents/MacOS/companion
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${COMPANION_NAME})
|
||||
|
||||
ADD_CUSTOM_TARGET( makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS addframeworks opentx-simulators-bundle)
|
||||
ENDIF( )
|
||||
add_custom_target(makedmg
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app -dmg -no-plugins
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS addframeworks opentx-simulators-bundle)
|
||||
endif()
|
||||
|
||||
ADD_CUSTOM_TARGET( stamp
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/version.h ${CMAKE_SOURCE_DIR}/../companion.stamp
|
||||
DEPENDS ${CMAKE_BINARY_DIR}/version.h )
|
||||
|
||||
IF( LUPDATE_FOUND )
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
if(LUPDATE_FOUND)
|
||||
add_custom_target(translations
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
|
||||
)
|
||||
ELSE()
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
)
|
||||
else()
|
||||
add_custom_target(translations
|
||||
COMMAND echo "Sorry, QT lupdate was not found."
|
||||
)
|
||||
ENDIF()
|
||||
)
|
||||
endif()
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
set(CPACK_PACKAGE_NAME "companion${C9X_NAME_SUFFIX}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Models and settings editor for the OpenTx open source firmware")
|
||||
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE)
|
||||
|
||||
# The file stripping is deliberately disabled, with the stripped file we get
|
||||
# The file stripping is deliberately disabled, with the stripped file we get
|
||||
# very poor trace-backs from the users when they report Companion crash
|
||||
SET( CPACK_STRIP_FILES FALSE )
|
||||
set(CPACK_STRIP_FILES FALSE)
|
||||
|
||||
find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
|
||||
if(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
execute_process(
|
||||
COMMAND ${DPKG_PROGRAM} --print-architecture
|
||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${C9X_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
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})
|
||||
SET(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
|
||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Bertrand Songis <bsongis-nosp@m-gmail.com>")
|
||||
set(CPACK_DEBIAN_PACKAGE_VERSION ${VERSION})
|
||||
set(CPACK_DEBIAN_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
||||
set(CPACK_DEBIAN_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
||||
set(CPACK_DEBIAN_ARCHITECTURE $(CMAKE_SYSTEM_PROCESSOR))
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
else(DPKG_PROGRAM)
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
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}")
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
|
||||
set(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}-${VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/lib /lib/udev /lib/udev/rules.d")
|
||||
endif(DPKG_PROGRAM)
|
||||
|
||||
INCLUDE(CPack)
|
||||
include(CPack)
|
||||
|
||||
@@ -605,6 +605,10 @@ void AppData::warningId (const int x) { store(x, _warningId,
|
||||
|
||||
// Constructor
|
||||
AppData::AppData()
|
||||
{
|
||||
}
|
||||
|
||||
void AppData::init()
|
||||
{
|
||||
//Initialize the profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
@@ -614,8 +618,28 @@ AppData::AppData()
|
||||
for (int i=0; i<MAX_JOYSTICKS; i++)
|
||||
joystick[i].init( i );
|
||||
|
||||
// Copy existing 2.0.16 settings if present
|
||||
QSettings settings(COMPANY, PRODUCT);
|
||||
|
||||
// Copy existing 2.1 settings if present
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings settings21("OpenTX", "Companion 2.1");
|
||||
|
||||
QStringList keys = settings21.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
if (settings21.value(*i) != QString("") && settings21.value(*i) != QString("Start Menu Folder"))
|
||||
{
|
||||
settings.setValue(*i, settings21.value(*i));
|
||||
}
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
for (int i=0; i<MAX_PROFILES; i++)
|
||||
profile[i].init( i );
|
||||
}
|
||||
|
||||
// Copy existing 2.0 settings if present
|
||||
if (profile[0].name().isEmpty())
|
||||
{
|
||||
QSettings settings20("OpenTX", "Companion 2.0");
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <QSettings>
|
||||
|
||||
#define COMPANY "OpenTX"
|
||||
#define PRODUCT "Companion 2.1"
|
||||
#define PRODUCT "Companion 2.2"
|
||||
|
||||
#define MAX_PROFILES 15
|
||||
#define MAX_JOYSTICKS 8
|
||||
@@ -384,6 +384,7 @@ class AppData: protected CompStoreObj
|
||||
|
||||
// Constructor
|
||||
AppData();
|
||||
void init();
|
||||
};
|
||||
|
||||
extern AppData g;
|
||||
|
||||
@@ -109,14 +109,9 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
ui->useCompanionNightlyBuilds->setChecked(g.useCompanionNightlyBuilds());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
#else
|
||||
ui->useCompanionNightlyBuilds->hide();
|
||||
ui->useFirmwareNightlyBuilds->hide();
|
||||
#endif
|
||||
ui->autoCheckCompanion->setChecked(g.autoCheckApp());
|
||||
ui->useFirmwareNightlyBuilds->setChecked(g.useFirmwareNightlyBuilds());
|
||||
ui->autoCheckFirmware->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef BURNCONFIGDIALOG_H_
|
||||
#define BURNCONFIGDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define MEM_TYPE_EEPROM 1
|
||||
#define MEM_TYPE_FLASH 2
|
||||
|
||||
@@ -82,15 +82,18 @@ class MyProxyStyle : public QProxyStyle
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(companion);
|
||||
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("OpenTX Companion");
|
||||
app.setOrganizationName("OpenTX");
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
g.init();
|
||||
|
||||
QStringList strl = QApplication::arguments();
|
||||
if (strl.contains("--version")) {
|
||||
printf("%s\n", C9X_VERSION);
|
||||
printf("%s\n", VERSION);
|
||||
fflush(stdout);
|
||||
exit(0);
|
||||
}
|
||||
@@ -106,7 +109,7 @@ int main(int argc, char *argv[])
|
||||
app.installTranslator(&companionTranslator);
|
||||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Companion @C9X_VERSION@
|
||||
Name=Companion @VERSION@
|
||||
GenericName=Transmitter Companion App
|
||||
Comment=The Ultimate Transmitter Companion
|
||||
Icon=@COMPANION_NAME@
|
||||
|
||||
@@ -1,43 +1,58 @@
|
||||
<RCC>
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>images/customize.png</file>
|
||||
<file>icon.png</file>
|
||||
<file>../../CREDITS.txt</file>
|
||||
<file>../../DONATIONS.txt</file>
|
||||
<file>../releasenotes.txt</file>
|
||||
<file>images/9xdb.png</file>
|
||||
<file>images/9xdl.png</file>
|
||||
<file>images/9xdr.png</file>
|
||||
<file>images/9xdt.png</file>
|
||||
<file>images/9xdb-bl.png</file>
|
||||
<file>images/9xdl-bl.png</file>
|
||||
<file>images/9xdr-bl.png</file>
|
||||
<file>images/9xdt-bl.png</file>
|
||||
<file>images/9xdb-gr.png</file>
|
||||
<file>images/9xdl-gr.png</file>
|
||||
<file>images/9xdr-gr.png</file>
|
||||
<file>images/9xdt-gr.png</file>
|
||||
<file>images/9xdb-or.png</file>
|
||||
<file>images/9xdl-or.png</file>
|
||||
<file>images/9xdr-or.png</file>
|
||||
<file>images/9xdt-or.png</file>
|
||||
<file>images/9xdb-yl.png</file>
|
||||
<file>images/9xdl-yl.png</file>
|
||||
<file>images/9xdr-yl.png</file>
|
||||
<file>images/9xdt-yl.png</file>
|
||||
<file>images/9xdb-rd.png</file>
|
||||
<file>images/9xdl-rd.png</file>
|
||||
<file>images/9xdr-rd.png</file>
|
||||
<file>images/9xdt-rd.png</file>
|
||||
<file>images/9xmenu.png</file>
|
||||
<file>images/9xmenumenu.png</file>
|
||||
<file>images/9xmenuexit.png</file>
|
||||
<file>images/9xcurs.png</file>
|
||||
<file>images/9xcursup.png</file>
|
||||
<file>images/9xcursplus.png</file>
|
||||
<file>images/9xcursmin.png</file>
|
||||
<file>images/9xcursdown.png</file>
|
||||
<file>images/9xcursphoto.png</file>
|
||||
<file>images/simulator/Horus/middle.png</file>
|
||||
<file>images/simulator/Horus/left.png</file>
|
||||
<file>images/simulator/Horus/right.png</file>
|
||||
<file>images/simulator/Horus/top.png</file>
|
||||
<file>images/simulator/Horus/bottom.png</file>
|
||||
<file>images/simulator/Horus/led.png</file>
|
||||
<file>images/simulator/Horus/border-right.png</file>
|
||||
<file>images/simulator/Horus/left_btn1.png</file>
|
||||
<file>images/simulator/Horus/left_btn2.png</file>
|
||||
<file>images/simulator/Horus/left_scrnsht.png</file>
|
||||
<file>images/simulator/Horus/right_btnU.png</file>
|
||||
<file>images/simulator/Horus/right_btnL.png</file>
|
||||
<file>images/simulator/Horus/right_btnD.png</file>
|
||||
<file>images/simulator/Horus/right_btnR.png</file>
|
||||
<file>images/simulator/Horus/right_ent.png</file>
|
||||
<file>images/simulator/9X/9xdb.png</file>
|
||||
<file>images/simulator/9X/9xdl.png</file>
|
||||
<file>images/simulator/9X/9xdr.png</file>
|
||||
<file>images/simulator/9X/9xdt.png</file>
|
||||
<file>images/simulator/9X/9xdb-bl.png</file>
|
||||
<file>images/simulator/9X/9xdl-bl.png</file>
|
||||
<file>images/simulator/9X/9xdr-bl.png</file>
|
||||
<file>images/simulator/9X/9xdt-bl.png</file>
|
||||
<file>images/simulator/9X/9xdb-gr.png</file>
|
||||
<file>images/simulator/9X/9xdl-gr.png</file>
|
||||
<file>images/simulator/9X/9xdr-gr.png</file>
|
||||
<file>images/simulator/9X/9xdt-gr.png</file>
|
||||
<file>images/simulator/9X/9xdb-or.png</file>
|
||||
<file>images/simulator/9X/9xdl-or.png</file>
|
||||
<file>images/simulator/9X/9xdr-or.png</file>
|
||||
<file>images/simulator/9X/9xdt-or.png</file>
|
||||
<file>images/simulator/9X/9xdb-yl.png</file>
|
||||
<file>images/simulator/9X/9xdl-yl.png</file>
|
||||
<file>images/simulator/9X/9xdr-yl.png</file>
|
||||
<file>images/simulator/9X/9xdt-yl.png</file>
|
||||
<file>images/simulator/9X/9xdb-rd.png</file>
|
||||
<file>images/simulator/9X/9xdl-rd.png</file>
|
||||
<file>images/simulator/9X/9xdr-rd.png</file>
|
||||
<file>images/simulator/9X/9xdt-rd.png</file>
|
||||
<file>images/simulator/9X/9xmenu.png</file>
|
||||
<file>images/simulator/9X/9xmenumenu.png</file>
|
||||
<file>images/simulator/9X/9xmenuexit.png</file>
|
||||
<file>images/simulator/9X/9xcurs.png</file>
|
||||
<file>images/simulator/9X/9xcursup.png</file>
|
||||
<file>images/simulator/9X/9xcursplus.png</file>
|
||||
<file>images/simulator/9X/9xcursmin.png</file>
|
||||
<file>images/simulator/9X/9xcursdown.png</file>
|
||||
<file>images/simulator/9X/9xcursphoto.png</file>
|
||||
<file>images/screenshot.png</file>
|
||||
<file>images/splash-9x.png</file>
|
||||
<file>images/splash-9xrpro.png</file>
|
||||
@@ -47,18 +62,18 @@
|
||||
<file>images/maps.png</file>
|
||||
<file>images/track.png</file>
|
||||
<file>images/track0.png</file>
|
||||
<file>images/x9b0.png</file>
|
||||
<file>images/x9l0.png</file>
|
||||
<file>images/x9l1.png</file>
|
||||
<file>images/x9l2.png</file>
|
||||
<file>images/x9l3.png</file>
|
||||
<file>images/x9l4.png</file>
|
||||
<file>images/x9r0.png</file>
|
||||
<file>images/x9r1.png</file>
|
||||
<file>images/x9r2.png</file>
|
||||
<file>images/x9r3.png</file>
|
||||
<file>images/x9s0.png</file>
|
||||
<file>images/x9t0.png</file>
|
||||
<file>images/simulator/Taranis/x9b0.png</file>
|
||||
<file>images/simulator/Taranis/x9l0.png</file>
|
||||
<file>images/simulator/Taranis/x9l1.png</file>
|
||||
<file>images/simulator/Taranis/x9l2.png</file>
|
||||
<file>images/simulator/Taranis/x9l3.png</file>
|
||||
<file>images/simulator/Taranis/x9l4.png</file>
|
||||
<file>images/simulator/Taranis/x9r0.png</file>
|
||||
<file>images/simulator/Taranis/x9r1.png</file>
|
||||
<file>images/simulator/Taranis/x9r2.png</file>
|
||||
<file>images/simulator/Taranis/x9r3.png</file>
|
||||
<file>images/simulator/Taranis/x9s0.png</file>
|
||||
<file>images/simulator/Taranis/x9t0.png</file>
|
||||
<file>images/taranison.png</file>
|
||||
<file>images/wizard/ailerons.png</file>
|
||||
<file>images/wizard/airbrakes.png</file>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef _COMPAREDIALOG_H
|
||||
#define _COMPAREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QLabel>
|
||||
#include <QtWidgets>
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
@@ -11,7 +11,9 @@ enum BoardEnum {
|
||||
BOARD_AR9X,
|
||||
BOARD_TARANIS,
|
||||
BOARD_TARANIS_PLUS,
|
||||
BOARD_TARANIS_X9E
|
||||
BOARD_TARANIS_X9E,
|
||||
BOARD_FLAMENCO,
|
||||
BOARD_HORUS
|
||||
};
|
||||
|
||||
#define C9X_MAX_MODELS 60
|
||||
@@ -25,7 +27,7 @@ enum BoardEnum {
|
||||
#define C9X_MAX_GVARS 9
|
||||
#define C9X_MAX_ENCODERS 2
|
||||
#define C9X_NUM_CHNOUT 32 // number of real output channels
|
||||
#define C9X_NUM_CSW 32 // number of custom switches
|
||||
#define C9X_NUM_CSW 64 // number of custom switches
|
||||
#define C9X_MAX_CUSTOM_FUNCTIONS 64 // number of functions assigned to switches
|
||||
#define C9X_NUM_MODULES 2
|
||||
#define NUM_STICKS 4
|
||||
|
||||
@@ -27,7 +27,7 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
|
||||
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)
|
||||
if (!errors.test(ALL_OK)
|
||||
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef CUSTOMIZESPLASHDIALOG_H
|
||||
#define CUSTOMIZESPLASHDIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
namespace Ui
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include "downloaddialog.h"
|
||||
#include "ui_downloaddialog.h"
|
||||
#include <QMessageBox>
|
||||
#include <QtGui>
|
||||
#include <QTime>
|
||||
#include "helpers.h"
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#ifndef DOWNLOADDIALOG_H
|
||||
#define DOWNLOADDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QFile>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class downloadDialog;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <list>
|
||||
#include <float.h>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
#include "firmwares/th9x/th9xinterface.h"
|
||||
@@ -475,13 +476,6 @@ QString RawSource::toString(const ModelData * model) const
|
||||
QObject::tr("ACC"), QObject::tr("GPS Time"),
|
||||
};
|
||||
|
||||
static const QString logicalSwitches[] = {
|
||||
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
|
||||
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
|
||||
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
|
||||
QObject::tr("L31"), QObject::tr("L32")
|
||||
};
|
||||
|
||||
if (index<0) {
|
||||
return QObject::tr("----");
|
||||
}
|
||||
@@ -508,7 +502,7 @@ QString RawSource::toString(const ModelData * model) const
|
||||
case SOURCE_TYPE_SWITCH:
|
||||
return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index));
|
||||
case SOURCE_TYPE_CUSTOM_SWITCH:
|
||||
return logicalSwitches[index];
|
||||
return QObject::tr("L%1").arg(index+1);
|
||||
case SOURCE_TYPE_CYC:
|
||||
return QObject::tr("CYC%1").arg(index+1);
|
||||
case SOURCE_TYPE_PPM:
|
||||
@@ -590,13 +584,6 @@ QString RawSwitch::toString() const
|
||||
SwitchUp('R'), QString::fromUtf8("SR-"), SwitchDn('R'),
|
||||
};
|
||||
|
||||
static const QString logicalSwitches[] = {
|
||||
QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"),
|
||||
QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"),
|
||||
QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"),
|
||||
QObject::tr("L31"), QObject::tr("L32")
|
||||
};
|
||||
|
||||
static const QString flightModes[] = {
|
||||
QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8")
|
||||
};
|
||||
@@ -634,7 +621,7 @@ QString RawSwitch::toString() const
|
||||
else
|
||||
return CHECK_IN_ARRAY(switches9X, index-1);
|
||||
case SWITCH_TYPE_VIRTUAL:
|
||||
return CHECK_IN_ARRAY(logicalSwitches, index-1);
|
||||
return QObject::tr("L%1").arg(index);
|
||||
case SWITCH_TYPE_MULTIPOS_POT:
|
||||
return CHECK_IN_ARRAY(multiposPots, index-1);
|
||||
case SWITCH_TYPE_TRIM:
|
||||
@@ -1183,9 +1170,9 @@ GeneralSettings::GeneralSettings()
|
||||
byte8u=(uint8_t)t_CountrySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok)
|
||||
imperial=byte8u;
|
||||
QString chars=t_CountrySet.mid(4,2);
|
||||
ttsLanguage[0]=chars[0].toAscii();
|
||||
ttsLanguage[1]=chars[1].toAscii();
|
||||
QString chars = t_CountrySet.mid(4, 2);
|
||||
ttsLanguage[0] = chars[0].toLatin1();
|
||||
ttsLanguage[1] = chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1410,7 +1397,7 @@ void ModelData::clear()
|
||||
moduleData[1].protocol = PULSES_OFF;
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
flightModeData[i].clear(i);
|
||||
flightModeData[i].clear();
|
||||
}
|
||||
clearInputs();
|
||||
clearMixes();
|
||||
@@ -1523,7 +1510,9 @@ int ModelData::getTrimValue(int phaseIdx, int trimIdx)
|
||||
}
|
||||
else {
|
||||
phaseIdx = phase.trimRef[trimIdx];
|
||||
if (phase.trimMode[trimIdx] != 0)
|
||||
if (phase.trimMode[trimIdx] == 0)
|
||||
result = 0;
|
||||
else
|
||||
result += phase.trim[trimIdx];
|
||||
}
|
||||
}
|
||||
@@ -1536,57 +1525,16 @@ bool ModelData::isGVarLinked(int phaseIdx, int gvarIdx)
|
||||
return flightModeData[phaseIdx].gvars[gvarIdx] > 1024;
|
||||
}
|
||||
|
||||
bool ModelData::isGVarLinkedCircular(int phaseIdx, int gvarIdx)
|
||||
int ModelData::getGVarFieldValue(int phaseIdx, int gvarIdx)
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
int val = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
if ((phaseIdx==0) || (val<=1024)) return false;
|
||||
int nextPhase = val - 1025;
|
||||
int idx = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
for (int i=0; idx>1024 && i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
int nextPhase = idx - 1025;
|
||||
if (nextPhase >= phaseIdx) nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
idx = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int ModelData::getGVarValue(int phaseIdx, int gvarIdx)
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
int val = flightModeData[phaseIdx].gvars[gvarIdx];
|
||||
if ((phaseIdx==0) || (val<=1024)) return val;
|
||||
int nextPhase = val - 1025;
|
||||
if (nextPhase >= phaseIdx) nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
}
|
||||
return flightModeData[0].gvars[gvarIdx]; // circular linked
|
||||
}
|
||||
|
||||
bool ModelData::isRELinked(int phaseIdx, int reIdx)
|
||||
{
|
||||
return flightModeData[phaseIdx].rotaryEncoders[reIdx] > 1024;
|
||||
}
|
||||
|
||||
bool ModelData::isRELinkedCircular(int phaseIdx, int reIdx)
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_ENCODERS; i++) {
|
||||
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
|
||||
if ((phaseIdx==0) || (val<=1024)) return false;
|
||||
int nextPhase = val - 1025;
|
||||
if (nextPhase >= phaseIdx) nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int ModelData::getREValue(int phaseIdx, int reIdx)
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_ENCODERS; i++) {
|
||||
int val = flightModeData[phaseIdx].rotaryEncoders[reIdx];
|
||||
if ((phaseIdx==0) || (val<=1024)) return val;
|
||||
int nextPhase = val - 1025;
|
||||
if (nextPhase >= phaseIdx) nextPhase += 1;
|
||||
phaseIdx = nextPhase;
|
||||
}
|
||||
return flightModeData[0].rotaryEncoders[reIdx]; // circular linked
|
||||
return idx;
|
||||
}
|
||||
|
||||
void ModelData::setTrimValue(int phaseIdx, int trimIdx, int value)
|
||||
@@ -1738,7 +1686,7 @@ unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
@@ -1758,7 +1706,7 @@ unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
@@ -1779,7 +1727,7 @@ unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
|
||||
if (result.test(NO_ERROR)) {
|
||||
if (result.test(ALL_OK)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
@@ -1882,17 +1830,3 @@ SimulatorInterface *GetCurrentFirmwareSimulator()
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void FlightModeData::clear(const int phase)
|
||||
{
|
||||
memset(this, 0, sizeof(FlightModeData));
|
||||
if (phase != 0) {
|
||||
for (int idx=0; idx<C9X_MAX_GVARS; idx++) {
|
||||
gvars[idx] = 1025;
|
||||
}
|
||||
for (int idx=0; idx<C9X_MAX_ENCODERS; idx++) {
|
||||
rotaryEncoders[idx] = 1025;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QtXml>
|
||||
#include <QtXml> // This should be removed from here, and remove Xml dependency from all libs which don't need it.
|
||||
#include <QComboBox>
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
@@ -46,7 +46,10 @@ QString getBoardName(BoardEnum board);
|
||||
#define IS_TARANIS(board) (board==BOARD_TARANIS || board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_PLUS(board) (board==BOARD_TARANIS_PLUS || board==BOARD_TARANIS_X9E)
|
||||
#define IS_TARANIS_X9E(board) (board==BOARD_TARANIS_X9E)
|
||||
#define IS_ARM(board) (IS_TARANIS(board) || IS_SKY9X(board))
|
||||
#define IS_HORUS(board) (board==BOARD_HORUS)
|
||||
#define IS_FLAMENCO(board) (board==BOARD_FLAMENCO)
|
||||
#define IS_STM32(board) (IS_TARANIS(board) || IS_HORUS(board) || IS_FLAMENCO(board))
|
||||
#define IS_ARM(board) (IS_STM32(board) || IS_SKY9X(board))
|
||||
|
||||
const uint8_t modn12x3[4][4]= {
|
||||
{1, 2, 3, 4},
|
||||
@@ -632,7 +635,7 @@ class CustomFunctionData { // Function Switches data
|
||||
|
||||
class FlightModeData {
|
||||
public:
|
||||
FlightModeData() { clear(0); }
|
||||
FlightModeData() { clear(); }
|
||||
int trimMode[NUM_STICKS];
|
||||
int trimRef[NUM_STICKS];
|
||||
int trim[NUM_STICKS];
|
||||
@@ -640,9 +643,9 @@ class FlightModeData {
|
||||
char name[10+1];
|
||||
unsigned int fadeIn;
|
||||
unsigned int fadeOut;
|
||||
int rotaryEncoders[C9X_MAX_ENCODERS];
|
||||
int rotaryEncoders[2];
|
||||
int gvars[C9X_MAX_GVARS];
|
||||
void clear(const int phase);
|
||||
void clear() { memset(this, 0, sizeof(FlightModeData)); }
|
||||
};
|
||||
|
||||
class SwashRingData { // Swash Ring data
|
||||
@@ -842,7 +845,6 @@ enum PulsesProtocol {
|
||||
PULSES_PXX_XJT_LR12,
|
||||
PULSES_PXX_DJT,
|
||||
PULSES_CROSSFIRE,
|
||||
PULSES_MULTIMODULE,
|
||||
PULSES_PROTOCOL_LAST
|
||||
};
|
||||
|
||||
@@ -1078,12 +1080,7 @@ class ModelData {
|
||||
void setTrimValue(int phaseIdx, int trimIdx, int value);
|
||||
|
||||
bool isGVarLinked(int phaseIdx, int gvarIdx);
|
||||
bool isGVarLinkedCircular(int phaseIdx, int gvarIdx);
|
||||
int getGVarValue(int phaseIdx, int gvarIdx);
|
||||
|
||||
bool isRELinked(int phaseIdx, int reIdx);
|
||||
bool isRELinkedCircular(int phaseIdx, int reIdx);
|
||||
int getREValue(int phaseIdx, int reIdx);
|
||||
int getGVarFieldValue(int phaseIdx, int gvarIdx);
|
||||
|
||||
ModelData removeGlobalVars();
|
||||
|
||||
@@ -1512,8 +1509,7 @@ void registerOpenTxFirmwares();
|
||||
void unregisterOpenTxFirmwares();
|
||||
|
||||
enum EepromLoadErrors {
|
||||
NO_ERROR,
|
||||
|
||||
ALL_OK,
|
||||
UNKNOWN_ERROR,
|
||||
UNSUPPORTED_NEWER_VERSION,
|
||||
WRONG_SIZE,
|
||||
@@ -1630,9 +1626,7 @@ class Firmware {
|
||||
}
|
||||
|
||||
virtual int getCapability(const Capability) = 0;
|
||||
|
||||
virtual QTime getMaxTimerStart() = 0;
|
||||
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||
|
||||
@@ -36,7 +36,6 @@ eepromFatHeader(NULL)
|
||||
#define EEPROM_BLOCK_SIZE (4*1024)
|
||||
#define EEPROM_MARK 0x84697771 /* thanks ;) */
|
||||
#define EEPROM_ZONE_SIZE (8*1024)
|
||||
#define EEPROM_BUFFER_SIZE 256
|
||||
#define EEPROM_FAT_SIZE 128
|
||||
#define EEPROM_MAX_ZONES (EEPROM_SIZE / EEPROM_ZONE_SIZE)
|
||||
#define EEPROM_MAX_FILES (EEPROM_MAX_ZONES - 1)
|
||||
@@ -237,6 +236,9 @@ void RleFile::EeFsSetDat(unsigned int blk, unsigned int ofs, const uint8_t *buf,
|
||||
|
||||
unsigned int RleFile::EeFsGetFree()
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
unsigned int ret = 0;
|
||||
unsigned int i;
|
||||
if (IS_ARM(board))
|
||||
@@ -256,6 +258,9 @@ unsigned int RleFile::EeFsGetFree()
|
||||
*/
|
||||
void RleFile::EeFsFree(unsigned int blk)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return;
|
||||
|
||||
unsigned int i = blk;
|
||||
while (EeFsGetLink(i)) i = EeFsGetLink(i);
|
||||
if (IS_ARM(board)) {
|
||||
@@ -273,6 +278,8 @@ void RleFile::EeFsFree(unsigned int blk)
|
||||
*/
|
||||
unsigned int RleFile::EeFsAlloc()
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
unsigned int ret = (IS_ARM(board) ? eeFsArm->freeList : eeFs->freeList);
|
||||
if (ret) {
|
||||
if (IS_ARM(board))
|
||||
@@ -286,12 +293,18 @@ unsigned int RleFile::EeFsAlloc()
|
||||
|
||||
unsigned int RleFile::size(unsigned int id)
|
||||
{
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
else
|
||||
return IS_ARM(board) ? eeFsArm->files[id].size : eeFs->files[id].size;
|
||||
}
|
||||
|
||||
unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
{
|
||||
if (IS_SKY9X(board)) {
|
||||
if (IS_HORUS(board)) {
|
||||
return 1;
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
if (eepromFatHeader) {
|
||||
m_fileId = eepromFatHeader->files[i_fileId].zoneIndex;
|
||||
if (eepromFatHeader->files[i_fileId].exists) {
|
||||
@@ -325,6 +338,9 @@ unsigned int RleFile::openRd(unsigned int i_fileId)
|
||||
|
||||
unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
unsigned int len = IS_ARM(board) ? eeFsArm->files[m_fileId].size : eeFs->files[m_fileId].size;
|
||||
len -= m_pos;
|
||||
if (i_len > len) i_len = len;
|
||||
@@ -345,6 +361,9 @@ unsigned int RleFile::read(uint8_t *buf, unsigned int i_len)
|
||||
// G: Read runlength (RLE) compressed bytes into buf.
|
||||
unsigned int RleFile::readRlc12(uint8_t *buf, unsigned int i_len, bool rlc2)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
memset(buf, 0, i_len);
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
@@ -417,9 +436,11 @@ unsigned int importRlc(QByteArray & dst, QByteArray & src, unsigned int rlcVersi
|
||||
dst.resize(0);
|
||||
|
||||
for( ; 1; ) {
|
||||
for (int i=0; i<zeroes; i++)
|
||||
dst.append((char)0);
|
||||
zeroes = 0;
|
||||
if (zeroes > 0) {
|
||||
for (int i = 0; i < zeroes; i++)
|
||||
dst.append((char) 0);
|
||||
zeroes = 0;
|
||||
}
|
||||
|
||||
if (len == 0)
|
||||
return dst.size();
|
||||
@@ -526,6 +547,9 @@ void RleFile::closeTrunc()
|
||||
|
||||
unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
create(i_fileId, typ);
|
||||
bool state0 = true;
|
||||
uint8_t cnt = 0;
|
||||
@@ -572,6 +596,9 @@ unsigned int RleFile::writeRlc1(unsigned int i_fileId, unsigned int typ, const u
|
||||
*/
|
||||
unsigned int RleFile::writeRlc2(unsigned int i_fileId, unsigned int typ, const uint8_t *buf, unsigned int i_len)
|
||||
{
|
||||
if (IS_HORUS(board))
|
||||
return 0;
|
||||
|
||||
if (IS_SKY9X(board)) {
|
||||
openRd(i_fileId);
|
||||
if (eepromFatHeader) {
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <iostream>
|
||||
#include "er9xinterface.h"
|
||||
#include "er9xeeprom.h"
|
||||
#include "simulator/er9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
@@ -113,7 +114,7 @@ unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -185,7 +186,7 @@ unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -260,7 +261,7 @@ QDomElement Er9xInterface::getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral *
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Er9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
@@ -270,7 +271,7 @@ QDomElement Er9xInterface::getModelDataXML(QDomDocument * qdoc, Er9xModelData *
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Er9xModelData));
|
||||
return md;
|
||||
}
|
||||
@@ -288,7 +289,7 @@ bool Er9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen)
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, sizeof(Er9xGeneral));
|
||||
break;
|
||||
@@ -325,7 +326,7 @@ bool Er9xInterface::loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod,
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tmod, data, sizeof(Er9xModelData));
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set(ER9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/er9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ER9X_CHECKOUT_DIRECTORY}/er9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ER9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ER9X_CHECKOUT_DIRECTORY} && svn checkout http://er9x.googlecode.com/svn/trunk/src@790 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp ${ER9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/er9x/er9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(er9x-simulator er9xsimulator.cpp)
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "firmwares/er9x/er9xsimulator.h"
|
||||
#include "firmwares/er9x/er9xinterface.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define FRSKY
|
||||
#define PHASES
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define SWSRC_SW1 DSW_SW1
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Er9x {
|
||||
|
||||
#include "simpgmspace.h"
|
||||
#include "er9x.cpp"
|
||||
#include "stamp.cpp"
|
||||
#include "menus.cpp"
|
||||
#include "pers.cpp"
|
||||
#include "file.cpp"
|
||||
#include "lcd.cpp"
|
||||
#include "drivers.cpp"
|
||||
#include "simpgmspace.cpp"
|
||||
#include "templates.cpp"
|
||||
#include "frsky.cpp"
|
||||
#include "audio.cpp"
|
||||
|
||||
uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void setTrim(uint8_t idx, int8_t value)
|
||||
{
|
||||
g_model.trim[idx] = value;
|
||||
}
|
||||
|
||||
void getTrims(int16_t values[4])
|
||||
{
|
||||
for (int i=0; i<4; i++)
|
||||
values[i] = g_model.trim[i];
|
||||
}
|
||||
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
|
||||
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
|
||||
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
|
||||
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
|
||||
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
|
||||
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
|
||||
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
|
||||
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#define TRIM_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(swtch, pin, mask) \
|
||||
case swtch: \
|
||||
if (state) pin &= ~(mask); else pin |= (mask); \
|
||||
break;
|
||||
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
|
||||
case swtch: \
|
||||
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
|
||||
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||
break;
|
||||
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
{
|
||||
switch (swtch) {
|
||||
SWITCH_CASE(0, pinc, 1<<INP_C_ThrCt)
|
||||
SWITCH_CASE(4, pinc, 1<<INP_C_AileDR)
|
||||
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
|
||||
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
|
||||
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
|
||||
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
|
||||
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
|
||||
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
|
||||
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
|
||||
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
|
||||
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
|
||||
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
|
||||
}
|
||||
}
|
||||
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
using namespace Er9x;
|
||||
|
||||
Er9xSimulator::Er9xSimulator(Er9xInterface * er9xInterface):
|
||||
er9xInterface(er9xInterface)
|
||||
{
|
||||
}
|
||||
|
||||
bool Er9xSimulator::timer10ms()
|
||||
{
|
||||
AUDIO_DRIVER(); // the tone generator
|
||||
AUDIO_HEARTBEAT(); // the queue processing
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Er9xSimulator::getLcd()
|
||||
{
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Er9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Er9xSimulator::start(RadioData &radioData, bool tests)
|
||||
{
|
||||
er9xInterface->save(&eeprom[0], radioData);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Er9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
}
|
||||
|
||||
void Er9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
outputs.beep = audio.busy();
|
||||
}
|
||||
|
||||
void Er9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Er9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
Er9x::setTrim(idx, value);
|
||||
}
|
||||
|
||||
void Er9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
trims.extended = false;
|
||||
Er9x::getTrims(trims.values);
|
||||
}
|
||||
|
||||
const char * Er9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef er9x_simulator_h
|
||||
#define er9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Er9xInterface;
|
||||
|
||||
class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Er9xSimulator(Er9xInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
virtual void setLuaStateReloadPermanentScripts() {};
|
||||
|
||||
protected:
|
||||
|
||||
Er9xInterface * er9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <iostream>
|
||||
#include "ersky9xinterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include "simulator/ersky9xsimulator.h"
|
||||
#include "file.h"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
@@ -151,7 +152,7 @@ unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -229,7 +230,7 @@ unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -304,7 +305,7 @@ QDomElement Ersky9xInterface::getGeneralDataXML(QDomDocument * qdoc, Ersky9xGene
|
||||
{
|
||||
QDomElement gd = qdoc->createElement("GENERAL_DATA");
|
||||
appendNumberElement(qdoc, &gd, "Version", tgen->myVers, true); // have to write value here
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromAscii(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendTextElement(qdoc, &gd, "Owner", QString::fromLatin1(tgen->ownerName,sizeof(tgen->ownerName)).trimmed());
|
||||
appendCDATAElement(qdoc, &gd, "Data", (const char *)tgen,sizeof(Ersky9xGeneral));
|
||||
return gd;
|
||||
}
|
||||
@@ -314,7 +315,7 @@ QDomElement Ersky9xInterface::getModelDataXML(QDomDocument * qdoc, Ersky9xModelD
|
||||
QDomElement md = qdoc->createElement("MODEL_DATA");
|
||||
md.setAttribute("number", modelNum);
|
||||
appendNumberElement(qdoc, &md, "Version", mdver, true); // have to write value here
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromAscii(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendTextElement(qdoc, &md, "Name", QString::fromLatin1(tmod->name,sizeof(tmod->name)).trimmed());
|
||||
appendCDATAElement(qdoc, &md, "Data", (const char *)tmod,sizeof(Ersky9xModelData_v11));
|
||||
return md;
|
||||
}
|
||||
@@ -332,7 +333,7 @@ bool Ersky9xInterface::loadGeneralDataXML(QDomDocument * qdoc, Ersky9xGeneral *
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(tgen, data, std::min((unsigned int)ba.size(), (unsigned int)sizeof(Ersky9xGeneral)));
|
||||
break;
|
||||
@@ -372,7 +373,7 @@ bool Ersky9xInterface::loadModelDataXML(QDomDocument * qdoc, ModelData *model, i
|
||||
while (!n.isNull()) {
|
||||
if (n.isCDATASection()) {
|
||||
QString ds = n.toCDATASection().data();
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toAscii());
|
||||
QByteArray ba = QByteArray::fromBase64(ds.toLatin1());
|
||||
const char * data = ba.data();
|
||||
memcpy(&ersky9xModel, data, std::min(ba.size(), (int)sizeof(ersky9xModel)));
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set(ERSKY9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/ersky9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${ERSKY9X_CHECKOUT_DIRECTORY}/ersky9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${ERSKY9X_CHECKOUT_DIRECTORY} && svn checkout http://ersky9x.googlecode.com/svn/trunk/src@170 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp ${ERSKY9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/ersky9x/ersky9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(ersky9x-simulator ersky9xsimulator.cpp)
|
||||
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "firmwares/ersky9x/ersky9xsimulator.h"
|
||||
#include "firmwares/ersky9x/ersky9xinterface.h"
|
||||
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define PCBSKY9X
|
||||
#define PCBSKY
|
||||
#define STAMP
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define WS_HOW_HIGH
|
||||
#define TEMPLATES
|
||||
#define HELI
|
||||
#define HAPTIC
|
||||
#define AUDIO
|
||||
#define REVB
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define SWSRC_SW1 DSW_SW1
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#include <exception>
|
||||
|
||||
namespace Ersky9x {
|
||||
|
||||
#include "../ersky9x/timers.h"
|
||||
#include "../ersky9x/ersky9x.cpp"
|
||||
#include "../ersky9x/stamp.cpp"
|
||||
#include "../ersky9x/menus.cpp"
|
||||
#include "../ersky9x/pers.cpp"
|
||||
#include "../ersky9x/file.cpp"
|
||||
#include "../ersky9x/lcd.cpp"
|
||||
#include "../ersky9x/drivers.cpp"
|
||||
#include "../ersky9x/logicio.cpp"
|
||||
#include "../ersky9x/timers.cpp"
|
||||
#include "../ersky9x/simpgmspace.cpp"
|
||||
#include "../ersky9x/templates.cpp"
|
||||
#include "../ersky9x/frsky.cpp"
|
||||
#include "../ersky9x/audio.cpp"
|
||||
#include "../ersky9x/sound.cpp"
|
||||
#include "../ersky9x/diskio.cpp"
|
||||
|
||||
#define isBacklightEnable() (PWM->PWM_CH_NUM[0].PWM_CDTY != 100)
|
||||
|
||||
//uint8_t pxxFlag = 0;
|
||||
int16_t g_anas[7];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 1500;
|
||||
else
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void setTrim(uint8_t idx, int8_t value)
|
||||
{
|
||||
g_model.trim[idx] = value;
|
||||
}
|
||||
|
||||
void getTrims(int16_t values[4])
|
||||
{
|
||||
for (int i=0; i<4; i++)
|
||||
values[i] = g_model.trim[i];
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(swtch, pin, mask) \
|
||||
case swtch: \
|
||||
if (state) pin |= (mask); else pin &= ~(mask); \
|
||||
break;
|
||||
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
|
||||
case swtch: \
|
||||
if (state < 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
|
||||
if (state > 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||
break;
|
||||
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
{
|
||||
// printf("swtch=%d state=%d\n", swtch, state); fflush(stdout);
|
||||
switch (swtch) {
|
||||
SWITCH_CASE(0, PIOC->PIO_PDSR, 1<<20)
|
||||
SWITCH_CASE(1, PIOA->PIO_PDSR, 1<<15)
|
||||
SWITCH_CASE(2, PIOC->PIO_PDSR, 1<<31)
|
||||
SWITCH_3_CASE(3, PIOC->PIO_PDSR, PIOC->PIO_PDSR, 0x00004000, 0x00000800)
|
||||
SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2)
|
||||
SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16)
|
||||
SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8)
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define KEYS_GPIO_REG_MENU PIOB->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_EXIT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_UP PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_DOWN PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_RIGHT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_REG_LEFT PIOC->PIO_PDSR
|
||||
#define KEYS_GPIO_PIN_MENU 0x00000020
|
||||
#define KEYS_GPIO_PIN_EXIT 0x01000000
|
||||
#define KEYS_GPIO_PIN_UP 0x00000002
|
||||
#define KEYS_GPIO_PIN_DOWN 0x00000020
|
||||
#define KEYS_GPIO_PIN_RIGHT 0x00000010
|
||||
#define KEYS_GPIO_PIN_LEFT 0x00000008
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin &= ~mask; else pin |= mask;\
|
||||
break;
|
||||
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, KEYS_GPIO_REG_MENU, KEYS_GPIO_PIN_MENU)
|
||||
KEY_CASE(KEY_EXIT, KEYS_GPIO_REG_EXIT, KEYS_GPIO_PIN_EXIT)
|
||||
KEY_CASE(KEY_RIGHT, KEYS_GPIO_REG_RIGHT, KEYS_GPIO_PIN_RIGHT)
|
||||
KEY_CASE(KEY_LEFT, KEYS_GPIO_REG_LEFT, KEYS_GPIO_PIN_LEFT)
|
||||
KEY_CASE(KEY_UP, KEYS_GPIO_REG_UP, KEYS_GPIO_PIN_UP)
|
||||
KEY_CASE(KEY_DOWN, KEYS_GPIO_REG_DOWN, KEYS_GPIO_PIN_DOWN)
|
||||
}
|
||||
}
|
||||
|
||||
#define TRIMS_GPIO_REG_LHL PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LVD PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RVU PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RHL PIOA->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LHR PIOB->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_LVU PIOC->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RVD PIOC->PIO_PDSR
|
||||
#define TRIMS_GPIO_REG_RHR PIOC->PIO_PDSR
|
||||
#define PIN_TRIM_LH_L 0x00800000
|
||||
#define PIN_TRIM_LV_DN 0x01000000
|
||||
#define PIN_TRIM_RV_UP 0x00000002
|
||||
#define PIN_TRIM_RH_L 0x00000001
|
||||
#define PIN_TRIM_LH_R 0x00000010
|
||||
#define PIN_TRIM_LV_UP 0x10000000
|
||||
#define PIN_TRIM_RV_DN 0x00000400
|
||||
#define PIN_TRIM_RH_R 0x00000200
|
||||
|
||||
#define TRIM_CASE KEY_CASE
|
||||
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace Ersky9x;
|
||||
|
||||
Ersky9xSimulator::Ersky9xSimulator(Ersky9xInterface * ersky9xInterface):
|
||||
ersky9xInterface(ersky9xInterface)
|
||||
{
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Ersky9xSimulator::getLcd()
|
||||
{
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::start(RadioData &radioData, bool tests)
|
||||
{
|
||||
ersky9xInterface->save(Ersky9x::eeprom, radioData);
|
||||
StartEepromThread(NULL);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
Ersky9x::setTrim(idx, value);
|
||||
}
|
||||
|
||||
void Ersky9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
trims.extended = false;
|
||||
Ersky9x::getTrims(trims.values);
|
||||
}
|
||||
|
||||
const char * Ersky9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ersky9x_simulator_h
|
||||
#define ersky9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Ersky9xInterface;
|
||||
|
||||
class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Ersky9xSimulator(Ersky9xInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual const char * getPhaseName(unsigned int phase) { return 0; }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id, uint8_t defaultValue = 0) { return 0; };
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id) { return 0; };
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value) {};
|
||||
|
||||
virtual void setLuaStateReloadPermanentScripts() {};
|
||||
|
||||
protected:
|
||||
|
||||
Ersky9xInterface * ersky9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -207,7 +207,7 @@ unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eepro
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,13 @@
|
||||
#define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32)
|
||||
#define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16)
|
||||
#define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14))
|
||||
#define MAX_CUSTOM_SWITCHES(board, version) (IS_ARM(board) ? 32 : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
|
||||
#define MAX_LOGICAL_SWITCHES(board, version) (IS_ARM(board) ? (version >= 218 ? 64 : 32) : ((IS_DBLEEPROM(board, version) && version<217) ? 15 : 12))
|
||||
#define MAX_CUSTOM_FUNCTIONS(board, version) (IS_ARM(board) ? (version >= 216 ? 64 : 32) : (IS_DBLEEPROM(board, version) ? 24 : 16))
|
||||
#define MAX_CURVES(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 32 : 16) : 8)
|
||||
#define MAX_GVARS(board, version) ((IS_ARM(board) && version >= 216) ? 9 : 5)
|
||||
#define MAX_SENSORS(board, version) (32)
|
||||
#define NUM_PPM_INPUTS(board, version) ((IS_ARM(board) && version >= 216) ? 16 : 8)
|
||||
#define ROTENC_COUNT(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 218) ? 0 : 1) : (IS_2560(board) ? 2 : 0))
|
||||
|
||||
#define IS_AFTER_RELEASE_21_MARCH_2013(board, version) (version >= 214 || (!IS_ARM(board) && version >= 213))
|
||||
#define IS_AFTER_RELEASE_23_MARCH_2013(board, version) (version >= 214 || (board==BOARD_STOCK && version >= 213))
|
||||
@@ -100,7 +101,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val+offset);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
@@ -125,7 +126,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
|
||||
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
internalCache.push_back(element);
|
||||
return element.table;
|
||||
}
|
||||
static void Cleanup()
|
||||
static void Cleanup()
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
@@ -263,7 +264,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
addConversion(RawSource(SOURCE_TYPE_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i), val++);
|
||||
}
|
||||
}
|
||||
@@ -296,7 +297,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
if (afterrelease21March2013) {
|
||||
if ((board != BOARD_STOCK && (board!=BOARD_M128 || version<215)) || (variant & GVARS_VARIANT)) {
|
||||
for (int i=0; i<MAX_GVARS(board, version); i++) {
|
||||
@@ -305,25 +306,25 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 0), val++); // BATT
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 1), val++); // TIME
|
||||
val += 5;
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 2), val++); // Timer1
|
||||
addConversion(RawSource(SOURCE_TYPE_SPECIAL, 3), val++); // Timer2
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
|
||||
if (version < 216) {
|
||||
if (i == TELEMETRY_SOURCE_TX_TIME || i == TELEMETRY_SOURCE_SWR || i == TELEMETRY_SOURCE_A3 ||
|
||||
i == TELEMETRY_SOURCE_A4 || i == TELEMETRY_SOURCE_ASPEED || i == TELEMETRY_SOURCE_DTE ||
|
||||
i == TELEMETRY_SOURCE_CELL_MIN || i == TELEMETRY_SOURCE_CELLS_MIN || i == TELEMETRY_SOURCE_VFAS_MIN)
|
||||
continue;
|
||||
}
|
||||
if (i == TELEMETRY_SOURCE_TX_TIME || i == TELEMETRY_SOURCE_SWR || i == TELEMETRY_SOURCE_A3 ||
|
||||
i == TELEMETRY_SOURCE_A4 || i == TELEMETRY_SOURCE_A3_MIN || i == TELEMETRY_SOURCE_A4_MIN)
|
||||
for (int i=0; i<TELEMETRY_SOURCE_ACC; i++) {
|
||||
if (version < 216) {
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_ASPEED || i==TELEMETRY_SOURCE_DTE || i==TELEMETRY_SOURCE_CELL_MIN || i==TELEMETRY_SOURCE_CELLS_MIN || i==TELEMETRY_SOURCE_VFAS_MIN)
|
||||
continue;
|
||||
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
|
||||
}
|
||||
if (!IS_ARM(board)) {
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME || i==TELEMETRY_SOURCE_SWR || i==TELEMETRY_SOURCE_A3 || i==TELEMETRY_SOURCE_A4 || i==TELEMETRY_SOURCE_A3_MIN || i==TELEMETRY_SOURCE_A4_MIN)
|
||||
continue;
|
||||
}
|
||||
addConversion(RawSource(SOURCE_TYPE_TELEMETRY, i), val++);
|
||||
if (version >= 216 && IS_ARM(board)) {
|
||||
if (i==TELEMETRY_SOURCE_RSSI_RX)
|
||||
val += 1;
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME)
|
||||
val += 5;
|
||||
if (i==TELEMETRY_SOURCE_DTE)
|
||||
val += 5;
|
||||
if (i==TELEMETRY_SOURCE_POWER_MAX)
|
||||
val += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,7 +370,7 @@ class SourcesConversionTable: public ConversionTable {
|
||||
internalCache.push_back(element);
|
||||
return element.table;
|
||||
}
|
||||
static void Cleanup()
|
||||
static void Cleanup()
|
||||
{
|
||||
for (std::list<Cache>::iterator it=internalCache.begin(); it!=internalCache.end(); it++) {
|
||||
Cache element = *it;
|
||||
@@ -383,7 +384,7 @@ std::list<SourcesConversionTable::Cache> SourcesConversionTable::internalCache;
|
||||
|
||||
void OpenTxEepromCleanup(void)
|
||||
{
|
||||
SourcesConversionTable::Cleanup();
|
||||
SourcesConversionTable::Cleanup();
|
||||
SwitchesConversionTable::Cleanup();
|
||||
}
|
||||
|
||||
@@ -391,8 +392,8 @@ template <int N>
|
||||
class SwitchField: public ConversionField< SignedField<N> > {
|
||||
public:
|
||||
SwitchField(RawSwitch & sw, BoardEnum board, unsigned int version, unsigned long flags=0):
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toAscii(),
|
||||
QObject::tr("Switch ").toAscii()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toAscii()),
|
||||
ConversionField< SignedField<N> >(_switch, SwitchesConversionTable::getInstance(board, version, flags), QObject::tr("Switch").toLatin1(),
|
||||
QObject::tr("Switch ").toLatin1()+ sw.toString()+ QObject::tr(" cannot be exported on this board!").toLatin1()),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
@@ -407,14 +408,14 @@ class SwitchField: public ConversionField< SignedField<N> > {
|
||||
_switch = sw.toValue();
|
||||
ConversionField< SignedField<N> >::beforeExport();
|
||||
}
|
||||
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
ConversionField< SignedField<N> >::afterImport();
|
||||
ConversionField< SignedField<N> >::afterImport();
|
||||
sw = RawSwitch(_switch);
|
||||
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< SignedField<N> >::internalField.getName()).arg(sw.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected:
|
||||
RawSwitch & sw;
|
||||
int _switch;
|
||||
@@ -552,7 +553,7 @@ template <int N>
|
||||
class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
public:
|
||||
SourceField(RawSource & source, BoardEnum board, unsigned int version, unsigned int variant, unsigned long flags=0):
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
ConversionField< UnsignedField<N> >(_source, SourcesConversionTable::getInstance(board, version, variant, flags),
|
||||
"Source", QObject::tr("Source %1 cannot be exported on this board!").arg(source.toString())),
|
||||
source(source),
|
||||
_source(0)
|
||||
@@ -568,13 +569,13 @@ class SourceField: public ConversionField< UnsignedField<N> > {
|
||||
_source = source.toValue();
|
||||
ConversionField< UnsignedField<N> >::beforeExport();
|
||||
}
|
||||
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
ConversionField< UnsignedField<N> >::afterImport();
|
||||
ConversionField< UnsignedField<N> >::afterImport();
|
||||
source = RawSource(_source);
|
||||
eepromImportDebug() << QString("imported %1: %2").arg(ConversionField< UnsignedField<N> >::internalField.getName()).arg(source.toString());
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
RawSource & source;
|
||||
@@ -741,14 +742,6 @@ class CurveReferenceField: public TransformedField {
|
||||
int _curve_value;
|
||||
};
|
||||
|
||||
static int exportHeliInversionWeight(int source) {
|
||||
return (source < 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
static int importHeliInversionWeight(int source) {
|
||||
return source ? -100: 100;
|
||||
}
|
||||
|
||||
class HeliField: public StructField {
|
||||
public:
|
||||
HeliField(SwashRingData & heli, BoardEnum board, unsigned int version, unsigned int variant)
|
||||
@@ -764,15 +757,22 @@ class HeliField: public StructField {
|
||||
Append(new SignedField<8>(heli.elevatorWeight));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< SignedField<1> >(heli.elevatorWeight, exportHeliInversionWeight, importHeliInversionWeight));
|
||||
Append(new ConversionField< SignedField<1> >(heli.aileronWeight, exportHeliInversionWeight, importHeliInversionWeight));
|
||||
Append(new ConversionField< SignedField<1> >(heli.collectiveWeight, exportHeliInversionWeight, importHeliInversionWeight));
|
||||
Append(new BoolField<1>(invertELE));
|
||||
Append(new BoolField<1>(invertAIL));
|
||||
Append(new BoolField<1>(invertCOL));
|
||||
Append(new UnsignedField<5>(heli.type));
|
||||
Append(new SourceField<8>(heli.collectiveSource, board, version, variant));
|
||||
//, FLAG_NOSWITCHES)); Fix shift in collective
|
||||
Append(new UnsignedField<8>(heli.value));
|
||||
}
|
||||
}
|
||||
|
||||
// TODO before + after
|
||||
|
||||
protected:
|
||||
bool invertELE;
|
||||
bool invertAIL;
|
||||
bool invertCOL;
|
||||
};
|
||||
|
||||
class FlightModeField: public TransformedField {
|
||||
@@ -784,7 +784,7 @@ class FlightModeField: public TransformedField {
|
||||
index(index),
|
||||
board(board),
|
||||
version(version),
|
||||
rotencCount(IS_ARM(board) ? 1 : (IS_2560(board) ? 2 : 0))
|
||||
rotencCount(ROTENC_COUNT(board, version))
|
||||
{
|
||||
if (board == BOARD_STOCK || (board==BOARD_M128 && version>=215)) {
|
||||
// On stock we use 10bits per trim
|
||||
@@ -804,13 +804,21 @@ class FlightModeField: public TransformedField {
|
||||
internalField.Append(new SignedField<16>(trimBase[i]));
|
||||
}
|
||||
}
|
||||
|
||||
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
|
||||
if (HAS_LARGE_LCD(board))
|
||||
internalField.Append(new ZCharField<10>(phase.name));
|
||||
else
|
||||
internalField.Append(new ZCharField<6>(phase.name));
|
||||
|
||||
if (IS_ARM(board) && version >= 218) {
|
||||
if (HAS_LARGE_LCD(board))
|
||||
internalField.Append(new ZCharField<10>(phase.name));
|
||||
else
|
||||
internalField.Append(new ZCharField<6>(phase.name));
|
||||
internalField.Append(new SwitchField<9>(phase.swtch, board, version));
|
||||
internalField.Append(new SpareBitsField<7>());
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SwitchField<8>(phase.swtch, board, version));
|
||||
if (HAS_LARGE_LCD(board))
|
||||
internalField.Append(new ZCharField<10>(phase.name));
|
||||
else
|
||||
internalField.Append(new ZCharField<6>(phase.name));
|
||||
}
|
||||
if (IS_ARM(board) && version >= 214) {
|
||||
internalField.Append(new UnsignedField<8>(phase.fadeIn));
|
||||
internalField.Append(new UnsignedField<8>(phase.fadeOut));
|
||||
@@ -923,7 +931,25 @@ class MixField: public TransformedField {
|
||||
version(version),
|
||||
model(model)
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
if (IS_TARANIS(board) && version >= 218) {
|
||||
internalField.Append(new SignedField<11>(_weight));
|
||||
internalField.Append(new UnsignedField<5>(_destCh));
|
||||
internalField.Append(new SourceField<10>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
|
||||
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
|
||||
internalField.Append(new UnsignedField<2>(mix.mixWarn));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new SignedField<14>(_offset));
|
||||
internalField.Append(new SwitchField<9>(mix.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<9>(mix.flightModes));
|
||||
internalField.Append(new CurveReferenceField(mix.curve, board, version));
|
||||
internalField.Append(new UnsignedField<8>(mix.delayUp));
|
||||
internalField.Append(new UnsignedField<8>(mix.delayDown));
|
||||
internalField.Append(new UnsignedField<8>(mix.speedUp));
|
||||
internalField.Append(new UnsignedField<8>(mix.speedDown));
|
||||
internalField.Append(new ZCharField<8>(mix.name));
|
||||
}
|
||||
else if (IS_TARANIS(board) && version >= 217) {
|
||||
internalField.Append(new UnsignedField<8>(_destCh));
|
||||
internalField.Append(new UnsignedField<9>(mix.flightModes));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
@@ -1191,7 +1217,21 @@ class InputField: public TransformedField {
|
||||
board(board),
|
||||
version(version)
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
if (IS_TARANIS(board) && version >= 218) {
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
|
||||
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
|
||||
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
|
||||
internalField.Append(new UnsignedField<5>(expo.chn, "Channel"));
|
||||
internalField.Append(new SwitchField<9>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<9>(expo.flightModes));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new ZCharField<8>(expo.name));
|
||||
internalField.Append(new SignedField<8>(_offset, "Offset"));
|
||||
internalField.Append(new CurveReferenceField(expo.curve, board, version));
|
||||
}
|
||||
else if (IS_TARANIS(board) && version >= 217) {
|
||||
internalField.Append(new SourceField<10>(expo.srcRaw, board, version, 0));
|
||||
internalField.Append(new UnsignedField<14>(expo.scale, "Scale"));
|
||||
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
|
||||
@@ -1425,7 +1465,13 @@ class CurvesField: public TransformedField {
|
||||
maxPoints(IS_ARM(board) ? 512 : 112-8)
|
||||
{
|
||||
for (int i=0; i<maxCurves; i++) {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
if (IS_TARANIS(board) && version >= 218) {
|
||||
internalField.Append(new UnsignedField<1>((unsigned int &)curves[i].type));
|
||||
internalField.Append(new BoolField<1>(curves[i].smooth));
|
||||
internalField.Append(new ConversionField< SignedField<6> >(curves[i].count, -5));
|
||||
internalField.Append(new ZCharField<3>(curves[i].name));
|
||||
}
|
||||
else if (IS_TARANIS(board) && version >= 216) {
|
||||
internalField.Append(new UnsignedField<3>((unsigned int &)curves[i].type));
|
||||
internalField.Append(new BoolField<1>(curves[i].smooth));
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
@@ -1582,7 +1628,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
||||
{
|
||||
int val=0;
|
||||
addConversion(RawSwitch(SWITCH_TYPE_NONE), val++);
|
||||
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
for (int i=1; i<=MAX_SWITCHES_POSITION(board, version); i++) {
|
||||
int s = switchIndex(i, board, version);
|
||||
@@ -1596,7 +1642,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
@@ -1607,7 +1653,7 @@ class AndSwitchesConversionTable: public ConversionTable {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, -s), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_SWITCH, s), val++);
|
||||
}
|
||||
for (int i=1; i<=MAX_CUSTOM_SWITCHES(board, version); i++) {
|
||||
for (int i=1; i<=MAX_LOGICAL_SWITCHES(board, version); i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, -i), -val);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_VIRTUAL, i), val++);
|
||||
}
|
||||
@@ -1672,7 +1718,16 @@ class LogicalSwitchField: public TransformedField {
|
||||
v2(0),
|
||||
v3(0)
|
||||
{
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
if (IS_ARM(board) && version >= 218) {
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
|
||||
internalField.Append(new SignedField<10>(v1));
|
||||
internalField.Append(new SignedField<10>(v3));
|
||||
internalField.Append(new ConversionField< SignedField<9> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
|
||||
internalField.Append(new SpareBitsField<1>()); // TODO extra switch mode
|
||||
internalField.Append(new SpareBitsField<2>());
|
||||
internalField.Append(new SignedField<16>(v2));
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new ConversionField< UnsignedField<6> >(csw.func, &functionsConversionTable, "Function"));
|
||||
internalField.Append(new SignedField<10>(v1));
|
||||
internalField.Append(new SignedField<16>(v2));
|
||||
@@ -1707,7 +1762,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
int scale = (version >= 216 ? 0 : 5);
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(csw.delay, 0, scale));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(csw.duration, 0, scale));
|
||||
if (version >= 214) {
|
||||
if (version >= 214 && version <= 217) {
|
||||
internalField.Append(new ConversionField< SignedField<8> >((int &)csw.andsw, andswitchesConversionTable, "AND switch"));
|
||||
}
|
||||
}
|
||||
@@ -1718,7 +1773,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
}
|
||||
}
|
||||
|
||||
~LogicalSwitchField()
|
||||
~LogicalSwitchField()
|
||||
{
|
||||
delete andswitchesConversionTable;
|
||||
}
|
||||
@@ -2030,8 +2085,14 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
{
|
||||
memset(_param, 0, sizeof(_param));
|
||||
|
||||
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
|
||||
if (version >= 218) {
|
||||
internalField.Append(new SwitchField<9>(fn.swtch, board, version));
|
||||
internalField.Append(new ConversionField< UnsignedField<7> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SwitchField<8>(fn.swtch, board, version));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(_func, &functionsConversionTable, "Function", ::QObject::tr("OpenTX on this board doesn't accept this function")));
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216)
|
||||
internalField.Append(new CharField<8>(_param, false));
|
||||
@@ -2058,7 +2119,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
if (fn.swtch.type != SWITCH_TYPE_NONE) {
|
||||
_func = fn.func;
|
||||
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
|
||||
_active = (version >= 216 ? fn.repeatParam : (fn.repeatParam/5));
|
||||
else
|
||||
_active = (fn.enabled ? 1 : 0);
|
||||
@@ -2154,7 +2215,7 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
{
|
||||
fn.func = (AssignFunc)_func;
|
||||
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic)
|
||||
if (fn.func == FuncPlaySound || fn.func == FuncPlayPrompt || fn.func == FuncPlayValue || fn.func == FuncPlayHaptic || (fn.func >= FuncAdjustGV1 && fn.func <= FuncAdjustGVLast))
|
||||
fn.repeatParam = (version >= 216 ? _active : (_active*5));
|
||||
else
|
||||
fn.enabled = (_active & 0x01);
|
||||
@@ -2212,9 +2273,8 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
}
|
||||
}
|
||||
else if (fn.func == FuncPlayValue) {
|
||||
if (version >= 213) {
|
||||
if (version >= 213)
|
||||
sourcesConversionTable->importValue(value, (int &)fn.param);
|
||||
}
|
||||
else
|
||||
SourcesConversionTable::getInstance(board, version, variant, FLAG_NONONE|FLAG_NOSWITCHES)->importValue(value, (int &)fn.param);
|
||||
}
|
||||
@@ -2475,7 +2535,7 @@ class FrskyScreenField: public DataField {
|
||||
else
|
||||
numbers.Append(new SpareBitsField<4*8>());
|
||||
}
|
||||
|
||||
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
script.Append(new CharField<8>(screen.body.script.filename));
|
||||
script.Append(new SpareBitsField<16*8>());
|
||||
@@ -2907,8 +2967,21 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_TIMERS(board, version); i++) {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
if (IS_ARM(board) && version >= 218) {
|
||||
internalField.Append(new SwitchField<9>(modelData.timers[i].mode, board, version, true));
|
||||
internalField.Append(new UnsignedField<23>(modelData.timers[i].val));
|
||||
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].persistent));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
if (IS_TARANIS(board))
|
||||
internalField.Append(new ZCharField<8>(modelData.timers[i].name));
|
||||
else
|
||||
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
internalField.Append(new UnsignedField<24>(modelData.timers[i].val));
|
||||
internalField.Append(new SignedField<24>(modelData.timers[i].pvalue));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
@@ -2921,6 +2994,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new ZCharField<3>(modelData.timers[i].name));
|
||||
}
|
||||
else if ((IS_ARM(board) || IS_2560(board)) && version >= 216) {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
|
||||
internalField.Append(new UnsignedField<2>(modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
@@ -2929,6 +3003,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new SignedField<16>(modelData.timers[i].pvalue));
|
||||
}
|
||||
else if (afterrelease21March2013) {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
internalField.Append(new UnsignedField<12>(modelData.timers[i].val));
|
||||
internalField.Append(new BoolField<1>((bool &)modelData.timers[i].countdownBeep));
|
||||
internalField.Append(new BoolField<1>(modelData.timers[i].minuteBeep));
|
||||
@@ -2942,6 +3017,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SwitchField<8>(modelData.timers[i].mode, board, version, true));
|
||||
internalField.Append(new UnsignedField<16>(modelData.timers[i].val));
|
||||
if (HAS_PERSISTENT_TIMERS(board)) {
|
||||
internalField.Append(new UnsignedField<1>(modelData.timers[i].persistent));
|
||||
@@ -3001,7 +3077,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
for (int i=0; i<MAX_EXPOS(board, version); i++)
|
||||
internalField.Append(new InputField(modelData.expoData[i], board, version));
|
||||
internalField.Append(new CurvesField(modelData.curves, board, version));
|
||||
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
|
||||
for (int i=0; i<MAX_LOGICAL_SWITCHES(board, version); i++)
|
||||
internalField.Append(new LogicalSwitchField(modelData.logicalSw[i], board, version, variant, &modelData));
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
if (IS_ARM(board))
|
||||
@@ -3010,8 +3086,9 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new AvrCustomFunctionField(modelData.customFn[i], board, version, variant));
|
||||
}
|
||||
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
|
||||
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
|
||||
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++) {
|
||||
internalField.Append(new FlightModeField(modelData.flightModeData[i], i, board, version));
|
||||
}
|
||||
|
||||
if (!IS_ARM(board) || version < 216) {
|
||||
internalField.Append(new SignedField<8>(modelData.moduleData[0].ppmFrameLength));
|
||||
@@ -3122,7 +3199,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
if (IS_TARANIS(board) && version < 218) {
|
||||
for (int i=0; i<MAX_CURVES(board, version); i++) {
|
||||
internalField.Append(new ZCharField<6>(modelData.curves[i].name));
|
||||
}
|
||||
@@ -3150,13 +3227,13 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++) {
|
||||
internalField.Append(new ZCharField<4>(modelData.inputNames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
@@ -3178,7 +3255,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version == 216) {
|
||||
@@ -3298,8 +3375,9 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
|
||||
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
internalField.Append(new SignedField<16>(generalData.trainer.calib[i]));
|
||||
}
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
internalField.Append(new UnsignedField<6>(generalData.trainer.mix[i].src));
|
||||
internalField.Append(new UnsignedField<2>(generalData.trainer.mix[i].mode));
|
||||
@@ -3308,7 +3386,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.view, 0, MAX_VIEWS(board)-1));
|
||||
|
||||
internalField.Append(new SpareBitsField<2>());
|
||||
internalField.Append(new SpareBitsField<2>()); // TODO buzzerMode?
|
||||
internalField.Append(new BoolField<1>(generalData.fai));
|
||||
internalField.Append(new SignedField<2>((int &)generalData.beeperMode));
|
||||
internalField.Append(new BoolField<1>(generalData.flashBeep));
|
||||
@@ -3325,13 +3403,18 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.inactivityTimer));
|
||||
if (IS_9X(board) && version >= 215) {
|
||||
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
|
||||
if (IS_9X(board)) {
|
||||
if (version >= 215) {
|
||||
internalField.Append(new UnsignedField<3>(generalData.mavbaud));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(generalData.minuteBeep));
|
||||
internalField.Append(new BoolField<1>(generalData.preBeep));
|
||||
}
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(generalData.minuteBeep));
|
||||
internalField.Append(new BoolField<1>(generalData.preBeep));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
}
|
||||
if (version >= 216 && IS_TARANIS(board))
|
||||
internalField.Append(new SignedField<3>(generalData.splashDuration));
|
||||
@@ -3344,20 +3427,19 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
if (IS_ARM(board))
|
||||
internalField.Append(new SignedField<8>(generalData.switchesDelay));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<8>());
|
||||
internalField.Append(new SpareBitsField<8>()); // TODO blOffBright + blOnBright
|
||||
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightDelay));
|
||||
internalField.Append(new UnsignedField<8>(generalData.templateSetup));
|
||||
internalField.Append(new SignedField<8>(generalData.PPM_Multiplier));
|
||||
internalField.Append(new SignedField<8>(generalData.hapticLength));
|
||||
|
||||
if (version < 216 || !IS_9X(board)) {
|
||||
if (version < 216 || (version < 218 && !IS_9X(board)) || (!IS_9X(board) && !IS_TARANIS(board))) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.reNavigation));
|
||||
}
|
||||
|
||||
if (version >= 216 && !IS_TARANIS(board)) {
|
||||
internalField.Append(new UnsignedField<4>(generalData.stickReverse));
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
internalField.Append(new UnsignedField<8>(generalData.stickReverse));
|
||||
}
|
||||
|
||||
internalField.Append(new SignedField<3>(generalData.beeperLength));
|
||||
@@ -3379,33 +3461,46 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||
internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.txCurrentCalibration));
|
||||
if (version >= 213) {
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureWarn)); // TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.mAhWarn));
|
||||
if (version < 218) internalField.Append(new UnsignedField<16>(generalData.mAhUsed));
|
||||
internalField.Append(new UnsignedField<32>(generalData.globalTimer));
|
||||
internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.temperatureCalib)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.btBaudrate)); // TODO
|
||||
internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
|
||||
if (version < 218) internalField.Append(new BoolField<8>(generalData.optrexDisplay)); //TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.sticksGain)); // TODO
|
||||
}
|
||||
if (version >= 214) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
|
||||
if (version < 218) internalField.Append(new UnsignedField<8>(generalData.rotarySteps)); // TODO
|
||||
internalField.Append(new UnsignedField<8>(generalData.countryCode));
|
||||
internalField.Append(new UnsignedField<8>(generalData.imperial));
|
||||
}
|
||||
if (version >= 215) {
|
||||
internalField.Append(new CharField<2>(generalData.ttsLanguage));
|
||||
internalField.Append(new SignedField<8>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.varioVolume));
|
||||
if (version < 218) {
|
||||
internalField.Append(new SignedField<8>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<8>(generalData.varioVolume));
|
||||
}
|
||||
else {
|
||||
internalField.Append(new SignedField<4>(generalData.beepVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.wavVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.varioVolume));
|
||||
internalField.Append(new SignedField<4>(generalData.backgroundVolume));
|
||||
}
|
||||
if (version >= 216) {
|
||||
internalField.Append(new SignedField<8>(generalData.varioPitch));
|
||||
internalField.Append(new SignedField<8>(generalData.varioRange));
|
||||
internalField.Append(new SignedField<8>(generalData.varioRepeat));
|
||||
}
|
||||
internalField.Append(new SignedField<8>(generalData.backgroundVolume));
|
||||
if (version < 218) internalField.Append(new SignedField<8>(generalData.backgroundVolume));
|
||||
}
|
||||
if (version >= 218) {
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
|
||||
}
|
||||
}
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
if (version >= 217) {
|
||||
@@ -3431,11 +3526,11 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(board))
|
||||
internalField.Append(new SpareBitsField<64>());
|
||||
internalField.Append(new SpareBitsField<64>()); // switchUnlockStates
|
||||
else if (IS_TARANIS(board))
|
||||
internalField.Append(new SpareBitsField<16>());
|
||||
|
||||
if (version >= 217) {
|
||||
internalField.Append(new SpareBitsField<16>()); // switchUnlockStates
|
||||
|
||||
if (version == 217) {
|
||||
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
|
||||
internalField.Append(new ArmCustomFunctionField(generalData.customFn[i], board, version, variant));
|
||||
}
|
||||
|
||||
@@ -82,8 +82,7 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
addConversion(PULSES_DSMX, val++);
|
||||
}
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(PULSES_CROSSFIRE, val++);
|
||||
addConversion(PULSES_MULTIMODULE, val++);
|
||||
addConversion(PULSES_CROSSFIRE, val++);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
|
||||
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/nightly/firmware"
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/firmware"
|
||||
#define OPENTX_NIGHT_FIRMWARE_DOWNLOADS "http://downloads-22.open-tx.org/nightly/firmware"
|
||||
|
||||
#define FILE_TYP_GENERAL 1
|
||||
#define FILE_TYP_MODEL 2
|
||||
@@ -75,6 +75,10 @@ const char * OpenTxEepromInterface::getName()
|
||||
return "OpenTX for 9XR-PRO";
|
||||
case BOARD_AR9X:
|
||||
return "OpenTX for ar9x board / 9X";
|
||||
case BOARD_FLAMENCO:
|
||||
return "OpenTX for Flamenco experimental";
|
||||
case BOARD_HORUS:
|
||||
return "OpenTX for FrSky Horus";
|
||||
default:
|
||||
return "OpenTX for an unknown board";
|
||||
}
|
||||
@@ -98,6 +102,8 @@ const int OpenTxEepromInterface::getEEpromSize()
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_FLAMENCO:
|
||||
case BOARD_HORUS:
|
||||
return EESIZE_TARANIS;
|
||||
default:
|
||||
return 0;
|
||||
@@ -387,7 +393,7 @@ unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *e
|
||||
}
|
||||
}
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -403,7 +409,9 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_AR9X:
|
||||
case BOARD_9XRPRO:
|
||||
version = 217;
|
||||
case BOARD_FLAMENCO:
|
||||
case BOARD_HORUS:
|
||||
version = 218;
|
||||
break;
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
@@ -636,7 +644,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return id.contains("nooverridech") ? 0 : 1;
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
return 64;
|
||||
else
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
@@ -805,16 +813,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
}
|
||||
}
|
||||
|
||||
QTime OpenTxFirmware::getMaxTimerStart()
|
||||
{
|
||||
if (IS_TARANIS(board))
|
||||
return QTime(23, 59, 59);
|
||||
else if (IS_ARM(board))
|
||||
return QTime(8, 59, 59);
|
||||
else
|
||||
return QTime(0, 59, 59);
|
||||
}
|
||||
|
||||
bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
||||
{
|
||||
if (IS_TARANIS(board) && (source == TELEMETRY_SOURCE_RSSI_TX))
|
||||
@@ -966,16 +964,16 @@ EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
// M128 revert because too much RAM used!
|
||||
case 216:
|
||||
// A lot of things (first github release)
|
||||
return OLD_VERSION;
|
||||
break;
|
||||
case 217:
|
||||
// 3 logical switches removed on M128 / gruvin9x boards
|
||||
return OLD_VERSION;
|
||||
case 218:
|
||||
break;
|
||||
default:
|
||||
return NOT_OPENTX;
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
return ALL_OK;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
@@ -1083,7 +1081,7 @@ unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *e
|
||||
}
|
||||
|
||||
std::cout << " ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
@@ -1099,25 +1097,10 @@ QString OpenTxFirmware::getFirmwareBaseUrl()
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
{
|
||||
QString url = getFirmwareBaseUrl();
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
case BOARD_GRUVIN9X:
|
||||
case BOARD_MEGA2560:
|
||||
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
|
||||
break;
|
||||
case BOARD_SKY9X:
|
||||
case BOARD_AR9X:
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
break;
|
||||
default:
|
||||
url.clear();
|
||||
break;
|
||||
}
|
||||
if (IS_ARM(board))
|
||||
url.append(QString("/getfw.php?fw=%1.bin").arg(id));
|
||||
else
|
||||
url.append(QString("/getfw.php?fw=%1.hex").arg(id));
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -1153,7 +1136,7 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
|
||||
Option usb_options[] = { { "massstorage", QObject::tr("Instead of Joystick emulation, USB connection is Mass Storage (as in the Bootloader)") }, { "cli", QObject::tr("Instead of Joystick emulation, USB connection is Command Line Interface") }, { NULL } };
|
||||
firmware->addOptions(usb_options);
|
||||
firmware->addOption("mixersmon", QObject::tr("Adds mixers output view to the CHANNELS MONITOR screen, pressing [ENT] switches between the views"));
|
||||
firmware->addOption("eu", QObject::tr("Removes D8 FrSky protocol support which is not legal for use in the EU on radios sold after Jan 1st, 2015"));
|
||||
firmware->addOption("eu", QObject::tr("Removes D8 and LR12 FrSky protocols that are not legal for use in the EU on radios sold after Jan 1st, 2015"));
|
||||
firmware->addOption("internalppm", QObject::tr("Support for PPM internal module hack"));
|
||||
}
|
||||
|
||||
@@ -1178,109 +1161,8 @@ void registerOpenTxFirmwares()
|
||||
Option nav_options[] = { { "rotenc", QObject::tr("Rotary Encoder use in menus navigation") }, { "potscroll", QObject::tr("Pots use in menus navigation") }, { NULL } };
|
||||
Option dsm2_options[] = { { "DSM2", QObject::tr("Support for DSM2 modules"), 0 }, { "DSM2PPM", QObject::tr("Support for DSM2 modules using ppm instead of true serial"), 0 }, { NULL } };
|
||||
|
||||
/* Taranis Plus board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("Turnigy 9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("Turnigy 9XR with m128 chip"), BOARD_M128);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("Turnigy 9XR"), BOARD_STOCK);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
|
||||
firmware->addOption("novario", QObject::tr("No vario support"));
|
||||
firmware->addOption("nogps", QObject::tr("No GPS support"));
|
||||
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board */
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X with stock board"), BOARD_STOCK);
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("9X board"), BOARD_STOCK);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1316,7 +1198,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("9X with stock board and m128 chip"), BOARD_M128);
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("M128 / 9X board"), BOARD_M128);
|
||||
firmware->addOptions(ext_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
@@ -1345,52 +1227,69 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* ar9x board */
|
||||
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("9X with AR9X board"), BOARD_AR9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("9XR"), BOARD_STOCK);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
|
||||
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
firmware->addOption("nowshh", QObject::tr("No Winged Shadow How High support"));
|
||||
firmware->addOption("novario", QObject::tr("No vario support"));
|
||||
firmware->addOption("nogps", QObject::tr("No GPS support"));
|
||||
firmware->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen"));
|
||||
firmware->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("9X with Sky9x board"), BOARD_SKY9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("9XR with M128 chip"), BOARD_M128);
|
||||
firmware->addOptions(extr_options);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nosplash", QObject::tr("No splash screen"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("audio", QObject::tr("Support for radio modified with regular speaker"));
|
||||
firmware->addOption("voice", QObject::tr("Used if you have modified your radio with voice mode"));
|
||||
firmware->addOption("haptic", QObject::tr("Used if you have modified your radio with haptic mode"));
|
||||
// NOT TESTED firmware->addOption("PXX", QObject::tr("Support of FrSky PXX protocol"));
|
||||
firmware->addOption("DSM2", QObject::tr("Support for DSM2 modules"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
firmware->addOption("thrtrace", QObject::tr("Enable the throttle trace in Statistics"));
|
||||
firmware->addOption("pgbar", QObject::tr("EEprom write Progress bar"));
|
||||
firmware->addOption("imperial", QObject::tr("Imperial units"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Gruvin9x board */
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("9X with Gruvin9x board"), BOARD_GRUVIN9X);
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("Gruvin9x board / 9X"), BOARD_GRUVIN9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable heli menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
@@ -1415,7 +1314,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* MEGA2560 board */
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("DIY MEGA2560 radio"), BOARD_MEGA2560);
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("MEGA2560 board"), BOARD_MEGA2560);
|
||||
addOpenTxLcdOptions(firmware);
|
||||
firmware->addOption("PWR", QObject::tr("Power management by soft-off circuitry"));
|
||||
firmware->addOptions(ext_options);
|
||||
@@ -1444,6 +1343,99 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("Sky9x board / 9X"), BOARD_SKY9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* ar9x board */
|
||||
firmware = new OpenTxFirmware("opentx-ar9x", QObject::tr("ar9x board / 9X"), BOARD_AR9X);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("dblkeys", QObject::tr("Enable resetting values by pressing up and down at the same time"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
// firmware->addOption("rtc", QObject::tr("Optional RTC added"));
|
||||
// firmware->addOption("volume", QObject::tr("i2c volume control added"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("9XR-PRO"), BOARD_9XRPRO);
|
||||
firmware->addOption("heli", QObject::tr("Enable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("templates", QObject::tr("Enable TEMPLATES menu"));
|
||||
firmware->addOption("nofp", QObject::tr("No flight modes"));
|
||||
firmware->addOption("nocurves", QObject::tr("Disable curves menus"));
|
||||
firmware->addOption("ppmca", QObject::tr("PPM center adjustment in limits"));
|
||||
firmware->addOption("gvars", QObject::tr("Global variables"), GVARS_VARIANT);
|
||||
firmware->addOption("symlimits", QObject::tr("Symetrical Limits"));
|
||||
firmware->addOption("timer3", QObject::tr("Support for a third timer"));
|
||||
firmware->addOption("potscroll", QObject::tr("Pots use in menus navigation"));
|
||||
firmware->addOption("autosource", QObject::tr("In model setup menus automatically set source by moving the control"));
|
||||
firmware->addOption("autoswitch", QObject::tr("In model setup menus automatically set switch by moving the control"));
|
||||
firmware->addOption("nographics", QObject::tr("No graphical check boxes and sliders"));
|
||||
firmware->addOption("battgraph", QObject::tr("Battery graph"));
|
||||
firmware->addOption("nobold", QObject::tr("Don't use bold font for highlighting active items"));
|
||||
firmware->addOption("bluetooth", QObject::tr("Bluetooth interface"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("FrSky Taranis"), BOARD_TARANIS);
|
||||
firmware->addOption("haptic", QObject::tr("Haptic module installed"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis Plus board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisplus", QObject::tr("FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis X9E board */
|
||||
firmware = new OpenTxFirmware("opentx-taranisx9e", QObject::tr("FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
firmware->addOption("shutdownconfirm", QObject::tr("Confirmation before radio shutdown"));
|
||||
firmware->addOption("horussticks", QObject::tr("Horus magnetic sticks"));
|
||||
addOpenTxTaranisOptions(firmware);
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Horus board */
|
||||
firmware = new OpenTxFirmware("opentx-horus", QObject::tr("FrSky Horus"), BOARD_HORUS);
|
||||
firmware->addOption("noheli", QObject::tr("Disable HELI menu and cyclic mix support"));
|
||||
firmware->addOption("nogvars", QObject::tr("Disable Global variables"));
|
||||
firmware->addOption("lua", QObject::tr("Support for Lua model scripts"));
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
default_firmware_variant = GetFirmware("opentx-taranisplus-en");
|
||||
current_firmware_variant = default_firmware_variant;
|
||||
}
|
||||
|
||||
@@ -118,8 +118,6 @@ class OpenTxFirmware: public Firmware {
|
||||
virtual QString getFirmwareUrl();
|
||||
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual QTime getMaxTimerStart();
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
|
||||
set(RADIO_SRC_DIRECTORY ${PROJECT_SOURCE_DIR}/../../radio/src)
|
||||
|
||||
add_custom_target(about_lbm_9x
|
||||
make lbm PCB=9X
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(about_lbm_taranis
|
||||
make lbm PCB=TARANIS
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(commondeps
|
||||
make stamp_header tra
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${RADIO_SRC_DIRECTORY}/stamp-opentx.h)
|
||||
|
||||
macro(add_lua_export_target target)
|
||||
add_custom_command(
|
||||
OUTPUT ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc
|
||||
COMMAND ${CMAKE_C_COMPILER} -E ${ARGN} -DEXPORT ${INTTYPES_INCLUDE_OPTION} myeeprom.h | grep LEXP > lua_exports_${target}.txt
|
||||
COMMAND python ../util/luaexport.py ${C9X_VERSION} lua_exports_${target}.txt lua/lua_exports_${target}.inc lua_fields_${target}.txt
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
add_custom_target(lua_export_${target} DEPENDS ${RADIO_SRC_DIRECTORY}/lua/lua_exports_${target}.inc)
|
||||
endmacro(add_lua_export_target)
|
||||
|
||||
add_lua_export_target(taranis -DCPUARM -DPCBTARANIS -DLUA -DVIRTUALINPUTS)
|
||||
add_lua_export_target(taranis_x9e -DCPUARM -DPCBTARANIS -DREVPLUS -DREV9E -DLUA -DVIRTUALINPUTS)
|
||||
|
||||
set(OPENTX_SRC_FILES
|
||||
opentxsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/firmwares/opentx
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/FatFs/option
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/CoOS
|
||||
${RADIO_SRC_DIRECTORY}/thirdparty/Lua/src
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
set(CMAKE_SHARED_LINKER_FLAGS -F/Library/Frameworks)
|
||||
endif(APPLE)
|
||||
|
||||
if(DEFINED TRANSLATIONS)
|
||||
set(COMMON_DEFINITIONS ${COMMON_DEFINITIONS} TRANSLATIONS_${TRANSLATIONS})
|
||||
string(TOLOWER ${TRANSLATIONS} TRANSLATION_SUFFIX)
|
||||
set(SUFFIX ${SUFFIX}-${TRANSLATION_SUFFIX})
|
||||
endif()
|
||||
|
||||
set(COMMON_DEFINITIONS
|
||||
${COMMON_DEFINITIONS}
|
||||
SUFFIX="${SUFFIX}"
|
||||
HELI
|
||||
GVARS
|
||||
FLIGHT_MODES
|
||||
PPM_CENTER_ADJUSTABLE
|
||||
PPM_LIMITS_SYMETRICAL
|
||||
OVERRIDE_CHANNEL_FUNCTION
|
||||
FAI_CHOICE
|
||||
)
|
||||
|
||||
set(COMMON_LIBRARIES
|
||||
${QT_LIBRARIES}
|
||||
${PTHREAD_LIBRARY}
|
||||
${SDL_LIBRARY}
|
||||
)
|
||||
|
||||
add_library(opentx-9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9x128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xr128${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-ar9x${SUFFIX}-simulator about_lbm_9x commondeps)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis commondeps lua_export_taranis_x9e)
|
||||
|
||||
set(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
opentx-9xr${SUFFIX}-simulator
|
||||
opentx-9x128${SUFFIX}-simulator
|
||||
opentx-9xr128${SUFFIX}-simulator
|
||||
opentx-gruvin9x${SUFFIX}-simulator
|
||||
opentx-mega2560${SUFFIX}-simulator
|
||||
opentx-sky9x${SUFFIX}-simulator
|
||||
opentx-9xrpro${SUFFIX}-simulator
|
||||
opentx-ar9x${SUFFIX}-simulator
|
||||
opentx-taranis${SUFFIX}-simulator
|
||||
opentx-taranisplus${SUFFIX}-simulator
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega64
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9X with ATmega128
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega128
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Gruvin9x
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Mega2560
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Sky9x
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR-PRO
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# AR9X
|
||||
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis standard
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis Plus
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis X9E
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set(SIMULATOR_BUNDLES)
|
||||
foreach(_file ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${_file}-bundle")
|
||||
add_custom_target(${SIMULATOR_BUNDLE}
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND pwd
|
||||
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${_file}
|
||||
)
|
||||
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
|
||||
endforeach()
|
||||
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
|
||||
endif(APPLE)
|
||||
|
||||
@@ -1,589 +0,0 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opentxsimulator.h"
|
||||
#include <stdio.h>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#define COMPANION
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
#define GUI
|
||||
#define SPLASH
|
||||
#define FRSKY
|
||||
#define FRSKY_HUB
|
||||
#define GPS
|
||||
#define VARIO
|
||||
#define GAUGES
|
||||
#define PPM_UNIT_PERCENT_PREC1
|
||||
#define AUDIO
|
||||
#define PXX
|
||||
#define DSM2
|
||||
#define DSM2_PPM
|
||||
#define DBLKEYS
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#if defined(PCBTARANIS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define LUAINPUTS
|
||||
#else
|
||||
#define BUZZER
|
||||
#define TEMPLATES
|
||||
#endif
|
||||
#define BOLD_FONT
|
||||
#define HAPTIC
|
||||
#define THRTRACE
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define TIMERS 3
|
||||
#else
|
||||
#define TIMERS 2
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
#define ROTARY_ENCODERS 1
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define ROTARY_ENCODERS 2
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define FRSKY_SPORT
|
||||
#endif
|
||||
|
||||
#if defined (PCBTARANIS)
|
||||
#define MIXERS_MONITOR
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
// some C++ headers must be included outside the custom namespace (fails to compile in gcc-6)
|
||||
#include <math.h>
|
||||
|
||||
namespace NAMESPACE {
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/pulses/ppm_arm.cpp"
|
||||
#include "radio/src/pulses/pxx_arm.cpp"
|
||||
#include "radio/src/pulses/dsm2_arm.cpp"
|
||||
#include "radio/src/main_arm.cpp"
|
||||
#include "radio/src/pulses/pulses_arm.cpp"
|
||||
#include "radio/src/tasks_arm.cpp"
|
||||
#include "radio/src/audio_arm.cpp"
|
||||
#include "radio/src/telemetry/telemetry.cpp"
|
||||
#include "radio/src/telemetry/frsky_sport.cpp"
|
||||
#include "radio/src/sbus.cpp"
|
||||
#include "radio/src/crc16.cpp"
|
||||
#else
|
||||
#include "radio/src/main_avr.cpp"
|
||||
#include "radio/src/audio_avr.cpp"
|
||||
#include "radio/src/pulses/pulses_avr.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/eeprom_common.cpp"
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#else
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBSKY9X)
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/opentx.cpp"
|
||||
#include "radio/src/debug.cpp"
|
||||
#include "radio/src/strhelpers.cpp"
|
||||
#include "radio/src/switches.cpp"
|
||||
#include "radio/src/functions.cpp"
|
||||
#include "radio/src/curves.cpp"
|
||||
#include "radio/src/mixer.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/sdcard.cpp"
|
||||
#endif
|
||||
#include "radio/src/timers.cpp"
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/trainer_input.cpp"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/Taranis/fonts.cpp"
|
||||
#include "radio/src/gui/Taranis/widgets.cpp"
|
||||
#include "radio/src/gui/Taranis/navigation.cpp"
|
||||
#include "radio/src/gui/Taranis/popups.cpp"
|
||||
#include "radio/src/gui/Taranis/helpers.cpp"
|
||||
#include "radio/src/gui/Taranis/menus.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_version.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_diaganas.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Taranis/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Taranis/view_main.cpp"
|
||||
#include "radio/src/gui/Taranis/view_statistics.cpp"
|
||||
#include "radio/src/gui/Taranis/view_channels.cpp"
|
||||
#include "radio/src/gui/Taranis/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Taranis/view_text.cpp"
|
||||
#include "radio/src/gui/Taranis/view_about.cpp"
|
||||
#include "radio/src/gui/Taranis/lcd.cpp"
|
||||
#include "radio/src/gui/Taranis/splash.cpp"
|
||||
#else
|
||||
#include "radio/src/gui/9X/fonts.cpp"
|
||||
#include "radio/src/gui/9X/widgets.cpp"
|
||||
#include "radio/src/gui/9X/navigation.cpp"
|
||||
#include "radio/src/gui/9X/popups.cpp"
|
||||
#include "radio/src/gui/9X/helpers.cpp"
|
||||
#include "radio/src/gui/9X/menus.cpp"
|
||||
#include "radio/src/gui/9X/menu_model.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
||||
#include "radio/src/gui/9X/menu_general.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/gui/9X/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/9X/view_text.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_version.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_diaganas.cpp"
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/9X/menu_general_hardware.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/9X/view_main.cpp"
|
||||
#include "radio/src/gui/9X/view_statistics.cpp"
|
||||
#include "radio/src/gui/9X/view_telemetry.cpp"
|
||||
#if !defined(CPUM64)
|
||||
#include "radio/src/gui/9X/view_about.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/lcd.cpp"
|
||||
#include "radio/src/gui/9X/splash.cpp"
|
||||
#endif
|
||||
|
||||
#if !defined(VIRTUALINPUTS)
|
||||
#include "radio/src/templates.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
#include "radio/src/logs.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(RTCLOCK)
|
||||
#include "radio/src/rtc.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(BUZZER)
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
#include "radio/src/targets/taranis/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/taranis/haptic_driver.cpp"
|
||||
#if defined(REV9E)
|
||||
#include "radio/src/targets/taranis/top_lcd_driver.cpp"
|
||||
#endif
|
||||
#include "radio/src/targets/taranis/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/taranis/trainer_driver.cpp"
|
||||
#include "radio/src/targets/taranis/serial2_driver.cpp"
|
||||
#elif defined(PCBSKY9X)
|
||||
#include "radio/src/targets/sky9x/board_sky9x.cpp"
|
||||
#include "radio/src/targets/sky9x/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pwr_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/eeprom_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/keys_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/audio_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/serial2_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
#include "radio/src/targets/gruvin9x/somo14d.cpp"
|
||||
#elif defined(PCBMEGA2560)
|
||||
#include "radio/src/targets/mega2560/board_mega2560.cpp"
|
||||
#else
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/keys.cpp"
|
||||
#include "radio/src/haptic.cpp"
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/telemetry/frsky_d_arm.cpp"
|
||||
#else
|
||||
#include "radio/src/telemetry/frsky_d.cpp"
|
||||
#endif
|
||||
#include "radio/src/translations/tts_en.cpp"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/translations/tts_cz.cpp"
|
||||
#include "radio/src/translations/tts_de.cpp"
|
||||
#include "radio/src/translations/tts_es.cpp"
|
||||
#include "radio/src/translations/tts_fr.cpp"
|
||||
#include "radio/src/translations/tts_hu.cpp"
|
||||
#include "radio/src/translations/tts_it.cpp"
|
||||
#include "radio/src/translations/tts_nl.cpp"
|
||||
#include "radio/src/translations/tts_pl.cpp"
|
||||
#include "radio/src/translations/tts_pt.cpp"
|
||||
#include "radio/src/translations/tts_se.cpp"
|
||||
#include "radio/src/translations/tts_sk.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
#include "radio/src/lua/interface.cpp"
|
||||
#include "radio/src/lua/api_general.cpp"
|
||||
#include "radio/src/lua/api_lcd.cpp"
|
||||
#include "radio/src/lua/api_model.cpp"
|
||||
#include "radio/src/thirdparty/Lua/src/lapi.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcode.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lctype.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldebug.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldo.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ldump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lfunc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lgc.c"
|
||||
#include "radio/src/thirdparty/Lua/src/llex.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmem.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lobject.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lopcodes.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lparser.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstate.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstring.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lrotable.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lundump.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lvm.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lzio.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbaselib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/linit.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lmathlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lbitlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/loadlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lauxlib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/ltablib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lcorolib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/liolib.c"
|
||||
#include "radio/src/thirdparty/Lua/src/lstrlib.c"
|
||||
#endif
|
||||
|
||||
int16_t g_anas[NUM_STICKS+NUM_POTS];
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
return g_anas[chan];
|
||||
}
|
||||
|
||||
uint16_t getAnalogValue(uint32_t index)
|
||||
{
|
||||
return anaIn(index);
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return g_model.extendedTrims;
|
||||
}
|
||||
|
||||
uint8_t getStickMode()
|
||||
{
|
||||
return limit<uint8_t>(0, g_eeGeneral.stickMode, 3);
|
||||
}
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
void resetTrims()
|
||||
{
|
||||
TRIMS_GPIO_REG_RVD |= TRIMS_GPIO_PIN_RVD;
|
||||
TRIMS_GPIO_REG_RVU |= TRIMS_GPIO_PIN_RVU;
|
||||
TRIMS_GPIO_REG_RHL |= TRIMS_GPIO_PIN_RHL;
|
||||
TRIMS_GPIO_REG_RHR |= TRIMS_GPIO_PIN_RHR;
|
||||
TRIMS_GPIO_REG_LVD |= TRIMS_GPIO_PIN_LVD;
|
||||
TRIMS_GPIO_REG_LVU |= TRIMS_GPIO_PIN_LVU;
|
||||
TRIMS_GPIO_REG_LHL |= TRIMS_GPIO_PIN_LHL;
|
||||
TRIMS_GPIO_REG_LHR |= TRIMS_GPIO_PIN_LHR;
|
||||
}
|
||||
#endif
|
||||
|
||||
void delay_01us(::uint16_t nb)
|
||||
{
|
||||
}
|
||||
|
||||
OpenTxSimulator::OpenTxSimulator()
|
||||
{
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setSdPath(const QString &sdPath)
|
||||
{
|
||||
#if defined(SDCARD)
|
||||
strncpy(simuSdDirectory, sdPath.toAscii().constData(), sizeof(simuSdDirectory)-1);
|
||||
simuSdDirectory[sizeof(simuSdDirectory)-1] = '\0';
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setVolumeGain(int value)
|
||||
{
|
||||
volumeGain = value;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
::uint8_t * OpenTxSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(QByteArray & eeprom, bool tests)
|
||||
{
|
||||
memcpy(NAMESPACE::eeprom, eeprom.data(), std::min<int>(sizeof(NAMESPACE::eeprom), eeprom.size()));
|
||||
start((const char *)0, tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::start(const char * filename, bool tests)
|
||||
{
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] = 0;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] = 0;
|
||||
g_rotenc[1] = 0;
|
||||
#endif
|
||||
|
||||
StartEepromThread(filename);
|
||||
StartAudioThread(volumeGain);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
#if defined(CPUARM)
|
||||
StopAudioThread();
|
||||
#endif
|
||||
StopEepromThread();
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#define g_chans512 channelOutputs
|
||||
#include "simulatorimport.h"
|
||||
#if defined(PCBSKY9X)
|
||||
outputs.beep = g_beepCnt;
|
||||
g_beepCnt = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setValues(TxInputs &inputs)
|
||||
{
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
idx = NAMESPACE::modn12x3[4*getStickMode() + idx];
|
||||
::uint8_t phase = getTrimFlightPhase(getFlightMode(), idx);
|
||||
setTrimValue(phase, idx, value);
|
||||
}
|
||||
|
||||
void OpenTxSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
::uint8_t phase = getFlightMode();
|
||||
trims.extended = hasExtendedTrims();
|
||||
for (::uint8_t idx=0; idx<4; idx++) {
|
||||
trims.values[idx] = getTrimValue(getTrimFlightPhase(phase, idx), idx);
|
||||
}
|
||||
|
||||
for (int i=0; i<2; i++) {
|
||||
::uint8_t idx = NAMESPACE::modn12x3[4*getStickMode() + i];
|
||||
::int16_t tmp = trims.values[i];
|
||||
trims.values[i] = trims.values[idx];
|
||||
trims.values[idx] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxSimulator::wheelEvent(int steps)
|
||||
{
|
||||
#if defined(REV9E)
|
||||
if (steps == 255)
|
||||
x9de_rotenc -= 2;
|
||||
else
|
||||
x9de_rotenc += 2;
|
||||
#elif defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] += steps*4;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
g_rotenc[0] += steps;
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned int OpenTxSimulator::getPhase()
|
||||
{
|
||||
return getFlightMode();
|
||||
}
|
||||
|
||||
const char * OpenTxSimulator::getPhaseName(unsigned int phase)
|
||||
{
|
||||
static char buff[sizeof(g_model.flightModeData[0].name)+1];
|
||||
zchar2str(buff, g_model.flightModeData[phase].name, sizeof(g_model.flightModeData[0].name));
|
||||
return buff;
|
||||
}
|
||||
|
||||
const char * OpenTxSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
processSportPacket(data);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id, uint8_t defaultValue)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->custom.ratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setLuaStateReloadPermanentScripts()
|
||||
{
|
||||
#if defined(LUA)
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
|
||||
{
|
||||
traceCallback = callback;
|
||||
}
|
||||
|
||||
class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
{
|
||||
public:
|
||||
OpenTxSimulatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
virtual SimulatorInterface *create()
|
||||
{
|
||||
return new OpenTxSimulator();
|
||||
}
|
||||
|
||||
virtual QString name()
|
||||
{
|
||||
return QString("opentx-" FLAVOUR SUFFIX);
|
||||
}
|
||||
|
||||
virtual BoardEnum type()
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
return BOARD_TARANIS;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
extern "C" DLLEXPORT SimulatorFactory *registerSimu()
|
||||
{
|
||||
return new NAMESPACE::OpenTxSimulatorFactory();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
set(TH9X_CHECKOUT_DIRECTORY ${PROJECT_BINARY_DIR}/firmwares/th9x)
|
||||
add_custom_command(
|
||||
OUTPUT ${TH9X_CHECKOUT_DIRECTORY}/th9xsimulator.cpp
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${TH9X_CHECKOUT_DIRECTORY}
|
||||
COMMAND cd ${TH9X_CHECKOUT_DIRECTORY} && svn checkout http://th9x.googlecode.com/svn/trunk/src@285 .
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp ${TH9X_CHECKOUT_DIRECTORY}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/firmwares/th9x/th9xsimulator.cpp
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_library(th9x-simulator th9xsimulator.cpp)
|
||||
@@ -0,0 +1,232 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "firmwares/th9x/th9xsimulator.h"
|
||||
#include "firmwares/th9x/th9xinterface.h"
|
||||
|
||||
#define SIM
|
||||
#define SIMU
|
||||
#define SIMU_EXCEPTIONS
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#define NUM_POTS 3
|
||||
#define NUM_CSW 12
|
||||
#define SWSRC_SW1 10
|
||||
|
||||
#include <exception>
|
||||
#include <algorithm>
|
||||
|
||||
namespace Th9x {
|
||||
|
||||
#include "simpgmspace.h"
|
||||
#include "th9x.cpp"
|
||||
#include "stamp.cpp"
|
||||
#include "menus.cpp"
|
||||
#include "pers.cpp"
|
||||
#include "file.cpp"
|
||||
#include "lcd.cpp"
|
||||
#include "drivers.cpp"
|
||||
#include "foldedlist.cpp"
|
||||
#include "simpgmspace.cpp"
|
||||
#include "pulses.cpp"
|
||||
|
||||
int16_t g_anas[7];
|
||||
char g_title[80] = "";
|
||||
|
||||
uint16_t anaIn(uint8_t chan)
|
||||
{
|
||||
if (chan == 7)
|
||||
return 750;
|
||||
else
|
||||
return 512 + g_anas[chan];
|
||||
}
|
||||
|
||||
bool hasExtendedTrims()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void setTrim(uint8_t idx, int8_t value)
|
||||
{
|
||||
g_model.trimData[idx].itrim = trimRevertM(value, g_model.trimData[idx].tmode);
|
||||
}
|
||||
|
||||
void getTrims(int16_t values[4])
|
||||
{
|
||||
for (int i=0; i<4; i++) {
|
||||
values[i] = trimVal(i);
|
||||
}
|
||||
}
|
||||
|
||||
void eeprom_RESV_mismatch(void)
|
||||
{
|
||||
assert(!"Should never been called. Only needed by VC++ (debug mode)");
|
||||
}
|
||||
|
||||
#define TRIMS_GPIO_REG_LHL pind
|
||||
#define TRIMS_GPIO_REG_LVD pind
|
||||
#define TRIMS_GPIO_REG_RVU pind
|
||||
#define TRIMS_GPIO_REG_RHL pind
|
||||
#define TRIMS_GPIO_REG_LHR pind
|
||||
#define TRIMS_GPIO_REG_LVU pind
|
||||
#define TRIMS_GPIO_REG_RVD pind
|
||||
#define TRIMS_GPIO_REG_RHR pind
|
||||
#define PIN_TRIM_LH_L (1<<INP_D_TRM_LH_DWN)
|
||||
#define PIN_TRIM_LV_DN (1<<INP_D_TRM_LV_DWN)
|
||||
#define PIN_TRIM_RV_UP (1<<INP_D_TRM_RV_UP)
|
||||
#define PIN_TRIM_RH_L (1<<INP_D_TRM_RH_DWN)
|
||||
#define PIN_TRIM_LH_R (1<<INP_D_TRM_LH_UP)
|
||||
#define PIN_TRIM_LV_UP (1<<INP_D_TRM_LV_UP)
|
||||
#define PIN_TRIM_RV_DN (1<<INP_D_TRM_RV_DWN)
|
||||
#define PIN_TRIM_RH_R (1<<INP_D_TRM_RH_UP)
|
||||
|
||||
#define TRIM_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
switch (trim) {
|
||||
TRIM_CASE(0, TRIMS_GPIO_REG_LHL, PIN_TRIM_LH_L)
|
||||
TRIM_CASE(1, TRIMS_GPIO_REG_LHR, PIN_TRIM_LH_R)
|
||||
TRIM_CASE(2, TRIMS_GPIO_REG_LVD, PIN_TRIM_LV_DN)
|
||||
TRIM_CASE(3, TRIMS_GPIO_REG_LVU, PIN_TRIM_LV_UP)
|
||||
TRIM_CASE(4, TRIMS_GPIO_REG_RVD, PIN_TRIM_RV_DN)
|
||||
TRIM_CASE(5, TRIMS_GPIO_REG_RVU, PIN_TRIM_RV_UP)
|
||||
TRIM_CASE(6, TRIMS_GPIO_REG_RHL, PIN_TRIM_RH_L)
|
||||
TRIM_CASE(7, TRIMS_GPIO_REG_RHR, PIN_TRIM_RH_R)
|
||||
}
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(swtch, pin, mask) \
|
||||
case swtch: \
|
||||
if (state) pin &= ~(mask); else pin |= (mask); \
|
||||
break;
|
||||
#define SWITCH_3_CASE(swtch, pin1, pin2, mask1, mask2) \
|
||||
case swtch: \
|
||||
if (state >= 0) pin1 &= ~(mask1); else pin1 |= (mask1); \
|
||||
if (state <= 0) pin2 &= ~(mask2); else pin2 |= (mask2); \
|
||||
break;
|
||||
|
||||
void simuSetSwitch(uint8_t swtch, int8_t state)
|
||||
{
|
||||
switch (swtch) {
|
||||
SWITCH_CASE(0, pine, 1<<INP_E_ThrCt)
|
||||
SWITCH_CASE(4, pine, 1<<INP_E_AileDR)
|
||||
SWITCH_3_CASE(3, ping, pine, (1<<INP_G_ID1), (1<<INP_E_ID2))
|
||||
SWITCH_CASE(1, ping, 1<<INP_G_RuddDR)
|
||||
SWITCH_CASE(2, pine, 1<<INP_E_ElevDR)
|
||||
SWITCH_CASE(5, pine, 1<<INP_E_Gear)
|
||||
SWITCH_CASE(6, pine, 1<<INP_E_Trainer)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define KEY_CASE(key, pin, mask) \
|
||||
case key: \
|
||||
if (state) pin |= mask; else pin &= ~mask;\
|
||||
break;
|
||||
|
||||
void simuSetKey(uint8_t key, bool state)
|
||||
{
|
||||
switch (key) {
|
||||
KEY_CASE(KEY_MENU, pinb, (1<<INP_B_KEY_MEN))
|
||||
KEY_CASE(KEY_EXIT, pinb, (1<<INP_B_KEY_EXT))
|
||||
KEY_CASE(KEY_RIGHT, pinb, (1<<INP_B_KEY_RGT))
|
||||
KEY_CASE(KEY_LEFT, pinb, (1<<INP_B_KEY_LFT))
|
||||
KEY_CASE(KEY_UP, pinb, (1<<INP_B_KEY_UP))
|
||||
KEY_CASE(KEY_DOWN, pinb, (1<<INP_B_KEY_DWN))
|
||||
}
|
||||
}
|
||||
|
||||
#define isBacklightEnable() (PORTB & (1<<OUT_B_LIGHT))
|
||||
|
||||
}
|
||||
|
||||
using namespace Th9x;
|
||||
|
||||
Th9xSimulator::Th9xSimulator(Th9xInterface * th9xInterface):
|
||||
th9xInterface(th9xInterface)
|
||||
{
|
||||
}
|
||||
|
||||
bool Th9xSimulator::timer10ms()
|
||||
{
|
||||
#define TIMER10MS_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
uint8_t * Th9xSimulator::getLcd()
|
||||
{
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Th9xSimulator::lcdChanged(bool & lightEnable)
|
||||
{
|
||||
#define LCDCHANGED_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Th9xSimulator::start(RadioData &radioData, bool tests)
|
||||
{
|
||||
th9xInterface->save(&eeprom[0], radioData);
|
||||
StartMainThread(tests);
|
||||
}
|
||||
|
||||
void Th9xSimulator::stop()
|
||||
{
|
||||
StopMainThread();
|
||||
}
|
||||
|
||||
void Th9xSimulator::getValues(TxOutputs &outputs)
|
||||
{
|
||||
#define GETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
for (int i=0; i<8; i++)
|
||||
outputs.chans[i] *= 2;
|
||||
}
|
||||
|
||||
void Th9xSimulator::setValues(TxInputs &_inputs)
|
||||
{
|
||||
TxInputs inputs = _inputs;
|
||||
for (int i=0; i<4; i++)
|
||||
inputs.sticks[i] /= 2;
|
||||
for (int i=0; i<3; i++)
|
||||
inputs.pots[i] /= 2;
|
||||
#define SETVALUES_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void Th9xSimulator::setTrim(unsigned int idx, int value)
|
||||
{
|
||||
Th9x::setTrim(idx, value);
|
||||
}
|
||||
|
||||
void Th9xSimulator::getTrims(Trims & trims)
|
||||
{
|
||||
trims.extended = false;
|
||||
Th9x::getTrims(trims.values);
|
||||
}
|
||||
|
||||
const char * Th9xSimulator::getError()
|
||||
{
|
||||
#define GETERROR_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef th9x_simulator_h
|
||||
#define th9x_simulator_h
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
class RadioData;
|
||||
class Th9xInterface;
|
||||
|
||||
class Th9xSimulator : public SimulatorInterface {
|
||||
|
||||
public:
|
||||
|
||||
Th9xSimulator(Th9xInterface *);
|
||||
|
||||
virtual void start(RadioData & radioData, bool tests);
|
||||
|
||||
virtual void stop();
|
||||
|
||||
virtual bool timer10ms();
|
||||
|
||||
virtual uint8_t * getLcd();
|
||||
|
||||
virtual bool lcdChanged(bool & lightEnable);
|
||||
|
||||
virtual void setValues(TxInputs &inputs);
|
||||
|
||||
virtual void getValues(TxOutputs &outputs);
|
||||
|
||||
virtual void setTrim(unsigned int idx, int value);
|
||||
|
||||
virtual void getTrims(Trims & trims);
|
||||
|
||||
virtual unsigned int getPhase() { return 0; }
|
||||
|
||||
virtual const char * getError();
|
||||
|
||||
protected:
|
||||
|
||||
Th9xInterface * th9xInterface;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <iostream>
|
||||
#include "th9xinterface.h"
|
||||
#include "th9xeeprom.h"
|
||||
#include "simulator/th9xsimulator.h"
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
@@ -122,7 +123,7 @@ unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, i
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
errors.set(NO_ERROR);
|
||||
errors.set(ALL_OK);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
if (xmlOK) {
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
if (!errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
@@ -162,7 +162,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (eeprom_size == 0 || !errors.test(NO_ERROR)) {
|
||||
if (eeprom_size == 0 || !errors.test(ALL_OK)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FLASHEEPROMDIALOG_H_
|
||||
#define FLASHEEPROMDIALOG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
|
||||
#define ER9X_EEPROM_FILE_TYPE "ER9X_EEPROM_FILE"
|
||||
#define EEPE_EEPROM_FILE_HEADER "EEPE EEPROM FILE"
|
||||
|
||||
@@ -203,7 +203,6 @@ void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
||||
void FlashFirmwareDialog::on_burnButton_clicked()
|
||||
{
|
||||
g.flashDir(QFileInfo(fwName).dir().absolutePath());
|
||||
g.profile[g.id()].fwName(fwName);
|
||||
g.checkHardwareCompatibility(ui->checkHardwareCompatibility->isChecked());
|
||||
g.backupOnFlash(ui->backupEEprom->isChecked());
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#ifndef FLASH_FIRMWARE_DIALOG_H
|
||||
#define FLASH_FIRMWARE_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "xmlinterface.h"
|
||||
|
||||
@@ -24,7 +24,8 @@ foreach(name ${generaledit_NAMES})
|
||||
set(generaledit_UIS ${generaledit_UIS} ${name}.ui)
|
||||
endforeach()
|
||||
|
||||
qt4_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt4_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
qt5_wrap_ui(generaledit_SRCS ${generaledit_UIS})
|
||||
qt5_wrap_cpp(generaledit_SRCS ${generaledit_HDRS})
|
||||
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
add_library(generaledit ${generaledit_SRCS})
|
||||
qt5_use_modules(generaledit Widgets Xml Multimedia)
|
||||
@@ -14,7 +14,7 @@ CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSe
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(layout);
|
||||
|
||||
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->setColumnCount(3);
|
||||
tableWidget->setShowGrid(false);
|
||||
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#include <QDateTime>
|
||||
#include <QtGui>
|
||||
#include <QScrollArea>
|
||||
#include "generaledit.h"
|
||||
#include "ui_generaledit.h"
|
||||
#include "helpers.h"
|
||||
@@ -111,18 +108,22 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
for (int i=0; i<(NUM_STICKS+potsnum); i++) {
|
||||
Byte=calib.mid(i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok) generalSettings.calibMid[i]=byte16;
|
||||
if (ok)
|
||||
generalSettings.calibMid[i]=byte16;
|
||||
Byte=calib.mid(4+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok) generalSettings.calibSpanNeg[i]=byte16;
|
||||
if (ok)
|
||||
generalSettings.calibSpanNeg[i]=byte16;
|
||||
Byte=calib.mid(8+i*12,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok) generalSettings.calibSpanPos[i]=byte16;
|
||||
if (ok)
|
||||
generalSettings.calibSpanPos[i]=byte16;
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
Byte=trainercalib.mid(i*4,4);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
if (ok) generalSettings.trainer.calib[i]=byte16;
|
||||
if (ok)
|
||||
generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
generalSettings.txCurrentCalibration=txCurrentCalibration;
|
||||
generalSettings.txVoltageCalibration=txVoltageCalibration;
|
||||
@@ -142,37 +143,34 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
int16_t offset;
|
||||
bool ok;
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
qba = controlNames.mid(3*i,3).toAscii();
|
||||
qba = controlNames.mid(3*i,3).toLatin1();
|
||||
strcpy(generalSettings.stickName[i], qba.data());
|
||||
}
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Switches)); i++) {
|
||||
Byte=hwtypes.mid(i,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toAscii();
|
||||
if (ok) {
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.switchConfig[i]=byte16;
|
||||
strcpy(generalSettings.switchName[i], qba.data());
|
||||
}
|
||||
}
|
||||
offset = GetCurrentFirmware()->getCapability(Switches);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Pots)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
if (ok) {
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.potConfig[i]=byte16;
|
||||
strcpy(generalSettings.potName[i], qba.data());
|
||||
}
|
||||
}
|
||||
offset += GetCurrentFirmware()->getCapability(Pots);
|
||||
for (int i=0; i<(GetCurrentFirmware()->getCapability(Sliders)); i++) {
|
||||
Byte=hwtypes.mid(i+offset,1);
|
||||
byte16=(int16_t)Byte.toInt(&ok,16);
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toAscii();
|
||||
if (ok) {
|
||||
qba=controlNames.mid(3*(i+NUM_STICKS+offset),3).toLatin1();
|
||||
if (ok)
|
||||
generalSettings.sliderConfig[i]=byte16;
|
||||
strcpy(generalSettings.sliderName[i], qba.data());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Warning"), tr("Wrong data in profile, Switch/pot config not retrieved"));
|
||||
@@ -184,35 +182,48 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
QString chars;
|
||||
bool ok;
|
||||
byte8=(int8_t)DisplaySet.mid(0,2).toInt(&ok,16);
|
||||
if (ok) generalSettings.optrexDisplay=(byte8==1 ? true : false);
|
||||
if (ok)
|
||||
generalSettings.optrexDisplay=(byte8==1 ? true : false);
|
||||
byte8u=(uint8_t)DisplaySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.contrast=byte8u;
|
||||
if (ok)
|
||||
generalSettings.contrast=byte8u;
|
||||
byte8u=(uint8_t)DisplaySet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.backlightBright=byte8u;
|
||||
if (ok)
|
||||
generalSettings.backlightBright=byte8u;
|
||||
byte8=(int8_t)BeeperSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
|
||||
if (ok)
|
||||
generalSettings.beeperMode = (GeneralSettings::BeeperMode)byte8;
|
||||
byte8=(int8_t)BeeperSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok) generalSettings.beeperLength=byte8;
|
||||
if (ok)
|
||||
generalSettings.beeperLength=byte8;
|
||||
byte8=(int8_t)HapticSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
|
||||
if (ok)
|
||||
generalSettings.hapticMode=(GeneralSettings::BeeperMode)byte8;
|
||||
byte8=(int8_t)HapticSet.mid(2,2).toInt(&ok,16);
|
||||
if (ok) generalSettings.hapticStrength=byte8;
|
||||
if (ok)
|
||||
generalSettings.hapticStrength=byte8;
|
||||
byte8=(int8_t)HapticSet.mid(4,2).toInt(&ok,16);
|
||||
if (ok) generalSettings.hapticLength=byte8;
|
||||
if (ok)
|
||||
generalSettings.hapticLength=byte8;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.speakerMode=byte8u;
|
||||
if (ok)
|
||||
generalSettings.speakerMode=byte8u;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.speakerPitch=byte8u;
|
||||
if (ok)
|
||||
generalSettings.speakerPitch=byte8u;
|
||||
byte8u=(uint8_t)SpeakerSet.mid(4,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.speakerVolume=byte8u;
|
||||
if (ok)
|
||||
generalSettings.speakerVolume=byte8u;
|
||||
if (CountrySet.length()==6) {
|
||||
byte8u=(uint8_t)CountrySet.mid(0,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.countryCode=byte8u;
|
||||
if (ok)
|
||||
generalSettings.countryCode=byte8u;
|
||||
byte8u=(uint8_t)CountrySet.mid(2,2).toUInt(&ok,16);
|
||||
if (ok) generalSettings.imperial=byte8u;
|
||||
if (ok)
|
||||
generalSettings.imperial=byte8u;
|
||||
chars=CountrySet.mid(4,2);
|
||||
generalSettings.ttsLanguage[0]=chars[0].toAscii();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toAscii();
|
||||
generalSettings.ttsLanguage[0]=chars[0].toLatin1();
|
||||
generalSettings.ttsLanguage[1]=chars[1].toLatin1();
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GENERALEDIT_H
|
||||
#define GENERALEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtWidgets>
|
||||
#include "eeprominterface.h"
|
||||
#include "genericpanel.h"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "generalsetup.h"
|
||||
#include "ui_generalsetup.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
GeneralSetupPanel::GeneralSetupPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
@@ -316,7 +315,7 @@ void GeneralSetupPanel::on_voiceLang_CB_currentIndexChanged(int index)
|
||||
if (!lock) {
|
||||
QString code = ui->voiceLang_CB->itemData(index).toString();
|
||||
for (int i=0; i<2; i++) {
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toAscii();
|
||||
generalSettings.ttsLanguage[i] = code.at(i).toLatin1();
|
||||
}
|
||||
generalSettings.ttsLanguage[2] = '\0';
|
||||
emit modified();
|
||||
|
||||
@@ -86,7 +86,7 @@ void getFileComboBoxValue(QComboBox * b, char * dest, int length)
|
||||
{
|
||||
memset(dest, 0, length+1);
|
||||
if (b->currentText() != "----") {
|
||||
strncpy(dest, b->currentText().toAscii(), length);
|
||||
strncpy(dest, b->currentText().toLatin1(), length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void populatePhasesCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step, bool allowGvars):
|
||||
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),
|
||||
@@ -115,7 +115,7 @@ GVarGroup::GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBo
|
||||
lock(true)
|
||||
{
|
||||
if (allowGvars && GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
populateGVCB(*weightCB, weight, model);
|
||||
populateGVCB(weightCB, weight);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
}
|
||||
@@ -179,14 +179,13 @@ void GVarGroup::valuesChanged()
|
||||
}
|
||||
}
|
||||
|
||||
CurveGroup::CurveGroup(QComboBox * curveTypeCB, QCheckBox * curveGVarCB, QComboBox * curveValueCB, QSpinBox * curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags):
|
||||
CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags):
|
||||
QObject(),
|
||||
curveTypeCB(curveTypeCB),
|
||||
curveGVarCB(curveGVarCB),
|
||||
curveValueCB(curveValueCB),
|
||||
curveValueSB(curveValueSB),
|
||||
curve(curve),
|
||||
model(model),
|
||||
flags(flags),
|
||||
lock(false),
|
||||
lastType(-1)
|
||||
@@ -220,7 +219,7 @@ void CurveGroup::update()
|
||||
curveGVarCB->setChecked(true);
|
||||
if (lastType != CurveReference::CURVE_REF_DIFF && lastType != CurveReference::CURVE_REF_EXPO) {
|
||||
lastType = curve.type;
|
||||
populateGVCB(*curveValueCB, curve.value, model);
|
||||
populateGVCB(curveValueCB, curve.value);
|
||||
}
|
||||
curveValueCB->show();
|
||||
curveValueSB->hide();
|
||||
@@ -277,7 +276,6 @@ void CurveGroup::gvarCBChanged(int state)
|
||||
if (!lock) {
|
||||
if (state) {
|
||||
curve.value = 10000+1; // TODO constant in EEpromInterface ...
|
||||
lastType = -1; // quickfix for issue #3518: force refresh of curveValueCB at next update() to set current index to GV1
|
||||
}
|
||||
else {
|
||||
curve.value = 0; // TODO could be better
|
||||
@@ -480,39 +478,33 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
b->setMaxVisibleItems(10);
|
||||
}
|
||||
|
||||
void populateGVCB(QComboBox & b, int value, const ModelData & model)
|
||||
void populateGVCB(QComboBox *b, int value)
|
||||
{
|
||||
bool selected = false;
|
||||
|
||||
b.clear();
|
||||
b->clear();
|
||||
|
||||
int count = GetCurrentFirmware()->getCapability(Gvars);
|
||||
for (int i=-count; i<=-1; i++) {
|
||||
int pgvars = GetCurrentFirmware()->getCapability(Gvars);
|
||||
for (int i=-pgvars; i<=-1; i++) {
|
||||
int16_t gval = (int16_t)(-10000+i);
|
||||
if (strlen(model.gvars_names[-i-1]) > 0)
|
||||
b.addItem(QObject::tr("-GV%1 (%2)").arg(-i).arg(model.gvars_names[-i-1]), gval);
|
||||
else
|
||||
b.addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||
if (value == gval) {
|
||||
b.setCurrentIndex(b.count()-1);
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=1; i<=count; i++) {
|
||||
for (int i=1; i<=pgvars; i++) {
|
||||
int16_t gval = (int16_t)(10000+i);
|
||||
if (strlen(model.gvars_names[i-1]) > 0)
|
||||
b.addItem(QObject::tr("GV%1 (%2)").arg(i).arg(model.gvars_names[i-1]), gval);
|
||||
else
|
||||
b.addItem(QObject::tr("GV%1").arg(i), gval);
|
||||
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
||||
if (value == gval) {
|
||||
b.setCurrentIndex(b.count()-1);
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!selected) {
|
||||
b.setCurrentIndex(count);
|
||||
b->setCurrentIndex(pgvars);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,7 +790,13 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
|
||||
}
|
||||
BoardEnum board = GetCurrentFirmware()->getBoard();
|
||||
SimulatorDialog * sd;
|
||||
if (IS_TARANIS(board)) {
|
||||
if (board == BOARD_HORUS) {
|
||||
sd = new SimulatorDialogHorus(parent, si, flags);
|
||||
}
|
||||
else if (board == BOARD_FLAMENCO) {
|
||||
sd = new SimulatorDialogFlamenco(parent, si, flags);
|
||||
}
|
||||
else if (IS_TARANIS(board)) {
|
||||
for (int i=0; i<GetCurrentFirmware()->getCapability(Pots); i++) {
|
||||
if (radioData.generalSettings.isPotAvailable(i)) {
|
||||
flags |= (SIMULATOR_FLAGS_S1 << i);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef HELPERS_H
|
||||
#define HELPERS_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QCheckBox>
|
||||
#include <QSpinBox>
|
||||
#include <QTableWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QDebug>
|
||||
@@ -45,7 +46,7 @@ class GVarGroup: public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GVarGroup(QCheckBox * weightGV, QAbstractSpinBox * weightSB, QComboBox * weightCB, int & weight, const ModelData & model, const int deflt, const int mini, const int maxi, const double step=1.0, bool allowGVars=true);
|
||||
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);
|
||||
@@ -71,7 +72,7 @@ class CurveGroup : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, const ModelData & model, unsigned int flags=0);
|
||||
CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox *curveValueCB, QSpinBox *curveValueSB, CurveReference & curve, unsigned int flags=0);
|
||||
void update();
|
||||
|
||||
protected slots:
|
||||
@@ -85,7 +86,6 @@ class CurveGroup : public QObject {
|
||||
QComboBox *curveValueCB;
|
||||
QSpinBox *curveValueSB;
|
||||
CurveReference & curve;
|
||||
const ModelData & model;
|
||||
unsigned int flags;
|
||||
bool lock;
|
||||
int lastType;
|
||||
@@ -118,7 +118,8 @@ void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
#define GVARS_VARIANT 0x0001
|
||||
#define FRSKY_VARIANT 0x0002
|
||||
|
||||
void populateGVCB(QComboBox & b, int value, const ModelData & model);
|
||||
// void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up
|
||||
void populateGVCB(QComboBox *b, int value);
|
||||
void populateSourceCB(QComboBox *b, const RawSource &source, const GeneralSettings generalSettings, const ModelData * model, unsigned int flags);
|
||||
QString image2qstring(QImage image);
|
||||
int findmult(float value, float base);
|
||||
|
||||
|
After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 42 KiB |