Compare commits
954 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e681c876e6 | |||
| a4e6c90d1d | |||
| c5e0eb84b8 | |||
| b045b979cd | |||
| 93fde17526 | |||
| dc6d9aca3a | |||
| 77772287fe | |||
| 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 | |||
| d0d7135db4 | |||
| 1ce0b71c5c | |||
| 109faf8989 | |||
| 754b875d81 | |||
| 2572ed0eba | |||
| 404a1934c5 | |||
| feac6d000f | |||
| 77ebe3caec | |||
| e71b53964b | |||
| 4a60c8aa6e | |||
| d54f25ccba | |||
| 2f03e2c4ad | |||
| c92d88b664 | |||
| 11cff7a63b | |||
| 07ca8319ad | |||
| 2f54e85421 | |||
| b666892da4 | |||
| edf1dbc0b7 | |||
| 7f991ea7f9 | |||
| f0753fe51c | |||
| 7f4abd7c83 | |||
| 52809b51b9 | |||
| ed2f66aedd | |||
| 1a399a649d | |||
| 0f246d2f39 | |||
| e5ef862729 | |||
| e6546af9b1 | |||
| feb98816ec | |||
| 71411fcb62 | |||
| d5824f5719 | |||
| f32231cab2 | |||
| f875aec72b | |||
| 1b7e62a1f0 | |||
| ef5746de11 | |||
| 454a664d01 | |||
| 58edcc3af8 | |||
| 09846ca917 | |||
| 2b2f34af29 | |||
| a06d405a2c | |||
| 429490eb86 | |||
| c73a8bac25 | |||
| 86f1363d0a | |||
| c4d7feaa9b | |||
| 312c370162 | |||
| a9603cbdb7 | |||
| f854442c79 | |||
| 922141fcf7 | |||
| 34fef4fefe | |||
| d74092d6eb | |||
| 5445e506a6 | |||
| a1d44d4d9f | |||
| cc2fcce559 | |||
| 3a740907bb | |||
| b1f5ea115c | |||
| a4869cdb8a | |||
| 333d7f1ac1 | |||
| 380f435cf2 | |||
| 5805c0904a | |||
| cd2be28aab | |||
| d038a0379b | |||
| bca18f5938 | |||
| 62e6e30481 | |||
| a556c50956 | |||
| 8f4c161dc0 | |||
| aa24bd72ff | |||
| a11884522a | |||
| 58216ec8b0 | |||
| 1641db873d | |||
| b1ec421b02 | |||
| 5119448170 | |||
| 0d6d309362 | |||
| b56e107e25 | |||
| 473ddcb56d | |||
| 484583106c | |||
| 7138c7c0e4 | |||
| dcebac87b9 | |||
| 8b419770e2 | |||
| 3d29b8e7e5 | |||
| 22c429a1a7 | |||
| 3b4a6fb49b | |||
| 3dc7e66ba7 | |||
| fbc2def259 | |||
| 08ff104d26 | |||
| a2c50ce2f8 | |||
| b65fa29e1d | |||
| b3073e104b | |||
| 22b17c64ff | |||
| 2e068044c6 | |||
| d3e2a00cd2 | |||
| 2feb5ac894 | |||
| 6f30718745 | |||
| 16e7dbbb94 | |||
| 942148fc5c | |||
| 088f4d5e3f | |||
| 03fabd95ac | |||
| 7e5374f31d | |||
| 756441bc50 | |||
| 7c0767144f | |||
| 95040234b3 | |||
| 01226b612a | |||
| 4605f9d61d | |||
| fcb845a6b2 | |||
| 0e34c24d96 | |||
| 47ea418d5b | |||
| 2aa2b41f3a | |||
| 85a5554922 | |||
| 543123a169 | |||
| b96f882866 | |||
| f0039129e9 | |||
| 6cbe780d57 | |||
| cd4d6afff8 | |||
| 9cd0cbf417 | |||
| 2a54bee20b | |||
| ee4ea18a3e | |||
| 0673663427 | |||
| d38cf06b07 | |||
| 54891af0d2 | |||
| 6f774eb61a | |||
| ab0272c16c | |||
| 022bd2d3da | |||
| dd88490d00 | |||
| fb371cf5b7 | |||
| e18e6f9c41 | |||
| c8f77fceec | |||
| 018a022c35 | |||
| 1668507114 | |||
| 580dc6d2de | |||
| ebe4ed19c5 | |||
| bc08d95576 | |||
| d353f3c388 | |||
| 319b8695d5 | |||
| cad1cc4432 | |||
| 768b255d7d | |||
| aa88651e0a | |||
| 9463f49ba1 | |||
| cee3559aac | |||
| 082ba0893d | |||
| 4ef9913f76 | |||
| 8a3de9184b | |||
| 4f5ce6b0f0 | |||
| 719ecc8473 | |||
| 76b5143dd4 | |||
| 21a67b82d4 | |||
| 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 | |||
| 701082f012 | |||
| dad1a06344 | |||
| 8976afe3bc | |||
| e326cb8515 | |||
| dc4a434076 | |||
| 9ae7aea7bb | |||
| dcbc20f1c0 | |||
| 1acd23bf8c | |||
| f98bf5e678 | |||
| 60eca69bfe | |||
| 7297669c4b | |||
| ad63f7e7f7 | |||
| da8c0297c4 | |||
| cd16b4da0e | |||
| 94efa965da | |||
| cb5bb83067 | |||
| 98abd4ec08 | |||
| 1cc3fedaf2 | |||
| 2f378d83d6 | |||
| 22f4f18071 | |||
| 268fc43fbd | |||
| 637d20a66d | |||
| 48a11f63ea | |||
| 30f5b1b275 | |||
| e8680c32b0 | |||
| 21760a3960 | |||
| a30ddb7437 | |||
| f4dc2caedf | |||
| 0d9f011a4e | |||
| 03ff929ef7 | |||
| 3849121098 | |||
| 66f473b8b6 | |||
| 6af4d09345 | |||
| e3dee13cb3 | |||
| 7a01f04f49 | |||
| b46fd48de6 | |||
| d7d38cd076 | |||
| 8e0adbe602 | |||
| 11753450ae | |||
| bb1d368c03 | |||
| 3231c0506f | |||
| 1b74d5a061 | |||
| 7ec4f508ee | |||
| 60f2535212 | |||
| 3f6e1d0b3a | |||
| e57361f7e1 | |||
| 436b5003d9 | |||
| 1dfa03d77d | |||
| 1d6adcc25a | |||
| b48946b3aa | |||
| b50c452500 | |||
| e55466894c | |||
| a38e9f6d3a | |||
| de4a5c586d | |||
| 455f9bfde2 | |||
| 9f25c7a0b6 | |||
| 02dbe6bcac | |||
| 6fe12ba625 | |||
| cd794e986a | |||
| 3aba306de9 | |||
| 412d8131f7 | |||
| daac7e6bf2 | |||
| b7bf6c5be7 | |||
| cc28219760 | |||
| 5d9f168003 | |||
| d1dbe6efce | |||
| 22a50041e3 | |||
| ea74e31841 | |||
| cdc66a7d01 | |||
| a5f94e17eb | |||
| be84af5f84 | |||
| 02b72befdb | |||
| 5f343b4a6e | |||
| 7f8211ada5 | |||
| a3584e56f4 | |||
| 106702342d | |||
| 701af4984b | |||
| bfc01f9504 | |||
| 18ffe9f503 | |||
| 407289e1d1 | |||
| 6bffe4aa80 | |||
| 1aa5143677 | |||
| 0f6bee2273 | |||
| 71aa066b99 | |||
| 96a2e18833 | |||
| d63ac41b6a | |||
| 365d2b6c58 | |||
| 6389f977bc | |||
| 7134f38ad5 | |||
| aab8fc8a96 | |||
| 0c39ed3488 | |||
| a142a74c36 | |||
| 9f8a1d5f97 | |||
| e65c131c75 | |||
| 552e730065 | |||
| dbc0d764e1 | |||
| 5cebe43306 | |||
| 646cc937ac | |||
| 6d52039266 | |||
| 14967b6a94 | |||
| b9ce8df5b6 | |||
| cae807499b | |||
| df0c0808b0 | |||
| 064c58d858 | |||
| 9af87b228c | |||
| 9eae49eed3 | |||
| 92310fff5f | |||
| 3d7c71d3ce | |||
| cd0f24fd8c | |||
| c1c3289b02 | |||
| b13b3467af | |||
| 0569d5b880 | |||
| 80bf502b11 | |||
| fbb5adcebb | |||
| 3aac623a4b | |||
| 10f5bd211b | |||
| 3387395932 | |||
| c269b2ceff | |||
| 20c6edd58e | |||
| 4854ffa683 | |||
| 0baad9e393 | |||
| 3ddcd3050e | |||
| ed86c5e16c | |||
| 2030bf7599 | |||
| 4571ed2438 | |||
| b46bb9b5cf | |||
| 2d4db9604a | |||
| b65d716029 | |||
| 259a42bfdc | |||
| 562c879751 | |||
| 746dbe22b8 | |||
| 2a49e98a80 | |||
| 20ee2318cd | |||
| 21ac2eca88 | |||
| afdff355de | |||
| 3f14a25852 | |||
| abc48390ca | |||
| 8dd5ebf053 | |||
| 65c9ae6bfd | |||
| 5188645313 | |||
| 2260cde321 | |||
| f76f7a6ad4 | |||
| 33c694f5a3 | |||
| a8890b11e0 | |||
| c8525b311f | |||
| 99d3afbe1a | |||
| 1f1a88a06c | |||
| bf6b5cc389 | |||
| 9967aab3dd | |||
| 2fef5f3e78 | |||
| d3edecb133 | |||
| 6ecf4ec6a0 | |||
| 57bc32edf5 | |||
| 5beeb208be | |||
| 2bf3f80364 | |||
| 3c0ed1350a | |||
| 2625e05953 | |||
| 461d994dea | |||
| c2ee6d2eaf | |||
| ebad326256 | |||
| 3dc47f39ea | |||
| aaacfb0888 | |||
| 45d22c83d4 | |||
| 45801a89ea | |||
| 1a1f175ac1 | |||
| 922ff5622f | |||
| b4a8caba1c | |||
| bab02ce9f7 | |||
| 3a09fb3777 | |||
| 7caa7f8144 | |||
| 1d9e2b7ad0 | |||
| 2a3e690373 | |||
| 3f48f28079 | |||
| 9083b1f35c | |||
| a18ff7b502 | |||
| 0460b892d8 | |||
| 4b9fcdaf9f | |||
| 91bd3f0cdb | |||
| c96f8aef36 | |||
| bd48c4770b | |||
| 0a616cee36 | |||
| b8923b1411 | |||
| 57e26f4b5e | |||
| ffd49691f5 | |||
| f956563444 | |||
| b54123f8a3 | |||
| 976c01051d | |||
| d14931f77f | |||
| 2a2650376c | |||
| 17302fb6e0 | |||
| 54cc9e0545 | |||
| ff2c2d41ad | |||
| db6a68e8ed | |||
| 967ac584a4 | |||
| 50b080cf61 | |||
| a975d40ceb | |||
| e1b1342655 | |||
| 8a6ba0eb8e | |||
| 87df5766f0 | |||
| 4acebc3186 | |||
| bd206cbbd2 | |||
| c846cc582a | |||
| be7b4e5064 | |||
| 61b701f930 | |||
| 8b83911017 | |||
| 2274e6395d | |||
| f7c9da6826 | |||
| bf6c6ac0c4 | |||
| 405d83b539 | |||
| 362e7c67db | |||
| 29e2ce7bd1 | |||
| a985d021b6 | |||
| c907c20705 | |||
| 5b4d9cd7d7 | |||
| 6ae59ab67c | |||
| 6374f52585 | |||
| 398d32821e | |||
| 771206e1b2 | |||
| c47a43e5ce | |||
| 62edfbb651 | |||
| b17f697f69 | |||
| 8b00509cb2 | |||
| ac9e9665dc | |||
| 89bb1226ac | |||
| 94cc359c9f | |||
| 8999839538 | |||
| 09b2cd7b46 | |||
| 4b1bd9bfd5 | |||
| 468b5520bd | |||
| c0dee366c0 | |||
| c767ed7159 | |||
| 10e72cc214 | |||
| 7e6e709031 | |||
| a2514545f4 | |||
| 57e8fc1cb1 | |||
| 6d0d0f9b0b | |||
| 88aea7f780 | |||
| e4f7fd910c | |||
| 7befb457f2 | |||
| c22784d5a4 | |||
| 404cab2548 | |||
| ef56bf3cb4 | |||
| 3920cc6919 | |||
| 5a049857f5 | |||
| 97a9c91baf | |||
| 55b5acb62e | |||
| 34f7c3a463 | |||
| 3002c0a478 | |||
| 433983e2ca | |||
| 0a33883d49 | |||
| 5d7f55fa97 | |||
| acad63f838 | |||
| ed2ae75c8a | |||
| dbca85c0e8 | |||
| 78a55507cd | |||
| c3e16dac92 | |||
| 6412361680 | |||
| 3b3fe4d946 | |||
| d1d8a32cff | |||
| 8739bd8ad9 | |||
| 77d3eae4d6 | |||
| e83b7c3a69 | |||
| f4e55f9d45 | |||
| 8bde8ca7b4 | |||
| d00b9eb8ec | |||
| 2f5682e25a | |||
| 0d6907c76c | |||
| 710ed9c5d1 | |||
| c53ba92139 | |||
| 5e2fe112b0 | |||
| 001c400f47 | |||
| 983a4da111 | |||
| d42a29570c | |||
| c2e35ddd9c | |||
| 0f91d66b49 | |||
| 6ac811076e | |||
| 2530caa16e | |||
| a1a50041dd | |||
| 65bdd25173 | |||
| 096b3c98a4 | |||
| fbd7fa4464 | |||
| 0c7e545b42 | |||
| ed05174fc8 | |||
| a8db4c4fa5 | |||
| ab1ce7515c | |||
| 34090a1d3e | |||
| 60c925a721 | |||
| 36d5f42b66 | |||
| 3075ad857e | |||
| 4056287d3d | |||
| 537d7e089f | |||
| b10276bb34 | |||
| e685528fd3 | |||
| 7498ab9957 | |||
| 9f19deb1e2 | |||
| 616741888e | |||
| 5b4f0a0bbb | |||
| 00a5437dde | |||
| 379d432365 | |||
| 744c560255 | |||
| 28b9a70e6b | |||
| f5f1a052ca | |||
| e8f28cc681 | |||
| 23c985ffd6 | |||
| 3dc781c89c | |||
| 4d7f456be5 | |||
| 154572e547 | |||
| 3469fa5c93 | |||
| dcce01fa9c | |||
| 56bc0d817f | |||
| 71706d5e93 | |||
| b8c51c9bf0 | |||
| e68b421de3 | |||
| 32ca88dbf8 | |||
| 4d83dd2c24 | |||
| 330a91441a | |||
| affda2d8fe | |||
| e7f3c280f0 | |||
| 89c27cfcca | |||
| 9303361d6b | |||
| 82c8246c25 | |||
| c0f2dddfa1 | |||
| db8ee18b5d | |||
| e3c9ecd26e | |||
| 5df19e1c3d | |||
| 3384ad2235 | |||
| d693ccd4f0 | |||
| 47547e2397 | |||
| 51f46d9a69 | |||
| 04a8570d48 | |||
| 806c343b80 | |||
| 17cb8f9459 | |||
| 1fdecd1ad4 | |||
| 900b53f165 | |||
| 6356fbb2f4 | |||
| 979ece9208 | |||
| a1df80a7f7 | |||
| a5bb41a31b | |||
| 9b527b1810 | |||
| 2b312fdbb4 | |||
| 2d9c130839 | |||
| a569c67371 | |||
| ada0f3d8b4 | |||
| 192f5a1bd7 | |||
| 70d77fd851 | |||
| f7a8715657 | |||
| 5d8c86923b | |||
| a6e53bd419 | |||
| 08756af9f5 | |||
| 447df60823 | |||
| 3d792ea4df | |||
| 26a38913a8 | |||
| 238335dec6 | |||
| 1efbde7d46 | |||
| 1e92313dcd | |||
| e174255ddb | |||
| 4b0841b17d | |||
| e136905e75 | |||
| 7c0d9c7009 | |||
| c251865538 | |||
| e079148249 | |||
| fab861e8bd | |||
| d0c696c1bc | |||
| 7b75c04b30 | |||
| 572cfd67af | |||
| c7a07ded12 | |||
| 4e7181fb7e | |||
| fce1cc681a | |||
| a7b62fc2a9 | |||
| 6fcecb5666 | |||
| d837739e4f | |||
| a530bc7a6f | |||
| 32a7c9aee6 | |||
| 5fe10c118d | |||
| 815fef458c | |||
| 20eff3358a | |||
| 98c1503bed | |||
| 7c8093b70f | |||
| edba5bcf89 | |||
| 0a75eb93d3 | |||
| a2c30b1849 | |||
| 386cb2c912 | |||
| 60dc533fe8 | |||
| 6c0a9714fc | |||
| 15469aeaf7 | |||
| a8ff8b524b | |||
| 2378080ae8 | |||
| 23e16b26f1 | |||
| 3353d989bb | |||
| 58659b9b1a | |||
| f4eab9bf58 | |||
| 57f5f68804 | |||
| 5c4b12dfc2 | |||
| 99ff846209 | |||
| 37dd2b0064 | |||
| 9c20658e26 | |||
| 6e6e80bcfc | |||
| 185ad88bc8 | |||
| 54405135c0 | |||
| d7cf14857e | |||
| 5417c426e3 | |||
| 3f6621b087 | |||
| 151fb59e27 | |||
| a2902280b0 | |||
| 10832ad60a | |||
| 121f7780c2 | |||
| 25d233e832 | |||
| 46de8229dd | |||
| 813956721d | |||
| 302bf05f57 | |||
| 977e44d44a | |||
| 105ac6306a | |||
| 3c1734bdb2 | |||
| 9546843bc2 | |||
| bf89c53f33 | |||
| 406e69ab1d | |||
| 753cb4f01c | |||
| 40c34644b8 | |||
| b3b534cd6d | |||
| 491886a5c2 | |||
| 44c096c366 | |||
| 68eafbfba7 | |||
| dd5fd62b41 | |||
| a1bc46e473 | |||
| eedaf1966e | |||
| 3cbbcf18c8 | |||
| 9a70c84179 | |||
| 9546636f0a | |||
| ecd9f1e2cf | |||
| 310321ce0e | |||
| 39c0b79f85 | |||
| 70e93fb493 | |||
| 8a202f0ecc | |||
| 53a77a5bdb | |||
| b83ad1899a | |||
| 80aee0d126 | |||
| df82aeed76 | |||
| 70d67dd7dd | |||
| 922220c748 | |||
| 819509b63a | |||
| db072442c8 | |||
| c1efd39df7 | |||
| f5dca813fb | |||
| 1bc8e0d6c1 | |||
| 0fba4a638d | |||
| 71530f253d | |||
| 274ed3a917 | |||
| ebae27272e | |||
| 3049ff768e | |||
| f6bff9683d | |||
| 013c10e7fb | |||
| af38cb6dff | |||
| 3d461b771f | |||
| cee35869ba | |||
| b6a2e89c17 | |||
| 7cf03bd74e | |||
| 776dec5c74 | |||
| 23b9d77217 | |||
| 06dc5136f7 | |||
| b8b6263c75 | |||
| 8cc98a53f3 | |||
| 67e0ecfa0b | |||
| b7f52f2521 | |||
| c6e9939024 | |||
| dd3cbda0c7 | |||
| 260c7cd0c0 | |||
| ee6b2da037 | |||
| f52c95ed55 | |||
| d2ed8d9287 | |||
| a9c60a45e9 | |||
| 0cfe5b6c76 | |||
| c8115c674d | |||
| b67dfbd086 | |||
| 4e4d0fe883 | |||
| 34c311a562 | |||
| 1da0f157de | |||
| 545f54a89c | |||
| dad815f631 | |||
| 9ca09d0a85 | |||
| 71f8b663cb | |||
| be9a26611f | |||
| d9362d2634 | |||
| 09d6fa833f | |||
| c7ff93fdf4 | |||
| c2e73c74a6 | |||
| d2e38364e6 | |||
| 404eefc3da | |||
| ba1c429554 | |||
| 0df47c19c7 | |||
| 027df32564 | |||
| 21353d2b31 | |||
| f1df8ead68 | |||
| dbac5b773f | |||
| fb1cdeeac1 | |||
| 8a66e883ec | |||
| 1922bc9edd | |||
| cc41d69954 | |||
| 771b7a1821 | |||
| a3fa0bd79d | |||
| 19e68bac4d | |||
| 983e9f2f2b | |||
| 311b5e1d04 | |||
| 9b002b94ca | |||
| 69cbb06470 | |||
| 2b25071e8c | |||
| c9d465ca2a | |||
| e1dfb15ba9 | |||
| 7e44eab63c | |||
| 7e7a762617 | |||
| d5c2d51dea | |||
| 7d2e48a99b | |||
| 4ea9e5c11f | |||
| 8f96f50a84 | |||
| c90bf43d17 | |||
| 2549e2a2de | |||
| 658ca48137 | |||
| c64369e95f | |||
| 6eec7789cc | |||
| 1b6f34069a | |||
| 98b4d26676 | |||
| 62ae7ef2bd | |||
| c9a58e5cfa | |||
| 4d5c4621c7 | |||
| 2af072ea7f | |||
| 2341f5be68 | |||
| a100af81be | |||
| 6f21556b81 | |||
| 8d97235f41 | |||
| 0559abd323 | |||
| d0211c5dc6 | |||
| f42cf4c0f4 | |||
| a8d4ba5758 | |||
| a94d08606f | |||
| 0a213389f4 | |||
| 7041a4dac6 | |||
| 97cc519bcb | |||
| 6fffd7fbae | |||
| d2bd78b366 | |||
| e758d524de | |||
| d967ec0b80 | |||
| 4509b1a2a7 | |||
| 4626550c53 | |||
| 7b469016c1 | |||
| 29e9039176 | |||
| 370728433a | |||
| f6b07ceda8 | |||
| 2c08118d6d | |||
| 7c8deb8a48 | |||
| b427fd1364 | |||
| 611f85113c | |||
| 76791c1961 | |||
| 7b28910cc2 | |||
| 841f11c21a | |||
| f845be683c | |||
| a1e2132c12 | |||
| dec83e2ef5 | |||
| f9897c0191 | |||
| 668fadb737 | |||
| 1f06e7982a | |||
| 7336d92a6d | |||
| 7b490b03d9 | |||
| 7958ff7105 | |||
| 1492d808f3 | |||
| 84fe232b0c | |||
| 51b8d70cc6 | |||
| 576ce4983d | |||
| b1170b2ab9 | |||
| 41d0675886 | |||
| 5048ce5d45 | |||
| 268f168218 | |||
| 08d4cb15aa | |||
| 2e252aacac | |||
| d23a1f5739 | |||
| 863ed513c0 | |||
| 18f28270f0 | |||
| 11ced4eecf | |||
| 44e73bac96 | |||
| 8ba9016580 | |||
| 17171b2166 | |||
| 34731af074 | |||
| 654dac1acc | |||
| 90ebaf2d88 | |||
| 2b804f92b5 | |||
| e1e60b5572 | |||
| 4b9f69a666 | |||
| 1c86a16c84 | |||
| 0cf3aeef57 | |||
| b04295ad44 | |||
| 6147c23c0f | |||
| cad3b7726d | |||
| 895afcc58c | |||
| df6d77289c | |||
| 4ad6ea8190 | |||
| a480c6ce87 | |||
| 17c176084c | |||
| 5fdff961a6 | |||
| 475f1f1b2a | |||
| 1a23b0c8d1 | |||
| 92b5b72350 | |||
| b639466a4f | |||
| 0347883fdd | |||
| 46cc410da7 |
@@ -1,3 +1,4 @@
|
||||
/.idea/
|
||||
/.*project
|
||||
/.settings
|
||||
/.autotools
|
||||
@@ -6,3 +7,6 @@ radio/src/bootloader/bootloader_ramBoot*
|
||||
*.lbm
|
||||
*.o
|
||||
/doc/
|
||||
*.stamp
|
||||
radio/src/lua/lua_fields_*.txt
|
||||
radio/src/lua/lua_exports_*.txt
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
language: cpp
|
||||
|
||||
before_install:
|
||||
- sudo apt-get remove cmake cmake-data --yes
|
||||
- sudo add-apt-repository ppa:george-edison55/precise-backports --yes
|
||||
- sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded --yes
|
||||
- sudo apt-get update
|
||||
|
||||
install:
|
||||
- sudo apt-get install -y xvfb lcov cmake cmake-data bc curl gcc-arm-none-eabi gcc-avr avr-libc avrdude libqtcore4 libqt4-dev qt4-qmake g++ libxerces-c-dev xsdcxx libsdl1.2-dev libusb-1.0-0 libphonon-dev phonon libqtwebkit-dev python-qt4 python-qt4-dev libfox-1.6-dev libgtest-dev
|
||||
|
||||
script:
|
||||
- radio/util/commit-tests.sh
|
||||
- mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DPCB=TARANIS .. && cmake --build .
|
||||
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
add_subdirectory(${RADIO_SRC_DIRECTORY})
|
||||
add_subdirectory(${COMPANION_SRC_DIRECTORY})
|
||||
@@ -7,6 +7,8 @@
|
||||
<a href="http://aerialtechhobbies.com">Aerial Tech Hobbies</a>
|
||||
<a href="http://litepilots.com">LitePilots</a>
|
||||
<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>
|
||||
|
||||
Mario Sette
|
||||
Felice Baratto
|
||||
@@ -24,7 +26,6 @@ Chris Guy
|
||||
Adrien Gravouille
|
||||
Thomas Black
|
||||
Marc Lucht
|
||||
Michel Baily
|
||||
Zdenek Trojanek
|
||||
Martin Hotar
|
||||
Stefan Grundevik
|
||||
@@ -111,7 +112,6 @@ Erhard Werner
|
||||
Stig Jøran Moen
|
||||
Keith Hertzog
|
||||
Christophe Dauvergne
|
||||
Michel Baily
|
||||
Tauno Rautakorpi
|
||||
Sven Assmus
|
||||
Paul Dittman
|
||||
@@ -400,7 +400,6 @@ Colin Rycroft
|
||||
Emanuel Stassar
|
||||
Michael Gregory
|
||||
Robert Russell
|
||||
Gordon Stahl
|
||||
Felix Kaiser
|
||||
Joshua Bardwell
|
||||
Davd Goodall
|
||||
@@ -416,7 +415,6 @@ Andrea Montefusco
|
||||
Paul Luby
|
||||
Donald L Webster
|
||||
Kenneth Frehafer
|
||||
Peter McHenry
|
||||
Matthias Hase
|
||||
Markus Wolf
|
||||
Andrew Fazio
|
||||
@@ -587,7 +585,6 @@ Dietmar Drees
|
||||
Jürgen Monden
|
||||
David Morgan
|
||||
Andrew Fernie
|
||||
Michel Baily
|
||||
Donald Burke
|
||||
Ronald Donker
|
||||
Fredie Singh
|
||||
@@ -598,7 +595,6 @@ Julien Gérard
|
||||
Alexandre d'Alton
|
||||
Peter Mergaerts
|
||||
Jan Houwers
|
||||
Gordon Stahl
|
||||
Christian Grandjean
|
||||
Roger Bergevin
|
||||
NorthSide
|
||||
@@ -770,3 +766,87 @@ Ron Powell
|
||||
Alain Labonne
|
||||
Carol Sills
|
||||
Franck Aßmann
|
||||
Larry Anderson
|
||||
Mikael Wallbäck
|
||||
Wes Warner
|
||||
Christoffer H Henni
|
||||
Donna Bayer
|
||||
Garry Ogilvie
|
||||
Karlheinz Sirsch
|
||||
Fred Larssen
|
||||
Rob Coppock
|
||||
Franz Josef Hahn
|
||||
Serge Ribault
|
||||
Tanguy Le Moign
|
||||
Barrett Powell
|
||||
Patrice Lafeuille
|
||||
Martin Blume
|
||||
Marek Kopyto
|
||||
Marco Lange
|
||||
Gary Nix
|
||||
Jack Oliphant
|
||||
John Lever
|
||||
Adolphe Montefiore
|
||||
Steven De Weerdt
|
||||
Håkan Berggen
|
||||
Ayelet Egosi
|
||||
Jean-Frederic Gaudreault
|
||||
Jim Wagner
|
||||
Lee Scott
|
||||
Roger Keatley
|
||||
Sherman Lovell
|
||||
Hugh Caldwell
|
||||
JB Fisher Company
|
||||
Michels Bernhard
|
||||
Pietro Rossin
|
||||
Carsten Wache
|
||||
Brock White
|
||||
Steven Poretz
|
||||
David Huelster
|
||||
Gordon Stahl (monthly)
|
||||
John Mathison
|
||||
Richard Duczmal
|
||||
Gregory Barron
|
||||
Marcel Fischer
|
||||
Klas Mälman
|
||||
Viljo Liukku
|
||||
Eric Smith
|
||||
Sven Assmus
|
||||
Luke Mole
|
||||
NorthSide
|
||||
Hannes Mössler
|
||||
James Kaufman
|
||||
Ravi Gupta
|
||||
Lexington S Morley
|
||||
Ralph Segar
|
||||
Frédéric Devillard
|
||||
Cory Theurer
|
||||
Valentinos Zachariou
|
||||
Garrett Paquette
|
||||
Heung Jin Choi
|
||||
Kerry Cochrell
|
||||
Doug Miller
|
||||
Andrzej Weydmann
|
||||
Chair-man.nl
|
||||
Eric Beier
|
||||
Jay Warren
|
||||
Marian Matej
|
||||
Alastair Smith
|
||||
Timothy Senecal
|
||||
Dietmar Drees
|
||||
Bruce Jones
|
||||
Adil Busaidy
|
||||
Herman Hofman
|
||||
Jean Paul Michel
|
||||
Peter McHenry
|
||||
Julien lecoquierre
|
||||
Jean-Marie Clay
|
||||
Robert Nicoll
|
||||
Dan Nixon
|
||||
Ewald Moehring
|
||||
Giovanni Carnesecchi
|
||||
Paul Dumsday
|
||||
Tadeusz Adamowski
|
||||
Andrew Newton
|
||||
Neil Horne
|
||||
Kerstin Appelqvist
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
##OpenTX Next Branch
|
||||
##OpenTX 2.2 Branch
|
||||
|
||||
You have found your way to the GitHub repository site for the OpenTX Next Branch. This code branch holds the source code for the ongoing development.
|
||||
[](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 stable release code is not here, it is in the master branch.
|
||||
Under no circumstances build and use software from this branch for real world application. At times you will be more or less guaranteed to crash your plane and destroy all your model settings.
|
||||
The ongoing development on 2.2.x is done in this branch.
|
||||
|
||||
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,25 @@
|
||||
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}
|
||||
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_command(
|
||||
OUTPUT ${target}.png
|
||||
OUTPUT ${target}.specs
|
||||
COMMAND ${RADIO_DIRECTORY}/util/font2png.py ${font} ${size} ${bold} ${target}
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
add_custom_target(ttf_${radio}_${name} DEPENDS ${target}.png ${target}.specs)
|
||||
endmacro(add_truetype_font_target)
|
||||
@@ -0,0 +1,38 @@
|
||||
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" "+%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,3 +1,95 @@
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.5 / 2015-11-05</h2>
|
||||
|
||||
Notice: version 2.1.4 was skipped by the OpenTX team to avoid confusion with FrSky's release of OpenTX 2.1.4
|
||||
|
||||
<ul>
|
||||
<li>Fixed: changing any setting on the telemetry panel does not set the file as being modified (<a href=https://github.com/opentx/opentx/issues/2875>#2875</a>)</li>
|
||||
<li>Print model fix for "Play value.... not on startup" (<a href=https://github.com/opentx/opentx/issues/2736>#2736</a>)</li>
|
||||
<li>Top LCD Timer could not be selected for X9E (<a href=https://github.com/opentx/opentx/issues/2850>#2850</a>)</li>
|
||||
<li>More informative error/info messages when openin eepe files (<a href=https://github.com/opentx/opentx/issues/2778>#2778</a>)</li>
|
||||
<li>Print model fix for curves (<a href=https://github.com/opentx/opentx/issues/2896>#2896</a>)</li>
|
||||
<li>Added missing special functions (bind, range check, set failsafe) (<a href=https://github.com/opentx/opentx/issues/2753>#2753</a>)</li>
|
||||
<li>Some defaults missing when changing telemetry formula, update propagation issues (<a href=https://github.com/opentx/opentx/issues/2928>#2928</a>)</li>
|
||||
<li>Fixed wrong import of Logical switches from OpenTX 2.0.x version (<a href=https://github.com/opentx/opentx/issues/2942>#2942</a>)</li>
|
||||
<li>Fixed a problem with updates path on Windows (<a href=https://github.com/opentx/opentx/issues/2876>#2876</a>)</li>
|
||||
<li>Edge representation unified (changed from "no release" to "instant") (<a href=https://github.com/opentx/opentx/issues/2837>#2837</a>)</li>
|
||||
<li>Added channel names on failsafe sliders (<a href=https://github.com/opentx/opentx/issues/3021>#3021</a>)</li>
|
||||
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
|
||||
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes: <a href=https://github.com/opentx/opentx/issues/2994>#2994</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/3016>#3016</a>,
|
||||
<a href=https://github.com/opentx/opentx/issues/3012>#3012</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.3 / 2015-09-09</h2>
|
||||
|
||||
<ul>
|
||||
<li>Fix missing translations in inputs/mixes tabs, print and compare dialogs (<a href=https://github.com/opentx/opentx/issues/2847>#2847</a>)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.2 / 2015-09-07</h2>
|
||||
|
||||
<ul>
|
||||
<li>Fixed: Lua model scripts outputs not working in a simulator (<a href=https://github.com/opentx/opentx/issues/2684>#2684</a>)</li>
|
||||
<li>Fixed a problem of Companion 2.1 trying to install into 2.0 path.
|
||||
The effect will only be visible for the users that did not install any of the previous 2.1.x versions.
|
||||
(<a href=https://github.com/opentx/opentx/issues/2645>#2645</a>)</li>
|
||||
<li>Added missing SDL libraries to MAC package (<a href=https://github.com/opentx/opentx/issues/2678>#2678</a>)</li>
|
||||
<li>Added used channels check/warning in Wizard (<a href=https://github.com/opentx/opentx/issues/2091>#2091</a>)</li>
|
||||
<li>Model Print and Model Compare improvements and fixes (<a href=https://github.com/opentx/opentx/issues/2734>#2734</a>, <a href=https://github.com/opentx/opentx/issues/2737>#2737</a>, <a href=https://github.com/opentx/opentx/issues/2576>#2576</a>)</li>
|
||||
<li>Negative telemetry offset value was reset when writing back to radio (<a href=https://github.com/opentx/opentx/issues/2738>#2738</a>)</li>
|
||||
<li>Telemetry sensor names were not displayed (<a href=https://github.com/opentx/opentx/issues/2807>#2807</a>)</li>
|
||||
<li>Mixes multiplex representation now the same as on the radio (<a href=https://github.com/opentx/opentx/issues/2808>#2808</a>)</li>
|
||||
<li>Fixed language-related startup crash on Mac (<a href=https://github.com/opentx/opentx/issues/2815>#2815</a>)</li>
|
||||
<li>Fixed issues with conversion from 2.0 (<a href=https://github.com/opentx/opentx/issues/2809>#2809</a>, <a href=https://github.com/opentx/opentx/issues/2800>#2800</a>)</li>
|
||||
<li>Fixed Throttle source export issue on X9E (<a href=https://github.com/opentx/opentx/issues/2844>#2844</a>)</li>
|
||||
<li>Added support for the AR9X replacement board (prototype) for the Turnigy 9X radio, info <a href=http://www.rcgroups.com/forums/showthread.php?t=2479552>here</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.1 / 2015-08-06</h2>
|
||||
<ul>
|
||||
<li>Vario source and center silent options were not saved(<a href=https://github.com/opentx/opentx/issues/2476>#2476</a>)</li>
|
||||
<li>DSM receiver numbers for external module were not converted from previous version EEPROM (<a href=https://github.com/opentx/opentx/issues/2474>#2474</a>)</li>
|
||||
<li>Precision incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2479>#2479</a>)</li>
|
||||
<li>Unit incorrectly set for Calculated->Cells sensor (<a href=https://github.com/opentx/opentx/issues/2485>#2485</a>)</li>
|
||||
<li>Fixed import/export of trim values (<a href=https://github.com/opentx/opentx/issues/2484>#2484</a>)</li>
|
||||
<li>Removed constant access to floppy disk (<a href=https://github.com/opentx/opentx/issues/2160>#2160</a>)</li>
|
||||
<li>Telemetry view script combo box list was empty (<a href=https://github.com/opentx/opentx/issues/2465>#2465</a>)</li>
|
||||
<li>Telemetry view bars ranges not transfered to radio (<a href=https://github.com/opentx/opentx/issues/2491>#2491</a>)</li>
|
||||
<li>Fixed Standalone simulator radio selection display problem (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
|
||||
<li>Added missing simulation libraries and enabled side by side installation of Companion 2.0 and 2.1 on Linux (<a href=https://github.com/opentx/opentx/issues/2500>#2500</a>)</li>
|
||||
<li>Standalone simulator now remembers which radio was simulated in previous session (<a href=https://github.com/opentx/opentx/issues/2503>#2503</a>)</li>
|
||||
<li>Radio calibration value were not displayed (<a href=https://github.com/opentx/opentx/issues/2502>#2502</a>)</li>
|
||||
<li>Fixed Vario / Voltage / Current sources export problem</li>
|
||||
<li>Writing model settings to 9XR-PRO did not work (<a href=https://github.com/opentx/opentx/issues/2402>#2402</a>, <a href=https://github.com/opentx/opentx/issues/2517>#2517</a>)</li>
|
||||
<li>Model Print and Model Compare improvements</li>
|
||||
<li>Fixed Companion OSX version (<a href=https://github.com/opentx/opentx/issues/2549>#2549</a>)</li>
|
||||
<li>Firmware nightly builds are now downloadable from nightly builds of Companion (<a href=https://github.com/opentx/opentx/issues/2526>#2526</a>, <a href=https://github.com/opentx/opentx/issues/2634>#2634</a>)</li>
|
||||
<li>Fixed telemetry item lists (<a href=https://github.com/opentx/opentx/issues/2541>#2541</a>)</li>
|
||||
<li>Fixed missing pots P1..P3 for 9X (<a href=https://github.com/opentx/opentx/issues/2543>#2543</a>)</li>
|
||||
<li>Fixed "Invalid model and settings" error message when writing models and settings to the radio (<a href=https://github.com/opentx/opentx/issues/2544>#2544</a>)</li>
|
||||
<li>Global Functions fixes (<a href=https://github.com/opentx/opentx/issues/2558>#2558</a>)</li>
|
||||
<li>Export to Google Earth now working (only) with the new telemetry fields (GPS, GAlt and GSpd) (<a href=https://github.com/opentx/opentx/issues/2546>#2546</a>)</li>
|
||||
<li>Fixed unsuccessful writing of setting to the radio for 9XR PRO (<a href=https://github.com/opentx/opentx/issues/2605>#2605</a>)</li>
|
||||
<li>Fixed missing LUA script outputs in special function "Play Value" (<a href=https://github.com/opentx/opentx/issues/2649>#2649</a>)</li>
|
||||
<li>Various texts and translations corrections</li>
|
||||
<li>Various small bug-fixes</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Version 2.1.0 / 2015-07-16</h2>
|
||||
<ul>
|
||||
<li>SD card synchronizaton tool</li>
|
||||
|
||||
@@ -1,101 +1,115 @@
|
||||
PROJECT( companion )
|
||||
include(Macros)
|
||||
|
||||
SET( C9X_VERSION_MAJOR "2" )
|
||||
SET( C9X_VERSION_MINOR "1" )
|
||||
SET( C9X_VERSION_REVISION "0" )
|
||||
SET( C9X_VERSION ${C9X_VERSION_MAJOR}.${C9X_VERSION_MINOR}.${C9X_VERSION_REVISION} )
|
||||
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")
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
|
||||
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(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
OPTION(DEBUG_IMPORT "Turns on debug output for EEPROM import") # Disabled by default
|
||||
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()
|
||||
|
||||
IF(DEBUG_IMPORT)
|
||||
ADD_DEFINITIONS( -DDEBUG_MODEL_IMPORT)
|
||||
MESSAGE( STATUS "EEPROM import debugging enabled" )
|
||||
ENDIF(DEBUG_IMPORT)
|
||||
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 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 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()
|
||||
|
||||
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()
|
||||
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 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()
|
||||
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()
|
||||
|
||||
FIND_PACKAGE(Qt4 4.8.4 REQUIRED)
|
||||
SET( QT_USE_QTNETWORK True )
|
||||
SET( QT_USE_QTXML True )
|
||||
INCLUDE( ${QT_USE_FILE} )
|
||||
message(STATUS "Looking for QT lupdate ")
|
||||
find_package(Lupdate)
|
||||
if(LUPDATE_FOUND)
|
||||
message("QT lupdate: " ${LUPDATE_EXECUTABLE})
|
||||
else()
|
||||
message("QT lupdate not found!")
|
||||
endif()
|
||||
|
||||
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()
|
||||
add_definitions(-DQXT_STATIC)
|
||||
|
||||
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_CUSTOM_COMMAND(
|
||||
add_custom_command(
|
||||
COMMAND ${XSDCXX_EXECUTABLE} cxx-tree --root-element-all --generate-serialization --output-dir ${PROJECT_BINARY_DIR}/ ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/radio.hxx ${PROJECT_BINARY_DIR}/radio.cxx
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/radio.xsd
|
||||
)
|
||||
|
||||
IF( MSVC )
|
||||
SET(CMAKE_CXX_FLAGS "/EHsc /LD")
|
||||
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/winbuild C:/Programs/pthreads/Pre-built.2/include C:/Programs/msinttypes)
|
||||
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)
|
||||
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()
|
||||
|
||||
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}
|
||||
${COMPANION_SRC_DIRECTORY}/qxtcommandoptions
|
||||
)
|
||||
|
||||
add_subdirectory(shared)
|
||||
@@ -104,6 +118,7 @@ add_subdirectory(generaledit)
|
||||
add_subdirectory(simulation)
|
||||
add_subdirectory(firmwares/opentx/simulator)
|
||||
add_subdirectory(qcustomplot)
|
||||
add_subdirectory(qxtcommandoptions)
|
||||
|
||||
set(common_SRCS
|
||||
eeprominterface.cpp
|
||||
@@ -122,7 +137,7 @@ set(common_SRCS
|
||||
firmwares/opentx/opentxinterface.cpp
|
||||
file.cpp
|
||||
appdata.cpp
|
||||
)
|
||||
)
|
||||
|
||||
qt4_wrap_cpp(common_SRCS)
|
||||
|
||||
@@ -142,6 +157,7 @@ set(companion_SRCS
|
||||
apppreferencesdialog.cpp
|
||||
fwpreferencesdialog.cpp
|
||||
burnconfigdialog.cpp
|
||||
multimodelprinter.cpp
|
||||
comparedialog.cpp
|
||||
contributorsdialog.cpp
|
||||
releasenotesdialog.cpp
|
||||
@@ -156,16 +172,17 @@ set(companion_SRCS
|
||||
flashfirmwaredialog.cpp
|
||||
flasheepromdialog.cpp
|
||||
printdialog.cpp
|
||||
modelprinter.cpp
|
||||
fusesdialog.cpp
|
||||
logsdialog.cpp
|
||||
downloaddialog.cpp
|
||||
splashlibrary.cpp
|
||||
splashlibrarydialog.cpp
|
||||
mainwindow.cpp
|
||||
companion.cpp
|
||||
radionotfound.cpp
|
||||
wizarddata.cpp
|
||||
wizarddialog.cpp
|
||||
)
|
||||
)
|
||||
|
||||
set(companion_MOC_HDRS
|
||||
apppreferencesdialog.h
|
||||
@@ -179,7 +196,7 @@ set(companion_MOC_HDRS
|
||||
releasenotesdialog.h
|
||||
releasenotesfirmwaredialog.h
|
||||
customizesplashdialog.h
|
||||
splashlibrary.h
|
||||
splashlibrarydialog.h
|
||||
splashlabel.h
|
||||
progresswidget.h
|
||||
progressdialog.h
|
||||
@@ -195,7 +212,9 @@ set(companion_MOC_HDRS
|
||||
radionotfound.h
|
||||
helpers.h
|
||||
wizarddialog.h
|
||||
)
|
||||
modelprinter.h
|
||||
multimodelprinter.h
|
||||
)
|
||||
|
||||
set(companion_UIS
|
||||
mdichild.ui
|
||||
@@ -209,84 +228,59 @@ set(companion_UIS
|
||||
printdialog.ui
|
||||
htmldialog.ui
|
||||
customizesplashdialog.ui
|
||||
splashlibrary.ui
|
||||
splashlibrarydialog.ui
|
||||
progresswidget.ui
|
||||
progressdialog.ui
|
||||
flashfirmwaredialog.ui
|
||||
flasheepromdialog.ui
|
||||
radionotfound.ui
|
||||
)
|
||||
)
|
||||
|
||||
set(companion_RCS
|
||||
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)
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
|
||||
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)
|
||||
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)
|
||||
|
||||
TODAY(DATE)
|
||||
NOW(TIME)
|
||||
if(WIN32)
|
||||
set(companion_SRCS ${companion_SRCS} icon.rc)
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_EXE_LINKER_FLAGS -mwindows)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
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}/firmwares/opentx/stamp-opentx.h.in ${CMAKE_CURRENT_BINARY_DIR}/stamp-opentx.h @ONLY)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
IF( WIN32 )
|
||||
SET( companion_SRCS ${companion_SRCS} icon.rc )
|
||||
IF ( NOT MSVC )
|
||||
SET(CMAKE_EXE_LINKER_FLAGS -mwindows)
|
||||
ENDIF( )
|
||||
ENDIF( )
|
||||
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)
|
||||
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )
|
||||
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
|
||||
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})
|
||||
|
||||
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 )
|
||||
add_definitions(-DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}")
|
||||
|
||||
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} )
|
||||
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()
|
||||
|
||||
ADD_DEFINITIONS( -DQT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}" )
|
||||
|
||||
IF( APPLE )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} MACOSX_BUNDLE ${companion_SRCS} ${companion_QM} )
|
||||
# OS X compiler no longer automatically includes /Library/Frameworks in search path
|
||||
SET( CMAKE_EXE_LINKER_FLAGS -F/Library/Frameworks )
|
||||
ELSE( )
|
||||
ADD_EXECUTABLE( ${PROJECT_NAME} WIN32 ${companion_SRCS} ${companion_QM} )
|
||||
ENDIF( )
|
||||
|
||||
target_link_libraries(companion generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
target_link_libraries(${COMPANION_NAME} generaledit modeledit simulation common qcustomplot shared ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${XERCESC_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS})
|
||||
|
||||
############# Standalone simu ###############
|
||||
|
||||
@@ -294,14 +288,14 @@ 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} )
|
||||
set(simu_SRCS ${simu_SRCS})
|
||||
qt4_wrap_cpp(simu_SRCS ${simu_MOC_HDRS})
|
||||
qt4_add_resources(simu_SRCS companion.qrc) # TODO not needed
|
||||
|
||||
if(WIN32)
|
||||
@@ -309,139 +303,142 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
add_executable(simulator MACOSX_BUNDLE ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} MACOSX_BUNDLE ${simu_SRCS})
|
||||
else()
|
||||
add_executable(simulator WIN32 ${simu_SRCS})
|
||||
add_executable(${SIMULATOR_NAME} WIN32 ${simu_SRCS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(simulator simulation common ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
target_link_libraries(${SIMULATOR_NAME} simulation common qxtcommandoptions ${QT_LIBRARIES} ${QT_QTMAIN_LIBRARY} ${PTHREAD_LIBRARY} ${SDL_LIBRARY} ${PHONON_LIBS} ${OPENTX_SIMULATOR_LIBS})
|
||||
|
||||
############# Packaging ####################
|
||||
|
||||
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( TARGETS simulator DESTINATION ${CMAKE_INSTALL_PREFIX}/bin )
|
||||
INSTALL( FILES companion.desktop DESTINATION share/applications )
|
||||
INSTALL( FILES images/linuxicons/16x16/companion.png DESTINATION /usr/share/icons/hicolor/16x16/apps )
|
||||
INSTALL( FILES images/linuxicons/22x22/companion.png DESTINATION /usr/share/icons/hicolor/22x22/apps )
|
||||
INSTALL( FILES images/linuxicons/24x24/companion.png DESTINATION /usr/share/icons/hicolor/24x24/apps )
|
||||
INSTALL( FILES images/linuxicons/32x32/companion.png DESTINATION /usr/share/icons/hicolor/32x32/apps )
|
||||
INSTALL( FILES images/linuxicons/48x48/companion.png DESTINATION /usr/share/icons/hicolor/48x48/apps )
|
||||
INSTALL( FILES images/linuxicons/128x128/companion.png DESTINATION /usr/share/icons/hicolor/128x128/apps )
|
||||
INSTALL( FILES images/linuxicons/256x256/companion.png DESTINATION /usr/share/icons/hicolor/256x256/apps )
|
||||
INSTALL( FILES images/linuxicons/512x512/companion.png DESTINATION /usr/share/icons/hicolor/512x512/apps )
|
||||
INSTALL( FILES images/linuxicons/scalable/companion.svg DESTINATION /usr/share/icons/hicolor/scalable/apps )
|
||||
INSTALL( FILES ../targets/linux/45-companion-taranis.rules DESTINATION /etc/udev/rules.d/ )
|
||||
# Linux specific code
|
||||
SET(OperatingSystem "Linux")
|
||||
ELSE (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
INSTALL( TARGETS ${PROJECT_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(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${COMPANION_NAME} DESTINATION ${QT_BINARY_DIR})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
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}/companionInstall.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}/simulatorInstall.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 opentx-simulators ${PROJECT_BINARY_DIR}/companion/simulator.nsi
|
||||
COMMENT "Simulator Windows NSIS Installer")
|
||||
|
||||
ADD_CUSTOM_TARGET( installer
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/companionInstall.exe
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/simulatorInstall.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 ALL
|
||||
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 ${PROJECT_SOURCE_DIR}/../targets/mac/lib* companion.app/Contents/Frameworks
|
||||
#COMMAND rsync ${PROJECT_SOURCE_DIR}/../targets/mac/libcrypto.1.0.0.dylib companion.app/Contents/Frameworks
|
||||
COMMAND rsync -r --exclude=.svn ${PROJECT_SOURCE_DIR}/../targets/mac/qt_menu.nib companion.app/Contents/Resources/
|
||||
COMMAND rsync ${PROJECT_BINARY_DIR}/*.qm companion.app/Contents/translations
|
||||
COMMAND ${QT_BINARY_DIR}/macdeployqt companion.app
|
||||
WORKING_DIRECTORY ${WORK_DIR}
|
||||
DEPENDS ${PROJECT_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 ${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(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 )
|
||||
|
||||
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} -ts ${companion_TS}
|
||||
)
|
||||
ELSE()
|
||||
ADD_CUSTOM_TARGET( translations
|
||||
COMMAND ${LUPDATE_EXECUTABLE} ${CMAKE_SOURCE_DIR} -no-obsolete -ts ${companion_TS}
|
||||
)
|
||||
else()
|
||||
add_custom_target(translations
|
||||
COMMAND echo "Sorry, QT lupdate was not found."
|
||||
)
|
||||
ENDIF()
|
||||
)
|
||||
endif()
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "COMPANION")
|
||||
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
|
||||
# very poor trace-backs from the users when they report Companion crash
|
||||
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)
|
||||
|
||||
@@ -312,10 +312,10 @@ QString Profile::speaker() const { return _speaker; }
|
||||
QString Profile::stickPotCalib() const { return _stickPotCalib; }
|
||||
QString Profile::timeStamp() const { return _timeStamp; }
|
||||
QString Profile::trainerCalib() const { return _trainerCalib; }
|
||||
int Profile::currentCalib() const { return _currentCalib; }
|
||||
int Profile::txCurrentCalibration() const { return _txCurrentCalibration; }
|
||||
int Profile::gsStickMode() const { return _gsStickMode; }
|
||||
int Profile::ppmMultiplier() const { return _ppmMultiplier; }
|
||||
int Profile::vBatCalib() const { return _vBatCalib; }
|
||||
int Profile::txVoltageCalibration() const { return _txVoltageCalibration; }
|
||||
int Profile::vBatWarn() const { return _vBatWarn; }
|
||||
int Profile::vBatMin() const { return _vBatMin; }
|
||||
int Profile::vBatMax() const { return _vBatMax; }
|
||||
@@ -342,10 +342,10 @@ void Profile::speaker (const QString x) { store(x, _speaker, "Speake
|
||||
void Profile::stickPotCalib (const QString x) { store(x, _stickPotCalib, "StickPotCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::timeStamp (const QString x) { store(x, _timeStamp, "TimeStamp" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::trainerCalib (const QString x) { store(x, _trainerCalib, "TrainerCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::currentCalib (const int x) { store(x, _currentCalib, "currentCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txCurrentCalibration (const int x) { store(x, _txCurrentCalibration, "currentCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::gsStickMode (const int x) { store(x, _gsStickMode, "GSStickMode" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::ppmMultiplier (const int x) { store(x, _ppmMultiplier, "PPM_Multiplier" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatCalib (const int x) { store(x, _vBatCalib, "VbatCalib" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::txVoltageCalibration (const int x) { store(x, _txVoltageCalibration, "VbatCalib","Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatWarn (const int x) { store(x, _vBatWarn, "vBatWarn" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMin (const int x) { store(x, _vBatMin, "VbatMin" ,"Profiles", QString("profile%1").arg(index));}
|
||||
void Profile::vBatMax (const int x) { store(x, _vBatMax, "VbatMax" ,"Profiles", QString("profile%1").arg(index));}
|
||||
@@ -378,10 +378,10 @@ Profile& Profile::operator=(const Profile& rhs)
|
||||
speaker ( rhs.speaker() );
|
||||
stickPotCalib( rhs.stickPotCalib() );
|
||||
trainerCalib ( rhs.trainerCalib() );
|
||||
currentCalib ( rhs.currentCalib() );
|
||||
txCurrentCalibration ( rhs.txCurrentCalibration() );
|
||||
gsStickMode ( rhs.gsStickMode() );
|
||||
ppmMultiplier( rhs.ppmMultiplier() );
|
||||
vBatCalib ( rhs.vBatCalib() );
|
||||
txVoltageCalibration ( rhs.txVoltageCalibration() );
|
||||
vBatWarn ( rhs.vBatWarn() );
|
||||
vBatMin ( rhs.vBatMin() );
|
||||
vBatMax ( rhs.vBatMax() );
|
||||
@@ -424,10 +424,10 @@ void Profile::initFwVariables()
|
||||
_timeStamp = "";
|
||||
_trainerCalib = "";
|
||||
|
||||
_currentCalib = 0;
|
||||
_txCurrentCalibration = 0;
|
||||
_gsStickMode = 0;
|
||||
_ppmMultiplier = 0;
|
||||
_vBatCalib = 0;
|
||||
_txVoltageCalibration = 0;
|
||||
_vBatWarn = 0;
|
||||
_vBatMin = 0;
|
||||
_vBatMax = 0;
|
||||
@@ -483,10 +483,10 @@ void Profile::flush()
|
||||
getset( _stickPotCalib, "StickPotCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _timeStamp, "TimeStamp" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _trainerCalib, "TrainerCalib" ,"" ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _currentCalib, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txCurrentCalibration, "currentCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _gsStickMode, "GSStickMode" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _ppmMultiplier, "PPM_Multiplier" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatCalib, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _txVoltageCalibration, "VbatCalib" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatWarn, "vBatWarn" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMin, "VbatMin" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
getset( _vBatMax, "VbatMax" ,0 ,"Profiles", QString("profile%1").arg(index));
|
||||
@@ -512,6 +512,7 @@ QString AppData::mcu() { return _mcu; }
|
||||
QString AppData::programmer() { return _programmer; }
|
||||
QString AppData::sambaLocation() { return _sambaLocation; }
|
||||
QString AppData::sambaPort() { return _sambaPort; }
|
||||
QString AppData::lastSimulator() { return _lastSimulator; }
|
||||
|
||||
QString AppData::backupDir() { return _backupDir; }
|
||||
QString AppData::gePath() { return _gePath; }
|
||||
@@ -560,6 +561,7 @@ void AppData::mcu (const QString x) { store(x, _mcu,
|
||||
void AppData::programmer (const QString x) { store(x, _programmer, "programmer" );}
|
||||
void AppData::sambaLocation (const QString x) { store(x, _sambaLocation, "samba_location" );}
|
||||
void AppData::sambaPort (const QString x) { store(x, _sambaPort, "samba_port" );}
|
||||
void AppData::lastSimulator (const QString x) { store(x, _lastSimulator, "last_simulator" );}
|
||||
|
||||
void AppData::backupDir (const QString x) { store(x, _backupDir, "backupPath" );}
|
||||
void AppData::gePath (const QString x) { store(x, _gePath, "gePath" );}
|
||||
@@ -602,8 +604,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");
|
||||
@@ -611,7 +633,10 @@ AppData::AppData()
|
||||
QStringList keys = settings20.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, settings20.value(*i));
|
||||
if (settings20.value(*i) != QString("") && settings20.value(*i) != QString("Start Menu Folder"))
|
||||
{
|
||||
settings.setValue(*i, settings20.value(*i));
|
||||
}
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
@@ -627,7 +652,10 @@ AppData::AppData()
|
||||
QStringList keys = pre2016settings.allKeys();
|
||||
for (QStringList::iterator i=keys.begin(); i!=keys.end(); i++)
|
||||
{
|
||||
settings.setValue(*i, pre2016settings.value(*i));
|
||||
if (pre2016settings.value(*i) != QString("") && pre2016settings.value(*i) != QString("Start Menu Folder"))
|
||||
{
|
||||
settings.setValue(*i, pre2016settings.value(*i));
|
||||
}
|
||||
}
|
||||
|
||||
//Reload profiles
|
||||
@@ -716,6 +744,7 @@ AppData::AppData()
|
||||
getset( _programmer, "programmer" ,"usbasp" );
|
||||
getset( _sambaLocation, "samba_location" ,"" );
|
||||
getset( _sambaPort, "samba_port" ,"\\USBserial\\COM23" );
|
||||
getset( _lastSimulator, "last_simulator" ,"" );
|
||||
|
||||
getset( _backupDir, "backupPath" ,"" );
|
||||
getset( _gePath, "gePath" ,"" );
|
||||
@@ -728,10 +757,13 @@ AppData::AppData()
|
||||
getset( _updatesDir, "lastUpdatesDir" ,"" );
|
||||
|
||||
getset( _outputDisplayDetails, "outputDisplayDetails" ,false );
|
||||
getset( _enableBackup, "backupEnable" ,false );
|
||||
getset( _enableBackup, "enableBackup" ,false );
|
||||
getset( _backupOnFlash, "backupOnFlash" ,true );
|
||||
getset( _checkHardwareCompatibility, "checkHardwareCompatibility" ,true );
|
||||
|
||||
getset( _useCompanionNightlyBuilds, "useCompanionNightlyBuilds" ,false );
|
||||
getset( _useFirmwareNightlyBuilds, "useFirmwareNightlyBuilds" ,false );
|
||||
|
||||
getset( _jsSupport, "js_support" ,false );
|
||||
getset( _maximized, "maximized" ,false );
|
||||
getset( _showSplash, "show_splash" ,true );
|
||||
|
||||
@@ -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
|
||||
@@ -125,10 +125,10 @@ class Profile: protected CompStoreObj
|
||||
QString _stickPotCalib;
|
||||
QString _timeStamp;
|
||||
QString _trainerCalib;
|
||||
int _currentCalib;
|
||||
int _txCurrentCalibration;
|
||||
int _gsStickMode;
|
||||
int _ppmMultiplier;
|
||||
int _vBatCalib;
|
||||
int _txVoltageCalibration;
|
||||
int _vBatWarn;
|
||||
int _vBatMin;
|
||||
int _vBatMax;
|
||||
@@ -156,10 +156,10 @@ class Profile: protected CompStoreObj
|
||||
QString stickPotCalib() const;
|
||||
QString timeStamp() const;
|
||||
QString trainerCalib() const;
|
||||
int currentCalib() const;
|
||||
int txCurrentCalibration() const;
|
||||
int gsStickMode() const;
|
||||
int ppmMultiplier() const;
|
||||
int vBatCalib() const;
|
||||
int txVoltageCalibration() const;
|
||||
int vBatWarn() const;
|
||||
int vBatMin() const;
|
||||
int vBatMax() const;
|
||||
@@ -186,10 +186,10 @@ class Profile: protected CompStoreObj
|
||||
void stickPotCalib (const QString);
|
||||
void timeStamp (const QString);
|
||||
void trainerCalib (const QString);
|
||||
void currentCalib (const int);
|
||||
void txCurrentCalibration (const int);
|
||||
void gsStickMode (const int);
|
||||
void ppmMultiplier (const int);
|
||||
void vBatCalib (const int);
|
||||
void txVoltageCalibration (const int);
|
||||
void vBatWarn (const int);
|
||||
void vBatMin (const int);
|
||||
void vBatMax (const int);
|
||||
@@ -216,6 +216,8 @@ class AppData: protected CompStoreObj
|
||||
BOOL_PROPERTY(outputDisplayDetails, false)
|
||||
BOOL_PROPERTY(backupOnFlash, true)
|
||||
BOOL_PROPERTY(checkHardwareCompatibility, true)
|
||||
BOOL_PROPERTY(useCompanionNightlyBuilds, false)
|
||||
BOOL_PROPERTY(useFirmwareNightlyBuilds, false)
|
||||
|
||||
// All the global variables
|
||||
public:
|
||||
@@ -240,6 +242,7 @@ class AppData: protected CompStoreObj
|
||||
QString _programmer;
|
||||
QString _sambaLocation;
|
||||
QString _sambaPort;
|
||||
QString _lastSimulator;
|
||||
|
||||
QString _backupDir;
|
||||
QString _gePath;
|
||||
@@ -290,6 +293,7 @@ class AppData: protected CompStoreObj
|
||||
QString programmer();
|
||||
QString sambaLocation();
|
||||
QString sambaPort();
|
||||
QString lastSimulator();
|
||||
|
||||
QString backupDir();
|
||||
QString gePath();
|
||||
@@ -339,6 +343,7 @@ class AppData: protected CompStoreObj
|
||||
void programmer (const QString);
|
||||
void sambaLocation (const QString);
|
||||
void sambaPort (const QString);
|
||||
void lastSimulator (const QString);
|
||||
|
||||
void backupDir (const QString);
|
||||
void gePath (const QString);
|
||||
|
||||
@@ -41,8 +41,10 @@ AppPreferencesDialog::~AppPreferencesDialog()
|
||||
|
||||
void AppPreferencesDialog::writeValues()
|
||||
{
|
||||
g.autoCheckApp(ui->startupCheck_companion9x->isChecked());
|
||||
g.autoCheckFw(ui->startupCheck_fw->isChecked());
|
||||
g.useCompanionNightlyBuilds(ui->useCompanionNightlyBuilds->isChecked());
|
||||
g.autoCheckApp(ui->autoCheckCompanion->isChecked());
|
||||
g.useFirmwareNightlyBuilds(ui->useFirmwareNightlyBuilds->isChecked());
|
||||
g.autoCheckFw(ui->autoCheckFirmware->isChecked());
|
||||
g.showSplash(ui->showSplash->isChecked());
|
||||
g.simuSW(ui->simuSW->isChecked());
|
||||
g.useWizard(ui->modelWizard_CB->isChecked());
|
||||
@@ -107,8 +109,15 @@ void AppPreferencesDialog::initSettings()
|
||||
ui->snapshotPath->setDisabled(true);
|
||||
ui->snapshotPathButton->setDisabled(true);
|
||||
}
|
||||
ui->startupCheck_companion9x->setChecked(g.autoCheckApp());
|
||||
ui->startupCheck_fw->setChecked(g.autoCheckFw());
|
||||
#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->autoCheckFirmware->setChecked(g.autoCheckFw());
|
||||
ui->showSplash->setChecked(g.showSplash());
|
||||
ui->historySize->setValue(g.historySize());
|
||||
ui->backLightColor->setCurrentIndex(g.backLight());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>686</width>
|
||||
<height>619</height>
|
||||
<height>713</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -233,7 +233,7 @@ May be different from firmware language</string>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
@@ -290,6 +290,9 @@ May be different from firmware language</string>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -624,7 +627,7 @@ Mode 4:
|
||||
<item row="10" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="sdPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
<string>Select Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -634,7 +637,7 @@ Mode 4:
|
||||
<string>The profile specific folder, if set, will override general Backup folder</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
<string>Select Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -645,8 +648,8 @@ Mode 4:
|
||||
<string>Application Settings</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="7" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_companion9x">
|
||||
<item row="10" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="autoCheckCompanion">
|
||||
<property name="text">
|
||||
<string>Automatic check for Companion updates</string>
|
||||
</property>
|
||||
@@ -665,7 +668,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1" colspan="3">
|
||||
<item row="13" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="backupEnable">
|
||||
<property name="text">
|
||||
<string>Enable automatic backup before writing firmware</string>
|
||||
@@ -679,24 +682,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="startupCheck_fw">
|
||||
<property name="text">
|
||||
<string>Automatic check for OpenTX firmware updates</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<item row="18" column="1">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -709,7 +695,24 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="11" column="1" colspan="3">
|
||||
<widget class="Line" name="line_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="autoCheckFirmware">
|
||||
<property name="text">
|
||||
<string>Automatic check for OpenTX firmware updates</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -749,7 +752,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<item row="16" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
@@ -784,14 +787,14 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_17">
|
||||
<property name="text">
|
||||
<string>Automatic Backup Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1" colspan="3">
|
||||
<item row="14" column="1" colspan="3">
|
||||
<widget class="Line" name="line_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@@ -805,7 +808,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<item row="16" column="1">
|
||||
<widget class="QLineEdit" name="libraryPath">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
@@ -815,7 +818,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="15" column="1">
|
||||
<widget class="QComboBox" name="splashincludeCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
@@ -835,7 +838,7 @@ Mode 4:
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<item row="12" column="1">
|
||||
<widget class="QLineEdit" name="backupPath">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -848,10 +851,10 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<item row="12" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="backupPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
<string>Select Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -871,14 +874,34 @@ Mode 4:
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="ge_pathButton">
|
||||
<property name="text">
|
||||
<string>Find Executable</string>
|
||||
<string>Select Executable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2" colspan="2">
|
||||
<item row="16" column="2" colspan="2">
|
||||
<widget class="QPushButton" name="libraryPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
<string>Select Folder</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QCheckBox" name="useFirmwareNightlyBuilds">
|
||||
<property name="text">
|
||||
<string>Use OpenTX firmware nightly builds</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="useCompanionNightlyBuilds">
|
||||
<property name="text">
|
||||
<string>Use Companion nightly builds</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -889,7 +912,17 @@ Mode 4:
|
||||
<string>Simulator Settings</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="5" column="4">
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="joystickCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QPushButton" name="joystickcalButton">
|
||||
<property name="text">
|
||||
<string>Calibrate</string>
|
||||
@@ -951,7 +984,7 @@ Mode 4:
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="4">
|
||||
<item row="1" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="snapshotClipboardCKB">
|
||||
<property name="text">
|
||||
<string>Only capture to clipboard</string>
|
||||
@@ -966,32 +999,9 @@ Mode 4:
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="joystickCB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<widget class="QPushButton" name="snapshotPathButton">
|
||||
<property name="text">
|
||||
<string>Open Folder</string>
|
||||
<string>Select Folder</string>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
@@ -1032,9 +1042,15 @@ Mode 4:
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@@ -1043,7 +1059,7 @@ Mode 4:
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="4">
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QCheckBox" name="simuSW">
|
||||
<property name="text">
|
||||
<string>Remember simulator switch values</string>
|
||||
@@ -1112,8 +1128,8 @@ Mode 4:
|
||||
<tabstop>historySize</tabstop>
|
||||
<tabstop>showSplash</tabstop>
|
||||
<tabstop>modelWizard_CB</tabstop>
|
||||
<tabstop>startupCheck_fw</tabstop>
|
||||
<tabstop>startupCheck_companion9x</tabstop>
|
||||
<tabstop>autoCheckFirmware</tabstop>
|
||||
<tabstop>autoCheckCompanion</tabstop>
|
||||
<tabstop>backupPath</tabstop>
|
||||
<tabstop>backupPathButton</tabstop>
|
||||
<tabstop>backupEnable</tabstop>
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#undef main
|
||||
#endif
|
||||
#include "mainwindow.h"
|
||||
#include "version.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "appdata.h"
|
||||
|
||||
@@ -87,6 +88,13 @@ int main(int argc, char *argv[])
|
||||
app.setOrganizationDomain("open-tx.org");
|
||||
app.setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
QStringList strl = QApplication::arguments();
|
||||
if (strl.contains("--version")) {
|
||||
printf("%s\n", VERSION);
|
||||
fflush(stdout);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
app.setStyle(new MyProxyStyle);
|
||||
#endif
|
||||
@@ -148,7 +156,8 @@ int main(int argc, char *argv[])
|
||||
delete splash;
|
||||
delete mainWin;
|
||||
|
||||
unregisterFirmwares();
|
||||
unregisterSimulators();
|
||||
unregisterOpenTxFirmwares();
|
||||
unregisterEEpromInterfaces();
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
||||
Name=Companion
|
||||
Name=Companion @VERSION@
|
||||
GenericName=Transmitter Companion App
|
||||
Comment=The Ultimate Transmitter Companion
|
||||
Icon=companion
|
||||
Exec='companion'
|
||||
Icon=@COMPANION_NAME@
|
||||
Exec='@COMPANION_NAME@'
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
Categories=Application
|
||||
@@ -5,39 +5,54 @@
|
||||
<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>
|
||||
@@ -100,6 +115,8 @@
|
||||
<file>images/library/00018.png</file>
|
||||
<file>images/library/00019.png</file>
|
||||
<file>images/library/00020.png</file>
|
||||
<file>images/library/00021.png</file>
|
||||
<file>images/library/00022.png</file>
|
||||
<file>images/library/00050.png</file>
|
||||
<file>images/library/00051.png</file>
|
||||
<file>images/library/00052.png</file>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#ifndef COMPAREDIALOG_H
|
||||
#define COMPAREDIALOG_H
|
||||
#ifndef _COMPAREDIALOG_H
|
||||
#define _COMPAREDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QtGui>
|
||||
#include <QDir>
|
||||
#include "eeprominterface.h"
|
||||
#include <QLabel>
|
||||
#include "multimodelprinter.h"
|
||||
|
||||
namespace Ui {
|
||||
class CompareDialog;
|
||||
@@ -12,80 +11,32 @@ namespace Ui {
|
||||
|
||||
class CompareDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CompareDialog(QWidget *parent, Firmware * firmware);
|
||||
~CompareDialog();
|
||||
Firmware * firmware;
|
||||
|
||||
protected:
|
||||
GeneralSettings * settings;
|
||||
ModelData * g_model1;
|
||||
ModelData * g_model2;
|
||||
ModelData * modeltemp;
|
||||
int model1;
|
||||
int model2;
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
Ui::CompareDialog *ui;
|
||||
template<class T> QString getColor1(T val1, T val2) {
|
||||
if (val1!=val2)
|
||||
return "green";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
template<class T> QString getColor2(T val1, T val2) {
|
||||
if (val1!=val2)
|
||||
return "red";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
QString getColor1(char * val1, char * val2) {
|
||||
if (strcmp(val1,val2)!=0)
|
||||
return "green";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
QString getColor2(char * val1, char * val2) {
|
||||
if (strcmp(val1,val2)!=0)
|
||||
return "red";
|
||||
else
|
||||
return "grey";
|
||||
}
|
||||
|
||||
int ModelHasExpo(ExpoData * ExpoArray, ExpoData expo, bool * expoused);
|
||||
bool ChannelHasExpo(ExpoData * expoArray, uint8_t destCh);
|
||||
int ModelHasMix(MixData * mixArray, MixData mix, bool * mixused);
|
||||
bool ChannelHasMix(MixData * mixArray, uint8_t destCh);
|
||||
MultiModelPrinter multimodelprinter;
|
||||
ModelData model1;
|
||||
ModelData model2;
|
||||
bool model1Valid;
|
||||
bool model2Valid;
|
||||
Ui::CompareDialog * ui;
|
||||
|
||||
QTextEdit * te;
|
||||
QString curvefile1;
|
||||
QString curvefile2;
|
||||
QDir *qd;
|
||||
|
||||
private slots:
|
||||
protected slots:
|
||||
void on_printButton_clicked();
|
||||
void on_printFileButton_clicked();
|
||||
|
||||
protected:
|
||||
protected:
|
||||
void closeEvent(QCloseEvent * event);
|
||||
bool handleDroppedModel(const QMimeData * mimeData, ModelData & model, QLabel * label);
|
||||
void dropEvent(QDropEvent *event);
|
||||
void dragMoveEvent(QDragMoveEvent *event);
|
||||
void dragEnterEvent(QDragEnterEvent *event);
|
||||
void dragLeaveEvent(QDragLeaveEvent *event);
|
||||
void printDiff();
|
||||
void printSetup();
|
||||
void printPhases();
|
||||
void printLimits();
|
||||
void printExpos();
|
||||
void printMixers();
|
||||
void printCurves();
|
||||
void printGvars();
|
||||
void printSwitches();
|
||||
void printSafetySwitches();
|
||||
void printFSwitches();
|
||||
void printFrSky();
|
||||
};
|
||||
|
||||
#endif // COMPAREDIALOG_H
|
||||
#endif // _COMPAREDIALOG_H
|
||||
|
||||
@@ -8,9 +8,12 @@ enum BoardEnum {
|
||||
BOARD_GRUVIN9X,
|
||||
BOARD_SKY9X,
|
||||
BOARD_9XRPRO,
|
||||
BOARD_AR9X,
|
||||
BOARD_TARANIS,
|
||||
BOARD_TARANIS_PLUS,
|
||||
BOARD_TARANIS_X9E
|
||||
BOARD_TARANIS_X9E,
|
||||
BOARD_FLAMENCO,
|
||||
BOARD_HORUS
|
||||
};
|
||||
|
||||
#define C9X_MAX_MODELS 60
|
||||
@@ -24,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
|
||||
|
||||
@@ -59,11 +59,18 @@ ContributorsDialog::ContributorsDialog(QWidget * parent):
|
||||
str.append(formatTable(tr("People who have donated to OpenTX"), names, 6));
|
||||
}
|
||||
|
||||
str.append(" <tr><td class=\"normal\"> </td></tr>" \
|
||||
" <tr><td colspan=3 class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
|
||||
" <tr><td colspan=3 class=\"normal\">" + tr("Thank you all !!!") + "</td></tr>" \
|
||||
str.append("<table><tr><td class=\"normal\"> </td></tr>" \
|
||||
" <tr><td class=\"normal\">" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "<br/></td></tr>" \
|
||||
"</table>");
|
||||
|
||||
#if 0
|
||||
QFile blacklist(":/BLACKLIST.txt");
|
||||
if (blacklist.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QStringList names;
|
||||
names << blacklist.readAll();
|
||||
str.append(formatTable(tr("OpenTX Blacklist"), names, 1));
|
||||
}
|
||||
#endif
|
||||
|
||||
str.append("</body></html>");
|
||||
ui->textEditor->setHtml(str);
|
||||
|
||||
@@ -26,8 +26,11 @@ bool convertEEprom(const QString &sourceEEprom, const QString &destinationEEprom
|
||||
sourceFile.close();
|
||||
|
||||
QSharedPointer<RadioData> radioData = QSharedPointer<RadioData>(new RadioData());
|
||||
if (!loadEEprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size) || !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version))
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEeprom(*radioData, (uint8_t *)eeprom.data(), eeprom_size));
|
||||
if (!errors.test(NO_ERROR)
|
||||
|| !currentFirmware->saveEEPROM((uint8_t *)eeprom.data(), *radioData, variant, version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QFile destinationFile(destinationEEprom);
|
||||
if (!destinationFile.open(QIODevice::WriteOnly))
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include "flashfirmwaredialog.h"
|
||||
#include "appdata.h"
|
||||
#include "helpers.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "splashlibrarydialog.h"
|
||||
|
||||
//*** Side Class ***
|
||||
|
||||
@@ -233,7 +233,7 @@ void customizeSplashDialog::on_rightLibraryButton_clicked(){libraryButton_clicke
|
||||
void customizeSplashDialog::libraryButton_clicked( Side side )
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this,&fileName);
|
||||
SplashLibraryDialog *ld = new SplashLibraryDialog(this,&fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
if (!side.displayImage( fileName, UNDEFINED ))
|
||||
|
||||
@@ -123,23 +123,23 @@ QString SensorData::unitString() const
|
||||
case UNIT_FEET:
|
||||
return QObject::tr("f");
|
||||
case UNIT_CELSIUS:
|
||||
return QObject::tr("°C");
|
||||
return QObject::trUtf8("°C");
|
||||
case UNIT_FAHRENHEIT:
|
||||
return QObject::tr("%F");
|
||||
return QObject::trUtf8("°F");
|
||||
case UNIT_PERCENT:
|
||||
return QObject::tr("%");
|
||||
case UNIT_MAH:
|
||||
return QObject::tr("mAh");
|
||||
case UNIT_WATTS:
|
||||
return QObject::tr("W");
|
||||
case UNIT_DBM:
|
||||
case UNIT_DB:
|
||||
return QObject::tr("dB");
|
||||
case UNIT_RPMS:
|
||||
return QObject::tr("rpms");
|
||||
case UNIT_G:
|
||||
return QObject::tr("g");
|
||||
case UNIT_DEGREE:
|
||||
return QObject::tr("°");
|
||||
return QObject::trUtf8("°");
|
||||
case UNIT_HOURS:
|
||||
return QObject::tr("hours");
|
||||
case UNIT_MINUTES:
|
||||
@@ -161,6 +161,14 @@ bool RawSource::isTimeBased() const
|
||||
return (type==SOURCE_TYPE_TELEMETRY && (index==TELEMETRY_SOURCE_TX_TIME || index==TELEMETRY_SOURCE_TIMER1 || index==TELEMETRY_SOURCE_TIMER2 || index==TELEMETRY_SOURCE_TIMER3));
|
||||
}
|
||||
|
||||
float RawSourceRange::getValue(int value)
|
||||
{
|
||||
if (IS_ARM(GetCurrentFirmware()->getBoard()))
|
||||
return float(value) * step;
|
||||
else
|
||||
return min + float(value) * step;
|
||||
}
|
||||
|
||||
RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSettings & settings, unsigned int flags) const
|
||||
{
|
||||
RawSourceRange result;
|
||||
@@ -467,13 +475,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("----");
|
||||
}
|
||||
@@ -500,7 +501,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:
|
||||
@@ -520,7 +521,7 @@ QString RawSource::toString(const ModelData * model) const
|
||||
return CHECK_IN_ARRAY(telemetry, index);
|
||||
}
|
||||
case SOURCE_TYPE_GVAR:
|
||||
return QObject::tr("GV%1").arg(index+1);
|
||||
return QObject::tr("GV%1").arg(index+1);
|
||||
default:
|
||||
return QObject::tr("----");
|
||||
}
|
||||
@@ -528,15 +529,15 @@ QString RawSource::toString(const ModelData * model) const
|
||||
|
||||
bool RawSource::isPot() const
|
||||
{
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS &&
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS &&
|
||||
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots));
|
||||
}
|
||||
|
||||
bool RawSource::isSlider() const
|
||||
{
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS+GetCurrentFirmware()->getCapability(Pots) &&
|
||||
return (type == SOURCE_TYPE_STICK &&
|
||||
index >= NUM_STICKS+GetCurrentFirmware()->getCapability(Pots) &&
|
||||
index < NUM_STICKS+GetCurrentFirmware()->getCapability(Pots)+GetCurrentFirmware()->getCapability(Sliders));
|
||||
}
|
||||
|
||||
@@ -553,7 +554,7 @@ QString SwitchDn(const char sw)
|
||||
return QString::fromUtf8(result);
|
||||
}
|
||||
|
||||
QString RawSwitch::toString()
|
||||
QString RawSwitch::toString() const
|
||||
{
|
||||
static const QString switches9X[] = {
|
||||
QString("THR"), QString("RUD"), QString("ELE"),
|
||||
@@ -582,13 +583,6 @@ QString RawSwitch::toString()
|
||||
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")
|
||||
};
|
||||
@@ -626,7 +620,7 @@ QString RawSwitch::toString()
|
||||
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:
|
||||
@@ -651,7 +645,7 @@ QString RawSwitch::toString()
|
||||
}
|
||||
}
|
||||
|
||||
QString CurveReference::toString()
|
||||
QString CurveReference::toString() const
|
||||
{
|
||||
if (value == 0) {
|
||||
return "----";
|
||||
@@ -670,7 +664,7 @@ QString CurveReference::toString()
|
||||
}
|
||||
}
|
||||
|
||||
CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
CSFunctionFamily LogicalSwitchData::getFunctionFamily() const
|
||||
{
|
||||
if (func == LS_FN_EDGE)
|
||||
return LS_FAMILY_EDGE;
|
||||
@@ -686,7 +680,7 @@ CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
return LS_FAMILY_VCOMP;
|
||||
}
|
||||
|
||||
unsigned int LogicalSwitchData::getRangeFlags()
|
||||
unsigned int LogicalSwitchData::getRangeFlags() const
|
||||
{
|
||||
if (func == LS_FN_DPOS)
|
||||
return RANGE_DELTA_FUNCTION;
|
||||
@@ -696,7 +690,7 @@ unsigned int LogicalSwitchData::getRangeFlags()
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::funcToString()
|
||||
QString LogicalSwitchData::funcToString() const
|
||||
{
|
||||
switch (func) {
|
||||
case LS_FN_OFF:
|
||||
@@ -746,123 +740,6 @@ QString LogicalSwitchData::funcToString()
|
||||
}
|
||||
}
|
||||
|
||||
QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettings & settings)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
if (!func)
|
||||
return result;
|
||||
|
||||
if (andsw!=0) {
|
||||
result +="( ";
|
||||
}
|
||||
switch (getFunctionFamily()) {
|
||||
case LS_FAMILY_EDGE:
|
||||
result += QObject::tr("Edge(%1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3));
|
||||
break;
|
||||
case LS_FAMILY_STICKY:
|
||||
result += QObject::tr("Sticky(%1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString());
|
||||
break;
|
||||
case LS_FAMILY_TIMER:
|
||||
result += QObject::tr("Timer(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2));
|
||||
break;
|
||||
case LS_FAMILY_VOFS: {
|
||||
RawSource source = RawSource(val1);
|
||||
RawSourceRange range = source.getRange(&model, settings);
|
||||
QString res;
|
||||
if (val1)
|
||||
res += source.toString(&model);
|
||||
else
|
||||
res += "0";
|
||||
res.remove(" ");
|
||||
if (func == LS_FN_APOS || func == LS_FN_ANEG)
|
||||
res = "|" + res + "|";
|
||||
else if (func == LS_FN_DAPOS)
|
||||
res = "|d(" + res + ")|";
|
||||
else if (func == LS_FN_DPOS) result = "d(" + res + ")";
|
||||
result += res;
|
||||
|
||||
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DPOS || func == LS_FN_DAPOS)
|
||||
result += " > ";
|
||||
else if (func == LS_FN_ANEG || func == LS_FN_VNEG)
|
||||
result += " < ";
|
||||
else if (func == LS_FN_VALMOSTEQUAL)
|
||||
result += " ~ ";
|
||||
else
|
||||
result += " missing";
|
||||
result += QString::number(range.step * (val2 /*TODO+ source.getRawOffset(model)*/) + range.offset);
|
||||
break;
|
||||
}
|
||||
case LS_FAMILY_VBOOL:
|
||||
result += RawSwitch(val1).toString();
|
||||
switch (func) {
|
||||
case LS_FN_AND:
|
||||
result += " AND ";
|
||||
break;
|
||||
case LS_FN_OR:
|
||||
result += " OR ";
|
||||
break;
|
||||
case LS_FN_XOR:
|
||||
result += " XOR ";
|
||||
break;
|
||||
default:
|
||||
result += " bar ";
|
||||
break;
|
||||
}
|
||||
result += RawSwitch(val2).toString();
|
||||
break;
|
||||
|
||||
case LS_FAMILY_VCOMP:
|
||||
if (val1)
|
||||
result += RawSource(val1).toString(&model);
|
||||
else
|
||||
result += "0";
|
||||
switch (func) {
|
||||
case LS_FN_EQUAL:
|
||||
case LS_FN_VEQUAL:
|
||||
result += " = ";
|
||||
break;
|
||||
case LS_FN_NEQUAL:
|
||||
result += " != ";
|
||||
break;
|
||||
case LS_FN_GREATER:
|
||||
result += " > ";
|
||||
break;
|
||||
case LS_FN_LESS:
|
||||
result += " < ";
|
||||
break;
|
||||
case LS_FN_EGREATER:
|
||||
result += " >= ";
|
||||
break;
|
||||
case LS_FN_ELESS:
|
||||
result += " <= ";
|
||||
break;
|
||||
default:
|
||||
result += " foo ";
|
||||
break;
|
||||
}
|
||||
if (val2)
|
||||
result += RawSource(val2).toString(&model);
|
||||
else
|
||||
result += "0";
|
||||
break;
|
||||
}
|
||||
|
||||
if (andsw!=0) {
|
||||
result +=" ) AND ";
|
||||
result += RawSwitch(andsw).toString();
|
||||
}
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(LogicalSwitchesExt)) {
|
||||
if (duration)
|
||||
result += QObject::tr(" Duration (%1s)").arg(duration/10.0);
|
||||
if (delay)
|
||||
result += QObject::tr(" Delay (%1s)").arg(delay/10.0);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void CustomFunctionData::clear()
|
||||
{
|
||||
memset(this, 0, sizeof(CustomFunctionData));
|
||||
@@ -871,7 +748,7 @@ void CustomFunctionData::clear()
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomFunctionData::funcToString()
|
||||
QString CustomFunctionData::funcToString() const
|
||||
{
|
||||
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
|
||||
return QObject::tr("Override %1").arg(RawSource(SOURCE_TYPE_CH, func).toString());
|
||||
@@ -890,7 +767,7 @@ QString CustomFunctionData::funcToString()
|
||||
else if (func == FuncPlaySound)
|
||||
return QObject::tr("Play Sound");
|
||||
else if (func == FuncPlayHaptic)
|
||||
return QObject::tr("Play Haptic");
|
||||
return QObject::tr("Haptic");
|
||||
else if (func == FuncReset)
|
||||
return QObject::tr("Reset");
|
||||
else if (func >= FuncSetTimer1 && func <= FuncSetTimer3)
|
||||
@@ -906,7 +783,7 @@ QString CustomFunctionData::funcToString()
|
||||
else if (func == FuncPlayScript)
|
||||
return QObject::tr("Play Script");
|
||||
else if (func == FuncLogs)
|
||||
return QObject::tr("Start Logs");
|
||||
return QObject::tr("SD Logs");
|
||||
else if (func == FuncVolume)
|
||||
return QObject::tr("Volume");
|
||||
else if (func == FuncBacklight)
|
||||
@@ -919,46 +796,106 @@ QString CustomFunctionData::funcToString()
|
||||
return QObject::tr("Background Music Pause");
|
||||
else if (func >= FuncAdjustGV1 && func <= FuncAdjustGVLast)
|
||||
return QObject::tr("Adjust GV%1").arg(func-FuncAdjustGV1+1);
|
||||
else if (func == FuncSetFailsafeInternalModule)
|
||||
return QObject::tr("SetFailsafe Int. Module");
|
||||
else if (func == FuncSetFailsafeExternalModule)
|
||||
return QObject::tr("SetFailsafe Ext. Module");
|
||||
else if (func == FuncRangeCheckInternalModule)
|
||||
return QObject::tr("RangeCheck Int. Module");
|
||||
else if (func == FuncRangeCheckExternalModule)
|
||||
return QObject::tr("RangeCheck Ext. Module");
|
||||
else if (func == FuncBindInternalModule)
|
||||
return QObject::tr("Bind Int. Module");
|
||||
else if (func == FuncBindExternalModule)
|
||||
return QObject::tr("Bind Ext. Module");
|
||||
else {
|
||||
return QString("???"); // Highlight unknown functions with output of question marks.(BTW should not happen that we do not know what a function is)
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomFunctionData::paramToString()
|
||||
void CustomFunctionData::populateResetParams(const ModelData * model, QComboBox * b, unsigned int value = 0)
|
||||
{
|
||||
int val = 0;
|
||||
Firmware * firmware = GetCurrentFirmware();
|
||||
BoardEnum board = GetEepromInterface()->getBoard();
|
||||
|
||||
b->addItem(QObject::tr("Timer1"), val++);
|
||||
b->addItem(QObject::tr("Timer2"), val++);
|
||||
if (IS_ARM(board)) {
|
||||
b->addItem( QObject::tr("Timer3"), val++);
|
||||
}
|
||||
b->addItem(QObject::tr("Flight"), val++);
|
||||
b->addItem(QObject::tr("Telemetry"), val++);
|
||||
int reCount = firmware->getCapability(RotaryEncoders);
|
||||
if (reCount == 1) {
|
||||
b->addItem(QObject::tr("Rotary Encoder"), val++);
|
||||
}
|
||||
else if (reCount == 2) {
|
||||
b->addItem(QObject::tr("REa"), val++);
|
||||
b->addItem(QObject::tr("REb"), val++);
|
||||
}
|
||||
if ((int)value < b->count()) {
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
if (model && IS_ARM(board)) {
|
||||
for (int i=0; i<C9X_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
|
||||
b->addItem(item.toString(model), val+i);
|
||||
if ((int)value == val+i) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CustomFunctionData::populatePlaySoundParams(QStringList & qs)
|
||||
{
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
}
|
||||
|
||||
void CustomFunctionData::populateHapticParams(QStringList & qs)
|
||||
{
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
}
|
||||
|
||||
QString CustomFunctionData::paramToString(const ModelData * model) const
|
||||
{
|
||||
QStringList qs;
|
||||
if (func <= FuncInstantTrim) {
|
||||
return QString("%1").arg(param);
|
||||
}
|
||||
else if (func==FuncLogs) {
|
||||
return QString("%1").arg(param/10.0) + QObject::tr("s");
|
||||
}
|
||||
else if (func==FuncPlaySound) {
|
||||
qs <<"Beep 1" << "Beep 2" << "Beep 3" << "Warn1" << "Warn2" << "Cheep" << "Ratata" << "Tick" << "Siren" << "Ring" ;
|
||||
qs << "SciFi" << "Robot" << "Chirp" << "Tada" << "Crickt" << "AlmClk" ;
|
||||
CustomFunctionData::populatePlaySoundParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncPlayHaptic) {
|
||||
qs << "0" << "1" << "2" << "3";
|
||||
CustomFunctionData::populateHapticParams(qs);
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if (func==FuncReset) {
|
||||
qs.append( QObject::tr("Timer1"));
|
||||
qs.append( QObject::tr("Timer2"));
|
||||
qs.append( QObject::tr("Timer3"));
|
||||
qs.append( QObject::tr("All"));
|
||||
qs.append( QObject::tr("Telemetry"));
|
||||
if (param>=0 && param<(int)qs.count())
|
||||
return qs.at(param);
|
||||
QComboBox cb;
|
||||
CustomFunctionData::populateResetParams(model, &cb);
|
||||
int pos = cb.findData(param);
|
||||
if (pos >= 0)
|
||||
return cb.itemText(pos);
|
||||
else
|
||||
return QObject::tr("<font color=red><b>Inconsistent parameter</b></font>");
|
||||
}
|
||||
else if ((func==FuncVolume)|| (func==FuncPlayValue)) {
|
||||
RawSource item(param);
|
||||
return item.toString();
|
||||
return item.toString(model);
|
||||
}
|
||||
else if ((func==FuncPlayPrompt) || (func==FuncPlayBoth)) {
|
||||
if ( GetCurrentFirmware()->getCapability(VoicesAsNumbers)) {
|
||||
@@ -968,54 +905,87 @@ QString CustomFunctionData::paramToString()
|
||||
return paramarm;
|
||||
}
|
||||
}
|
||||
else if ((func>FuncBackgroundMusicPause) && (func<FuncCount)) {
|
||||
else if ((func>=FuncAdjustGV1) && (func<FuncCount)) {
|
||||
switch (adjustMode) {
|
||||
case 0:
|
||||
return QObject::tr("Value ")+QString("%1").arg(param);
|
||||
break;
|
||||
case 1:
|
||||
return RawSource(param).toString();
|
||||
break;
|
||||
case 2:
|
||||
return RawSource(param).toString();
|
||||
break;
|
||||
case 3:
|
||||
if (param==0) {
|
||||
return QObject::tr("Decr:")+QString(" -1");
|
||||
}
|
||||
else {
|
||||
return QObject::tr("Incr:")+QString(" +1");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return "";
|
||||
if (param==0) return QObject::tr("Decr:") + " -1";
|
||||
else return QObject::tr("Incr:") + " +1";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
QString CustomFunctionData::repeatToString()
|
||||
QString CustomFunctionData::repeatToString() const
|
||||
{
|
||||
if (repeatParam==0) {
|
||||
return QObject::tr("No repeat");
|
||||
if (repeatParam == -1) {
|
||||
return QObject::tr("played once, not during startup");
|
||||
}
|
||||
else if (repeatParam == 0) {
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 5 : 10;
|
||||
return QObject::tr("%1 sec").arg(step*repeatParam);
|
||||
unsigned int step = IS_ARM(GetEepromInterface()->getBoard()) ? 1 : 10;
|
||||
return QObject::tr("repeat(%1s)").arg(step*repeatParam);
|
||||
}
|
||||
}
|
||||
|
||||
QString LimitData::minToString()
|
||||
QString CustomFunctionData::enabledToString() const
|
||||
{
|
||||
if ((func>=FuncOverrideCH1 && func<=FuncOverrideCH32) ||
|
||||
(func>=FuncAdjustGV1 && func<=FuncAdjustGVLast) ||
|
||||
(func==FuncReset) ||
|
||||
(func>=FuncSetTimer1 && func<=FuncSetTimer2) ||
|
||||
(func==FuncVolume) ||
|
||||
(func <= FuncInstantTrim)) {
|
||||
if (!enabled) {
|
||||
return QObject::tr("DISABLED");
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
CurveData::CurveData()
|
||||
{
|
||||
clear(5);
|
||||
}
|
||||
|
||||
void CurveData::clear(int count)
|
||||
{
|
||||
memset(this, 0, sizeof(CurveData));
|
||||
this->count = count;
|
||||
}
|
||||
|
||||
bool CurveData::isEmpty() const
|
||||
{
|
||||
for (int i=0; i<count; i++) {
|
||||
if (points[i].y != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QString LimitData::minToString() const
|
||||
{
|
||||
return QString::number((qreal)min/10);
|
||||
}
|
||||
|
||||
QString LimitData::maxToString()
|
||||
QString LimitData::maxToString() const
|
||||
{
|
||||
return QString::number((qreal)max/10);
|
||||
}
|
||||
|
||||
QString LimitData::offsetToString()
|
||||
QString LimitData::revertToString() const
|
||||
{
|
||||
return revert ? QObject::tr("INV") : QObject::tr("NOR");
|
||||
}
|
||||
|
||||
QString LimitData::offsetToString() const
|
||||
{
|
||||
return QString::number((qreal)offset/10, 'f', 1);
|
||||
}
|
||||
@@ -1052,13 +1022,13 @@ bool GeneralSettings::switchSourceAllowedTaranis(int index) const
|
||||
|
||||
bool GeneralSettings::isPotAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
if (index<0 || index>GetCurrentFirmware()->getCapability(Pots)) return false;
|
||||
return potConfig[index] != POT_NONE;
|
||||
}
|
||||
|
||||
bool GeneralSettings::isSliderAvailable(int index) const
|
||||
{
|
||||
if (index<0 || index>4) return false;
|
||||
if (index<0 || index>GetCurrentFirmware()->getCapability(Sliders)) return false;
|
||||
return sliderConfig[index] != SLIDER_NONE;
|
||||
}
|
||||
|
||||
@@ -1090,6 +1060,11 @@ GeneralSettings::GeneralSettings()
|
||||
switchConfig[6] = SWITCH_3POS;
|
||||
switchConfig[7] = SWITCH_TOGGLE;
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<3; i++) {
|
||||
potConfig[i] = POT_WITHOUT_DETENT;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
speakerVolume = 12;
|
||||
@@ -1109,8 +1084,8 @@ GeneralSettings::GeneralSettings()
|
||||
}
|
||||
else {
|
||||
QString t_trainercalib=g.profile[g.id()].trainerCalib();
|
||||
int8_t t_vBatCalib=(int8_t)g.profile[g.id()].vBatCalib();
|
||||
int8_t t_currentCalib=(int8_t)g.profile[g.id()].currentCalib();
|
||||
int8_t t_txVoltageCalibration=(int8_t)g.profile[g.id()].txVoltageCalibration();
|
||||
int8_t t_txCurrentCalibration=(int8_t)g.profile[g.id()].txCurrentCalibration();
|
||||
int8_t t_PPM_Multiplier=(int8_t)g.profile[g.id()].ppmMultiplier();
|
||||
uint8_t t_stickMode=(uint8_t)g.profile[g.id()].gsStickMode();
|
||||
uint8_t t_vBatWarn=(uint8_t)g.profile[g.id()].vBatWarn();
|
||||
@@ -1144,8 +1119,8 @@ GeneralSettings::GeneralSettings()
|
||||
if (ok)
|
||||
trainer.calib[i]=byte16;
|
||||
}
|
||||
currentCalib=t_currentCalib;
|
||||
vBatCalib=t_vBatCalib;
|
||||
txCurrentCalibration=t_txCurrentCalibration;
|
||||
txVoltageCalibration=t_txVoltageCalibration;
|
||||
vBatWarn=t_vBatWarn;
|
||||
PPM_Multiplier=t_PPM_Multiplier;
|
||||
stickMode = t_stickMode;
|
||||
@@ -1314,6 +1289,52 @@ bool ModelData::isInputValid(const unsigned int idx) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ModelData::hasExpos(uint8_t inputIdx) const
|
||||
{
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
const ExpoData & expo = expoData[i];
|
||||
if (expo.chn==inputIdx && expo.mode!=0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ModelData::hasMixes(uint8_t channelIdx) const
|
||||
{
|
||||
channelIdx += 1;
|
||||
for (int i=0; i<C9X_MAX_MIXERS; i++) {
|
||||
if (mixData[i].destCh == channelIdx) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QVector<const ExpoData *> ModelData::expos(int input) const
|
||||
{
|
||||
QVector<const ExpoData *> result;
|
||||
for (int i=0; i<C9X_MAX_EXPOS; i++) {
|
||||
const ExpoData * ed = &expoData[i];
|
||||
if ((int)ed->chn==input && ed->mode!=0) {
|
||||
result << ed;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QVector<const MixData *> ModelData::mixes(int channel) const
|
||||
{
|
||||
QVector<const MixData *> result;
|
||||
for (int i=0; i<C9X_MAX_MIXERS; i++) {
|
||||
const MixData * md = &mixData[i];
|
||||
if ((int)md->destCh == channel+1) {
|
||||
result << md;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void ModelData::removeInput(const int idx)
|
||||
{
|
||||
unsigned int chn = expoData[idx].chn;
|
||||
@@ -1363,12 +1384,16 @@ void ModelData::clear()
|
||||
moduleData[2].ppmDelay = 300;
|
||||
int board = GetEepromInterface()->getBoard();
|
||||
if (IS_TARANIS(board)) {
|
||||
moduleData[0].protocol=PXX_XJT_X16;
|
||||
moduleData[1].protocol=OFF;
|
||||
moduleData[0].protocol = PULSES_PXX_XJT_X16;
|
||||
moduleData[1].protocol = PULSES_OFF;
|
||||
}
|
||||
else if (IS_SKY9X(board)) {
|
||||
moduleData[0].protocol = PULSES_PPM;
|
||||
moduleData[1].protocol = PULSES_PPM;
|
||||
}
|
||||
else {
|
||||
moduleData[0].protocol=PPM;
|
||||
moduleData[1].protocol=OFF;
|
||||
moduleData[0].protocol = PULSES_PPM;
|
||||
moduleData[1].protocol = PULSES_OFF;
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
|
||||
flightModeData[i].clear();
|
||||
@@ -1393,7 +1418,7 @@ void ModelData::clear()
|
||||
sensorData[i].clear();
|
||||
}
|
||||
|
||||
bool ModelData::isempty()
|
||||
bool ModelData::isEmpty() const
|
||||
{
|
||||
return !used;
|
||||
}
|
||||
@@ -1581,7 +1606,7 @@ void registerEEpromInterfaces()
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_SKY9X));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_9XRPRO));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_PLUS));
|
||||
eepromInterfaces.push_back(new OpenTxEepromInterface(BOARD_TARANIS_X9E));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_STOCK));
|
||||
eepromInterfaces.push_back(new Gruvin9xInterface(BOARD_GRUVIN9X));
|
||||
@@ -1595,7 +1620,7 @@ void unregisterEEpromInterfaces()
|
||||
foreach(EEPROMInterface * intf, eepromInterfaces) {
|
||||
// qDebug() << "UnregisterEepromInterfaces(): deleting " << QString::number( reinterpret_cast<uint64_t>(intf), 16 );
|
||||
delete intf;
|
||||
}
|
||||
}
|
||||
OpenTxEepromCleanup();
|
||||
}
|
||||
|
||||
@@ -1603,42 +1628,116 @@ QList<Firmware *> firmwares;
|
||||
Firmware * default_firmware_variant;
|
||||
Firmware * current_firmware_variant;
|
||||
|
||||
void unregisterFirmwares()
|
||||
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound)
|
||||
{
|
||||
foreach (Firmware * f, firmwares) {
|
||||
delete f;
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
|
||||
QStringList errorsList;
|
||||
|
||||
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Possible causes for this:");
|
||||
|
||||
if (errors.test(UNSUPPORTED_NEWER_VERSION)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a newer version of OpenTX"); }
|
||||
if (errors.test(NOT_OPENTX)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from OpenTX"); }
|
||||
if (errors.test(NOT_TH9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Th9X"); }
|
||||
if (errors.test(NOT_GRUVIN9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Gruvin9X"); }
|
||||
if (errors.test(NOT_ERSKY9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from ErSky9X"); }
|
||||
if (errors.test(NOT_ER9X)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is not from Er9X"); }
|
||||
if (errors.test(WRONG_SIZE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom size is invalid"); }
|
||||
if (errors.test(WRONG_FILE_SYSTEM)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom file system is invalid"); }
|
||||
if (errors.test(UNKNOWN_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from a unknown board"); }
|
||||
if (errors.test(WRONG_BOARD)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom is from the wrong board"); }
|
||||
if (errors.test(BACKUP_NOT_SUPPORTED)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Eeprom backup not supported"); }
|
||||
|
||||
if (errors.test(UNKNOWN_ERROR)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Something that couldn't be guessed, sorry"); }
|
||||
|
||||
if (errors.test(HAS_WARNINGS)) {
|
||||
errorsList << QT_TRANSLATE_NOOP("EepromInterface", "Warning:");
|
||||
if (errors.test(WARNING_WRONG_FIRMWARE)) { errorsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
|
||||
}
|
||||
|
||||
QMessageBox msgBox(parent);
|
||||
msgBox.setWindowTitle(title);
|
||||
msgBox.setIcon(QMessageBox::Critical);
|
||||
msgBox.setText(mainMessage);
|
||||
msgBox.setInformativeText(errorsList.join("\n"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
bool loadEEprom(RadioData &radioData, const uint8_t *eeprom, const int size)
|
||||
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound)
|
||||
{
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->load(radioData, eeprom, size))
|
||||
return true;
|
||||
}
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)errorsFound);
|
||||
QStringList warningsList;
|
||||
if (errors.test(WARNING_WRONG_FIRMWARE)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"); }
|
||||
if (errors.test(OLD_VERSION)) { warningsList << QT_TRANSLATE_NOOP("EepromInterface", "- Your eeprom is from an old version of OpenTX, upgrading!\n You should 'save as' to keep the old file as a backup."); }
|
||||
|
||||
return false;
|
||||
QMessageBox msgBox(parent);
|
||||
msgBox.setWindowTitle(title);
|
||||
msgBox.setIcon(QMessageBox::Warning);
|
||||
msgBox.setText(QT_TRANSLATE_NOOP("EepromInterface", "Warnings!"));
|
||||
msgBox.setInformativeText(warningsList.join("\n"));
|
||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
bool loadBackup(RadioData &radioData, uint8_t *eeprom, int size, int index)
|
||||
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, const int size)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->loadBackup(radioData, eeprom, size, index))
|
||||
return true;
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->load(radioData, eeprom, size));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
unsigned long LoadBackup(RadioData & radioData, uint8_t * eeprom, int size, int index)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadBackup(radioData, eeprom, size, index));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
bool loadEEpromXml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long LoadEepromXml(RadioData & radioData, QDomDocument & doc)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
foreach(EEPROMInterface *eepromInterface, eepromInterfaces) {
|
||||
if (eepromInterface->loadxml(radioData, doc))
|
||||
return true;
|
||||
std::bitset<NUM_ERRORS> result((unsigned long long)eepromInterface->loadxml(radioData, doc));
|
||||
if (result.test(NO_ERROR)) {
|
||||
return result.to_ulong();
|
||||
}
|
||||
else {
|
||||
errors |= result;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
if (errors.none()) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
}
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
QString getBoardName(BoardEnum board)
|
||||
@@ -1660,6 +1759,8 @@ QString getBoardName(BoardEnum board)
|
||||
return "Sky9x";
|
||||
case BOARD_9XRPRO:
|
||||
return "9XR-PRO";
|
||||
case BOARD_AR9X:
|
||||
return "AR9X";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
@@ -22,24 +22,26 @@
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QtXml>
|
||||
#include <QComboBox>
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
#include "constants.h"
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
#define EESIZE_STOCK 2048
|
||||
#define EESIZE_M128 4096
|
||||
#define EESIZE_GRUVIN9X 4096
|
||||
#define EESIZE_TARANIS (32*1024)
|
||||
#define EESIZE_SKY9X (128*4096)
|
||||
#define EESIZE_9XRPRO (128*4096)
|
||||
#define EESIZE_RLC_MAX EESIZE_TARANIS
|
||||
#define EESIZE_STOCK 2048
|
||||
#define EESIZE_M128 4096
|
||||
#define EESIZE_GRUVIN9X 4096
|
||||
#define EESIZE_TARANIS (32*1024)
|
||||
#define EESIZE_SKY9X (128*4096)
|
||||
#define EESIZE_9XRPRO (128*4096)
|
||||
#define EESIZE_MAX EESIZE_9XRPRO
|
||||
|
||||
QString getBoardName(BoardEnum board);
|
||||
|
||||
#define IS_9X(board) (board==BOARD_STOCK || board==BOARD_M128)
|
||||
#define IS_STOCK(board) (board==BOARD_STOCK)
|
||||
#define IS_2560(board) (board==BOARD_GRUVIN9X || board==BOARD_MEGA2560)
|
||||
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO)
|
||||
#define IS_SKY9X(board) (board==BOARD_SKY9X || board==BOARD_9XRPRO || board==BOARD_AR9X)
|
||||
#define IS_9XRPRO(board) (board==BOARD_9XRPRO)
|
||||
#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)
|
||||
@@ -182,19 +184,6 @@ extern const char downArrow[];
|
||||
class ModelData;
|
||||
class GeneralSettings;
|
||||
|
||||
enum ThrottleSource {
|
||||
THROTTLE_SOURCE_THR,
|
||||
THROTTLE_SOURCE_P1,
|
||||
THROTTLE_SOURCE_P2,
|
||||
THROTTLE_SOURCE_P3,
|
||||
THROTTLE_SOURCE_S1 = THROTTLE_SOURCE_P1,
|
||||
THROTTLE_SOURCE_S2,
|
||||
THROTTLE_SOURCE_S3,
|
||||
THROTTLE_SOURCE_LS,
|
||||
THROTTLE_SOURCE_RS,
|
||||
THROTTLE_SOURCE_FIRST_CHANNEL,
|
||||
};
|
||||
|
||||
enum TelemetrySource {
|
||||
TELEMETRY_SOURCE_TX_BATT,
|
||||
TELEMETRY_SOURCE_TX_TIME,
|
||||
@@ -292,9 +281,7 @@ class RawSourceRange
|
||||
{
|
||||
}
|
||||
|
||||
float getValue(int value) {
|
||||
return min + float(value) * step;
|
||||
}
|
||||
float getValue(int value);
|
||||
|
||||
int decimals;
|
||||
double min;
|
||||
@@ -392,7 +379,7 @@ class RawSwitch {
|
||||
return index >= 0 ? (type * 256 + index) : -(type * 256 - index);
|
||||
}
|
||||
|
||||
QString toString();
|
||||
QString toString() const;
|
||||
|
||||
bool operator== ( const RawSwitch& other) {
|
||||
return (this->type == other.type) && (this->index == other.index);
|
||||
@@ -428,7 +415,7 @@ class CurveReference {
|
||||
CurveRefType type;
|
||||
int value;
|
||||
|
||||
QString toString();
|
||||
QString toString() const;
|
||||
};
|
||||
|
||||
enum InputMode {
|
||||
@@ -446,7 +433,7 @@ class ExpoData {
|
||||
unsigned int mode;
|
||||
unsigned int chn;
|
||||
RawSwitch swtch;
|
||||
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
|
||||
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
|
||||
int weight;
|
||||
int offset;
|
||||
CurveReference curve;
|
||||
@@ -469,14 +456,14 @@ class CurveData {
|
||||
CURVE_TYPE_LAST = CURVE_TYPE_CUSTOM
|
||||
};
|
||||
|
||||
CurveData() { clear(5); }
|
||||
|
||||
CurveData();
|
||||
void clear(int count);
|
||||
bool isEmpty() const;
|
||||
CurveType type;
|
||||
bool smooth;
|
||||
int count;
|
||||
CurvePoint points[C9X_MAX_POINTS];
|
||||
char name[6+1];
|
||||
void clear(int count) { memset(this, 0, sizeof(CurveData)); this->count = count; }
|
||||
};
|
||||
|
||||
class LimitData {
|
||||
@@ -490,9 +477,10 @@ class LimitData {
|
||||
bool symetrical;
|
||||
char name[6+1];
|
||||
CurveReference curve;
|
||||
QString minToString();
|
||||
QString maxToString();
|
||||
QString offsetToString();
|
||||
QString minToString() const;
|
||||
QString maxToString() const;
|
||||
QString offsetToString() const;
|
||||
QString revertToString() const;
|
||||
void clear();
|
||||
};
|
||||
|
||||
@@ -520,7 +508,7 @@ class MixData {
|
||||
bool noExpo;
|
||||
MltpxValue mltpx; // multiplex method 0=+ 1=* 2=replace
|
||||
unsigned int mixWarn; // mixer warning
|
||||
unsigned int phases; // -5=!FP4, 0=normal, 5=FP4
|
||||
unsigned int flightModes; // -5=!FP4, 0=normal, 5=FP4
|
||||
int sOffset;
|
||||
char name[MIXDATA_NAME_LEN+1];
|
||||
|
||||
@@ -577,10 +565,9 @@ class LogicalSwitchData { // Logical Switches data
|
||||
unsigned int duration;
|
||||
int andsw;
|
||||
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
|
||||
CSFunctionFamily getFunctionFamily();
|
||||
unsigned int getRangeFlags();
|
||||
QString funcToString();
|
||||
QString toString(const ModelData & model, const GeneralSettings & settings);
|
||||
CSFunctionFamily getFunctionFamily() const;
|
||||
unsigned int getRangeFlags() const;
|
||||
QString funcToString() const;
|
||||
};
|
||||
|
||||
enum AssignFunc {
|
||||
@@ -611,6 +598,12 @@ enum AssignFunc {
|
||||
FuncBackgroundMusicPause,
|
||||
FuncAdjustGV1,
|
||||
FuncAdjustGVLast = FuncAdjustGV1+C9X_MAX_GVARS-1,
|
||||
FuncSetFailsafeInternalModule,
|
||||
FuncSetFailsafeExternalModule,
|
||||
FuncRangeCheckInternalModule,
|
||||
FuncRangeCheckExternalModule,
|
||||
FuncBindInternalModule,
|
||||
FuncBindExternalModule,
|
||||
FuncCount,
|
||||
FuncReserve = -1
|
||||
};
|
||||
@@ -626,10 +619,15 @@ class CustomFunctionData { // Function Switches data
|
||||
unsigned int adjustMode;
|
||||
int repeatParam;
|
||||
void clear();
|
||||
QString funcToString();
|
||||
QString paramToString();
|
||||
QString repeatToString();
|
||||
QStringList toStringList();
|
||||
QString funcToString() const;
|
||||
QString paramToString(const ModelData * model) const;
|
||||
QString repeatToString() const;
|
||||
QString enabledToString() const;
|
||||
|
||||
static void populateResetParams(const ModelData * model, QComboBox * b, unsigned int value);
|
||||
static void populatePlaySoundParams(QStringList & qs);
|
||||
static void populateHapticParams(QStringList & qs);
|
||||
|
||||
};
|
||||
|
||||
class FlightModeData {
|
||||
@@ -757,6 +755,22 @@ enum TelemetryCurrentSources {
|
||||
TELEMETRY_CURRENT_SOURCE_FAS
|
||||
};
|
||||
|
||||
enum UartModes {
|
||||
UART_MODE_NONE,
|
||||
UART_MODE_TELEMETRY_MIRROR,
|
||||
UART_MODE_TELEMETRY,
|
||||
UART_MODE_SBUS_TRAINER,
|
||||
UART_MODE_DEBUG
|
||||
};
|
||||
|
||||
enum TrainerMode {
|
||||
TRAINER_MODE_MASTER_TRAINER_JACK,
|
||||
TRAINER_MODE_SLAVE,
|
||||
TRAINER_MODE_MASTER_SBUS_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_CPPM_EXTERNAL_MODULE,
|
||||
TRAINER_MODE_MASTER_BATTERY_COMPARTMENT,
|
||||
};
|
||||
|
||||
class FrSkyData {
|
||||
public:
|
||||
FrSkyData() { clear(); }
|
||||
@@ -769,6 +783,7 @@ class FrSkyData {
|
||||
FrSkyScreenData screens[4];
|
||||
FrSkyRSSIAlarm rssiAlarms[2];
|
||||
unsigned int varioSource;
|
||||
bool varioCenterSilent;
|
||||
int varioMin;
|
||||
int varioCenterMin; // if increment in 0.2m/s = 3.0m/s max
|
||||
int varioCenterMax;
|
||||
@@ -776,6 +791,7 @@ class FrSkyData {
|
||||
bool mAhPersistent;
|
||||
unsigned int storedMah;
|
||||
int fasOffset;
|
||||
bool ignoreSensorIds;
|
||||
|
||||
void clear();
|
||||
};
|
||||
@@ -792,6 +808,12 @@ class MavlinkData {
|
||||
|
||||
class TimerData {
|
||||
public:
|
||||
enum CountDownMode {
|
||||
COUNTDOWN_SILENT,
|
||||
COUNTDOWN_BEEPS,
|
||||
COUNTDOWN_VOICE,
|
||||
COUNTDOWN_HAPTIC
|
||||
};
|
||||
TimerData() { clear(); }
|
||||
RawSwitch mode;
|
||||
char name[TIMER_NAME_LEN+1];
|
||||
@@ -803,31 +825,32 @@ class TimerData {
|
||||
void clear() { memset(this, 0, sizeof(TimerData)); mode = RawSwitch(SWITCH_TYPE_TIMER_MODE, 0); }
|
||||
};
|
||||
|
||||
enum Protocol {
|
||||
OFF,
|
||||
PPM,
|
||||
SILV_A,
|
||||
SILV_B,
|
||||
SILV_C,
|
||||
CTP1009,
|
||||
LP45,
|
||||
DSM2,
|
||||
DSMX,
|
||||
PPM16,
|
||||
PPMSIM,
|
||||
PXX_XJT_X16,
|
||||
PXX_XJT_D8,
|
||||
PXX_XJT_LR12,
|
||||
PXX_DJT,
|
||||
PROTO_LAST
|
||||
enum PulsesProtocol {
|
||||
PULSES_OFF,
|
||||
PULSES_PPM,
|
||||
PULSES_SILV_A,
|
||||
PULSES_SILV_B,
|
||||
PULSES_SILV_C,
|
||||
PULSES_CTP1009,
|
||||
PULSES_LP45,
|
||||
PULSES_DSM2,
|
||||
PULSES_DSMX,
|
||||
PULSES_PPM16,
|
||||
PULSES_PPMSIM,
|
||||
PULSES_PXX_XJT_X16,
|
||||
PULSES_PXX_XJT_D8,
|
||||
PULSES_PXX_XJT_LR12,
|
||||
PULSES_PXX_DJT,
|
||||
PULSES_CROSSFIRE,
|
||||
PULSES_PROTOCOL_LAST
|
||||
};
|
||||
|
||||
enum TrainerProtocol {
|
||||
MASTER_JACK,
|
||||
SLAVE_JACK,
|
||||
MASTER_SBUS_MODULE,
|
||||
MASTER_CPPM_MODULE,
|
||||
MASTER_SBUS_BATT_COMPARTMENT
|
||||
TRAINER_MASTER_JACK,
|
||||
TRAINER_SLAVE_JACK,
|
||||
TRAINER_MASTER_SBUS_MODULE,
|
||||
TRAINER_MASTER_CPPM_MODULE,
|
||||
TRAINER_MASTER_SBUS_BATT_COMPARTMENT
|
||||
};
|
||||
|
||||
class ModuleData {
|
||||
@@ -842,10 +865,10 @@ class ModuleData {
|
||||
int failsafeChannels[C9X_NUM_CHNOUT];
|
||||
int ppmDelay;
|
||||
bool ppmPulsePol; // false = positive
|
||||
bool ppmOutputType; // false = open drain, true = push pull
|
||||
bool ppmOutputType; // false = open drain, true = push pull
|
||||
int ppmFrameLength;
|
||||
void clear() { memset(this, 0, sizeof(ModuleData)); }
|
||||
QString polarityToString() { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); }
|
||||
QString polarityToString() const { return ppmPulsePol ? QObject::tr("Positive") : QObject::tr("Negative"); } // TODO ModelPrinter
|
||||
};
|
||||
|
||||
#define C9X_MAX_SCRIPTS 7
|
||||
@@ -914,7 +937,7 @@ class SensorData {
|
||||
UNIT_PERCENT,
|
||||
UNIT_MAH,
|
||||
UNIT_WATTS,
|
||||
UNIT_DBM,
|
||||
UNIT_DB,
|
||||
UNIT_RPMS,
|
||||
UNIT_G,
|
||||
UNIT_DEGREE,
|
||||
@@ -987,6 +1010,11 @@ class ModelData {
|
||||
void removeInput(const int idx);
|
||||
|
||||
bool isInputValid(const unsigned int idx) const;
|
||||
bool hasExpos(uint8_t inputIdx) const;
|
||||
bool hasMixes(uint8_t output) const;
|
||||
|
||||
QVector<const ExpoData *> expos(int input) const;
|
||||
QVector<const MixData *> mixes(int channel) const;
|
||||
|
||||
bool used;
|
||||
char name[12+1];
|
||||
@@ -1037,8 +1065,10 @@ class ModelData {
|
||||
|
||||
SensorData sensorData[C9X_MAX_SENSORS];
|
||||
|
||||
unsigned int toplcdTimer;
|
||||
|
||||
void clear();
|
||||
bool isempty();
|
||||
bool isEmpty() const;
|
||||
void setDefaultInputs(const GeneralSettings & settings);
|
||||
void setDefaultMixes(const GeneralSettings & settings);
|
||||
void setDefaultValues(unsigned int id, const GeneralSettings & settings);
|
||||
@@ -1122,7 +1152,8 @@ class GeneralSettings {
|
||||
unsigned int currModel; // 0..15
|
||||
unsigned int contrast;
|
||||
unsigned int vBatWarn;
|
||||
int vBatCalib;
|
||||
int txVoltageCalibration;
|
||||
int txCurrentCalibration;
|
||||
int vBatMin;
|
||||
int vBatMax;
|
||||
int backlightMode;
|
||||
@@ -1170,7 +1201,6 @@ class GeneralSettings {
|
||||
int speakerVolume;
|
||||
unsigned int backlightBright;
|
||||
int switchesDelay;
|
||||
int currentCalib;
|
||||
int temperatureCalib;
|
||||
int temperatureWarn;
|
||||
unsigned int mAhWarn;
|
||||
@@ -1271,7 +1301,6 @@ enum Capability {
|
||||
HasExpoNames,
|
||||
HasNoExpo,
|
||||
HasMixerNames,
|
||||
HasChNames,
|
||||
HasCvNames,
|
||||
HasPxxCountry,
|
||||
HasPPMStart,
|
||||
@@ -1301,7 +1330,7 @@ enum Capability {
|
||||
PPMCenter,
|
||||
PPMUnitMicroseconds,
|
||||
SYMLimits,
|
||||
HasCurrentCalibration,
|
||||
HastxCurrentCalibration,
|
||||
HasVolume,
|
||||
HasBrightness,
|
||||
PerModelTimers,
|
||||
@@ -1313,6 +1342,8 @@ enum Capability {
|
||||
LCDWidth,
|
||||
GetThrSwitch,
|
||||
HasDisplayText,
|
||||
HasTopLcd,
|
||||
GlobalFunctions,
|
||||
VirtualInputs,
|
||||
TrainerInputs,
|
||||
RtcTime,
|
||||
@@ -1331,7 +1362,8 @@ enum Capability {
|
||||
HasInputDiff,
|
||||
HasMixerExpo,
|
||||
MixersMonitor,
|
||||
HasBatMeterRange
|
||||
HasBatMeterRange,
|
||||
DangerousFunctions,
|
||||
};
|
||||
|
||||
class SimulatorInterface;
|
||||
@@ -1348,19 +1380,17 @@ class EEPROMInterface
|
||||
|
||||
inline BoardEnum getBoard() { return board; }
|
||||
|
||||
virtual bool load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||
virtual unsigned long load(RadioData &radioData, const uint8_t *eeprom, int size) = 0;
|
||||
|
||||
virtual bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||
virtual unsigned long loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index) = 0;
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc) = 0;
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0) = 0;
|
||||
|
||||
virtual int getSize(ModelData &) = 0;
|
||||
virtual int getSize(const ModelData &) = 0;
|
||||
|
||||
virtual int getSize(GeneralSettings &) = 0;
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0) = 0;
|
||||
virtual int getSize(const GeneralSettings &) = 0;
|
||||
|
||||
virtual const int getEEpromSize() = 0;
|
||||
|
||||
@@ -1473,11 +1503,37 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
|
||||
void registerEEpromInterfaces();
|
||||
void unregisterEEpromInterfaces();
|
||||
void registerOpenTxFirmwares();
|
||||
void unregisterFirmwares();
|
||||
void unregisterOpenTxFirmwares();
|
||||
|
||||
bool loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
|
||||
bool loadEEprom(RadioData &radioData, const uint8_t *eeprom, int size);
|
||||
bool loadEEpromXml(RadioData &radioData, QDomDocument &doc);
|
||||
enum EepromLoadErrors {
|
||||
NO_ERROR,
|
||||
|
||||
UNKNOWN_ERROR,
|
||||
UNSUPPORTED_NEWER_VERSION,
|
||||
WRONG_SIZE,
|
||||
WRONG_FILE_SYSTEM,
|
||||
NOT_OPENTX,
|
||||
NOT_TH9X,
|
||||
NOT_GRUVIN9X,
|
||||
NOT_ERSKY9X,
|
||||
NOT_ER9X,
|
||||
UNKNOWN_BOARD,
|
||||
WRONG_BOARD,
|
||||
BACKUP_NOT_SUPPORTED,
|
||||
|
||||
HAS_WARNINGS,
|
||||
OLD_VERSION,
|
||||
WARNING_WRONG_FIRMWARE,
|
||||
|
||||
NUM_ERRORS
|
||||
};
|
||||
|
||||
void ShowEepromErrors(QWidget *parent, const QString &title, const QString &mainMessage, unsigned long errorsFound);
|
||||
void ShowEepromWarnings(QWidget *parent, const QString &title, unsigned long errorsFound);
|
||||
|
||||
unsigned long LoadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index);
|
||||
unsigned long LoadEeprom(RadioData &radioData, const uint8_t *eeprom, int size);
|
||||
unsigned long LoadEepromXml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
struct Option {
|
||||
const char * name;
|
||||
@@ -1571,6 +1627,8 @@ class Firmware {
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source) = 0;
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0) = 0;
|
||||
|
||||
public:
|
||||
QList<const char *> languages;
|
||||
QList<const char *> ttslanguages;
|
||||
|
||||
@@ -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)
|
||||
@@ -52,7 +51,8 @@ void RleFile::EeFsCreate(uint8_t *eeprom, int size, BoardEnum board, unsigned in
|
||||
if (IS_SKY9X(board)) {
|
||||
memset(eeprom, 0xFF, size);
|
||||
if (version >= 217) {
|
||||
eepromFatHeader = (EepromHeader *)eeprom;
|
||||
memset(eeprom, 0, EEPROM_FAT_SIZE);
|
||||
eepromFatHeader = (EepromHeader *)(eeprom + EEPROM_FAT_SIZE);
|
||||
eepromFatHeader->mark = EEPROM_MARK;
|
||||
eepromFatHeader->index = 1;
|
||||
for (int i=0; i<EEPROM_MAX_FILES; i++) {
|
||||
@@ -121,20 +121,16 @@ PACK(struct EepromFileHeader
|
||||
|
||||
bool RleFile::searchFat()
|
||||
{
|
||||
int bestFatIndex = -1;
|
||||
eepromFatHeader = NULL;
|
||||
uint32_t bestFatIndex = 0;
|
||||
for (int i=0; i<EEPROM_ZONE_SIZE/EEPROM_FAT_SIZE; i++) {
|
||||
EepromHeader * header = (EepromHeader *)(eeprom+i*EEPROM_FAT_SIZE);
|
||||
if (header->mark == EEPROM_MARK && (int)header->index >= bestFatIndex) {
|
||||
bestFatIndex = i;
|
||||
eepromFatHeader = header;
|
||||
bestFatIndex = header->index;
|
||||
}
|
||||
}
|
||||
if (bestFatIndex >= 0) {
|
||||
eepromFatHeader = (EepromHeader *)(eeprom+bestFatIndex*EEPROM_FAT_SIZE);;
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return (eepromFatHeader != NULL);
|
||||
}
|
||||
|
||||
bool RleFile::EeFsOpen(uint8_t *eeprom, int size, BoardEnum board)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "firmwareinterface.h"
|
||||
#include "helpers.h"
|
||||
|
||||
#define FW_MARK "FW"
|
||||
#define VERS_MARK "VERS"
|
||||
#define DATE_MARK "DATE"
|
||||
#define TIME_MARK "TIME"
|
||||
@@ -44,30 +45,34 @@ int getFileType(const QString &fullFileName)
|
||||
|
||||
FirmwareInterface::FirmwareInterface(const QString &filename):
|
||||
flash(MAX_FSIZE, 0),
|
||||
flash_size(0),
|
||||
flashSize(0),
|
||||
versionId(0),
|
||||
splash_offset(0),
|
||||
splash_size(0),
|
||||
splash_width(0),
|
||||
splash_height(0),
|
||||
eepromVersion(0),
|
||||
eepromVariant(0),
|
||||
splashOffset(0),
|
||||
splashSize(0),
|
||||
splashWidth(0),
|
||||
splashHeight(0),
|
||||
isValidFlag(false)
|
||||
{
|
||||
if (!filename.isEmpty()) {
|
||||
QFile file(filename);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { // reading HEX TEXT file
|
||||
QTextStream inputStream(&file);
|
||||
flash_size = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
|
||||
flashSize = HexInterface(inputStream).load((uint8_t *)flash.data(), MAX_FSIZE);
|
||||
file.close();
|
||||
if (flash_size == 0) {
|
||||
if (flashSize == 0) {
|
||||
file.open(QIODevice::ReadOnly);
|
||||
flash_size = file.read((char *)flash.data(), MAX_FSIZE);
|
||||
flashSize = file.read((char *)flash.data(), MAX_FSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (flash_size > 0) {
|
||||
if (flashSize > 0) {
|
||||
flavour = seekLabel(FW_MARK);
|
||||
version = seekLabel(VERS_MARK);
|
||||
if (version.startsWith("opentx-")) {
|
||||
// old version format
|
||||
int index = version.lastIndexOf('-');
|
||||
flavour = version.mid(0, index);
|
||||
version = version.mid(index+1);
|
||||
@@ -150,8 +155,8 @@ bool FirmwareInterface::SeekSplash(QByteArray splash)
|
||||
{
|
||||
int start = flash.indexOf(splash);
|
||||
if (start>0) {
|
||||
splash_offset = start;
|
||||
splash_size = splash.size();
|
||||
splashOffset = start;
|
||||
splashSize = splash.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -167,8 +172,8 @@ bool FirmwareInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
if (start>0) {
|
||||
int end = start + sps.size() + size;
|
||||
if (end == flash.indexOf(spe, end)) {
|
||||
splash_offset = start + sps.size();
|
||||
splash_size = end - start - sps.size();
|
||||
splashOffset = start + sps.size();
|
||||
splashSize = end - start - sps.size();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
@@ -187,10 +192,10 @@ bool FirmwareInterface::SeekSplash(QByteArray sps, QByteArray spe, int size)
|
||||
|
||||
void FirmwareInterface::SeekSplash(void)
|
||||
{
|
||||
splash_size = 0;
|
||||
splash_offset = 0;
|
||||
splash_width = SPLASH_WIDTH;
|
||||
splash_height = SPLASH_HEIGHT;
|
||||
splashSize = 0;
|
||||
splashOffset = 0;
|
||||
splashWidth = SPLASH_WIDTH;
|
||||
splashHeight = SPLASH_HEIGHT;
|
||||
splash_format = QImage::Format_Mono;
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)gr9x_splash, sizeof(gr9x_splash))) || SeekSplash(QByteArray((const char *)gr9xv4_splash, sizeof(gr9xv4_splash)))) {
|
||||
@@ -206,8 +211,8 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray((const char *)opentxtaranis_splash, sizeof(opentxtaranis_splash)))) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splashWidth = SPLASHX9D_WIDTH;
|
||||
splashHeight = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
@@ -221,8 +226,8 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(OTX_SPS_TARANIS, OTX_SPS_SIZE), QByteArray(OTX_SPE, OTX_SPE_SIZE), 6784)) {
|
||||
splash_width = SPLASHX9D_WIDTH;
|
||||
splash_height = SPLASHX9D_HEIGHT;
|
||||
splashWidth = SPLASHX9D_WIDTH;
|
||||
splashHeight = SPLASHX9D_HEIGHT;
|
||||
splash_format = QImage::Format_Indexed8;
|
||||
return;
|
||||
}
|
||||
@@ -232,14 +237,14 @@ void FirmwareInterface::SeekSplash(void)
|
||||
}
|
||||
|
||||
if (SeekSplash(QByteArray(ERSPLASH_MARKER, sizeof(ERSPLASH_MARKER)))) {
|
||||
splash_offset += sizeof(ERSPLASH_MARKER);
|
||||
splash_size = sizeof(er9x_splash);
|
||||
splashOffset += sizeof(ERSPLASH_MARKER);
|
||||
splashSize = sizeof(er9x_splash);
|
||||
}
|
||||
}
|
||||
|
||||
bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
if (splashOffset == 0 || splashSize == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -247,9 +252,9 @@ bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
QColor color;
|
||||
QByteArray splash;
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
unsigned int idx = (y/2)*splashWidth;
|
||||
for (unsigned int x=0; x<splashWidth; x++, idx++) {
|
||||
QRgb gray = qGray(newsplash.pixel(x, y));
|
||||
uint8_t z = ((255-gray)*15)/255;
|
||||
if (y & 1) z <<= 4;
|
||||
@@ -260,27 +265,27 @@ bool FirmwareInterface::setSplash(const QImage & newsplash)
|
||||
else {
|
||||
QColor black = QColor(0,0,0);
|
||||
QImage blackNwhite = newsplash.convertToFormat(QImage::Format_MonoLSB);
|
||||
for (uint y=0; y<splash_height; y++) {
|
||||
for (uint x=0; x<splash_width; x++) {
|
||||
for (uint y=0; y<splashHeight; y++) {
|
||||
for (uint x=0; x<splashWidth; x++) {
|
||||
color = QColor(blackNwhite.pixel(x,y));
|
||||
b[splash_width*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
b[splashWidth*(y/8) + x] |= ((color==black ? 1: 0)<<(y % 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
splash.clear();
|
||||
splash.append(b, splash_size);
|
||||
flash.replace(splash_offset, splash_size, splash);
|
||||
splash.append(b, splashSize);
|
||||
flash.replace(splashOffset, splashSize, splash);
|
||||
return true;
|
||||
}
|
||||
|
||||
int FirmwareInterface::getSplashWidth()
|
||||
{
|
||||
return splash_width;
|
||||
return splashWidth;
|
||||
}
|
||||
|
||||
uint FirmwareInterface::getSplashHeight()
|
||||
{
|
||||
return splash_height;
|
||||
return splashHeight;
|
||||
}
|
||||
|
||||
QImage::Format FirmwareInterface::getSplashFormat()
|
||||
@@ -290,17 +295,17 @@ QImage::Format FirmwareInterface::getSplashFormat()
|
||||
|
||||
QImage FirmwareInterface::getSplash()
|
||||
{
|
||||
if (splash_offset == 0 || splash_size == 0) {
|
||||
if (splashOffset == 0 || splashSize == 0) {
|
||||
return QImage(); // empty image
|
||||
}
|
||||
|
||||
if (splash_format == QImage::Format_Indexed8) {
|
||||
QImage image(splash_width, splash_height, QImage::Format_RGB888);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
unsigned int idx = (y/2)*splash_width;
|
||||
for (unsigned int x=0; x<splash_width; x++, idx++) {
|
||||
uint8_t byte = flash.at(splash_offset+idx);
|
||||
QImage image(splashWidth, splashHeight, QImage::Format_RGB888);
|
||||
if (splashOffset > 0) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
unsigned int idx = (y/2)*splashWidth;
|
||||
for (unsigned int x=0; x<splashWidth; x++, idx++) {
|
||||
uint8_t byte = flash.at(splashOffset+idx);
|
||||
unsigned int z = (y & 1) ? (byte >> 4) : (byte & 0x0F);
|
||||
z = 255-(z*255)/15;
|
||||
QRgb rgb = qRgb(z, z, z);
|
||||
@@ -311,11 +316,11 @@ QImage FirmwareInterface::getSplash()
|
||||
return image;
|
||||
}
|
||||
else {
|
||||
QImage image(splash_width, splash_height, QImage::Format_Mono);
|
||||
if (splash_offset > 0) {
|
||||
for (unsigned int y=0; y<splash_height; y++) {
|
||||
for(unsigned int x=0; x<splash_width; x++) {
|
||||
image.setPixel(x, y, (flash.at(splash_offset+(splash_width*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
|
||||
QImage image(splashWidth, splashHeight, QImage::Format_Mono);
|
||||
if (splashOffset > 0) {
|
||||
for (unsigned int y=0; y<splashHeight; y++) {
|
||||
for(unsigned int x=0; x<splashWidth; x++) {
|
||||
image.setPixel(x, y, (flash.at(splashOffset+(splashWidth*(y/8)+x)) & (1<<(y % 8))) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,7 +330,7 @@ QImage FirmwareInterface::getSplash()
|
||||
|
||||
bool FirmwareInterface::hasSplash()
|
||||
{
|
||||
return (splash_offset > 0 ? true : false);
|
||||
return (splashOffset > 0 ? true : false);
|
||||
}
|
||||
|
||||
bool FirmwareInterface::isValid()
|
||||
@@ -336,7 +341,7 @@ bool FirmwareInterface::isValid()
|
||||
unsigned int FirmwareInterface::save(QString fileName)
|
||||
{
|
||||
uint8_t binflash[MAX_FSIZE];
|
||||
memcpy(&binflash, flash.constData(), flash_size);
|
||||
memcpy(&binflash, flash.constData(), flashSize);
|
||||
QFile file(fileName);
|
||||
|
||||
int fileType = getFileType(fileName);
|
||||
@@ -347,16 +352,16 @@ unsigned int FirmwareInterface::save(QString fileName)
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
HexInterface hex=HexInterface(outputStream);
|
||||
hex.save(binflash, flash_size);
|
||||
hex.save(binflash, flashSize);
|
||||
}
|
||||
else {
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { //reading HEX TEXT file
|
||||
return -1;
|
||||
}
|
||||
file.write((char*)binflash, flash_size);
|
||||
file.write((char*)binflash, flashSize);
|
||||
}
|
||||
|
||||
file.close();
|
||||
|
||||
return flash_size;
|
||||
return flashSize;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class FirmwareInterface
|
||||
FirmwareInterface(const QString &filename);
|
||||
inline QString getDate() { return date; }
|
||||
inline QString getTime() { return time; }
|
||||
int getSize() { return flash_size; }
|
||||
int getSize() { return flashSize; }
|
||||
QString getFlavour() const;
|
||||
bool isHardwareCompatible(const FirmwareInterface &previousFirmware) const;
|
||||
inline QString getVersion() { return version; }
|
||||
@@ -64,7 +64,7 @@ class FirmwareInterface
|
||||
|
||||
private:
|
||||
QByteArray flash;
|
||||
uint flash_size;
|
||||
uint flashSize;
|
||||
QString seekString(const QString & string);
|
||||
QString seekLabel(const QString & label);
|
||||
void SeekSplash();
|
||||
@@ -80,10 +80,10 @@ class FirmwareInterface
|
||||
int eepromVersion;
|
||||
int eepromVariant;
|
||||
QByteArray splash;
|
||||
uint splash_offset;
|
||||
uint splash_size;
|
||||
uint splash_width;
|
||||
uint splash_height;
|
||||
uint splashOffset;
|
||||
uint splashSize;
|
||||
uint splashWidth;
|
||||
uint splashHeight;
|
||||
QImage::Format splash_format;
|
||||
bool isValidFlag;
|
||||
};
|
||||
|
||||
@@ -70,7 +70,7 @@ Er9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
result.trainer = trainer;
|
||||
result.blightinv=blightinv;
|
||||
result.stickScroll=stickScroll;
|
||||
@@ -361,16 +361,16 @@ t_Er9xModelData::operator ModelData ()
|
||||
c9x.timers[0].val = tmrVal;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
|
||||
@@ -61,7 +61,7 @@ PACK(typedef struct t_Er9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Er9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
|
||||
@@ -89,14 +89,17 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying er9x xml import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
Er9xGeneral er9xGeneral;
|
||||
memset(&er9xGeneral,0,sizeof(er9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &er9xGeneral)) {
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
} else {
|
||||
radioData.generalSettings=er9xGeneral;
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
@@ -111,21 +114,26 @@ bool Er9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying er9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -133,7 +141,8 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
|
||||
if (efile->readRlc1((uint8_t*)&er9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)er9xGeneral.myVers << " ";
|
||||
@@ -151,13 +160,16 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
break;
|
||||
default:
|
||||
std::cout << "not er9x\n";
|
||||
return false;
|
||||
errors.set(NOT_ER9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc1((uint8_t*)&er9xGeneral, sizeof(Er9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
|
||||
}
|
||||
radioData.generalSettings = er9xGeneral;
|
||||
|
||||
@@ -174,12 +186,15 @@ bool Er9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Er9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -190,23 +205,23 @@ int Er9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::getSize(ModelData &model)
|
||||
int Er9xInterface::getSize(const ModelData &model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::getSize(GeneralSettings &settings)
|
||||
int Er9xInterface::getSize(const GeneralSettings &settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Er9xInterface::isAvailable(Protocol prot, int port)
|
||||
int Er9xInterface::isAvailable(PulsesProtocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -29,24 +29,24 @@ class Er9xInterface : public EEPROMInterface
|
||||
virtual ~Er9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
virtual int getSize(const ModelData &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int getSize(const GeneralSettings &settings);
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -54,17 +54,17 @@ class Er9xInterface : public EEPROMInterface
|
||||
|
||||
private:
|
||||
void appendTextElement(QDomDocument * qdoc, QDomElement * pe, QString name, QString value);
|
||||
|
||||
|
||||
void appendNumberElement(QDomDocument * qdoc, QDomElement * pe,QString name, int value, bool forceZeroWrite = false);
|
||||
|
||||
|
||||
void appendCDATAElement(QDomDocument * qdoc, QDomElement * pe,QString name, const char * data, int size);
|
||||
|
||||
|
||||
QDomElement getGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); //parse out data to XML format
|
||||
|
||||
|
||||
QDomElement getModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum, int mdver); //parse out data to XML format
|
||||
|
||||
|
||||
bool loadGeneralDataXML(QDomDocument * qdoc, Er9xGeneral * tgen); // get data from XML
|
||||
|
||||
|
||||
bool loadModelDataXML(QDomDocument * qdoc, Er9xModelData * tmod, int modelNum = -1); // get data from XML
|
||||
|
||||
};
|
||||
|
||||
@@ -172,8 +172,7 @@ bool Er9xSimulator::timer10ms()
|
||||
|
||||
uint8_t * Er9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Er9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
||||
@@ -54,8 +54,14 @@ class Er9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { 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;
|
||||
|
||||
@@ -82,7 +82,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -135,7 +135,7 @@ Ersky9xGeneral::operator GeneralSettings ()
|
||||
result.switchWarningStates = switchWarningStates;
|
||||
result.speakerVolume = volume;
|
||||
result.backlightBright = bright ;
|
||||
result.currentCalib = current_calib;
|
||||
result.txCurrentCalibration = current_calib;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -493,16 +493,16 @@ t_Ersky9xModelData_v10::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
@@ -608,16 +608,16 @@ t_Ersky9xModelData_v11::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].ppmFrameLength=ppmFrameLength;
|
||||
|
||||
@@ -69,7 +69,7 @@ PACK(typedef struct t_Ersky9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Ersky9xTrainerData trainer;
|
||||
uint8_t view;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <QMessageBox>
|
||||
#include "ersky9xinterface.h"
|
||||
#include "ersky9xeeprom.h"
|
||||
#include "simulator/ersky9xsimulator.h"
|
||||
@@ -120,14 +119,17 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
|
||||
model.swashCollectiveSource = applyStickMode(model.swashCollectiveSource, mode);
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
std::cout << "trying ersky9x xml import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
Ersky9xGeneral ersky9xGeneral;
|
||||
memset(&ersky9xGeneral,0,sizeof(ersky9xGeneral));
|
||||
if(!loadGeneralDataXML(&doc, &ersky9xGeneral)) {
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
else {
|
||||
radioData.generalSettings=ersky9xGeneral;
|
||||
@@ -137,32 +139,39 @@ bool Ersky9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
if (ersky9xGeneral.myVers == 10) {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v10>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!loadModelDataXML<Ersky9xModelData_v11>(&doc, &radioData.models[i], i, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying ersky9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != EESIZE_SKY9X) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_SKY9X)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -170,7 +179,8 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
|
||||
|
||||
if (efile->readRlc2((uint8_t*)&ersky9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)ersky9xGeneral.myVers << " ";
|
||||
@@ -182,12 +192,14 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
|
||||
break;
|
||||
default:
|
||||
std::cout << "not ersky9x\n";
|
||||
return false;
|
||||
errors.set(NOT_ERSKY9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (!efile->readRlc2((uint8_t*)&ersky9xGeneral, sizeof(Ersky9xGeneral))) {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
radioData.generalSettings = ersky9xGeneral;
|
||||
|
||||
@@ -218,12 +230,15 @@ bool Ersky9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int siz
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Ersky9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -234,23 +249,23 @@ int Ersky9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t varia
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::getSize(ModelData &model)
|
||||
int Ersky9xInterface::getSize(const ModelData & model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::getSize(GeneralSettings &settings)
|
||||
int Ersky9xInterface::getSize(const GeneralSettings & settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Ersky9xInterface::isAvailable(Protocol prot, int port)
|
||||
int Ersky9xInterface::isAvailable(PulsesProtocol prot, int port)
|
||||
{
|
||||
switch (prot) {
|
||||
case PPM:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_PXX_DJT:
|
||||
case PULSES_PPM16:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -34,19 +34,19 @@ class Ersky9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t * eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t * eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t * eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t * eeprom, RadioData & radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
virtual int getSize(const ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
virtual int getSize(const GeneralSettings & settings);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -194,8 +194,7 @@ bool Ersky9xSimulator::timer10ms()
|
||||
|
||||
uint8_t * Ersky9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Ersky9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
||||
@@ -54,8 +54,14 @@ class Ersky9xSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len) {};
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id) { 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;
|
||||
|
||||
@@ -70,7 +70,7 @@ Gruvin9xGeneral_v103::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -127,7 +127,7 @@ Gruvin9xGeneral_v104::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
|
||||
result.backlightMode = 0;
|
||||
if (lightSw == 22) {
|
||||
@@ -170,12 +170,12 @@ t_Gruvin9xExpoData::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
c9x.swtch = gruvin9xToSwitch(swtch);
|
||||
if (negPhase) {
|
||||
c9x.phases= 1 << (phase -1);
|
||||
c9x.flightModes= 1 << (phase -1);
|
||||
} else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
} else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.weight = weight;
|
||||
if (expo) {
|
||||
@@ -423,25 +423,25 @@ t_Gruvin9xModelData_v102::operator ModelData ()
|
||||
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -493,25 +493,25 @@ t_Gruvin9xModelData_v103::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -563,25 +563,25 @@ t_Gruvin9xModelData_v105::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -653,25 +653,25 @@ t_Gruvin9xModelData_v106::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = SILV_A;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_A;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = SILV_B;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_B;
|
||||
break;
|
||||
case 5:
|
||||
c9x.moduleData[0].protocol = SILV_C;
|
||||
c9x.moduleData[0].protocol = PULSES_SILV_C;
|
||||
break;
|
||||
case 6:
|
||||
c9x.moduleData[0].protocol = CTP1009;
|
||||
c9x.moduleData[0].protocol = PULSES_CTP1009;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -69,7 +69,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v103 {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v103 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
@@ -106,7 +106,7 @@ PACK(typedef struct t_Gruvin9xGeneral_v104 {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Gruvin9xTrainerData_v104 trainer;
|
||||
uint8_t view; //index of subview in main scrren
|
||||
|
||||
@@ -93,24 +93,30 @@ bool Gruvin9xInterface::loadGeneral(GeneralSettings &settings, int version)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Gruvin9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
|
||||
bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != this->getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -118,14 +124,16 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (version == 0) {
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (efile->readRlc1(&version, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,25 +153,33 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
break;
|
||||
default:
|
||||
std::cout << "not gruvin9x\n";
|
||||
return false;
|
||||
errors.set(NOT_GRUVIN9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
if (version == 5) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings, 1)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else if (version < 104) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v103>(radioData.generalSettings)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else if (version <= 106) {
|
||||
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings))
|
||||
return false;
|
||||
if (!loadGeneral<Gruvin9xGeneral_v104>(radioData.generalSettings)) {
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
@@ -185,17 +201,21 @@ bool Gruvin9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int si
|
||||
}
|
||||
else {
|
||||
std::cout << "ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Gruvin9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -206,25 +226,25 @@ int Gruvin9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t vari
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::getSize(ModelData &model)
|
||||
int Gruvin9xInterface::getSize(const ModelData & model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::getSize(GeneralSettings &settings)
|
||||
int Gruvin9xInterface::getSize(const GeneralSettings & settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Gruvin9xInterface::isAvailable(Protocol proto, int port)
|
||||
int Gruvin9xInterface::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case SILV_A:
|
||||
case SILV_B:
|
||||
case SILV_C:
|
||||
case CTP1009:
|
||||
case DSM2:
|
||||
case PULSES_PPM:
|
||||
case PULSES_SILV_A:
|
||||
case PULSES_SILV_B:
|
||||
case PULSES_SILV_C:
|
||||
case PULSES_CTP1009:
|
||||
case PULSES_DSM2:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -30,24 +30,25 @@ class Gruvin9xInterface : public EEPROMInterface
|
||||
virtual ~Gruvin9xInterface();
|
||||
|
||||
virtual const char * getName();
|
||||
|
||||
|
||||
virtual const int getEEpromSize();
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom,int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &settings);
|
||||
virtual int getSize(const ModelData &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int getSize(const GeneralSettings & settings);
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -87,14 +87,14 @@ t_Open9xGruvin9xMixData_v207::operator MixData ()
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
@@ -155,14 +155,14 @@ t_Open9xGruvin9xMixData_v209::operator MixData ()
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ t_Open9xGruvin9xMixData_v211::operator MixData ()
|
||||
c9x.noExpo = noExpo;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
c9x.phases = phases;
|
||||
c9x.flightModes = phases;
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
return c9x;
|
||||
@@ -440,16 +440,16 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -514,19 +514,19 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -596,19 +596,19 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -679,19 +679,19 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -766,19 +766,19 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -160,12 +160,12 @@ t_Open9xArmExpoData_v208::operator ExpoData ()
|
||||
}
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
} else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
} else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.weight = weight;
|
||||
return c9x;
|
||||
@@ -190,14 +190,14 @@ t_Open9xArmExpoData_v210::operator ExpoData ()
|
||||
}
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.weight = weight;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
@@ -213,7 +213,7 @@ t_Open9xArmExpoData_v212::operator ExpoData ()
|
||||
// TODO c9x.curveMode=curveMode;
|
||||
// c9x.curveParam=curveParam;
|
||||
c9x.swtch = open9xArmToSwitch(swtch);
|
||||
c9x.phases= phases;
|
||||
c9x.flightModes= phases;
|
||||
c9x.weight = weight;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
return c9x;
|
||||
@@ -292,14 +292,14 @@ t_Open9xArmMixData_v208::operator MixData ()
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=511;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=511;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
|
||||
c9x.sOffset = sOffset;
|
||||
@@ -358,14 +358,14 @@ t_Open9xArmMixData_v209::operator MixData ()
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=511;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=511;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
|
||||
c9x.sOffset = sOffset;
|
||||
@@ -424,14 +424,14 @@ t_Open9xArmMixData_v210::operator MixData ()
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
c9x.flightModes= 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
c9x.flightModes=0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=511;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes=511;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
|
||||
c9x.sOffset = sOffset;
|
||||
@@ -493,7 +493,7 @@ t_Open9xArmMixData_v212::operator MixData ()
|
||||
c9x.noExpo = noExpo;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
c9x.phases = phases;
|
||||
c9x.flightModes = phases;
|
||||
c9x.sOffset = sOffset;
|
||||
getEEPROMZString(c9x.name, name, sizeof(name));
|
||||
}
|
||||
@@ -716,19 +716,19 @@ t_Open9xArmModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -799,19 +799,19 @@ t_Open9xArmModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -883,19 +883,19 @@ t_Open9xArmModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -967,19 +967,19 @@ t_Open9xArmModelData_v211::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1054,19 +1054,19 @@ t_Open9xArmModelData_v212::operator ModelData ()
|
||||
}
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -88,7 +88,7 @@ t_Open9xExpoData_v201::operator ExpoData ()
|
||||
ExpoData c9x;
|
||||
c9x.mode = mode;
|
||||
c9x.chn = chn;
|
||||
if (expo!=0 && curve!=0) {
|
||||
if (expo != 0 && curve != 0) {
|
||||
EEPROMWarnings.push_back(::QObject::tr("Simultaneous usage of expo and curves is no longer supported in OpenTX"));
|
||||
}
|
||||
else {
|
||||
@@ -101,14 +101,14 @@ t_Open9xExpoData_v201::operator ExpoData ()
|
||||
}
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
if (negPhase) {
|
||||
c9x.phases= 1 << (phase -1);
|
||||
c9x.flightModes = 1 << (phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
else if (phase == 0) {
|
||||
c9x.flightModes = 0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes = 63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.weight = weight;
|
||||
return c9x;
|
||||
@@ -121,7 +121,7 @@ t_Open9xExpoData_v211::operator ExpoData ()
|
||||
c9x.chn = chn;
|
||||
// TODO c9x.curve
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
c9x.phases = phases;
|
||||
c9x.flightModes = phases;
|
||||
c9x.weight = weight;
|
||||
return c9x;
|
||||
}
|
||||
@@ -129,8 +129,8 @@ t_Open9xExpoData_v211::operator ExpoData ()
|
||||
t_Open9xLimitData_v201::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.min = 10 * (min - 100);
|
||||
c9x.max = 10 * (max + 100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
return c9x;
|
||||
@@ -139,12 +139,12 @@ t_Open9xLimitData_v201::operator LimitData ()
|
||||
t_Open9xLimitData_v211::operator LimitData ()
|
||||
{
|
||||
LimitData c9x;
|
||||
c9x.min = 10*(min-100);
|
||||
c9x.max = 10*(max+100);
|
||||
c9x.min = 10 * (min - 100);
|
||||
c9x.max = 10 * (max + 100);
|
||||
c9x.revert = revert;
|
||||
c9x.offset = offset;
|
||||
c9x.symetrical=symetrical;
|
||||
c9x.ppmCenter=ppmCenter;
|
||||
c9x.symetrical = symetrical;
|
||||
c9x.ppmCenter = ppmCenter;
|
||||
return c9x;
|
||||
}
|
||||
|
||||
@@ -197,13 +197,13 @@ t_Open9xMixData_v201::operator MixData ()
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
} else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
if (phase < 0) {
|
||||
c9x.flightModes = 1 << (-phase -1);
|
||||
} else if (phase == 0) {
|
||||
c9x.flightModes = 0;
|
||||
} else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes = 63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
return c9x;
|
||||
@@ -258,13 +258,13 @@ t_Open9xMixData_v203::operator MixData ()
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
} else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
if (phase < 0) {
|
||||
c9x.flightModes = 1 << (-phase -1);
|
||||
} else if (phase == 0) {
|
||||
c9x.flightModes = 0;
|
||||
} else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes = 63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
return c9x;
|
||||
@@ -319,15 +319,15 @@ t_Open9xMixData_v205::operator MixData ()
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
if (phase < 0) {
|
||||
c9x.flightModes = 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
else if (phase == 0) {
|
||||
c9x.flightModes = 0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes = 63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ t_Open9xMixData_v209::operator MixData ()
|
||||
MixData c9x;
|
||||
|
||||
if (srcRaw) {
|
||||
c9x.destCh = destCh+1;
|
||||
c9x.destCh = destCh + 1;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
@@ -386,15 +386,15 @@ t_Open9xMixData_v209::operator MixData ()
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
|
||||
if (phase<0) {
|
||||
c9x.phases= 1 << (-phase -1);
|
||||
if (phase < 0) {
|
||||
c9x.flightModes = 1 << (-phase -1);
|
||||
}
|
||||
else if (phase==0) {
|
||||
c9x.phases=0;
|
||||
else if (phase ==0 ) {
|
||||
c9x.flightModes = 0;
|
||||
}
|
||||
else {
|
||||
c9x.phases=63;
|
||||
c9x.phases &= ~(1 << (phase -1));
|
||||
c9x.flightModes = 63;
|
||||
c9x.flightModes &= ~(1 << (phase -1));
|
||||
}
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ t_Open9xMixData_v211::operator MixData ()
|
||||
MixData c9x;
|
||||
|
||||
if (srcRaw) {
|
||||
c9x.destCh = destCh+1;
|
||||
c9x.destCh = destCh + 1;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
|
||||
if (srcRaw == 0) {
|
||||
@@ -453,7 +453,7 @@ t_Open9xMixData_v211::operator MixData ()
|
||||
c9x.noExpo = noExpo;
|
||||
c9x.mltpx = (MltpxValue)mltpx;
|
||||
c9x.mixWarn = mixWarn;
|
||||
c9x.phases = phases;
|
||||
c9x.flightModes = phases;
|
||||
c9x.sOffset = sOffset;
|
||||
}
|
||||
return c9x;
|
||||
@@ -603,8 +603,8 @@ t_Open9xCustomFunctionData_v203::operator CustomFunctionData ()
|
||||
CustomFunctionData c9x;
|
||||
c9x.swtch = open9xStockToSwitch(swtch);
|
||||
if (func < 16) {
|
||||
c9x.enabled=param & 0x01;
|
||||
c9x.param = (param>>1)<<1;
|
||||
c9x.enabled = param & 0x01;
|
||||
c9x.param = (param>>1) << 1;
|
||||
c9x.func = (AssignFunc)(func);
|
||||
} else {
|
||||
c9x.param = param;
|
||||
@@ -730,7 +730,7 @@ t_Open9xTimerData_v202::operator TimerData ()
|
||||
FrSkyRSSIAlarm t_Open9xFrSkyRSSIAlarm::get(int index)
|
||||
{
|
||||
FrSkyRSSIAlarm c9x;
|
||||
c9x.level = (2+index+level) % 4;
|
||||
c9x.level = (2 + index + level) % 4;
|
||||
c9x.value = value + 50;
|
||||
return c9x;
|
||||
}
|
||||
@@ -840,7 +840,7 @@ t_Open9xFrSkyData_v204::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.blades = blades+2;
|
||||
c9x.blades = blades + 2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
c9x.screens[0].body.bars[i] = bars[i];
|
||||
@@ -853,7 +853,7 @@ t_Open9xFrSkyData_v205::operator FrSkyData ()
|
||||
c9x.channels[0] = channels[0];
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.blades = blades+2;
|
||||
c9x.blades = blades + 2;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
c9x.screens[0].body.bars[i] = bars[i];
|
||||
@@ -869,7 +869,7 @@ t_Open9xFrSkyData_v208::operator FrSkyData ()
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.voltsSource = voltsSource;
|
||||
c9x.blades = blades+2;
|
||||
c9x.blades = blades + 2;
|
||||
c9x.currentSource=currentSource;
|
||||
c9x.screens[0].type = 1;
|
||||
for (int i=0; i<4; i++)
|
||||
@@ -886,7 +886,7 @@ t_Open9xFrSkyData_v210::operator FrSkyData ()
|
||||
c9x.channels[1] = channels[1];
|
||||
c9x.usrProto = usrProto;
|
||||
c9x.voltsSource = voltsSource;
|
||||
c9x.blades = blades+2;
|
||||
c9x.blades = blades + 2;
|
||||
c9x.currentSource=currentSource;
|
||||
|
||||
int lines_screen_index = 0;
|
||||
@@ -917,16 +917,16 @@ t_Open9xModelData_v201::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -991,16 +991,16 @@ t_Open9xModelData_v202::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1067,16 +1067,16 @@ t_Open9xModelData_v203::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1141,16 +1141,16 @@ t_Open9xModelData_v204::operator ModelData ()
|
||||
c9x.timers[1] = timer2;
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1217,19 +1217,19 @@ t_Open9xModelData_v205::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1295,19 +1295,19 @@ t_Open9xModelData_v208::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1381,19 +1381,19 @@ t_Open9xModelData_v209::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1468,19 +1468,19 @@ t_Open9xModelData_v210::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
@@ -1556,19 +1556,19 @@ t_Open9xModelData_v211::operator ModelData ()
|
||||
c9x.timers[i] = timers[i];
|
||||
switch(protocol) {
|
||||
case 1:
|
||||
c9x.moduleData[0].protocol = PPM16;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM16;
|
||||
break;
|
||||
case 2:
|
||||
c9x.moduleData[0].protocol = PPMSIM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPMSIM;
|
||||
break;
|
||||
case 3:
|
||||
c9x.moduleData[0].protocol = PXX_DJT;
|
||||
c9x.moduleData[0].protocol = PULSES_PXX_DJT;
|
||||
break;
|
||||
case 4:
|
||||
c9x.moduleData[0].protocol = DSM2;
|
||||
c9x.moduleData[0].protocol = PULSES_DSM2;
|
||||
break;
|
||||
default:
|
||||
c9x.moduleData[0].protocol = PPM;
|
||||
c9x.moduleData[0].protocol = PULSES_PPM;
|
||||
break;
|
||||
}
|
||||
c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define HAS_PERSISTENT_TIMERS(board) (IS_ARM(board) || IS_2560(board))
|
||||
#define HAS_LARGE_LCD(board) IS_TARANIS(board)
|
||||
#define MAX_VIEWS(board) (HAS_LARGE_LCD(board) ? 2 : 256)
|
||||
#define MAX_POTS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 3) : 3)
|
||||
#define MAX_POTS(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : (version >= 216 ? 3 : 2)) : 3)
|
||||
#define MAX_SLIDERS(board) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 4 : 2) : 0)
|
||||
#define MAX_SWITCHES(board, version) (IS_TARANIS(board) ? (IS_TARANIS_X9E(board) ? 18 : 8) : 7)
|
||||
#define MAX_SWITCHES_POSITION(board, version) (IS_TARANIS_X9E(board) ? 18*3 : (IS_TARANIS(board) ? 8*3 : 9))
|
||||
@@ -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))
|
||||
@@ -80,7 +81,7 @@ class SwitchesConversionTable: public ConversionTable {
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=1; i<=MAX_POTS(board)*6; i++) {
|
||||
for (int i=1; i<=MAX_POTS(board, version)*6; i++) {
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, -i), -val+offset);
|
||||
addConversion(RawSwitch(SWITCH_TYPE_MULTIPOS_POT, i), val++);
|
||||
}
|
||||
@@ -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++);
|
||||
}
|
||||
|
||||
@@ -212,8 +213,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
for (int i=0; i<32; i++)
|
||||
for (int i=0; i<32; i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i), val++);
|
||||
}
|
||||
for (int i=0; i<7; i++) {
|
||||
for (int j=0; j<6; j++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_LUA_OUTPUT, i*16+j), val++);
|
||||
@@ -221,16 +223,18 @@ class SourcesConversionTable: public ConversionTable {
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board); i++) {
|
||||
for (int i=0; i<NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_STICK, i), val++);
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++)
|
||||
for (int i=0; i<MAX_ROTARY_ENCODERS(board); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_ROTARY_ENCODER, 0), val++);
|
||||
}
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
for (int i=0; i<NUM_STICKS; i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_TRIM, i), val++);
|
||||
}
|
||||
}
|
||||
|
||||
addConversion(RawSource(SOURCE_TYPE_MAX), val++);
|
||||
@@ -260,21 +264,24 @@ 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++);
|
||||
}
|
||||
}
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
for (int i=0; i<3; i++)
|
||||
for (int i=0; i<3; i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_CYC, i), val++);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<NUM_PPM_INPUTS(board, version); i++)
|
||||
for (int i=0; i<NUM_PPM_INPUTS(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_PPM, i), val++);
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_CHANNELS(board, version); i++)
|
||||
for (int i=0; i<MAX_CHANNELS(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_CH, i), val++);
|
||||
}
|
||||
|
||||
if (!(flags & FLAG_NOTELEMETRY)) {
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
@@ -293,8 +300,9 @@ class SourcesConversionTable: public ConversionTable {
|
||||
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++)
|
||||
for (int i=0; i<MAX_GVARS(board, version); i++) {
|
||||
addConversion(RawSource(SOURCE_TYPE_GVAR, i), val++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,38 +388,12 @@ void OpenTxEepromCleanup(void)
|
||||
SwitchesConversionTable::Cleanup();
|
||||
}
|
||||
|
||||
ThrottleSourceConversionTable::ThrottleSourceConversionTable(BoardEnum board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
|
||||
addConversion(THROTTLE_SOURCE_THR, val++);
|
||||
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(THROTTLE_SOURCE_S1, val++);
|
||||
addConversion(THROTTLE_SOURCE_S2, val++);
|
||||
if (version >= 216)
|
||||
addConversion(THROTTLE_SOURCE_S3, val++);
|
||||
addConversion(THROTTLE_SOURCE_LS, val++);
|
||||
addConversion(THROTTLE_SOURCE_RS, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(THROTTLE_SOURCE_P1, val++);
|
||||
addConversion(THROTTLE_SOURCE_P2, val++);
|
||||
addConversion(THROTTLE_SOURCE_P3, val++);
|
||||
}
|
||||
|
||||
for (int i=0; i<MAX_CHANNELS(board, version); i++) {
|
||||
addConversion(THROTTLE_SOURCE_FIRST_CHANNEL+i, val++);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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), "Switch",
|
||||
"Switch "+ sw.toString()+" cannot be exported on this board!"),
|
||||
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()),
|
||||
sw(sw),
|
||||
_switch(0)
|
||||
{
|
||||
@@ -802,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
|
||||
@@ -822,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));
|
||||
@@ -941,9 +931,27 @@ 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.phases));
|
||||
internalField.Append(new UnsignedField<9>(mix.flightModes));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
|
||||
internalField.Append(new UnsignedField<4>(mix.mixWarn));
|
||||
@@ -961,7 +969,7 @@ class MixField: public TransformedField {
|
||||
else if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new UnsignedField<5>(_destCh));
|
||||
internalField.Append(new UnsignedField<3>(mix.mixWarn));
|
||||
internalField.Append(new UnsignedField<9>(mix.phases));
|
||||
internalField.Append(new UnsignedField<9>(mix.flightModes));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new BoolField<1>(mix.noExpo));
|
||||
internalField.Append(new SignedField<3>(mix.carryTrim));
|
||||
@@ -979,7 +987,7 @@ class MixField: public TransformedField {
|
||||
}
|
||||
else if (IS_TARANIS(board) && version == 216) {
|
||||
internalField.Append(new UnsignedField<8>(_destCh));
|
||||
internalField.Append(new UnsignedField<16>(mix.phases));
|
||||
internalField.Append(new UnsignedField<16>(mix.flightModes));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
internalField.Append(new UnsignedField<1>((unsigned int &)mix.carryTrim));
|
||||
internalField.Append(new SpareBitsField<5>());
|
||||
@@ -1000,7 +1008,7 @@ class MixField: public TransformedField {
|
||||
else if (IS_ARM(board) && version == 216) {
|
||||
internalField.Append(new UnsignedField<5>(_destCh));
|
||||
internalField.Append(new UnsignedField<3>(mix.mixWarn));
|
||||
internalField.Append(new UnsignedField<16>(mix.phases));
|
||||
internalField.Append(new UnsignedField<16>(mix.flightModes));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new BoolField<1>(mix.noExpo));
|
||||
internalField.Append(new SignedField<3>(mix.carryTrim));
|
||||
@@ -1019,7 +1027,7 @@ class MixField: public TransformedField {
|
||||
}
|
||||
else if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(_destCh));
|
||||
internalField.Append(new UnsignedField<16>(mix.phases));
|
||||
internalField.Append(new UnsignedField<16>(mix.flightModes));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new BoolField<1>(mix.noExpo));
|
||||
internalField.Append(new SignedField<3>(mix.carryTrim));
|
||||
@@ -1064,7 +1072,7 @@ class MixField: public TransformedField {
|
||||
internalField.Append(new SourceField<8>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
|
||||
internalField.Append(new SignedField<8>(_weight));
|
||||
internalField.Append(new SwitchField<8>(mix.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<8>(mix.phases));
|
||||
internalField.Append(new UnsignedField<8>(mix.flightModes));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
internalField.Append(new SignedField<3>(mix.carryTrim));
|
||||
internalField.Append(new UnsignedField<2>(mix.mixWarn));
|
||||
@@ -1085,7 +1093,7 @@ class MixField: public TransformedField {
|
||||
internalField.Append(new SignedField<8>(_weight));
|
||||
internalField.Append(new SwitchField<6>(mix.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<2>((unsigned int &)mix.mltpx));
|
||||
internalField.Append(new UnsignedField<5>(mix.phases));
|
||||
internalField.Append(new UnsignedField<5>(mix.flightModes));
|
||||
internalField.Append(new SignedField<3>(mix.carryTrim));
|
||||
internalField.Append(new SourceField<6>(mix.srcRaw, board, version, FLAG_NOTELEMETRY));
|
||||
internalField.Append(new UnsignedField<2>(mix.mixWarn));
|
||||
@@ -1209,12 +1217,26 @@ 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"));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<16>(expo.phases));
|
||||
internalField.Append(new UnsignedField<16>(expo.flightModes));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
@@ -1226,7 +1248,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
internalField.Append(new UnsignedField<3>(expo.chn, "Channel"));
|
||||
internalField.Append(new BoolField<2>(_curveMode));
|
||||
internalField.Append(new UnsignedField<9>(expo.phases, "Phases"));
|
||||
internalField.Append(new UnsignedField<9>(expo.flightModes, "Phases"));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new ZCharField<6>(expo.name));
|
||||
@@ -1237,7 +1259,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<16>(expo.scale, "Scale"));
|
||||
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<16>(expo.phases));
|
||||
internalField.Append(new UnsignedField<16>(expo.flightModes));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new SignedField<6>(expo.carryTrim, "CarryTrim"));
|
||||
internalField.Append(new UnsignedField<2>(expo.mode, "Mode"));
|
||||
@@ -1251,7 +1273,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<4>(expo.chn, "Channel"));
|
||||
internalField.Append(new BoolField<2>(_curveMode));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<16>(expo.phases, "Phases"));
|
||||
internalField.Append(new UnsignedField<16>(expo.flightModes, "Phases"));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new ZCharField<6>(expo.name));
|
||||
internalField.Append(new SignedField<8>(_curveParam));
|
||||
@@ -1260,7 +1282,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<8>(expo.mode, "Mode"));
|
||||
internalField.Append(new UnsignedField<8>(expo.chn, "Channel"));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<16>(expo.phases, "Phases"));
|
||||
internalField.Append(new UnsignedField<16>(expo.flightModes, "Phases"));
|
||||
internalField.Append(new SignedField<8>(_weight, "Weight"));
|
||||
internalField.Append(new BoolField<8>(_curveMode));
|
||||
if (HAS_LARGE_LCD(board)) {
|
||||
@@ -1277,7 +1299,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<2>(expo.chn));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new SpareBitsField<3>());
|
||||
internalField.Append(new UnsignedField<8>(expo.phases));
|
||||
internalField.Append(new UnsignedField<8>(expo.flightModes));
|
||||
internalField.Append(new SwitchField<8>(expo.swtch, board, version));
|
||||
internalField.Append(new SignedField<8>(_weight));
|
||||
internalField.Append(new SignedField<8>(_curveParam));
|
||||
@@ -1286,7 +1308,7 @@ class InputField: public TransformedField {
|
||||
internalField.Append(new UnsignedField<2>(expo.mode));
|
||||
internalField.Append(new SwitchField<6>(expo.swtch, board, version));
|
||||
internalField.Append(new UnsignedField<2>(expo.chn));
|
||||
internalField.Append(new UnsignedField<5>(expo.phases));
|
||||
internalField.Append(new UnsignedField<5>(expo.flightModes));
|
||||
internalField.Append(new BoolField<1>(_curveMode));
|
||||
internalField.Append(new SignedField<8>(_weight));
|
||||
internalField.Append(new SignedField<8>(_curveParam));
|
||||
@@ -1360,10 +1382,9 @@ class InputField: public TransformedField {
|
||||
|
||||
class LimitField: public StructField {
|
||||
public:
|
||||
template <int shift>
|
||||
template <int shift, int GV1>
|
||||
static int exportLimitValue(int value)
|
||||
{
|
||||
const int GV1 = 4096;
|
||||
if (value > 10000) {
|
||||
return -GV1 + value - 10001;
|
||||
}
|
||||
@@ -1373,16 +1394,9 @@ class LimitField: public StructField {
|
||||
return value + shift;
|
||||
}
|
||||
|
||||
template <int shift>
|
||||
template <int shift, int GV1>
|
||||
static int importLimitValue(int value)
|
||||
{
|
||||
/* GVARS mapping on radio:
|
||||
GV1 = -4096
|
||||
GV9 = -4088
|
||||
-GV1 = 4095
|
||||
-GV9 = 4087
|
||||
*/
|
||||
const int GV1 = 4096;
|
||||
if (value >= GV1) {
|
||||
return 10001 + value - GV1;
|
||||
}
|
||||
@@ -1402,10 +1416,10 @@ class LimitField: public StructField {
|
||||
StructField("Limit")
|
||||
{
|
||||
if (IS_TARANIS(board) && version >= 217) {
|
||||
Append(new ConversionField< SignedField<11> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.min, exportLimitValue<1000, 1024>, importLimitValue<1000, 1024>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.max, exportLimitValue<-1000, 1024>, importLimitValue<-1000, 1024>));
|
||||
Append(new SignedField<10>(limit.ppmCenter));
|
||||
Append(new ConversionField< SignedField<11> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
|
||||
Append(new ConversionField< SignedField<11> >(limit.offset, exportLimitValue<0, 1024>, importLimitValue<0, 1024>));
|
||||
Append(new BoolField<1>(limit.symetrical));
|
||||
Append(new BoolField<1>(limit.revert));
|
||||
Append(new SpareBitsField<3>());
|
||||
@@ -1416,10 +1430,10 @@ class LimitField: public StructField {
|
||||
}
|
||||
else {
|
||||
if (IS_TARANIS(board) && version >= 216) {
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000>, importLimitValue<1000>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000>, importLimitValue<-1000>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.min, exportLimitValue<1000, 4096>, importLimitValue<1000, 4096>));
|
||||
Append(new ConversionField< SignedField<16> >(limit.max, exportLimitValue<-1000, 4096>, importLimitValue<-1000, 4096>));
|
||||
Append(new SignedField<8>(limit.ppmCenter));
|
||||
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0>, importLimitValue<0>));
|
||||
Append(new ConversionField< SignedField<14> >(limit.offset, exportLimitValue<0, 4096>, importLimitValue<0, 4096>));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< SignedField<8> >(limit.min, +100, 10));
|
||||
@@ -1622,7 +1636,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++);
|
||||
}
|
||||
@@ -1633,7 +1647,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++);
|
||||
}
|
||||
@@ -1698,7 +1712,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));
|
||||
@@ -1710,12 +1733,6 @@ class LogicalSwitchField: public TransformedField {
|
||||
internalField.Append(new SignedField<16>(v3));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 216) {
|
||||
internalField.Append(new SignedField<8>(v1));
|
||||
internalField.Append(new SignedField<16>(v2));
|
||||
internalField.Append(new SignedField<16>(v3));
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(csw.func, &functionsConversionTable, "Function"));
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 215) {
|
||||
internalField.Append(new SignedField<16>(v1));
|
||||
internalField.Append(new SignedField<16>(v2));
|
||||
@@ -1739,7 +1756,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"));
|
||||
}
|
||||
}
|
||||
@@ -1754,6 +1771,7 @@ class LogicalSwitchField: public TransformedField {
|
||||
{
|
||||
delete andswitchesConversionTable;
|
||||
}
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
if (csw.func == LS_FN_TIMER) {
|
||||
@@ -1795,8 +1813,14 @@ class LogicalSwitchField: public TransformedField {
|
||||
switchesConversionTable->importValue(v2, csw.val2);
|
||||
}
|
||||
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
|
||||
if (IS_ARM(board)) {
|
||||
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint32_t)v2, csw.val2);
|
||||
}
|
||||
else {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
sourcesConversionTable->importValue((uint8_t)v2, csw.val2);
|
||||
}
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
RawSource val1(csw.val1);
|
||||
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
|
||||
@@ -1809,7 +1833,12 @@ class LogicalSwitchField: public TransformedField {
|
||||
}
|
||||
}
|
||||
else if (csw.func != LS_FN_OFF) {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
sourcesConversionTable->importValue((uint32_t)v1, csw.val1);
|
||||
}
|
||||
else {
|
||||
sourcesConversionTable->importValue((uint8_t)v1, csw.val1);
|
||||
}
|
||||
if (IS_TARANIS(board) && version < 216) {
|
||||
RawSource val1(csw.val1);
|
||||
if (val1.type == SOURCE_TYPE_STICK && val1.index < NUM_STICKS) {
|
||||
@@ -1938,9 +1967,12 @@ class CustomFunctionsConversionTable: public ConversionTable {
|
||||
val++;
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(FuncVolume, val++);
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncReserve, val++);
|
||||
addConversion(FuncSetFailsafeInternalModule, val);
|
||||
addConversion(FuncSetFailsafeExternalModule, val++);
|
||||
addConversion(FuncRangeCheckInternalModule, val);
|
||||
addConversion(FuncRangeCheckExternalModule, val++);
|
||||
addConversion(FuncBindInternalModule, val);
|
||||
addConversion(FuncBindExternalModule, val++);
|
||||
}
|
||||
addConversion(FuncPlaySound, val++);
|
||||
addConversion(FuncPlayPrompt, val++);
|
||||
@@ -2047,8 +2079,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));
|
||||
@@ -2099,6 +2137,21 @@ class ArmCustomFunctionField: public TransformedField {
|
||||
*((uint8_t *)(_param+3)) = fn.func - FuncSetTimer1;
|
||||
}
|
||||
}
|
||||
else if (fn.func >= FuncSetFailsafeInternalModule && fn.func <= FuncSetFailsafeExternalModule) {
|
||||
if (version >= 216) {
|
||||
*((uint16_t *)_param) = fn.func - FuncSetFailsafeInternalModule;
|
||||
}
|
||||
}
|
||||
else if (fn.func >= FuncRangeCheckInternalModule && fn.func <= FuncRangeCheckExternalModule) {
|
||||
if (version >= 216) {
|
||||
*((uint16_t *)_param) = fn.func - FuncRangeCheckInternalModule;
|
||||
}
|
||||
}
|
||||
else if (fn.func >= FuncBindInternalModule && fn.func <= FuncBindExternalModule) {
|
||||
if (version >= 216) {
|
||||
*((uint16_t *)_param) = fn.func - FuncBindInternalModule;
|
||||
}
|
||||
}
|
||||
else if (fn.func == FuncPlayPrompt || fn.func == FuncBackgroundMusic || fn.func == FuncPlayScript) {
|
||||
memcpy(_param, fn.paramarm, sizeof(_param));
|
||||
}
|
||||
@@ -2708,7 +2761,13 @@ class FrskyField: public StructField {
|
||||
}
|
||||
}
|
||||
|
||||
Append(new ConversionField< UnsignedField<8> >(frsky.varioSource, &telemetryVarioSourceConversionTable, "Vario Source"));
|
||||
if (version >= 217) {
|
||||
Append(new UnsignedField<7>(frsky.varioSource, "Vario Source"));
|
||||
Append(new BoolField<1>(frsky.varioCenterSilent));
|
||||
}
|
||||
else {
|
||||
Append(new ConversionField< UnsignedField<8> >(frsky.varioSource, &telemetryVarioSourceConversionTable, "Vario Source"));
|
||||
}
|
||||
Append(new SignedField<8>(frsky.varioCenterMax));
|
||||
Append(new SignedField<8>(frsky.varioCenterMin));
|
||||
Append(new SignedField<8>(frsky.varioMin));
|
||||
@@ -2811,7 +2870,8 @@ class SensorField: public TransformedField {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
|
||||
_id = sensor.id;
|
||||
_instance = sensor.instance;
|
||||
_param = (sensor.ratio) + ((unsigned int)sensor.offset << 16);
|
||||
_ratio = sensor.ratio;
|
||||
_offset = sensor.offset;
|
||||
}
|
||||
else {
|
||||
_id = sensor.persistentValue;
|
||||
@@ -2822,7 +2882,7 @@ class SensorField: public TransformedField {
|
||||
_param = ((uint8_t)sensor.sources[0]) + ((uint8_t)sensor.sources[1] << 8) + ((uint8_t)sensor.sources[2] << 16) + ((uint8_t)sensor.sources[3] << 24);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
_param = (sensor.gps) + (sensor.alt << 8);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
||||
_param = (sensor.amps);
|
||||
}
|
||||
}
|
||||
@@ -2832,8 +2892,8 @@ class SensorField: public TransformedField {
|
||||
if (sensor.type == SensorData::TELEM_TYPE_CUSTOM) {
|
||||
sensor.id = _id;
|
||||
sensor.instance = _instance;
|
||||
sensor.ratio = _param & 0xFFFF;
|
||||
sensor.offset = (_param >> 16) & 0xFFFF;
|
||||
sensor.ratio = _ratio;
|
||||
sensor.offset = _offset;
|
||||
}
|
||||
else {
|
||||
sensor.persistentValue = _id;
|
||||
@@ -2845,7 +2905,7 @@ class SensorField: public TransformedField {
|
||||
sensor.sources[i] = _sources[i];
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_DIST)
|
||||
(sensor.gps = _sources[0], sensor.alt = _sources[1]);
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION)
|
||||
else if (sensor.formula == SensorData::TELEM_FORMULA_CONSUMPTION || sensor.formula == SensorData::TELEM_FORMULA_TOTALIZE)
|
||||
sensor.amps = _sources[0];
|
||||
}
|
||||
eepromImportDebug() << QString("imported %1").arg(internalField.getName());
|
||||
@@ -2859,6 +2919,10 @@ class SensorField: public TransformedField {
|
||||
union {
|
||||
unsigned int _param;
|
||||
uint8_t _sources[4];
|
||||
struct {
|
||||
uint16_t _ratio;
|
||||
int16_t _offset;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2872,8 +2936,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
board(board),
|
||||
version(version),
|
||||
variant(variant),
|
||||
protocolsConversionTable(board),
|
||||
throttleSourceConversionTable(board, version)
|
||||
protocolsConversionTable(board)
|
||||
{
|
||||
sprintf(name, "Model %s", modelData.name);
|
||||
|
||||
@@ -2898,8 +2961,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));
|
||||
@@ -2912,6 +2988,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));
|
||||
@@ -2920,6 +2997,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));
|
||||
@@ -2933,6 +3011,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));
|
||||
@@ -2951,7 +3030,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
internalField.Append(new BoolField<1>(modelData.noGlobalFunctions));
|
||||
internalField.Append(new UnsignedField<2>(modelData.trimsDisplay));
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
internalField.Append(new BoolField<1>(modelData.frsky.ignoreSensorIds));
|
||||
}
|
||||
else if (IS_TARANIS(board) || (IS_ARM(board) && version >= 216)) {
|
||||
internalField.Append(new SpareBitsField<4>());
|
||||
@@ -2992,7 +3071,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))
|
||||
@@ -3001,14 +3080,15 @@ 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));
|
||||
}
|
||||
|
||||
internalField.Append(new ConversionField< UnsignedField<8> >(modelData.thrTraceSrc, &throttleSourceConversionTable, "Throttle Source"));
|
||||
internalField.Append(new UnsignedField<8>(modelData.thrTraceSrc, "Throttle Source"));
|
||||
|
||||
if (!afterrelease21March2013) {
|
||||
internalField.Append(new UnsignedField<8>(modelData.moduleData[0].modelId));
|
||||
@@ -3150,7 +3230,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
|
||||
if (IS_ARM(board) && version >= 217) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
@@ -3158,7 +3238,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
else if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i<6; i++) {
|
||||
if (i < MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
if (i < MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
internalField.Append(new BoolField<1>(modelData.potsWarningEnabled[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<1>());
|
||||
@@ -3167,7 +3247,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
}
|
||||
|
||||
if (IS_ARM(board) && version >= 216) {
|
||||
for (int i=0; i < MAX_POTS(board)+MAX_SLIDERS(board); i++) {
|
||||
for (int i=0; i < MAX_POTS(board, version)+MAX_SLIDERS(board); i++) {
|
||||
internalField.Append(new SignedField<8>(modelData.potPosition[i]));
|
||||
}
|
||||
}
|
||||
@@ -3186,6 +3266,10 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
|
||||
internalField.Append(new SensorField(modelData.sensorData[i], board, version));
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(board)) {
|
||||
internalField.Append(new UnsignedField<8>(modelData.toplcdTimer));
|
||||
}
|
||||
}
|
||||
|
||||
void OpenTxModelData::beforeExport()
|
||||
@@ -3193,10 +3277,10 @@ void OpenTxModelData::beforeExport()
|
||||
// qDebug() << QString("before export model") << modelData.name;
|
||||
|
||||
for (int module=0; module<3; module++) {
|
||||
if (modelData.moduleData[module].protocol >= PXX_XJT_X16 && modelData.moduleData[module].protocol <= PXX_XJT_LR12)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PXX_XJT_X16;
|
||||
else if (modelData.moduleData[module].protocol >= LP45 && modelData.moduleData[module].protocol <= DSMX)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - LP45;
|
||||
if (modelData.moduleData[module].protocol >= PULSES_PXX_XJT_X16 && modelData.moduleData[module].protocol <= PULSES_PXX_XJT_LR12)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_PXX_XJT_X16;
|
||||
else if (modelData.moduleData[module].protocol >= PULSES_LP45 && modelData.moduleData[module].protocol <= PULSES_DSMX)
|
||||
subprotocols[module] = modelData.moduleData[module].protocol - PULSES_LP45;
|
||||
else
|
||||
subprotocols[module] = (module==0 ? -1 : 0);
|
||||
}
|
||||
@@ -3210,7 +3294,7 @@ void OpenTxModelData::afterImport()
|
||||
for (unsigned int i=0; i<NUM_STICKS; i++) {
|
||||
for (int j=0; j<64; j++) {
|
||||
ExpoData * expo = &modelData.expoData[j];
|
||||
if (expo->mode == INPUT_MODE_BOTH && expo->chn == i && expo->phases == 0 && expo->swtch.type == SWITCH_TYPE_NONE)
|
||||
if (expo->mode == INPUT_MODE_BOTH && expo->chn == i && expo->flightModes == 0 && expo->swtch.type == SWITCH_TYPE_NONE)
|
||||
break;
|
||||
if (expo->mode == 0 || expo->chn > i) {
|
||||
ExpoData * newExpo = modelData.insertInput(j);
|
||||
@@ -3225,18 +3309,18 @@ void OpenTxModelData::afterImport()
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && modelData.moduleData[0].protocol == 0) {
|
||||
modelData.moduleData[0].protocol = PXX_XJT_X16;
|
||||
}
|
||||
|
||||
for (int module=0; module<3; module++) {
|
||||
if (modelData.moduleData[module].protocol == PXX_XJT_X16 || modelData.moduleData[module].protocol == LP45) {
|
||||
if (modelData.moduleData[module].protocol == PULSES_PXX_XJT_X16 || modelData.moduleData[module].protocol == PULSES_LP45) {
|
||||
if (subprotocols[module] >= 0)
|
||||
modelData.moduleData[module].protocol += subprotocols[module];
|
||||
else
|
||||
modelData.moduleData[module].protocol = OFF;
|
||||
modelData.moduleData[module].protocol = PULSES_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(board) && version < 217 && modelData.moduleData[1].protocol != PULSES_OFF) {
|
||||
modelData.moduleData[1].modelId = modelData.moduleData[0].modelId;
|
||||
}
|
||||
}
|
||||
|
||||
OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
@@ -3245,7 +3329,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
generalData(generalData),
|
||||
board(board),
|
||||
version(version),
|
||||
inputsCount(NUM_STICKS+MAX_POTS(board)+MAX_SLIDERS(board))
|
||||
inputsCount(NUM_STICKS+MAX_POTS(board, version)+MAX_SLIDERS(board))
|
||||
{
|
||||
eepromImportDebug() << QString("OpenTxGeneralData::OpenTxGeneralData(board: %1, version:%2, variant:%3)").arg(board).arg(version).arg(variant);
|
||||
|
||||
@@ -3282,7 +3366,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new UnsignedField<8>(generalData.currModel));
|
||||
internalField.Append(new UnsignedField<8>(generalData.contrast));
|
||||
internalField.Append(new UnsignedField<8>(generalData.vBatWarn));
|
||||
internalField.Append(new SignedField<8>(generalData.vBatCalib));
|
||||
internalField.Append(new SignedField<8>(generalData.txVoltageCalibration));
|
||||
internalField.Append(new SignedField<8>(generalData.backlightMode));
|
||||
|
||||
for (int i=0; i<NUM_STICKS; i++)
|
||||
@@ -3366,7 +3450,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
|
||||
if (IS_ARM(board)) {
|
||||
internalField.Append(new UnsignedField<8>(generalData.backlightBright));
|
||||
internalField.Append(new SignedField<8>(generalData.currentCalib));
|
||||
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));
|
||||
@@ -3409,7 +3493,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
internalField.Append(new UnsignedField<8>(generalData.hw_uartMode));
|
||||
}
|
||||
for (int i=0; i<4; i++) {
|
||||
if (i < MAX_POTS(board))
|
||||
if (i < MAX_POTS(board, version))
|
||||
internalField.Append(new UnsignedField<2>(generalData.potConfig[i]));
|
||||
else
|
||||
internalField.Append(new SpareBitsField<2>());
|
||||
@@ -3441,7 +3525,7 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo
|
||||
for (int i=0; i<NUM_STICKS; ++i) {
|
||||
internalField.Append(new ZCharField<3>(generalData.stickName[i]));
|
||||
}
|
||||
for (int i=0; i<MAX_POTS(board); ++i) {
|
||||
for (int i=0; i<MAX_POTS(board, version); ++i) {
|
||||
internalField.Append(new ZCharField<3>(generalData.potName[i]));
|
||||
}
|
||||
for (int i=0; i<MAX_SLIDERS(board); ++i) {
|
||||
|
||||
@@ -56,40 +56,37 @@ class ProtocolsConversionTable: public ConversionTable
|
||||
{
|
||||
int val = 0;
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(OFF, val++);
|
||||
addConversion(PULSES_OFF, val++);
|
||||
}
|
||||
addConversion(PPM, val++);
|
||||
addConversion(PULSES_PPM, val++);
|
||||
if (!IS_ARM(board)) {
|
||||
addConversion(PPM16, val++);
|
||||
addConversion(PPMSIM, val++);
|
||||
addConversion(PULSES_PPM16, val++);
|
||||
addConversion(PULSES_PPMSIM, val++);
|
||||
}
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(PXX_XJT_X16, val);
|
||||
addConversion(PXX_XJT_D8, val);
|
||||
addConversion(PXX_XJT_LR12, val++);
|
||||
addConversion(PULSES_PXX_XJT_X16, val);
|
||||
addConversion(PULSES_PXX_XJT_D8, val);
|
||||
addConversion(PULSES_PXX_XJT_LR12, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(PXX_DJT, val++);
|
||||
addConversion(PULSES_PXX_DJT, val++);
|
||||
}
|
||||
if (IS_ARM(board)) {
|
||||
addConversion(LP45, val);
|
||||
addConversion(DSM2, val);
|
||||
addConversion(DSMX, val++);
|
||||
addConversion(PULSES_LP45, val);
|
||||
addConversion(PULSES_DSM2, val);
|
||||
addConversion(PULSES_DSMX, val++);
|
||||
}
|
||||
else {
|
||||
addConversion(LP45, val++);
|
||||
addConversion(DSM2, val++);
|
||||
addConversion(DSMX, val++);
|
||||
addConversion(PULSES_LP45, val++);
|
||||
addConversion(PULSES_DSM2, val++);
|
||||
addConversion(PULSES_DSMX, val++);
|
||||
}
|
||||
if (IS_TARANIS(board)) {
|
||||
addConversion(PULSES_CROSSFIRE, val++);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class ThrottleSourceConversionTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
ThrottleSourceConversionTable(BoardEnum board, unsigned int version);
|
||||
};
|
||||
|
||||
class ChannelsConversionTable: public ConversionTable
|
||||
{
|
||||
public:
|
||||
@@ -121,7 +118,6 @@ class OpenTxModelData: public TransformedField {
|
||||
char name[256];
|
||||
int subprotocols[C9X_NUM_MODULES+1/*trainer*/];
|
||||
ProtocolsConversionTable protocolsConversionTable;
|
||||
ThrottleSourceConversionTable throttleSourceConversionTable;
|
||||
ChannelsConversionTable channelsConversionTable;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
#include "file.h"
|
||||
#include "appdata.h"
|
||||
|
||||
#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
|
||||
|
||||
@@ -70,6 +73,12 @@ const char * OpenTxEepromInterface::getName()
|
||||
return "OpenTX for Sky9x board / 9X";
|
||||
case BOARD_9XRPRO:
|
||||
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";
|
||||
}
|
||||
@@ -88,10 +97,13 @@ const int OpenTxEepromInterface::getEEpromSize()
|
||||
case BOARD_SKY9X:
|
||||
return EESIZE_SKY9X;
|
||||
case BOARD_9XRPRO:
|
||||
case BOARD_AR9X:
|
||||
return EESIZE_9XRPRO;
|
||||
case BOARD_TARANIS:
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
case BOARD_FLAMENCO:
|
||||
case BOARD_HORUS:
|
||||
return EESIZE_TARANIS;
|
||||
default:
|
||||
return 0;
|
||||
@@ -301,15 +313,19 @@ bool OpenTxEepromInterface::saveModel(unsigned int index, ModelData &model, unsi
|
||||
return (sz == eeprom.size());
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long OpenTxEepromInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying " << getName() << " import...";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
if (size==4096) {
|
||||
int notnull=false;
|
||||
@@ -320,21 +336,25 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
}
|
||||
if (notnull) {
|
||||
std::cout << " wrong size (" << size << ")\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(NULL, "companion", QObject::tr("Your radio probably uses a wrong firmware,\n eeprom size is 4096 but only the first 2048 are used"));
|
||||
errors.set(HAS_WARNINGS);
|
||||
errors.set(WARNING_WRONG_FIRMWARE);
|
||||
size=2048;
|
||||
}
|
||||
} else {
|
||||
std::cout << " wrong size (" << size << "/" << getEEpromSize() << ")\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, board)) {
|
||||
std::cout << " wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -342,30 +362,39 @@ bool OpenTxEepromInterface::load(RadioData &radioData, const uint8_t *eeprom, in
|
||||
uint8_t version;
|
||||
if (efile->readRlc2(&version, 1) != 1) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << " version " << (unsigned int)version;
|
||||
|
||||
if (!checkVersion(version)) {
|
||||
EepromLoadErrors version_error = checkVersion(version);
|
||||
if (version_error == OLD_VERSION) {
|
||||
errors.set(version_error);
|
||||
errors.set(HAS_WARNINGS);
|
||||
} else if (version_error == NOT_OPENTX) {
|
||||
std::cout << " not open9x\n";
|
||||
return false;
|
||||
errors.set(version_error);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!loadGeneral<OpenTxGeneralData>(radioData.generalSettings, version)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << " variant " << radioData.generalSettings.variant;
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
if (!loadModel(version, radioData.models[i], NULL, i, radioData.generalSettings.variant, radioData.generalSettings.stickMode+1)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
std::cout << " ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -378,8 +407,11 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
case BOARD_TARANIS_PLUS:
|
||||
case BOARD_TARANIS_X9E:
|
||||
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:
|
||||
@@ -411,7 +443,7 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
}
|
||||
|
||||
for (int i=0; i<getMaxModels(); i++) {
|
||||
if (!radioData.models[i].isempty()) {
|
||||
if (!radioData.models[i].isEmpty()) {
|
||||
result = saveModel<OpenTxModelData>(i, radioData.models[i], version, variant);
|
||||
if (!result) {
|
||||
return 0;
|
||||
@@ -438,19 +470,18 @@ int OpenTxEepromInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t
|
||||
return size;
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::getSize(ModelData &model)
|
||||
int OpenTxEepromInterface::getSize(const ModelData & model)
|
||||
{
|
||||
if (IS_SKY9X(board))
|
||||
return 0;
|
||||
|
||||
if (model.isempty())
|
||||
if (model.isEmpty())
|
||||
return 0;
|
||||
|
||||
// TODO something better...
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board, 255/*version max*/);
|
||||
QByteArray tmp(EESIZE_MAX, 0);
|
||||
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255/*version max*/);
|
||||
|
||||
OpenTxModelData open9xModel(model, board, 255/*version max*/, GetCurrentFirmware()->getVariantNumber());
|
||||
OpenTxModelData open9xModel((ModelData &)model, board, 255/*version max*/, GetCurrentFirmware()->getVariantNumber());
|
||||
|
||||
QByteArray eeprom;
|
||||
open9xModel.Export(eeprom);
|
||||
@@ -461,15 +492,15 @@ int OpenTxEepromInterface::getSize(ModelData &model)
|
||||
return efile->size(0);
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::getSize(GeneralSettings &settings)
|
||||
int OpenTxEepromInterface::getSize(const GeneralSettings & settings)
|
||||
{
|
||||
if (IS_SKY9X(board))
|
||||
return 0;
|
||||
|
||||
uint8_t tmp[EESIZE_RLC_MAX];
|
||||
efile->EeFsCreate(tmp, EESIZE_RLC_MAX, board, 255);
|
||||
QByteArray tmp(EESIZE_MAX, 0);
|
||||
efile->EeFsCreate((uint8_t *)tmp.data(), EESIZE_MAX, board, 255);
|
||||
|
||||
OpenTxGeneralData open9xGeneral(settings, board, 255, GetCurrentFirmware()->getVariantNumber());
|
||||
OpenTxGeneralData open9xGeneral((GeneralSettings &)settings, board, 255, GetCurrentFirmware()->getVariantNumber());
|
||||
// open9xGeneral.Dump();
|
||||
|
||||
QByteArray eeprom;
|
||||
@@ -555,8 +586,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return (IS_TARANIS(board) ? 10 : 6);
|
||||
case GvarsName:
|
||||
return (IS_9X(board) ? 0 : 6);
|
||||
case HasChNames:
|
||||
return (IS_TARANIS(board) ? 1 : 0);
|
||||
case GvarsInCS:
|
||||
case HasFAIMode:
|
||||
return 1;
|
||||
@@ -568,7 +597,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case OffsetWeight:
|
||||
return (IS_ARM(board) ? 500 : 245);
|
||||
case Timers:
|
||||
return (IS_ARM(board) ? 3 : 2);
|
||||
return ((IS_ARM(board) && id.contains("timer3")) ? 3 : 2);
|
||||
case TimersName:
|
||||
return (IS_TARANIS(board) ? 8 : (IS_ARM(board) ? 3 : 0));
|
||||
case PermTimers:
|
||||
@@ -605,10 +634,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
else
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
if (IS_TARANIS(board))
|
||||
if (IS_ARM(board))
|
||||
return 64;
|
||||
else if (IS_ARM(board))
|
||||
return 60;
|
||||
else if (IS_2560(board) || board==BOARD_M128)
|
||||
return 24;
|
||||
else
|
||||
@@ -617,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:
|
||||
@@ -649,7 +676,7 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case Haptic:
|
||||
return (IS_2560(board) || IS_SKY9X(board) || IS_TARANIS_PLUS(board) || id.contains("haptic"));
|
||||
case ModelTrainerEnable:
|
||||
if (IS_ARM(board))
|
||||
if (IS_TARANIS(board))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -707,10 +734,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case HasFailsafe:
|
||||
return (IS_ARM(board) ? 32 : 0);
|
||||
case NumModules:
|
||||
return (IS_ARM(board) && !IS_9XRPRO(board)) ? 2 : 1;
|
||||
return (IS_ARM(board) ? 2 : 1);
|
||||
case HasPPMStart:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
case HasCurrentCalibration:
|
||||
case HastxCurrentCalibration:
|
||||
return (IS_SKY9X(board) ? true : false);
|
||||
case HasVolume:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
@@ -732,6 +759,10 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
return (IS_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR) ;
|
||||
case HasDisplayText:
|
||||
return IS_ARM(board) ? 1 : 0;
|
||||
case HasTopLcd:
|
||||
return IS_TARANIS_X9E(board) ? 1 : 0;
|
||||
case GlobalFunctions:
|
||||
return IS_ARM(board) ? 64 : 0;
|
||||
case VirtualInputs:
|
||||
return IS_TARANIS(board) ? 32 : 0;
|
||||
case TrainerInputs:
|
||||
@@ -774,7 +805,9 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
||||
case MixersMonitor:
|
||||
return id.contains("mixersmon") ? 1 : 0;
|
||||
case HasBatMeterRange:
|
||||
return (IS_TARANIS(board) ? true : false);
|
||||
return (IS_TARANIS(board) ? true : id.contains("battgraph"));
|
||||
case DangerousFunctions:
|
||||
return id.contains("danger") ? 1 : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -791,32 +824,36 @@ bool OpenTxFirmware::isTelemetrySourceAvailable(int source)
|
||||
return true;
|
||||
}
|
||||
|
||||
int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
int OpenTxFirmware::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
if (IS_TARANIS(board)) {
|
||||
switch (port) {
|
||||
case 0:
|
||||
switch (proto) {
|
||||
case OFF:
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
case PULSES_OFF:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
return 1;
|
||||
case PULSES_PXX_XJT_D8:
|
||||
return id.contains("eu") ? 0 : 1;
|
||||
case PULSES_PPM:
|
||||
return id.contains("internalppm") ? 1 : 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (proto) {
|
||||
case OFF:
|
||||
case PPM:
|
||||
case PXX_XJT_X16:
|
||||
case PXX_XJT_D8:
|
||||
case PXX_XJT_LR12:
|
||||
//case PXX_DJT: // Unavailable for now
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
case PULSES_OFF:
|
||||
case PULSES_PPM:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
//case PULSES_PXX_DJT: // Unavailable for now
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_DSMX:
|
||||
case PULSES_CROSSFIRE:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -824,7 +861,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
case -1:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case PULSES_PPM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -838,13 +875,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
switch (port) {
|
||||
case 0:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
// case PXX_XJT_X16:
|
||||
// case PXX_XJT_D8:
|
||||
// case PXX_XJT_LR12:
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case DSMX:
|
||||
case PULSES_PPM:
|
||||
case PULSES_PXX_XJT_X16:
|
||||
case PULSES_PXX_XJT_D8:
|
||||
case PULSES_PXX_XJT_LR12:
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
case PULSES_DSMX:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -852,7 +889,7 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
break;
|
||||
case 1:
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case PULSES_PPM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -864,13 +901,13 @@ int OpenTxEepromInterface::isAvailable(Protocol proto, int port)
|
||||
}
|
||||
else {
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case DSMX:
|
||||
case LP45:
|
||||
case DSM2:
|
||||
case PXX_DJT:
|
||||
case PPM16:
|
||||
case PPMSIM:
|
||||
case PULSES_PPM:
|
||||
case PULSES_DSMX:
|
||||
case PULSES_LP45:
|
||||
case PULSES_DSM2:
|
||||
// case PULSES_PXX_DJT: // Unavailable for now
|
||||
case PULSES_PPM16:
|
||||
case PULSES_PPMSIM:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -883,73 +920,60 @@ size_t getSizeA(T (&)[SIZE]) {
|
||||
return SIZE;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
EepromLoadErrors OpenTxEepromInterface::checkVersion(unsigned int version)
|
||||
{
|
||||
switch(version) {
|
||||
case 201:
|
||||
// first version
|
||||
break;
|
||||
case 202:
|
||||
// channel order is now always RUD - ELE - THR - AIL
|
||||
// changes in timers
|
||||
// ppmFrameLength added
|
||||
// thrTraceSrc added
|
||||
break;
|
||||
case 203:
|
||||
// mixers changed (for the trims use for change the offset of a mix)
|
||||
// telemetry offset raised to -127 +127
|
||||
// function switches now have a param on 4 bits
|
||||
break;
|
||||
case 204:
|
||||
// telemetry changes (bars)
|
||||
break;
|
||||
case 205:
|
||||
// mixer changes (differential, negative curves)...
|
||||
break;
|
||||
// case 206:
|
||||
case 207:
|
||||
// V4: Rotary Encoders position in FlightModes
|
||||
break;
|
||||
case 208:
|
||||
// Trim value in 16bits
|
||||
// FrSky A1/A2 offset on 12bits
|
||||
// ARM: More Mixers / Expos / CSW / FSW / CHNOUT
|
||||
break;
|
||||
case 209:
|
||||
// Add TrmR, TrmE, TrmT, TrmA as Mix sources
|
||||
// Trims are now OFF / ON / Rud / Ele / Thr / Ail
|
||||
break;
|
||||
case 210:
|
||||
// Add names in Mixes / Expos
|
||||
// Add a new telemetry screen
|
||||
// Add support for Play Track <filename>
|
||||
break;
|
||||
case 211:
|
||||
// Curves big change
|
||||
break;
|
||||
case 212:
|
||||
// Big changes in mixers / limitse
|
||||
break;
|
||||
case 213:
|
||||
// GVARS / Variants introduction
|
||||
break;
|
||||
case 214:
|
||||
// Massive EEPROM change!
|
||||
break;
|
||||
case 215:
|
||||
// M128 revert because too much RAM used!
|
||||
break;
|
||||
case 216:
|
||||
// A lot of things (first github release)
|
||||
break;
|
||||
case 217:
|
||||
// 3 logical switches removed on M128 / gruvin9x boards
|
||||
return OLD_VERSION;
|
||||
case 218:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
return NOT_OPENTX;
|
||||
}
|
||||
|
||||
return true;
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int variant)
|
||||
@@ -985,13 +1009,16 @@ bool OpenTxEepromInterface::checkVariant(unsigned int version, unsigned int vari
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
std::cout << "trying " << getName() << " backup import...";
|
||||
|
||||
if (esize < 8 || memcmp(eeprom, "o9x", 3) != 0) {
|
||||
std::cout << " no\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
BoardEnum backupBoard = (BoardEnum)-1;
|
||||
@@ -1007,12 +1034,14 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
break;
|
||||
default:
|
||||
std::cout << " unknown board\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_BOARD);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (backupBoard != board) {
|
||||
std::cout << " not right board\n";
|
||||
return false;
|
||||
errors.set(WRONG_BOARD);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
uint8_t version = eeprom[4];
|
||||
@@ -1022,34 +1051,52 @@ bool OpenTxEepromInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, in
|
||||
|
||||
std::cout << " version " << (unsigned int)version << " ";
|
||||
|
||||
if (!checkVersion(version)) {
|
||||
EepromLoadErrors version_error = checkVersion(version);
|
||||
if (version_error == OLD_VERSION) {
|
||||
errors.set(version_error);
|
||||
errors.set(HAS_WARNINGS);
|
||||
} else if (version_error == NOT_OPENTX) {
|
||||
std::cout << " not open9x\n";
|
||||
return false;
|
||||
errors.set(version_error);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (size > esize-8) {
|
||||
std::cout << " wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (bcktype=='M') {
|
||||
if (!loadModel(version, radioData.models[index], &eeprom[8], size, variant)) {
|
||||
std::cout << " ko\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << " backup type not supported\n";
|
||||
return false;
|
||||
errors.set(BACKUP_NOT_SUPPORTED);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << " ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareBaseUrl()
|
||||
{
|
||||
#if defined(ALLOW_NIGHTLY_BUILDS)
|
||||
return (g.useFirmwareNightlyBuilds() ? OPENTX_NIGHT_FIRMWARE_DOWNLOADS : OPENTX_FIRMWARE_DOWNLOADS);
|
||||
#else
|
||||
return OPENTX_FIRMWARE_DOWNLOADS;
|
||||
#endif
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getFirmwareUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
switch (board) {
|
||||
case BOARD_STOCK:
|
||||
case BOARD_M128:
|
||||
@@ -1058,6 +1105,7 @@ QString OpenTxFirmware::getFirmwareUrl()
|
||||
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:
|
||||
@@ -1073,16 +1121,16 @@ QString OpenTxFirmware::getFirmwareUrl()
|
||||
|
||||
QString OpenTxFirmware::getReleaseNotesUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
url.append("/releasenotes.txt");
|
||||
return url;
|
||||
}
|
||||
|
||||
QString OpenTxFirmware::getStampUrl()
|
||||
{
|
||||
QString url = OPENTX_FIRMWARE_DOWNLOADS;
|
||||
url.append("/stamp-opentx.txt");
|
||||
return url;
|
||||
QString url = getFirmwareBaseUrl();
|
||||
url.append("/stamp-opentx.txt");
|
||||
return url;
|
||||
}
|
||||
|
||||
void addOpenTxCommonOptions(OpenTxFirmware * firmware)
|
||||
@@ -1100,9 +1148,10 @@ void addOpenTxTaranisOptions(OpenTxFirmware * firmware)
|
||||
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"));
|
||||
firmware->addOption("nojoystick", QObject::tr("No Joystick emulation inside the FW (only Mass Storage as in the Bootloader)"));
|
||||
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 and LR12 FrSky protocols that are not legal for use anymore 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"));
|
||||
}
|
||||
|
||||
@@ -1128,7 +1177,7 @@ void registerOpenTxFirmwares()
|
||||
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 } };
|
||||
|
||||
/* 9x board */
|
||||
firmware = new OpenTxFirmware("opentx-9x", QObject::tr("OpenTX for 9X 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"));
|
||||
@@ -1164,7 +1213,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9x board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9x128", QObject::tr("OpenTX for M128 / 9X board"), 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"));
|
||||
@@ -1194,7 +1243,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board */
|
||||
firmware = new OpenTxFirmware("opentx-9xr", QObject::tr("OpenTX for 9XR"), BOARD_STOCK);
|
||||
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"));
|
||||
@@ -1227,7 +1276,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR board with M128 chip */
|
||||
firmware = new OpenTxFirmware("opentx-9xr128", QObject::tr("OpenTX for 9XR with M128 chip"), BOARD_M128);
|
||||
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"));
|
||||
@@ -1255,7 +1304,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Gruvin9x board */
|
||||
firmware = new OpenTxFirmware("opentx-gruvin9x", QObject::tr("OpenTX for Gruvin9x board / 9X"), 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"));
|
||||
@@ -1280,7 +1329,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* MEGA2560 board */
|
||||
firmware = new OpenTxFirmware("opentx-mega2560", QObject::tr("OpenTX for MEGA2560 board"), 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);
|
||||
@@ -1310,7 +1359,7 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Sky9x board */
|
||||
firmware = new OpenTxFirmware("opentx-sky9x", QObject::tr("OpenTX for Sky9x board / 9X"), BOARD_SKY9X);
|
||||
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"));
|
||||
@@ -1318,6 +1367,7 @@ void registerOpenTxFirmwares()
|
||||
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"));
|
||||
@@ -1329,8 +1379,8 @@ void registerOpenTxFirmwares()
|
||||
addOpenTxCommonOptions(firmware);
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* 9XR-Pro */
|
||||
firmware = new OpenTxFirmware("opentx-9xrpro", QObject::tr("OpenTX for 9XR-PRO"), BOARD_9XRPRO);
|
||||
/* 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"));
|
||||
@@ -1338,6 +1388,30 @@ void registerOpenTxFirmwares()
|
||||
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"));
|
||||
@@ -1349,26 +1423,40 @@ void registerOpenTxFirmwares()
|
||||
firmwares.push_back(firmware);
|
||||
|
||||
/* Taranis board */
|
||||
firmware = new OpenTxFirmware("opentx-taranis", QObject::tr("OpenTX for FrSky Taranis"), BOARD_TARANIS);
|
||||
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("OpenTX for FrSky Taranis Plus"), BOARD_TARANIS_PLUS);
|
||||
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("OpenTX for FrSky Taranis X9E"), BOARD_TARANIS_X9E);
|
||||
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);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
void unregisterOpenTxFirmwares()
|
||||
{
|
||||
foreach (Firmware * f, firmwares) {
|
||||
delete f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author - Bertrand Songis <bsongis@gmail.com>
|
||||
*
|
||||
*
|
||||
* Based on th9x -> http://code.google.com/p/th9x/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -19,8 +19,6 @@
|
||||
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define OPENTX_FIRMWARE_DOWNLOADS "http://downloads-21.open-tx.org/firmware"
|
||||
|
||||
class RleFile;
|
||||
|
||||
class OpenTxEepromInterface : public EEPROMInterface
|
||||
@@ -35,25 +33,23 @@ class OpenTxEepromInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
virtual int getSize(const ModelData &);
|
||||
|
||||
virtual int getSize(const GeneralSettings &);
|
||||
|
||||
virtual int getSize(GeneralSettings &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
const char * getName();
|
||||
|
||||
bool checkVersion(unsigned int version);
|
||||
EepromLoadErrors checkVersion(unsigned int version);
|
||||
|
||||
bool checkVariant(unsigned int version, unsigned int variant);
|
||||
|
||||
@@ -101,6 +97,7 @@ class OpenTxFirmware: public Firmware {
|
||||
|
||||
addTTSLanguage("en");
|
||||
addTTSLanguage("cz");
|
||||
addTTSLanguage("de");
|
||||
addTTSLanguage("es");
|
||||
addTTSLanguage("fr");
|
||||
addTTSLanguage("hu");
|
||||
@@ -113,7 +110,7 @@ class OpenTxFirmware: public Firmware {
|
||||
}
|
||||
|
||||
virtual Firmware * getFirmwareVariant(const QString & id);
|
||||
|
||||
|
||||
virtual QString getStampUrl();
|
||||
|
||||
virtual QString getReleaseNotesUrl();
|
||||
@@ -123,9 +120,16 @@ class OpenTxFirmware: public Firmware {
|
||||
virtual int getCapability(const Capability);
|
||||
|
||||
virtual bool isTelemetrySourceAvailable(int source);
|
||||
|
||||
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
QString getFirmwareBaseUrl();
|
||||
|
||||
};
|
||||
|
||||
void registerOpenTxFirmwares();
|
||||
void unregisterOpenTxFirmwares();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,36 +1,19 @@
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|
||||
today(DATE)
|
||||
now(TIME)
|
||||
git_id(GIT_STR)
|
||||
|
||||
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(trans
|
||||
make tra
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
|
||||
add_custom_target(lua_exports
|
||||
make PCB=TARANIS lua_exports.inc
|
||||
WORKING_DIRECTORY ${RADIO_SRC_DIRECTORY}
|
||||
)
|
||||
configure_file(${RADIO_SRC_DIRECTORY}/stamp.h.in ${RADIO_SRC_DIRECTORY}/stamp.h @ONLY)
|
||||
|
||||
set(OPENTX_SRC_FILES
|
||||
opentxsimulator.cpp
|
||||
)
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_BINARY_DIR}/radio/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${RADIO_BIN_DIRECTORY}
|
||||
${PROJECT_SOURCE_DIR}
|
||||
${PROJECT_SOURCE_DIR}/firmwares/opentx
|
||||
${COMPANION_SRC_DIRECTORY}/firmwares/opentx
|
||||
${RADIO_SRC_DIRECTORY}
|
||||
${RADIO_SRC_DIRECTORY}/fonts/std
|
||||
${RADIO_SRC_DIRECTORY}/lua/src
|
||||
@@ -41,6 +24,11 @@ include_directories(
|
||||
${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)
|
||||
@@ -49,21 +37,21 @@ endif()
|
||||
|
||||
set(COMMON_DEFINITIONS
|
||||
${COMMON_DEFINITIONS}
|
||||
SUFFIX="${SUFFIX}"
|
||||
SUFFIX="${SUFFIX}"
|
||||
HELI
|
||||
GVARS
|
||||
FLIGHT_MODES
|
||||
PPM_CENTER_ADJUSTABLE
|
||||
PPM_LIMITS_SYMETRICAL
|
||||
OVERRIDE_CHANNEL_FUNCTION
|
||||
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})
|
||||
@@ -73,21 +61,28 @@ add_library(opentx-gruvin9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-mega2560${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-sky9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-9xrpro${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-ar9x${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranis${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisplus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-taranisx9e${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
add_library(opentx-horus${SUFFIX}-simulator SHARED ${OPENTX_SRC_FILES})
|
||||
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator about_lbm_9x trans)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator about_lbm_taranis trans lua_exports)
|
||||
set(dependencies_9x 9x_bitmaps firmware_translations)
|
||||
add_dependencies(opentx-9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xr${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9x128${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xr128${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-gruvin9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-mega2560${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-sky9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-9xrpro${SUFFIX}-simulator ${dependencies_9x})
|
||||
add_dependencies(opentx-ar9x${SUFFIX}-simulator ${dependencies_9x})
|
||||
set(dependencies_taranis taranis_bitmaps firmware_translations)
|
||||
add_dependencies(opentx-taranis${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis)
|
||||
add_dependencies(opentx-taranisplus${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis)
|
||||
add_dependencies(opentx-taranisx9e${SUFFIX}-simulator ${dependencies_taranis} lua_export_taranis_x9e)
|
||||
|
||||
add_dependencies(opentx-horus${SUFFIX}-simulator horus_bitmaps horus_fonts firmware_translations lua_export_horus)
|
||||
|
||||
set(OPENTX_LIBRARIES
|
||||
opentx-9x${SUFFIX}-simulator
|
||||
@@ -98,66 +93,103 @@ set(OPENTX_LIBRARIES
|
||||
opentx-mega2560${SUFFIX}-simulator
|
||||
opentx-sky9x${SUFFIX}-simulator
|
||||
opentx-9xrpro${SUFFIX}-simulator
|
||||
opentx-ar9x${SUFFIX}-simulator
|
||||
opentx-taranis${SUFFIX}-simulator
|
||||
opentx-taranisplus${SUFFIX}-simulator
|
||||
opentx-taranisx9e${SUFFIX}-simulator
|
||||
)
|
||||
opentx-horus${SUFFIX}-simulator
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
install(TARGETS ${OPENTX_LIBRARIES} LIBRARY DESTINATION ${SIMULATOR_LIB_PATH})
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
|
||||
# 9X with ATmega64
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega64
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-9xr${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM64 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9X with ATmega128
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-9x128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9x128${SUFFIX}-simulator PRIVATE PCBSTD PCB9X CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9x128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR with ATmega128
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/stock)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-9xr128${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xr128${SUFFIX}-simulator PRIVATE PCBSTD PCB9XR CPUM128 EEPROM EEPROM_RLC ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xr128${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Gruvin9x
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/gruvin9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-gruvin9x${SUFFIX}-simulator PRIVATE PCBGRUVIN9X CPUM2560 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-gruvin9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Mega2560
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-mega2560${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/mega2560 PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-mega2560${SUFFIX}-simulator PRIVATE PCBMEGA2560 CPUM2560 EEPROM EEPROM_RLC SDCARD ROTARY_ENCODERS=2 ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-mega2560${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Sky9x
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-sky9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-sky9x${SUFFIX}-simulator PRIVATE PCBSKY9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-sky9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# 9XR-PRO
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-9xrpro${SUFFIX}-simulator PRIVATE PCBSKY9X REVX CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-9xrpro${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# AR9X
|
||||
target_include_directories(opentx-ar9x${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/sky9x PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/9x)
|
||||
target_compile_definitions(opentx-ar9x${SUFFIX}-simulator PRIVATE PCBSKY9X AR9X CPUARM VOICE EEPROM SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-ar9x${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis standard
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-taranis${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranis${SUFFIX}-simulator PRIVATE PCBTARANIS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranis${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis Plus
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisplus${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS CPUARM CPUSTM32 EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisplus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
# Taranis X9E
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_include_directories(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/taranis PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/taranis)
|
||||
target_compile_definitions(opentx-taranisx9e${SUFFIX}-simulator PRIVATE PCBTARANIS REVPLUS REV9E CPUARM CPUSTM32 STM32F40_41xxx EEPROM EEPROM_RLC VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-taranisx9e${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
ADD_CUSTOM_TARGET(opentx-simulators
|
||||
# Horus
|
||||
target_include_directories(opentx-horus${SUFFIX}-simulator PRIVATE ${RADIO_SRC_DIRECTORY}/targets/horus PRIVATE ${RADIO_SRC_DIRECTORY}/fonts/horus PRIVATE ${CMAKE_BINARY_DIR}/radio/src/bitmaps/horus)
|
||||
target_compile_definitions(opentx-horus${SUFFIX}-simulator PRIVATE PCBHORUS CPUARM CPUSTM32 STM32F40_41xxx COLORLCD VOICE SDCARD ${COMMON_DEFINITIONS})
|
||||
target_link_libraries(opentx-horus${SUFFIX}-simulator PRIVATE ${COMMON_LIBRARIES})
|
||||
|
||||
add_custom_target(opentx-simulators
|
||||
DEPENDS ${OPENTX_LIBRARIES}
|
||||
)
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
set(SIMULATOR_BUNDLES)
|
||||
foreach(_file ${OPENTX_LIBRARIES})
|
||||
set(SIMULATOR_BUNDLE "${_file}-bundle")
|
||||
add_custom_target(${SIMULATOR_BUNDLE}
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtXml.framework/Versions/4/QtXml @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml lib${_file}.dylib
|
||||
COMMAND install_name_tool -change /opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui lib${_file}.dylib
|
||||
COMMAND install_name_tool -change @rpath/SDL.framework/Versions/A/SDL @executable_path/../Frameworks/SDL.framework/Versions/A/SDL lib${_file}.dylib
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMAND pwd
|
||||
COMMAND cp lib${_file}.dylib companion.app/Contents/Resources/
|
||||
DEPENDS ${_file}
|
||||
)
|
||||
list(APPEND SIMULATOR_BUNDLES ${SIMULATOR_BUNDLE})
|
||||
endforeach()
|
||||
add_custom_target(opentx-simulators-bundle DEPENDS ${SIMULATOR_BUNDLES})
|
||||
endif(APPLE)
|
||||
|
||||
|
||||
@@ -40,15 +40,20 @@
|
||||
#define AUTOSWITCH
|
||||
#define GRAPHICS
|
||||
#define CURVES
|
||||
#if defined(PCBTARANIS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#if defined(PCBFLAMENCO)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#elif defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
#define RTCLOCK
|
||||
#define XCURVES
|
||||
#define VIRTUALINPUTS
|
||||
#define LUA
|
||||
#define LUA_MODEL_SCRIPTS
|
||||
#define LUAINPUTS
|
||||
#else
|
||||
#define BUZZER
|
||||
#define TEMPLATES
|
||||
#define BUZZER
|
||||
#define TEMPLATES
|
||||
#endif
|
||||
#define BOLD_FONT
|
||||
#define HAPTIC
|
||||
@@ -61,17 +66,17 @@
|
||||
#endif
|
||||
|
||||
#if defined(PCBSKY9X) && !defined(REVX)
|
||||
#define ROTARY_ENCODERS 1
|
||||
#define ROTARY_ENCODERS 1
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#define ROTARY_ENCODERS 2
|
||||
#define ROTARY_ENCODERS 2
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define FRSKY_SPORT
|
||||
#define FRSKY_SPORT
|
||||
#endif
|
||||
|
||||
#if defined (PCBTARANIS)
|
||||
#define MIXERS_MONITOR
|
||||
#define MIXERS_MONITOR
|
||||
#endif
|
||||
|
||||
#undef min
|
||||
@@ -90,21 +95,26 @@ namespace NAMESPACE {
|
||||
#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"
|
||||
#include "radio/src/storage/storage_common.cpp"
|
||||
#if defined(EEPROM_RLC)
|
||||
#include "radio/src/eeprom_rlc.cpp"
|
||||
#else
|
||||
#include "radio/src/eeprom_raw.cpp"
|
||||
#include "radio/src/storage/eeprom_common.cpp"
|
||||
#include "radio/src/storage/eeprom_rlc.cpp"
|
||||
#elif defined(EEPROM)
|
||||
#include "radio/src/storage/eeprom_common.cpp"
|
||||
#include "radio/src/storage/eeprom_raw.cpp"
|
||||
#elif defined(SDCARD)
|
||||
#include "radio/src/storage/sdcard_raw.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBSKY9X)
|
||||
#include "radio/src/eeprom_conversions.cpp"
|
||||
#include "radio/src/storage/eeprom_conversions.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/opentx.cpp"
|
||||
@@ -121,86 +131,161 @@ namespace NAMESPACE {
|
||||
#include "radio/src/stamp.cpp"
|
||||
#include "radio/src/maths.cpp"
|
||||
#include "radio/src/vario.cpp"
|
||||
#include "radio/src/trainer_input.cpp"
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
#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"
|
||||
#include "radio/src/gui/horus/bitmaps.cpp"
|
||||
#include "radio/src/gui/horus/curves.cpp"
|
||||
#include "radio/src/gui/horus/fonts.cpp"
|
||||
#include "radio/src/gui/horus/widgets.cpp"
|
||||
#include "radio/src/gui/horus/navigation.cpp"
|
||||
#include "radio/src/gui/horus/popups.cpp"
|
||||
#include "radio/src/gui/horus/helpers.cpp"
|
||||
#include "radio/src/gui/horus/menus.cpp"
|
||||
#include "radio/src/gui/horus/menu_model.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_select.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/horus/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/horus/menu_general.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/horus/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/horus/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/horus/view_main.cpp"
|
||||
#include "radio/src/gui/horus/view_statistics.cpp"
|
||||
#include "radio/src/gui/horus/view_channels.cpp"
|
||||
#include "radio/src/gui/horus/view_telemetry.cpp"
|
||||
#include "radio/src/gui/horus/view_text.cpp"
|
||||
#include "radio/src/gui/horus/view_about.cpp"
|
||||
#include "radio/src/gui/horus/lcd.cpp"
|
||||
#include "radio/src/gui/horus/splash.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/gui/Flamenco/fonts.cpp"
|
||||
#include "radio/src/gui/Flamenco/widgets.cpp"
|
||||
#include "radio/src/gui/Flamenco/navigation.cpp"
|
||||
#include "radio/src/gui/Flamenco/popups.cpp"
|
||||
#include "radio/src/gui/Flamenco/helpers.cpp"
|
||||
#include "radio/src/gui/Flamenco/menus.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_select.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_custom_functions.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_version.cpp"
|
||||
// #include "radio/src/gui/Flamenco/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/Flamenco/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_main.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_statistics.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_channels.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_telemetry.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_text.cpp"
|
||||
#include "radio/src/gui/Flamenco/view_about.cpp"
|
||||
#include "radio/src/gui/Flamenco/lcd.cpp"
|
||||
#include "radio/src/gui/Flamenco/splash.cpp"
|
||||
#include "radio/src/targets/flamenco/tw8823_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/bmp.cpp"
|
||||
#include "radio/src/gui/taranis/fonts.cpp"
|
||||
#include "radio/src/gui/taranis/widgets.cpp"
|
||||
#include "radio/src/gui/taranis/navigation.cpp"
|
||||
#include "radio/src/gui/taranis/popups.cpp"
|
||||
#include "radio/src/gui/taranis/helpers.cpp"
|
||||
#include "radio/src/gui/taranis/menus.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_select.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_custom_scripts.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_gvars.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/taranis/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_setup.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_sdmanager.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_trainer.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_version.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_diagkeys.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_diaganas.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_hardware.cpp"
|
||||
#include "radio/src/gui/taranis/menu_general_calib.cpp"
|
||||
#include "radio/src/gui/taranis/view_main.cpp"
|
||||
#include "radio/src/gui/taranis/view_statistics.cpp"
|
||||
#include "radio/src/gui/taranis/view_channels.cpp"
|
||||
#include "radio/src/gui/taranis/view_telemetry.cpp"
|
||||
#include "radio/src/gui/taranis/view_text.cpp"
|
||||
#include "radio/src/gui/taranis/view_about.cpp"
|
||||
#include "radio/src/gui/taranis/lcd.cpp"
|
||||
#include "radio/src/gui/taranis/splash.cpp"
|
||||
#else
|
||||
#include "radio/src/gui/9X/fonts.cpp"
|
||||
#include "radio/src/gui/9X/widgets.cpp"
|
||||
#include "radio/src/gui/9X/navigation.cpp"
|
||||
#include "radio/src/gui/9X/popups.cpp"
|
||||
#include "radio/src/gui/9X/helpers.cpp"
|
||||
#include "radio/src/gui/9X/menus.cpp"
|
||||
#include "radio/src/gui/9X/menu_model.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_select.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_setup.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_heli.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_flightmodes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_inputs_mixes.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_curves.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_logical_switches.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_custom_functions.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_limits.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_telemetry.cpp"
|
||||
#include "radio/src/gui/9X/menu_model_templates.cpp"
|
||||
#include "radio/src/gui/9X/menu_general.cpp"
|
||||
#include "radio/src/gui/9X/menu_general_setup.cpp"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#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"
|
||||
#include "radio/src/gui/9x/view_about.cpp"
|
||||
#endif
|
||||
#include "radio/src/gui/9X/lcd.cpp"
|
||||
#include "radio/src/gui/9X/splash.cpp"
|
||||
#include "radio/src/gui/9x/lcd.cpp"
|
||||
#include "radio/src/gui/9x/splash.cpp"
|
||||
#endif
|
||||
|
||||
#if !defined(VIRTUALINPUTS)
|
||||
@@ -219,7 +304,27 @@ namespace NAMESPACE {
|
||||
#include "radio/src/buzzer.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
#include "radio/src/targets/horus/board_horus.cpp"
|
||||
#include "radio/src/targets/horus/keys_driver.cpp"
|
||||
#include "radio/src/targets/horus/audio_driver.cpp"
|
||||
#include "radio/src/targets/horus/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/horus/haptic_driver.cpp"
|
||||
#include "radio/src/targets/horus/pulses_driver.cpp"
|
||||
#include "radio/src/targets/taranis/rtc_driver.cpp"
|
||||
#include "radio/src/targets/horus/trainer_driver.cpp"
|
||||
#include "radio/src/targets/horus/serial2_driver.cpp"
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#include "radio/src/targets/flamenco/board_flamenco.cpp"
|
||||
#include "radio/src/targets/flamenco/keys_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/audio_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/telemetry_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/eeprom_driver.cpp"
|
||||
// #include "radio/src/targets/flamenco/haptic_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/pulses_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/rtc_driver.cpp"
|
||||
#include "radio/src/targets/flamenco/trainer_driver.cpp"
|
||||
#elif defined(PCBTARANIS)
|
||||
#include "radio/src/targets/taranis/board_taranis.cpp"
|
||||
#include "radio/src/targets/taranis/keys_driver.cpp"
|
||||
#include "radio/src/targets/taranis/audio_driver.cpp"
|
||||
@@ -231,7 +336,7 @@ namespace NAMESPACE {
|
||||
#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/uart3_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"
|
||||
@@ -242,7 +347,7 @@ namespace NAMESPACE {
|
||||
#include "radio/src/targets/sky9x/sdcard_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/coproc_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/haptic_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/second_serial_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/serial2_driver.cpp"
|
||||
#include "radio/src/targets/sky9x/pulses_driver.cpp"
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
#include "radio/src/targets/gruvin9x/board_gruvin9x.cpp"
|
||||
@@ -250,7 +355,11 @@ namespace NAMESPACE {
|
||||
#elif defined(PCBMEGA2560)
|
||||
#include "radio/src/targets/mega2560/board_mega2560.cpp"
|
||||
#else
|
||||
#include "radio/src/targets/stock/board_stock.cpp"
|
||||
#include "radio/src/targets/9x/board_stock.cpp"
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
#include "radio/src/gui/gui_helpers.cpp"
|
||||
#endif
|
||||
|
||||
#include "radio/src/keys.cpp"
|
||||
@@ -258,7 +367,11 @@ namespace NAMESPACE {
|
||||
#include "radio/src/targets/simu/simpgmspace.cpp"
|
||||
#include "radio/src/translations.cpp"
|
||||
#include "radio/src/telemetry/frsky.cpp"
|
||||
#include "radio/src/telemetry/frsky_d.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)
|
||||
@@ -276,7 +389,10 @@ namespace NAMESPACE {
|
||||
#endif
|
||||
|
||||
#if defined(LUA)
|
||||
#include "radio/src/lua_api.cpp"
|
||||
#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"
|
||||
@@ -307,6 +423,7 @@ namespace NAMESPACE {
|
||||
#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];
|
||||
@@ -369,8 +486,7 @@ bool OpenTxSimulator::timer10ms()
|
||||
|
||||
::uint8_t * OpenTxSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool OpenTxSimulator::lcdChanged(bool & lightEnable)
|
||||
@@ -450,11 +566,16 @@ void OpenTxSimulator::getTrims(Trims & trims)
|
||||
|
||||
void OpenTxSimulator::wheelEvent(int steps)
|
||||
{
|
||||
#if defined(REV9E)
|
||||
if (steps == 255)
|
||||
x9de_rotenc -= 2;
|
||||
#if defined(PCBHORUS) || defined(PCBFLAMENCO)
|
||||
if (steps > 0)
|
||||
rotencValue -= 2;
|
||||
else
|
||||
x9de_rotenc += 2;
|
||||
rotencValue += 2;
|
||||
#elif defined(REV9E)
|
||||
if (steps == 255)
|
||||
rotencValue -= 2;
|
||||
else
|
||||
rotencValue += 2;
|
||||
#elif defined(PCBSKY9X) && !defined(REVX)
|
||||
g_rotenc[0] += steps*4;
|
||||
#elif defined(PCBGRUVIN9X)
|
||||
@@ -487,12 +608,49 @@ void OpenTxSimulator::sendTelemetry(::uint8_t * data, unsigned int len)
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t OpenTxSimulator::getSensorInstance(uint16_t id)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16_t OpenTxSimulator::getSensorRatio(uint16_t id)
|
||||
{
|
||||
#if defined(FRSKY_SPORT)
|
||||
for (int i = 0; i<MAX_SENSORS; i++) {
|
||||
if (isTelemetryFieldAvailable(i)) {
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[i];
|
||||
if (sensor->id == id) {
|
||||
return sensor->custom.ratio;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setTrainerInput(unsigned int inputNumber, ::int16_t value)
|
||||
{
|
||||
#define SETTRAINER_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
}
|
||||
|
||||
void OpenTxSimulator::setLuaStateReloadPermanentScripts()
|
||||
{
|
||||
#if defined(LUA)
|
||||
luaState = INTERPRETER_RELOAD_PERMANENT_SCRIPTS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void OpenTxSimulator::installTraceHook(void (*callback)(const char *))
|
||||
{
|
||||
traceCallback = callback;
|
||||
@@ -517,7 +675,11 @@ class OpenTxSimulatorFactory: public SimulatorFactory
|
||||
|
||||
virtual BoardEnum type()
|
||||
{
|
||||
#if defined(PCBTARANIS)
|
||||
#if defined(PCBHORUS)
|
||||
return BOARD_HORUS;
|
||||
#elif defined(PCBFLAMENCO)
|
||||
return BOARD_FLAMENCO;
|
||||
#elif defined(PCBTARANIS)
|
||||
return BOARD_TARANIS;
|
||||
#else
|
||||
return BOARD_STOCK;
|
||||
|
||||
@@ -19,7 +19,15 @@
|
||||
|
||||
#include "simulatorinterface.h"
|
||||
|
||||
#if defined(PCBTARANIS) && defined(REV9E)
|
||||
#if defined(PCBHORUS)
|
||||
#define FLAVOUR "horus"
|
||||
#define NAMESPACE HORUS
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBFLAMENCO)
|
||||
#define FLAVOUR "flamenco"
|
||||
#define NAMESPACE FLAMENCO
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBTARANIS) && defined(REV9E)
|
||||
#define FLAVOUR "taranisx9e"
|
||||
#define NAMESPACE TaranisX9E
|
||||
#define EEPROM_VARIANT 0x8000
|
||||
@@ -35,6 +43,10 @@
|
||||
#define FLAVOUR "9xrpro"
|
||||
#define NAMESPACE Sky9xPro
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBSKY9X) && defined(AR9X)
|
||||
#define FLAVOUR "ar9x"
|
||||
#define NAMESPACE Ar9x
|
||||
#define EEPROM_VARIANT 0
|
||||
#elif defined(PCBSKY9X)
|
||||
#define FLAVOUR "sky9x"
|
||||
#define NAMESPACE Sky9X
|
||||
@@ -118,9 +130,15 @@ class DLLEXPORT OpenTxSimulator : public SimulatorInterface {
|
||||
|
||||
virtual void sendTelemetry(uint8_t * data, unsigned int len);
|
||||
|
||||
virtual uint8_t getSensorInstance(uint16_t id);
|
||||
|
||||
virtual uint16_t getSensorRatio(uint16_t id);
|
||||
|
||||
virtual void setTrainerInput(unsigned int inputNumber, int16_t value);
|
||||
|
||||
virtual void installTraceHook(void (*callback)(const char *));
|
||||
|
||||
virtual void setLuaStateReloadPermanentScripts();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
// Automatically generated file (CMake) - do not edit
|
||||
#define DATE_STR "@DATE@"
|
||||
#define TIME_STR "@TIME@"
|
||||
#define VERS_STR "@C9X_VERSION@"
|
||||
@@ -175,8 +175,7 @@ bool Th9xSimulator::timer10ms()
|
||||
|
||||
uint8_t * Th9xSimulator::getLcd()
|
||||
{
|
||||
#define GETLCD_IMPORT
|
||||
#include "simulatorimport.h"
|
||||
return (::uint8_t *)simuLcdBuf;
|
||||
}
|
||||
|
||||
bool Th9xSimulator::lcdChanged(bool & lightEnable)
|
||||
|
||||
@@ -62,7 +62,7 @@ Th9xGeneral::operator GeneralSettings ()
|
||||
result.currModel = currModel;
|
||||
result.contrast = contrast;
|
||||
result.vBatWarn = vBatWarn;
|
||||
result.vBatCalib = vBatCalib;
|
||||
result.txVoltageCalibration = txVoltageCalibration;
|
||||
// result.lightSw = th9xToSwitch(lightSw);
|
||||
result.trainer = trainer;
|
||||
result.view = view;
|
||||
|
||||
@@ -64,7 +64,7 @@ PACK(typedef struct t_Th9xGeneral {
|
||||
uint8_t currModel; //0..15
|
||||
uint8_t contrast;
|
||||
uint8_t vBatWarn;
|
||||
int8_t vBatCalib;
|
||||
int8_t txVoltageCalibration;
|
||||
int8_t lightSw;
|
||||
Th9xTrainerData trainer;
|
||||
uint8_t adcFilt:2;
|
||||
|
||||
@@ -57,23 +57,29 @@ const int Th9xInterface::getMaxModels()
|
||||
return 16;
|
||||
}
|
||||
|
||||
bool Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
unsigned long Th9xInterface::loadxml(RadioData &radioData, QDomDocument &doc)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
unsigned long Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
{
|
||||
std::cout << "trying th9x import... ";
|
||||
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
|
||||
if (size != getEEpromSize()) {
|
||||
std::cout << "wrong size\n";
|
||||
return false;
|
||||
errors.set(WRONG_SIZE);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
if (!efile->EeFsOpen((uint8_t *)eeprom, size, BOARD_STOCK)) {
|
||||
std::cout << "wrong file system\n";
|
||||
return false;
|
||||
errors.set(WRONG_FILE_SYSTEM);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
@@ -81,7 +87,8 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
|
||||
if (efile->readRlc2((uint8_t*)&th9xGeneral, 1) != 1) {
|
||||
std::cout << "no\n";
|
||||
return false;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
std::cout << "version " << (unsigned int)th9xGeneral.myVers << " ";
|
||||
@@ -91,14 +98,16 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
break;
|
||||
default:
|
||||
std::cout << "not th9x\n";
|
||||
return false;
|
||||
errors.set(NOT_TH9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
efile->openRd(FILE_GENERAL);
|
||||
int len = efile->readRlc2((uint8_t*)&th9xGeneral, sizeof(Th9xGeneral));
|
||||
if (len != sizeof(Th9xGeneral)) {
|
||||
std::cout << "not th9x\n";
|
||||
return false;
|
||||
errors.set(NOT_TH9X);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
radioData.generalSettings = th9xGeneral;
|
||||
|
||||
@@ -114,12 +123,15 @@ bool Th9xInterface::load(RadioData &radioData, const uint8_t *eeprom, int size)
|
||||
}
|
||||
|
||||
std::cout << "ok\n";
|
||||
return true;
|
||||
errors.set(NO_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
bool Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
unsigned long Th9xInterface::loadBackup(RadioData &radioData, uint8_t *eeprom, int esize, int index)
|
||||
{
|
||||
return false;
|
||||
std::bitset<NUM_ERRORS> errors;
|
||||
errors.set(UNKNOWN_ERROR);
|
||||
return errors.to_ulong();
|
||||
}
|
||||
|
||||
int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant, uint8_t version)
|
||||
@@ -130,24 +142,24 @@ int Th9xInterface::save(uint8_t *eeprom, RadioData &radioData, uint32_t variant,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Th9xInterface::getSize(ModelData &model)
|
||||
int Th9xInterface::getSize(const ModelData & model)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Th9xInterface::getSize(GeneralSettings &settings)
|
||||
int Th9xInterface::getSize(const GeneralSettings & settings)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Th9xInterface::isAvailable(Protocol proto, int port)
|
||||
int Th9xInterface::isAvailable(PulsesProtocol proto, int port)
|
||||
{
|
||||
switch (proto) {
|
||||
case PPM:
|
||||
case SILV_A:
|
||||
case SILV_B:
|
||||
case SILV_C:
|
||||
case CTP1009:
|
||||
case PULSES_PPM:
|
||||
case PULSES_SILV_A:
|
||||
case PULSES_SILV_B:
|
||||
case PULSES_SILV_C:
|
||||
case PULSES_CTP1009:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
|
||||
@@ -34,19 +34,19 @@ class Th9xInterface : public EEPROMInterface
|
||||
|
||||
virtual const int getMaxModels();
|
||||
|
||||
virtual bool load(RadioData &, const uint8_t *eeprom, int size);
|
||||
virtual unsigned long load(RadioData &, const uint8_t *eeprom, int size);
|
||||
|
||||
virtual bool loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
virtual unsigned long loadBackup(RadioData &, uint8_t *eeprom, int esize, int index);
|
||||
|
||||
virtual bool loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
virtual unsigned long loadxml(RadioData &radioData, QDomDocument &doc);
|
||||
|
||||
virtual int save(uint8_t *eeprom, RadioData &radioData, uint32_t variant=0, uint8_t version=0);
|
||||
|
||||
virtual int getSize(ModelData &);
|
||||
virtual int getSize(const ModelData &);
|
||||
|
||||
virtual int getSize(GeneralSettings &);
|
||||
virtual int getSize(const GeneralSettings &);
|
||||
|
||||
virtual int isAvailable(Protocol proto, int port=0);
|
||||
virtual int isAvailable(PulsesProtocol proto, int port=0);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "ui_flasheepromdialog.h"
|
||||
#include "eeprominterface.h"
|
||||
#include "helpers.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "firmwareinterface.h"
|
||||
#include "hexinterface.h"
|
||||
#include "appdata.h"
|
||||
#include "progressdialog.h"
|
||||
#include "radiointerface.h"
|
||||
#include "converteeprom.h"
|
||||
#include "splashlibrarydialog.h"
|
||||
|
||||
FlashEEpromDialog::FlashEEpromDialog(QWidget *parent, const QString &filename):
|
||||
QDialog(parent),
|
||||
@@ -102,9 +102,9 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
return -1;
|
||||
}
|
||||
|
||||
QByteArray eeprom(EESIZE_RLC_MAX, 0);
|
||||
QByteArray eeprom(EESIZE_MAX, 0);
|
||||
int fileType = getFileType(filename);
|
||||
|
||||
|
||||
#if 0
|
||||
if (fileType==FILE_TYPE_XML) {
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
@@ -125,7 +125,8 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
bool xmlOK = doc.setContent(&file);
|
||||
if (xmlOK) {
|
||||
RadioData * radioData = new RadioData();
|
||||
if (!loadEEpromXml(*radioData, doc)) {
|
||||
std::bitset<NUM_ERRORS> errors((unsigned long long)LoadEepromXml(*radioData, doc));
|
||||
if (!errors.test(NO_ERROR)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings File %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
@@ -144,7 +145,7 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_RLC_MAX);
|
||||
eeprom_size = HexInterface(inputStream).load((uint8_t *)eeprom.data(), EESIZE_MAX);
|
||||
}
|
||||
else if (fileType==FILE_TYPE_BIN) { //read binary
|
||||
eeprom_size = file.size();
|
||||
@@ -160,7 +161,8 @@ int FlashEEpromDialog::getEEpromVersion(const QString &filename)
|
||||
}
|
||||
|
||||
RadioData * radioData = new RadioData();
|
||||
if (eeprom_size == 0 || !loadEEprom(*radioData, (const uint8_t *)eeprom.data(), eeprom_size)) {
|
||||
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)) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("Invalid Models and Settings file %1").arg(filename));
|
||||
}
|
||||
else {
|
||||
@@ -175,8 +177,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||
QString calib = g.profile[g.id()].stickPotCalib();
|
||||
QString trainercalib = g.profile[g.id()].trainerCalib();
|
||||
int potsnum=GetCurrentFirmware()->getCapability(Pots);
|
||||
int8_t vBatCalib=(int8_t) g.profile[g.id()].vBatCalib();
|
||||
int8_t currentCalib=(int8_t) g.profile[g.id()].currentCalib();
|
||||
int8_t txVoltageCalibration=(int8_t) g.profile[g.id()].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration=(int8_t) g.profile[g.id()].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier=(int8_t) g.profile[g.id()].ppmMultiplier();
|
||||
|
||||
if ((calib.length()==(NUM_STICKS+potsnum)*12) && (trainercalib.length()==16)) {
|
||||
@@ -204,8 +206,8 @@ bool FlashEEpromDialog::patchCalibration()
|
||||
radioData->generalSettings.trainer.calib[i] = byte16;
|
||||
}
|
||||
}
|
||||
radioData->generalSettings.currentCalib = currentCalib;
|
||||
radioData->generalSettings.vBatCalib = vBatCalib;
|
||||
radioData->generalSettings.txCurrentCalibration = txCurrentCalibration;
|
||||
radioData->generalSettings.txVoltageCalibration = txVoltageCalibration;
|
||||
radioData->generalSettings.PPM_Multiplier = PPM_Multiplier;
|
||||
return true;
|
||||
}
|
||||
@@ -303,7 +305,7 @@ void FlashEEpromDialog::on_burnButton_clicked()
|
||||
backupPath = g.profile[g.id()].pBackupDir();
|
||||
if (backupPath.isEmpty()) {
|
||||
backupPath=g.backupDir();
|
||||
}
|
||||
}
|
||||
backupFilename = backupPath + "/backup-" + QDateTime().currentDateTime().toString("yyyy-MM-dd-HHmmss") + ".bin";
|
||||
}
|
||||
else if (ui->checkFirmwareCompatibility->isChecked()) {
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Allows Companion to write to older version of the firmware</string>
|
||||
<string><html><head/><body><p>Saves a dated copy of your eeprom to the backup folder you specified in the Companion settings before writing the current model to the radio.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Backup before Write</string>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "hexinterface.h"
|
||||
#include "progressdialog.h"
|
||||
#include "radiointerface.h"
|
||||
#include "splashlibrary.h"
|
||||
#include "progresswidget.h"
|
||||
#include "splashlibrarydialog.h"
|
||||
|
||||
#if defined WIN32 || !defined __GNUC__
|
||||
#include <windows.h>
|
||||
@@ -185,7 +185,7 @@ void FlashFirmwareDialog::on_useExternalSplash_clicked()
|
||||
void FlashFirmwareDialog::on_useLibrarySplash_clicked()
|
||||
{
|
||||
QString fileName;
|
||||
splashLibrary *ld = new splashLibrary(this, &fileName);
|
||||
SplashLibraryDialog *ld = new SplashLibraryDialog(this, &fileName);
|
||||
ld->exec();
|
||||
if (!fileName.isEmpty()) {
|
||||
QImage image(fileName);
|
||||
@@ -203,6 +203,7 @@ 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());
|
||||
|
||||
|
||||
@@ -4,13 +4,15 @@ set(generaledit_NAMES
|
||||
generaledit
|
||||
generalsetup
|
||||
trainer
|
||||
calibration
|
||||
hardware
|
||||
)
|
||||
|
||||
set(generaledit_SRCS
|
||||
calibration.cpp
|
||||
)
|
||||
|
||||
set(generaledit_HDRS
|
||||
calibration.h
|
||||
)
|
||||
|
||||
set(generaledit_UIS
|
||||
|
||||
@@ -1,422 +1,90 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QSpinBox>
|
||||
#include "calibration.h"
|
||||
#include "ui_calibration.h"
|
||||
|
||||
void CalibrationPanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
enabled = true;
|
||||
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
|
||||
}
|
||||
else if (index < 8) {
|
||||
enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
|
||||
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
|
||||
type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
|
||||
name->setField(generalSettings.switchName[index], 3, this);
|
||||
type->setField(generalSettings.switchConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrationPanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("None"), GeneralSettings::POT_NONE);
|
||||
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
|
||||
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
|
||||
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
|
||||
name->setField(generalSettings.potName[index], 3, this);
|
||||
type->setField(generalSettings.potConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrationPanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
|
||||
type->setEnabled(false);
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
|
||||
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
|
||||
name->setField(generalSettings.sliderName[index], 3, this);
|
||||
type->setField(generalSettings.sliderConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
CalibrationPanel::CalibrationPanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
ui(new Ui::Calibration)
|
||||
GeneralPanel(parent, generalSettings, firmware)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (!firmware->getCapability(MultiposPots)) {
|
||||
ui->potsTypeSeparator->hide();
|
||||
tableWidget = new QTableWidget();
|
||||
QVBoxLayout * layout = new QVBoxLayout();
|
||||
layout->addWidget(tableWidget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
this->setLayout(layout);
|
||||
|
||||
tableWidget->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||
tableWidget->setColumnCount(3);
|
||||
tableWidget->setShowGrid(false);
|
||||
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
|
||||
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
|
||||
QStringList headerLabels;
|
||||
headerLabels << QObject::tr("Negative span") << QObject::tr("Mid value") << QObject::tr("Positive span");
|
||||
tableWidget->setHorizontalHeaderLabels(headerLabels);
|
||||
|
||||
int rows = NUM_STICKS + GetCurrentFirmware()->getCapability(Pots) + GetCurrentFirmware()->getCapability(Sliders);
|
||||
tableWidget->setRowCount(rows);
|
||||
|
||||
for(int i = 0; i < rows; ++i) {
|
||||
|
||||
QTableWidgetItem *newItem = new QTableWidgetItem(AnalogString(i));
|
||||
newItem->setTextAlignment(Qt::AlignLeft);
|
||||
tableWidget->setVerticalHeaderItem(i, newItem);
|
||||
|
||||
for(int j = 0; j < 3; ++j) {
|
||||
QSpinBox * newItem = new QSpinBox();
|
||||
newItem->setMinimum(-9999);
|
||||
newItem->setMaximum(9999);
|
||||
newItem->setSingleStep(1);
|
||||
newItem->setValue(getCalibrationValue(i, j));
|
||||
newItem->setProperty("row", i);
|
||||
newItem->setProperty("column", j);
|
||||
tableWidget->setCellWidget(i, j, newItem);
|
||||
connect(newItem, SIGNAL(valueChanged(int)), this, SLOT(onCellChanged(int)));
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
ui->rudName->setField(generalSettings.stickName[0], 3, this);
|
||||
ui->eleName->setField(generalSettings.stickName[1], 3, this);
|
||||
ui->thrName->setField(generalSettings.stickName[2], 3, this);
|
||||
ui->ailName->setField(generalSettings.stickName[3], 3, this);
|
||||
}
|
||||
else {
|
||||
ui->rudLabel->hide();
|
||||
ui->rudName->hide();
|
||||
ui->eleLabel->hide();
|
||||
ui->eleName->hide();
|
||||
ui->thrLabel->hide();
|
||||
ui->thrName->hide();
|
||||
ui->ailLabel->hide();
|
||||
ui->ailName->hide();
|
||||
}
|
||||
|
||||
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
||||
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
|
||||
|
||||
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
|
||||
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
|
||||
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
|
||||
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
|
||||
|
||||
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
|
||||
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
|
||||
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
|
||||
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
|
||||
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
|
||||
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType);
|
||||
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
|
||||
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType);
|
||||
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
|
||||
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
|
||||
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
|
||||
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
|
||||
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
|
||||
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
|
||||
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
|
||||
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
|
||||
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
|
||||
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
|
||||
|
||||
int potsCount = GetCurrentFirmware()->getCapability(Pots);
|
||||
if (potsCount == 3) {
|
||||
ui->ana8Neg->hide();
|
||||
ui->ana8Mid->hide();
|
||||
ui->ana8Pos->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
|
||||
}
|
||||
else {
|
||||
ui->serialPortMode->hide();
|
||||
ui->serialPortLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
||||
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
||||
}
|
||||
else {
|
||||
ui->bluetoothLabel->hide();
|
||||
ui->bluetoothEnable->hide();
|
||||
ui->bluetoothName->hide();
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
}
|
||||
|
||||
CalibrationPanel::~CalibrationPanel()
|
||||
void CalibrationPanel::onCellChanged(int value)
|
||||
{
|
||||
delete ui;
|
||||
QSpinBox * sb = qobject_cast<QSpinBox*>(sender());
|
||||
int row = sb->property("row").toInt();
|
||||
int column = sb->property("column").toInt();
|
||||
|
||||
if (value != getCalibrationValue(row, column)) {
|
||||
setCalibrationValue(row,column, value);
|
||||
qDebug() << "CalibrationPanel::onCellChanged" << row << column << "to" << value;
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
int CalibrationPanel::getCalibrationValue(int row, int column)
|
||||
{
|
||||
switch(column) {
|
||||
case 0:
|
||||
return generalSettings.calibSpanNeg[row];
|
||||
case 1:
|
||||
return generalSettings.calibMid[row];
|
||||
case 2:
|
||||
return generalSettings.calibSpanPos[row];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*void CalibrationPanel::update()
|
||||
void CalibrationPanel::setCalibrationValue(int row, int column, int value)
|
||||
{
|
||||
}
|
||||
*/
|
||||
void CalibrationPanel::on_PPM_MultiplierDSB_editingFinished()
|
||||
{
|
||||
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_PPM1_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[0] = ui->PPM1->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_PPM2_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[1] = ui->PPM2->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_PPM3_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[2] = ui->PPM3->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_PPM4_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[3] = ui->PPM4->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
void CalibrationPanel::on_CurrentCalib_SB_editingFinished()
|
||||
{
|
||||
generalSettings.currentCalib = ui->CurrentCalib_SB->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_bluetoothEnable_stateChanged(int)
|
||||
{
|
||||
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::setValues()
|
||||
{
|
||||
ui->battCalibDSB->setValue((double)generalSettings.vBatCalib/10);
|
||||
ui->CurrentCalib_SB->setValue((double)generalSettings.currentCalib);
|
||||
|
||||
ui->ana1Neg->setValue(generalSettings.calibSpanNeg[0]);
|
||||
ui->ana2Neg->setValue(generalSettings.calibSpanNeg[1]);
|
||||
ui->ana3Neg->setValue(generalSettings.calibSpanNeg[2]);
|
||||
ui->ana4Neg->setValue(generalSettings.calibSpanNeg[3]);
|
||||
ui->ana5Neg->setValue(generalSettings.calibSpanNeg[4]);
|
||||
ui->ana6Neg->setValue(generalSettings.calibSpanNeg[5]);
|
||||
ui->ana7Neg->setValue(generalSettings.calibSpanNeg[6]);
|
||||
ui->ana8Neg->setValue(generalSettings.calibSpanNeg[7]);
|
||||
|
||||
ui->ana1Mid->setValue(generalSettings.calibMid[0]);
|
||||
ui->ana2Mid->setValue(generalSettings.calibMid[1]);
|
||||
ui->ana3Mid->setValue(generalSettings.calibMid[2]);
|
||||
ui->ana4Mid->setValue(generalSettings.calibMid[3]);
|
||||
ui->ana5Mid->setValue(generalSettings.calibMid[4]);
|
||||
ui->ana6Mid->setValue(generalSettings.calibMid[5]);
|
||||
ui->ana7Mid->setValue(generalSettings.calibMid[6]);
|
||||
ui->ana8Mid->setValue(generalSettings.calibMid[7]);
|
||||
|
||||
ui->ana1Pos->setValue(generalSettings.calibSpanPos[0]);
|
||||
ui->ana2Pos->setValue(generalSettings.calibSpanPos[1]);
|
||||
ui->ana3Pos->setValue(generalSettings.calibSpanPos[2]);
|
||||
ui->ana4Pos->setValue(generalSettings.calibSpanPos[3]);
|
||||
ui->ana5Pos->setValue(generalSettings.calibSpanPos[4]);
|
||||
ui->ana6Pos->setValue(generalSettings.calibSpanPos[5]);
|
||||
ui->ana7Pos->setValue(generalSettings.calibSpanPos[6]);
|
||||
ui->ana8Pos->setValue(generalSettings.calibSpanPos[7]);
|
||||
|
||||
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
|
||||
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
|
||||
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
|
||||
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
|
||||
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_battCalibDSB_editingFinished()
|
||||
{
|
||||
generalSettings.vBatCalib = ui->battCalibDSB->value()*10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
void CalibrationPanel::on_ana1Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[0] = ui->ana1Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana2Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[1] = ui->ana2Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana3Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[2] = ui->ana3Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana4Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[3] = ui->ana4Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana5Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[4] = ui->ana5Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana6Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[5] = ui->ana6Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana7Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[6] = ui->ana7Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana8Neg_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanNeg[7] = ui->ana8Neg->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana1Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[0] = ui->ana1Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana2Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[1] = ui->ana2Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana3Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[2] = ui->ana3Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana4Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[3] = ui->ana4Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana5Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[4] = ui->ana5Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana6Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[5] = ui->ana6Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana7Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[6] = ui->ana7Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana8Mid_editingFinished()
|
||||
{
|
||||
generalSettings.calibMid[7] = ui->ana8Mid->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
void CalibrationPanel::on_ana1Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[0] = ui->ana1Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana2Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[1] = ui->ana2Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana3Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[2] = ui->ana3Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana4Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[3] = ui->ana4Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana5Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[4] = ui->ana5Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana6Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[5] = ui->ana6Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana7Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[6] = ui->ana7Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_ana8Pos_editingFinished()
|
||||
{
|
||||
generalSettings.calibSpanPos[7] = ui->ana8Pos->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CalibrationPanel::on_serialPortMode_currentIndexChanged(int index)
|
||||
{
|
||||
generalSettings.hw_uartMode = index;
|
||||
emit modified();
|
||||
switch(column) {
|
||||
case 0:
|
||||
generalSettings.calibSpanNeg[row] = value;
|
||||
break;
|
||||
case 1:
|
||||
generalSettings.calibMid[row] = value;
|
||||
break;
|
||||
case 2:
|
||||
generalSettings.calibSpanPos[row] = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef CALIBRATION_H
|
||||
#define CALIBRATION_H
|
||||
|
||||
#include <QTableWidget>
|
||||
#include "generaledit.h"
|
||||
|
||||
namespace Ui {
|
||||
@@ -17,58 +18,16 @@ class CalibrationPanel : public GeneralPanel
|
||||
|
||||
public:
|
||||
CalibrationPanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~CalibrationPanel();
|
||||
// virtual void update();
|
||||
virtual ~CalibrationPanel() {};
|
||||
|
||||
private slots:
|
||||
void on_battCalibDSB_editingFinished();
|
||||
void on_PPM1_editingFinished();
|
||||
void on_PPM2_editingFinished();
|
||||
void on_PPM3_editingFinished();
|
||||
void on_PPM4_editingFinished();
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
|
||||
void on_CurrentCalib_SB_editingFinished();
|
||||
void on_bluetoothEnable_stateChanged(int);
|
||||
|
||||
void on_ana1Neg_editingFinished();
|
||||
void on_ana2Neg_editingFinished();
|
||||
void on_ana3Neg_editingFinished();
|
||||
void on_ana4Neg_editingFinished();
|
||||
void on_ana5Neg_editingFinished();
|
||||
void on_ana6Neg_editingFinished();
|
||||
void on_ana7Neg_editingFinished();
|
||||
void on_ana8Neg_editingFinished();
|
||||
|
||||
void on_ana1Mid_editingFinished();
|
||||
void on_ana2Mid_editingFinished();
|
||||
void on_ana3Mid_editingFinished();
|
||||
void on_ana4Mid_editingFinished();
|
||||
void on_ana5Mid_editingFinished();
|
||||
void on_ana6Mid_editingFinished();
|
||||
void on_ana7Mid_editingFinished();
|
||||
void on_ana8Mid_editingFinished();
|
||||
|
||||
void on_ana1Pos_editingFinished();
|
||||
void on_ana2Pos_editingFinished();
|
||||
void on_ana3Pos_editingFinished();
|
||||
void on_ana4Pos_editingFinished();
|
||||
void on_ana5Pos_editingFinished();
|
||||
void on_ana6Pos_editingFinished();
|
||||
void on_ana7Pos_editingFinished();
|
||||
void on_ana8Pos_editingFinished();
|
||||
|
||||
void on_serialPortMode_currentIndexChanged(int index);
|
||||
|
||||
protected:
|
||||
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void onCellChanged(int value);
|
||||
|
||||
private:
|
||||
Ui::Calibration *ui;
|
||||
QTableWidget * tableWidget;
|
||||
|
||||
void setValues();
|
||||
int getCalibrationValue(int row, int column);
|
||||
void setCalibrationValue(int row, int column, int value);
|
||||
};
|
||||
|
||||
#endif // CALIBRATION_H
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "generalsetup.h"
|
||||
#include "trainer.h"
|
||||
#include "calibration.h"
|
||||
#include "hardware.h"
|
||||
#include "../modeledit/customfunctions.h"
|
||||
#include "verticalscrollarea.h"
|
||||
|
||||
@@ -42,7 +43,8 @@ GeneralEdit::GeneralEdit(QWidget * parent, RadioData & radioData, Firmware * fir
|
||||
addTab(new CustomFunctionsPanel(this, NULL, generalSettings, firmware), tr("Global Functions"));
|
||||
}
|
||||
addTab(new TrainerPanel(this, generalSettings, firmware), tr("Trainer"));
|
||||
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Hardware / Calibration"));
|
||||
addTab(new HardwarePanel(this, generalSettings, firmware), tr("Hardware"));
|
||||
addTab(new CalibrationPanel(this, generalSettings, firmware), tr("Calibration"));
|
||||
|
||||
ui->tabWidget->setCurrentIndex( g.generalEditTab() );
|
||||
}
|
||||
@@ -88,8 +90,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
}
|
||||
else {
|
||||
QString trainercalib = g.profile[profile_id].trainerCalib();
|
||||
int8_t vBatCalib = (int8_t)g.profile[profile_id].vBatCalib();
|
||||
int8_t currentCalib = (int8_t)g.profile[profile_id].currentCalib();
|
||||
int8_t txVoltageCalibration = (int8_t)g.profile[profile_id].txVoltageCalibration();
|
||||
int8_t txCurrentCalibration = (int8_t)g.profile[profile_id].txCurrentCalibration();
|
||||
int8_t PPM_Multiplier = (int8_t)g.profile[profile_id].ppmMultiplier();
|
||||
uint8_t GSStickMode = (uint8_t)g.profile[profile_id].gsStickMode();
|
||||
uint8_t vBatWarn = (uint8_t)g.profile[profile_id].vBatWarn();
|
||||
@@ -123,8 +125,8 @@ void GeneralEdit::on_calretrieve_PB_clicked()
|
||||
if (ok)
|
||||
generalSettings.trainer.calib[i]=byte16;
|
||||
}
|
||||
generalSettings.currentCalib=currentCalib;
|
||||
generalSettings.vBatCalib=vBatCalib;
|
||||
generalSettings.txCurrentCalibration=txCurrentCalibration;
|
||||
generalSettings.txVoltageCalibration=txVoltageCalibration;
|
||||
generalSettings.vBatWarn=vBatWarn;
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
generalSettings.vBatMin = (int8_t) g.profile[profile_id].vBatMin();
|
||||
@@ -225,8 +227,8 @@ void GeneralEdit::on_calstore_PB_clicked()
|
||||
calib.append(QString("%1").arg((uint16_t)generalSettings.trainer.calib[i], 4, 16, QChar('0')));
|
||||
}
|
||||
g.profile[profile_id].trainerCalib( calib );
|
||||
g.profile[profile_id].vBatCalib( generalSettings.vBatCalib );
|
||||
g.profile[profile_id].currentCalib( generalSettings.currentCalib );
|
||||
g.profile[profile_id].txVoltageCalibration( generalSettings.txVoltageCalibration );
|
||||
g.profile[profile_id].txCurrentCalibration( generalSettings.txCurrentCalibration );
|
||||
g.profile[profile_id].vBatWarn( generalSettings.vBatWarn );
|
||||
if (GetCurrentFirmware()->getCapability(HasBatMeterRange)) {
|
||||
g.profile[profile_id].vBatMin( generalSettings.vBatMin );
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
#include "hardware.h"
|
||||
#include "ui_hardware.h"
|
||||
|
||||
void HardwarePanel::setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos = true)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
enabled = true;
|
||||
type->addItem(tr("None"), GeneralSettings::SWITCH_NONE);
|
||||
}
|
||||
else if (index < 8) {
|
||||
enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("2 Positions Toggle"), GeneralSettings::SWITCH_TOGGLE);
|
||||
type->addItem(tr("2 Positions"), GeneralSettings::SWITCH_2POS);
|
||||
if (threePos) type->addItem(tr("3 Positions"), GeneralSettings::SWITCH_3POS);
|
||||
name->setField(generalSettings.switchName[index], 3, this);
|
||||
type->setField(generalSettings.switchConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void HardwarePanel::setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS).toString());
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS_PLUS(firmware->getBoard()) && index < 3) {
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS(firmware->getBoard()) && index < 2) {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("None"), GeneralSettings::POT_NONE);
|
||||
type->addItem(tr("Pot with detent"), GeneralSettings::POT_WITH_DETENT);
|
||||
type->addItem(tr("Multipos switch"), GeneralSettings::POT_MULTIPOS_SWITCH);
|
||||
type->addItem(tr("Pot without detent"), GeneralSettings::POT_WITHOUT_DETENT);
|
||||
name->setField(generalSettings.potName[index], 3, this);
|
||||
type->setField(generalSettings.potConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
void HardwarePanel::setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type)
|
||||
{
|
||||
bool enabled = false;
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard()) && index < 2) {
|
||||
type->setEnabled(false);
|
||||
enabled = true;
|
||||
}
|
||||
else if (IS_TARANIS_X9E(firmware->getBoard()) && index < 4) {
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
label->setText(RawSource(SOURCE_TYPE_STICK, index+NUM_STICKS+4).toString());
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
type->addItem(tr("None"), GeneralSettings::SLIDER_NONE);
|
||||
type->addItem(tr("Slider with detent"), GeneralSettings::SLIDER_WITH_DETENT);
|
||||
name->setField(generalSettings.sliderName[index], 3, this);
|
||||
type->setField(generalSettings.sliderConfig[index], this);
|
||||
}
|
||||
else {
|
||||
label->hide();
|
||||
name->hide();
|
||||
type->hide();
|
||||
}
|
||||
}
|
||||
|
||||
HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings, Firmware * firmware):
|
||||
GeneralPanel(parent, generalSettings, firmware),
|
||||
ui(new Ui::Hardware)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
ui->rudName->setField(generalSettings.stickName[0], 3, this);
|
||||
ui->eleName->setField(generalSettings.stickName[1], 3, this);
|
||||
ui->thrName->setField(generalSettings.stickName[2], 3, this);
|
||||
ui->ailName->setField(generalSettings.stickName[3], 3, this);
|
||||
}
|
||||
else {
|
||||
ui->rudLabel->hide();
|
||||
ui->rudName->hide();
|
||||
ui->eleLabel->hide();
|
||||
ui->eleName->hide();
|
||||
ui->thrLabel->hide();
|
||||
ui->thrName->hide();
|
||||
ui->ailLabel->hide();
|
||||
ui->ailName->hide();
|
||||
}
|
||||
|
||||
setupPotConfig(0, ui->pot1Label, ui->pot1Name, ui->pot1Type);
|
||||
setupPotConfig(1, ui->pot2Label, ui->pot2Name, ui->pot2Type);
|
||||
setupPotConfig(2, ui->pot3Label, ui->pot3Name, ui->pot3Type);
|
||||
setupPotConfig(3, ui->pot4Label, ui->pot4Name, ui->pot4Type);
|
||||
|
||||
setupSliderConfig(0, ui->lsLabel, ui->lsName, ui->lsType);
|
||||
setupSliderConfig(1, ui->rsLabel, ui->rsName, ui->rsType);
|
||||
setupSliderConfig(2, ui->ls2Label, ui->ls2Name, ui->ls2Type);
|
||||
setupSliderConfig(3, ui->rs2Label, ui->rs2Name, ui->rs2Type);
|
||||
|
||||
setupSwitchConfig(0, ui->saLabel, ui->saName, ui->saType);
|
||||
setupSwitchConfig(1, ui->sbLabel, ui->sbName, ui->sbType);
|
||||
setupSwitchConfig(2, ui->scLabel, ui->scName, ui->scType);
|
||||
setupSwitchConfig(3, ui->sdLabel, ui->sdName, ui->sdType);
|
||||
setupSwitchConfig(4, ui->seLabel, ui->seName, ui->seType);
|
||||
setupSwitchConfig(5, ui->sfLabel, ui->sfName, ui->sfType, false); //switch does not support 3POS
|
||||
setupSwitchConfig(6, ui->sgLabel, ui->sgName, ui->sgType);
|
||||
setupSwitchConfig(7, ui->shLabel, ui->shName, ui->shType, false); //switch does not support 3POS
|
||||
setupSwitchConfig(8, ui->siLabel, ui->siName, ui->siType);
|
||||
setupSwitchConfig(9, ui->sjLabel, ui->sjName, ui->sjType);
|
||||
setupSwitchConfig(10, ui->skLabel, ui->skName, ui->skType);
|
||||
setupSwitchConfig(11, ui->slLabel, ui->slName, ui->slType);
|
||||
setupSwitchConfig(12, ui->smLabel, ui->smName, ui->smType);
|
||||
setupSwitchConfig(13, ui->snLabel, ui->snName, ui->snType);
|
||||
setupSwitchConfig(14, ui->soLabel, ui->soName, ui->soType);
|
||||
setupSwitchConfig(15, ui->spLabel, ui->spName, ui->spType);
|
||||
setupSwitchConfig(16, ui->sqLabel, ui->sqName, ui->sqType);
|
||||
setupSwitchConfig(17, ui->srLabel, ui->srName, ui->srType);
|
||||
|
||||
if (IS_TARANIS(firmware->getBoard())) {
|
||||
ui->serialPortMode->setCurrentIndex(generalSettings.hw_uartMode);
|
||||
}
|
||||
else {
|
||||
ui->serialPortMode->hide();
|
||||
ui->serialPortLabel->hide();
|
||||
}
|
||||
|
||||
if (!IS_SKY9X(firmware->getBoard())) {
|
||||
ui->txCurrentCalibration->hide();
|
||||
ui->txCurrentCalibrationLabel->hide();
|
||||
}
|
||||
|
||||
if (IS_TARANIS_X9E(firmware->getBoard())) {
|
||||
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
|
||||
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
|
||||
}
|
||||
else {
|
||||
ui->bluetoothLabel->hide();
|
||||
ui->bluetoothEnable->hide();
|
||||
ui->bluetoothName->hide();
|
||||
}
|
||||
|
||||
disableMouseScrolling();
|
||||
|
||||
setValues();
|
||||
}
|
||||
|
||||
HardwarePanel::~HardwarePanel()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void HardwarePanel::on_PPM_MultiplierDSB_editingFinished()
|
||||
{
|
||||
generalSettings.PPM_Multiplier = (int)(ui->PPM_MultiplierDSB->value()*10)-10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_PPM1_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[0] = ui->PPM1->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_PPM2_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[1] = ui->PPM2->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_PPM3_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[2] = ui->PPM3->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_PPM4_editingFinished()
|
||||
{
|
||||
generalSettings.trainer.calib[3] = ui->PPM4->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
|
||||
void HardwarePanel::on_txCurrentHardware_editingFinished()
|
||||
{
|
||||
generalSettings.txCurrentCalibration = ui->txCurrentCalibration->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_bluetoothEnable_stateChanged(int)
|
||||
{
|
||||
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::setValues()
|
||||
{
|
||||
ui->txVoltageCalibration->setValue((double)generalSettings.txVoltageCalibration/10);
|
||||
ui->txCurrentCalibration->setValue((double)generalSettings.txCurrentCalibration);
|
||||
|
||||
ui->PPM1->setValue(generalSettings.trainer.calib[0]);
|
||||
ui->PPM2->setValue(generalSettings.trainer.calib[1]);
|
||||
ui->PPM3->setValue(generalSettings.trainer.calib[2]);
|
||||
ui->PPM4->setValue(generalSettings.trainer.calib[3]);
|
||||
ui->PPM_MultiplierDSB->setValue((qreal)(generalSettings.PPM_Multiplier+10)/10);
|
||||
}
|
||||
|
||||
void HardwarePanel::on_txVoltageHardware_editingFinished()
|
||||
{
|
||||
generalSettings.txVoltageCalibration = ui->txVoltageCalibration->value()*10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void HardwarePanel::on_serialPortMode_currentIndexChanged(int index)
|
||||
{
|
||||
generalSettings.hw_uartMode = index;
|
||||
emit modified();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef HARDWARE_H
|
||||
#define HARDWARE_H
|
||||
|
||||
#include "generaledit.h"
|
||||
|
||||
namespace Ui {
|
||||
class Hardware;
|
||||
}
|
||||
|
||||
class QLabel;
|
||||
class AutoLineEdit;
|
||||
class AutoComboBox;
|
||||
|
||||
class HardwarePanel : public GeneralPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HardwarePanel(QWidget *parent, GeneralSettings & generalSettings, Firmware * firmware);
|
||||
virtual ~HardwarePanel();
|
||||
|
||||
private slots:
|
||||
void on_txVoltageHardware_editingFinished();
|
||||
void on_PPM1_editingFinished();
|
||||
void on_PPM2_editingFinished();
|
||||
void on_PPM3_editingFinished();
|
||||
void on_PPM4_editingFinished();
|
||||
void on_PPM_MultiplierDSB_editingFinished();
|
||||
|
||||
void on_txCurrentHardware_editingFinished();
|
||||
void on_bluetoothEnable_stateChanged(int);
|
||||
|
||||
void on_serialPortMode_currentIndexChanged(int index);
|
||||
|
||||
protected:
|
||||
void setupPotConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSliderConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type);
|
||||
void setupSwitchConfig(int index, QLabel *label, AutoLineEdit *name, AutoComboBox *type, bool threePos);
|
||||
|
||||
private:
|
||||
Ui::Hardware *ui;
|
||||
|
||||
void setValues();
|
||||
};
|
||||
|
||||
#endif // HARDWARE_H
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "simulatorinterface.h"
|
||||
#include "firmwareinterface.h"
|
||||
|
||||
Stopwatch gStopwatch("global");
|
||||
|
||||
const QColor colors[C9X_MAX_CURVES] = {
|
||||
QColor(0,0,127),
|
||||
QColor(0,127,0),
|
||||
@@ -47,44 +49,6 @@ const QColor colors[C9X_MAX_CURVES] = {
|
||||
QColor(255,127,0),
|
||||
};
|
||||
|
||||
QString getPhaseName(int val, const char * phasename)
|
||||
{
|
||||
if (!val) return "---";
|
||||
if (!phasename) {
|
||||
return QString(val < 0 ? "!" : "") + QObject::tr("FM%1").arg(abs(val) - 1);
|
||||
}
|
||||
else {
|
||||
QString phaseName;
|
||||
phaseName.append(phasename);
|
||||
if (phaseName.isEmpty()) {
|
||||
return QString(val < 0 ? "!" : "") + QObject::tr("FM%1").arg(abs(val) - 1);
|
||||
}
|
||||
else {
|
||||
return QString(val < 0 ? "!" : "") + phaseName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString getInputStr(ModelData * model, int index)
|
||||
{
|
||||
QString result;
|
||||
|
||||
if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
|
||||
if (strlen(model->inputNames[index]) > 0) {
|
||||
result = QObject::tr("[I%1]").arg(index+1);
|
||||
result += QString(model->inputNames[index]);
|
||||
}
|
||||
else {
|
||||
result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = RawSource(SOURCE_TYPE_STICK, index).toString(model);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value)
|
||||
{
|
||||
QString strings[] = { QObject::tr("---"), QObject::tr("Rud Trim"), QObject::tr("Ele Trim"), QObject::tr("Thr Trim"), QObject::tr("Ail Trim"), QObject::tr("Rot Enc"), QObject::tr("Rud"), QObject::tr("Ele"), QObject::tr("Thr"), QObject::tr("Ail"), QObject::tr("P1"), QObject::tr("P2"), QObject::tr("P3")};
|
||||
@@ -95,18 +59,35 @@ void populateGvSourceCB(QComboBox *b, int value)
|
||||
b->setCurrentIndex(value);
|
||||
}
|
||||
|
||||
QString getProtocolStr(const int proto)
|
||||
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current)
|
||||
{
|
||||
static const char *strings[] = { "OFF",
|
||||
"PPM",
|
||||
"Silverlit A", "Silverlit B", "Silverlit C",
|
||||
"CTP1009",
|
||||
"LP45", "DSM2", "DSMX",
|
||||
"PPM16", "PPMsim",
|
||||
"FrSky XJT - D16", "FrSky XJT - D8", "FrSky XJT - LR12", "FrSky DJT",
|
||||
};
|
||||
b->clear();
|
||||
b->addItem("----");
|
||||
|
||||
return CHECK_IN_ARRAY(strings, proto);
|
||||
bool added = false;
|
||||
// Convert set into list and sort it alphabetically case insensitive
|
||||
QStringList list = QStringList::fromSet(set);
|
||||
qSort(list.begin(), list.end(), caseInsensitiveLessThan);
|
||||
foreach (QString entry, list) {
|
||||
b->addItem(entry);
|
||||
if (entry == current) {
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
added = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!added && !current.isEmpty()) {
|
||||
b->addItem(current);
|
||||
b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
|
||||
void getFileComboBoxValue(QComboBox * b, char * dest, int length)
|
||||
{
|
||||
memset(dest, 0, length+1);
|
||||
if (b->currentText() != "----") {
|
||||
strncpy(dest, b->currentText().toAscii(), length);
|
||||
}
|
||||
}
|
||||
|
||||
void populatePhasesCB(QComboBox *b, int value)
|
||||
@@ -194,7 +175,7 @@ void GVarGroup::valuesChanged()
|
||||
else if (sb)
|
||||
weight = sb->value();
|
||||
else
|
||||
weight = dsb->value()/step;
|
||||
weight = round(dsb->value()/step);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,7 +619,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
for (int i=0; i<C9X_MAX_SENSORS; ++i) {
|
||||
if (model->sensorData[i].isAvailable()) {
|
||||
if (model && model->sensorData[i].isAvailable()) { //this conditon must be false if we populate Global Functions where model = 0
|
||||
for (int j=0; j<3; ++j) {
|
||||
item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i+j);
|
||||
b->addItem(item.toString(model), item.toValue());
|
||||
@@ -650,8 +631,6 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const GeneralSetti
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<(flags & POPULATE_TELEMETRYEXT ? TELEMETRY_SOURCES_STATUS_COUNT : TELEMETRY_SOURCES_COUNT); i++) {
|
||||
if (i==TELEMETRY_SOURCE_RSSI_TX && IS_TARANIS(board))
|
||||
continue;
|
||||
if (i==TELEMETRY_SOURCE_TX_TIME && !GetCurrentFirmware()->getCapability(RtcTime))
|
||||
continue;
|
||||
if (i==TELEMETRY_SOURCE_SWR && !GetCurrentFirmware()->getCapability(SportTelemetry))
|
||||
@@ -763,134 +742,6 @@ QString getFrSkySrc(int index)
|
||||
return RawSource(SOURCE_TYPE_TELEMETRY, index-1).toString();
|
||||
}
|
||||
|
||||
QString getTrimInc(ModelData * g_model)
|
||||
{
|
||||
switch (g_model->trimInc) {
|
||||
case -2:
|
||||
return QObject::tr("Exponential");
|
||||
case -1:
|
||||
return QObject::tr("Extra Fine");
|
||||
case 0:
|
||||
return QObject::tr("Fine");
|
||||
case 1:
|
||||
return QObject::tr("Medium");
|
||||
case 2:
|
||||
return QObject::tr("Coarse");
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
QString getTimerStr(TimerData & timer)
|
||||
{
|
||||
QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0'));
|
||||
result += QString(", ") + timer.mode.toString();
|
||||
if (timer.persistent)
|
||||
result += QObject::tr(", Persistent");
|
||||
if (timer.minuteBeep)
|
||||
result += QObject::tr(", MinuteBeep");
|
||||
if (timer.countdownBeep == 1)
|
||||
result += QObject::tr(", CountDown(Beeps)");
|
||||
else if (timer.countdownBeep == 2)
|
||||
result += QObject::tr(", CountDown(Voice)");
|
||||
return result;
|
||||
}
|
||||
|
||||
QString getProtocol(ModuleData & module)
|
||||
{
|
||||
QString str = getProtocolStr(module.protocol);
|
||||
|
||||
if (module.protocol == PPM)
|
||||
str.append(QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString()));
|
||||
else
|
||||
str.append(QObject::tr(": Channel start: %1, %2 Channels").arg(module.channelsStart+1).arg(module.channelsCount));
|
||||
return str;
|
||||
}
|
||||
|
||||
QString getTrainerMode(const int trainermode, ModuleData & module)
|
||||
{
|
||||
QString result;
|
||||
switch (trainermode) {
|
||||
case 1:
|
||||
result=QObject::tr("Slave/Jack")+QObject::tr(": Channel start: %1, %2 Channels, %3usec Delay, Pulse polarity %4").arg(module.channelsStart+1).arg(module.channelsCount).arg(module.ppmDelay).arg(module.polarityToString());
|
||||
break;
|
||||
case 2:
|
||||
result=QObject::tr("Master/SBUS Module");
|
||||
break;
|
||||
case 3:
|
||||
result=QObject::tr("Master/CPPM Module");
|
||||
break;
|
||||
case 4:
|
||||
result=QObject::tr("Master/SBUS in battery compartment");
|
||||
break;
|
||||
default:
|
||||
result=QObject::tr("Master/Jack");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QString getPhasesStr(unsigned int phases, ModelData * model)
|
||||
{
|
||||
int numphases = GetCurrentFirmware()->getCapability(FlightModes);
|
||||
|
||||
if (numphases && phases) {
|
||||
QString str;
|
||||
int count = 0;
|
||||
if (phases == (unsigned int)(1<<numphases) - 1) {
|
||||
str = QObject::tr("None");
|
||||
}
|
||||
if (phases) {
|
||||
for (int i=0; i<numphases;i++) {
|
||||
if (!(phases & (1<<i))) {
|
||||
if (count++ > 0) str += QString(", ");
|
||||
str += getPhaseName(i+1, model->flightModeData[i].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count > 1)
|
||||
return QObject::tr("Flight modes(%1)").arg(str);
|
||||
else
|
||||
return QObject::tr("Flight mode(%1)").arg(str);
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
QString getCenterBeepStr(ModelData * g_model)
|
||||
{
|
||||
QStringList strl;
|
||||
if (g_model->beepANACenter & 0x01)
|
||||
strl << QObject::tr("Rudder");
|
||||
if (g_model->beepANACenter & 0x02)
|
||||
strl << QObject::tr("Elevator");
|
||||
if (g_model->beepANACenter & 0x04)
|
||||
strl << QObject::tr("Throttle");
|
||||
if (g_model->beepANACenter & 0x08)
|
||||
strl << QObject::tr("Aileron");
|
||||
if (IS_TARANIS(GetCurrentFirmware()->getBoard())) {
|
||||
if (g_model->beepANACenter & 0x10)
|
||||
strl << "S1";
|
||||
if (g_model->beepANACenter & 0x20)
|
||||
strl << "S2";
|
||||
if (g_model->beepANACenter & 0x40)
|
||||
strl << "S3";
|
||||
if (g_model->beepANACenter & 0x80)
|
||||
strl << "LS";
|
||||
if (g_model->beepANACenter & 0x100)
|
||||
strl << "RS";
|
||||
}
|
||||
else {
|
||||
if (g_model->beepANACenter & 0x10)
|
||||
strl << "P1";
|
||||
if (g_model->beepANACenter & 0x20)
|
||||
strl << "P2";
|
||||
if (g_model->beepANACenter & 0x40)
|
||||
strl << "P3";
|
||||
}
|
||||
return strl.join(", ");
|
||||
}
|
||||
|
||||
QString getTheme()
|
||||
{
|
||||
int theme_set = g.theme();
|
||||
@@ -939,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);
|
||||
@@ -988,22 +845,38 @@ QPixmap makePixMap( QImage image, QString firmwareType )
|
||||
return(QPixmap::fromImage(image));
|
||||
}
|
||||
|
||||
int version2index(QString version)
|
||||
int version2index(const QString & version)
|
||||
{
|
||||
QStringList parts = version.split('.');
|
||||
int result = 0;
|
||||
if (parts.size() > 2)
|
||||
result = parts[2].toInt();
|
||||
int result = 999;
|
||||
QStringList parts = version.split("N");
|
||||
if (parts.size() > 1)
|
||||
result += 100 * parts[1].toInt();
|
||||
result = parts[1].toInt(); // nightly build
|
||||
parts = parts[0].split('.');
|
||||
if (parts.size() > 2)
|
||||
result += 1000 * parts[2].toInt();
|
||||
if (parts.size() > 1)
|
||||
result += 100000 * parts[1].toInt();
|
||||
if (parts.size() > 0)
|
||||
result += 10000 * parts[0].toInt();
|
||||
result += 10000000 * parts[0].toInt();
|
||||
return result;
|
||||
}
|
||||
|
||||
QString index2version(int index)
|
||||
{
|
||||
if (index >= 19900) {
|
||||
if (index >= 19900000) {
|
||||
int nightly = index % 1000;
|
||||
index /= 1000;
|
||||
int revision = index % 100;
|
||||
index /= 100;
|
||||
int minor = index % 100;
|
||||
int major = index / 100;
|
||||
QString result = QString("%1.%2.%3").arg(major).arg(minor).arg(revision);
|
||||
if (nightly > 0 && nightly < 999) {
|
||||
result += QString("N%1").arg(nightly);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
else if (index >= 19900) {
|
||||
int revision = index % 100;
|
||||
index /= 100;
|
||||
int minor = index % 100;
|
||||
@@ -1021,7 +894,7 @@ int qunlink(const QString & fileName)
|
||||
return unlink(ba.constData());
|
||||
}
|
||||
|
||||
QString generateProcessUniqueTempFileName(const QString &fileName)
|
||||
QString generateProcessUniqueTempFileName(const QString & fileName)
|
||||
{
|
||||
QString sanitizedFileName = fileName;
|
||||
sanitizedFileName.remove('/');
|
||||
@@ -1115,3 +988,107 @@ double toDecimalCoordinate(const QString & value)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList extractLatLon(const QString & position)
|
||||
{
|
||||
QStringList result;
|
||||
QStringList parts = position.split(' ');
|
||||
if (parts.size() != 2) {
|
||||
result.append("");
|
||||
result.append("");
|
||||
}
|
||||
else {
|
||||
result.append(parts.at(1).trimmed());
|
||||
result.append(parts.at(0).trimmed());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
TableLayout::TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels)
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
tableWidget = new QTableWidget(parent);
|
||||
QVBoxLayout * layout = new QVBoxLayout();
|
||||
layout->addWidget(tableWidget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
parent->setLayout(layout);
|
||||
|
||||
tableWidget->setRowCount(rowCount);
|
||||
tableWidget->setColumnCount(headerLabels.size());
|
||||
tableWidget->setShowGrid(false);
|
||||
tableWidget->verticalHeader()->setVisible(false);
|
||||
tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
tableWidget->setSelectionMode(QAbstractItemView::NoSelection);
|
||||
tableWidget->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
|
||||
tableWidget->setStyleSheet("QTableWidget {background-color: transparent;}");
|
||||
tableWidget->setHorizontalHeaderLabels(headerLabels);
|
||||
#else
|
||||
gridWidget = new QGridLayout(parent);
|
||||
|
||||
int col = 0;
|
||||
foreach(QString text, headerLabels) {
|
||||
QLabel *label = new QLabel();
|
||||
label->setFrameShape(QFrame::Panel);
|
||||
label->setFrameShadow(QFrame::Raised);
|
||||
label->setMidLineWidth(0);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
label->setMargin(5);
|
||||
label->setText(text);
|
||||
// if (!minimize)
|
||||
// label->setMinimumWidth(100);
|
||||
gridWidget->addWidget(label, 0, col++);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableLayout::addWidget(int row, int column, QWidget * widget)
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
QHBoxLayout * layout = new QHBoxLayout(tableWidget);
|
||||
layout->addWidget(widget);
|
||||
addLayout(row, column, layout);
|
||||
#else
|
||||
gridWidget->addWidget(widget, row + 1, column);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableLayout::addLayout(int row, int column, QLayout * layout)
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
layout->setContentsMargins(1, 3, 1, 3);
|
||||
QWidget * containerWidget = new QWidget(tableWidget);
|
||||
containerWidget->setLayout(layout);
|
||||
tableWidget->setCellWidget(row, column, containerWidget);
|
||||
#else
|
||||
gridWidget->addLayout(layout, row + 1, column);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableLayout::resizeColumnsToContents()
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
tableWidget->resizeColumnsToContents();
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableLayout::setColumnWidth(int col, int width)
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
tableWidget->setColumnWidth(col, width);
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
void TableLayout::pushRowsUp(int row)
|
||||
{
|
||||
#if defined(TABLE_LAYOUT)
|
||||
#else
|
||||
// Push the rows up
|
||||
QSpacerItem * spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
|
||||
gridWidget->addItem(spacer, row, 0);
|
||||
#endif
|
||||
// Push rows upward
|
||||
// addDoubleSpring(gridLayout, 5, num_fsw+1);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define HELPERS_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QTableWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QDebug>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
extern const QColor colors[C9X_MAX_CURVES];
|
||||
@@ -26,6 +29,8 @@ extern const QColor colors[C9X_MAX_CURVES];
|
||||
#define TRIM_MODE_NONE 0x1F // 0b11111
|
||||
|
||||
void populateGvSourceCB(QComboBox *b, int value);
|
||||
void populateFileComboBox(QComboBox * b, const QSet<QString> & set, const QString & current);
|
||||
void getFileComboBoxValue(QComboBox * b, char * dest, int length);
|
||||
void populateRotEncCB(QComboBox *b, int value, int renumber);
|
||||
|
||||
QString getTheme();
|
||||
@@ -98,8 +103,6 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||
|
||||
void populatePhasesCB(QComboBox *b, int value);
|
||||
void populateGvarUseCB(QComboBox *b, unsigned int phase);
|
||||
QString getProtocolStr(const int proto);
|
||||
QString getPhasesStr(unsigned int phases, ModelData * model);
|
||||
|
||||
#define POPULATE_NONE (1<<0)
|
||||
#define POPULATE_SOURCES (1<<1)
|
||||
@@ -117,17 +120,9 @@ QString getPhasesStr(unsigned int phases, 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 getPhaseName(int val, const char * phasename=NULL);
|
||||
QString getInputStr(ModelData * model, int index);
|
||||
QString image2qstring(QImage image);
|
||||
int findmult(float value, float base);
|
||||
|
||||
QString getTrimInc(ModelData * g_model);
|
||||
QString getTimerStr(TimerData & timer);
|
||||
QString getProtocol(ModuleData & module);
|
||||
QString getTrainerMode(const int trainermode, ModuleData & module);
|
||||
QString getCenterBeepStr(ModelData * g_model);
|
||||
|
||||
/* FrSky helpers */
|
||||
QString getFrSkyAlarmType(int alarm);
|
||||
QString getFrSkyUnits(int units);
|
||||
@@ -160,7 +155,7 @@ QVector<T> findWidgets(QObject * object, const QString & name)
|
||||
// Format a pixmap to fit on the radio using a specific firmware
|
||||
QPixmap makePixMap( QImage image, QString firmwareType );
|
||||
|
||||
int version2index(QString version);
|
||||
int version2index(const QString & version);
|
||||
QString index2version(int index);
|
||||
|
||||
class QTimeS : public QTime
|
||||
@@ -207,5 +202,62 @@ private:
|
||||
};
|
||||
|
||||
double toDecimalCoordinate(const QString & value);
|
||||
QStringList extractLatLon(const QString & position);
|
||||
|
||||
class TableLayout
|
||||
{
|
||||
public:
|
||||
TableLayout(QWidget * parent, int rowCount, const QStringList & headerLabels);
|
||||
// ~TableLayout() ;
|
||||
|
||||
void addWidget(int row, int column, QWidget * widget);
|
||||
void addLayout(int row, int column, QLayout * layout);
|
||||
|
||||
void resizeColumnsToContents();
|
||||
void setColumnWidth(int col, int width);
|
||||
void pushRowsUp(int row);
|
||||
|
||||
private:
|
||||
#if defined(TABLE_LAYOUT)
|
||||
QTableWidget * tableWidget;
|
||||
#else
|
||||
QGridLayout * gridWidget;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
class Stopwatch
|
||||
{
|
||||
public:
|
||||
Stopwatch(const QString & name) :
|
||||
name(name), total(0) {
|
||||
timer.start();
|
||||
};
|
||||
~Stopwatch() {};
|
||||
|
||||
void restart() {
|
||||
total = 0;
|
||||
timer.restart();
|
||||
};
|
||||
|
||||
void report() {
|
||||
qint64 elapsed = timer.restart();
|
||||
total += elapsed;
|
||||
qDebug() << name << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
|
||||
};
|
||||
|
||||
void report(const QString & text) {
|
||||
qint64 elapsed = timer.restart();
|
||||
total += elapsed;
|
||||
qDebug() << name << text << QString("%1 ms [%2 ms]").arg(elapsed).arg(total);
|
||||
};
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QElapsedTimer timer;
|
||||
qint64 total;
|
||||
};
|
||||
|
||||
extern Stopwatch gStopwatch;
|
||||
|
||||
#endif // HELPERS_H
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*/*.directory
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
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 |